Commit af92c512 authored by Andrew Burger's avatar Andrew Burger

Major queue changes note all the log supressions

parent 1b4c8d9e
This diff is collapsed.
......@@ -49,10 +49,10 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx)
(void*)sldch,
sizeof(SLDCH_t));
LOG_I(PHY,"SLDCH configuration %zd bytes, TBS payload %d bytes => %zd bytes\n",
sizeof(SLDCH_t)-sizeof(uint8_t*),
sldch->payload_length,
sldch_header_len+sizeof(SLDCH_t)-sizeof(uint8_t*)+sldch->payload_length);
// LOG_I(PHY,"SLDCH configuration %zd bytes, TBS payload %d bytes => %zd bytes\n",
// sizeof(SLDCH_t)-sizeof(uint8_t*),
// sldch->payload_length,
// sldch_header_len+sizeof(SLDCH_t)-sizeof(uint8_t*)+sldch->payload_length);
multicast_link_write_sock(0,
(char *)&pdu,
......
......@@ -242,9 +242,9 @@ multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP)
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
(struct sockaddr *) &group_list[groupP].sock_remote_addr,
sizeof (group_list[groupP].sock_remote_addr))) < 0) {
LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno),
__FILE__, __LINE__);
// LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
// errno, strerror(errno),
// __FILE__, __LINE__);
}
return num;
......
......@@ -160,7 +160,6 @@ void ue_init_mac(module_id_t module_idP) {
UE_mac_inst[module_idP].SI_Decoded = 0;
next_ra_frame = 0;
next_Mod_id = 0;
tx_request_pdu_list = NULL;
tx_req_num_elems = 0;
}
}
......@@ -2469,11 +2468,11 @@ ue_scheduler(const module_id_t module_idP,
if (msg_p != NULL) {
switch (ITTI_MSG_ID(msg_p)) {
case RRC_MAC_CCCH_DATA_REQ:
LOG_I(MAC,
"Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
ITTI_MSG_NAME(msg_p), ITTI_MSG_ORIGIN_NAME(msg_p), ITTI_MSG_INSTANCE(msg_p),
RRC_MAC_CCCH_DATA_REQ(msg_p).frame,
RRC_MAC_CCCH_DATA_REQ(msg_p).enb_index);
// LOG_I(MAC,
// "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
// ITTI_MSG_NAME(msg_p), ITTI_MSG_ORIGIN_NAME(msg_p), ITTI_MSG_INSTANCE(msg_p),
// RRC_MAC_CCCH_DATA_REQ(msg_p).frame,
// RRC_MAC_CCCH_DATA_REQ(msg_p).enb_index);
// TODO process CCCH data req.
break;
......@@ -3145,7 +3144,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
0);
if (sldch->payload_length >0 ) {
LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch);
// LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch);
return (sldch);
} else
return((SLDCH_t *)NULL);
......
This diff is collapsed.
......@@ -13,6 +13,7 @@
#include "openair2/PHY_INTERFACE/IF_Module.h"
#include "nfapi_interface.h"
#include "nfapi_pnf_interface.h"
#include <pthread.h>
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
//#include "openair1/PHY/defs.h"
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
......@@ -21,13 +22,9 @@
FILL_UL_INFO_MUTEX_t fill_ul_mutex;
//below 2 difinitions move to phy_stub_UE.c to add initialization when difinition.
extern UL_IND_t *UL_INFO;
extern nfapi_tx_request_pdu_t* tx_request_pdu_list;
// New
/// Pointers to config_request types. Used from nfapi callback functions.
//below 3 difinitions move to phy_stub_UE.c to add initialization when difinition.
extern nfapi_dl_config_request_t* dl_config_req;
extern nfapi_ul_config_request_t* ul_config_req;
extern nfapi_hi_dci0_request_t* hi_dci0_req;
int tx_req_num_elems;
......@@ -36,9 +33,6 @@ int tx_req_num_elems;
//module_id_t next_Mod_id;
eth_params_t stub_eth_params;
// This function should return all the sched_response config messages which concern a specific UE. Inside this
// function we should somehow make the translation of config message's rnti to Mod_ID.
Sched_Rsp_t get_nfapi_sched_response(uint8_t Mod_id);
......@@ -97,7 +91,8 @@ void dl_config_req_UE_MAC_dci(int sfn,
int sf,
nfapi_dl_config_request_pdu_t *dci,
nfapi_dl_config_request_pdu_t *dlsch,
int num_ue);
int num_ue,
nfapi_tx_request_pdu_t *tx_request_pdu_list);
void dl_config_req_UE_MAC_bch(int sfn,
int sf,
nfapi_dl_config_request_pdu_t *bch,
......@@ -105,7 +100,8 @@ void dl_config_req_UE_MAC_bch(int sfn,
void dl_config_req_UE_MAC_mch(int sfn,
int sf,
nfapi_dl_config_request_pdu_t *bch,
int num_ue);
int num_ue,
nfapi_tx_request_pdu_t *tx_request_pdu_list);
int tx_req_UE_MAC(nfapi_tx_request_t* req);
......@@ -137,6 +133,27 @@ int ue_init_standalone_socket(const char *addr, int port);
// This function is used to read from standalone pnf socket call corresponding memcpy functions
void *ue_standalone_pnf_task(void *context);
#define MAX_QUEUE_SIZE 512
typedef struct queue_t {
void *items[MAX_QUEUE_SIZE];
size_t read_index, write_index;
size_t num_items;
pthread_mutex_t mutex;
} queue_t;
void init_queue(queue_t *q);
void put_queue(queue_t *q, void *item);
void *get_queue(queue_t *q);
extern queue_t dl_config_req_queue;
extern queue_t tx_req_pdu_queue;
extern queue_t ul_config_req_queue;
extern queue_t hi_dci0_req_queue;
extern nfapi_ul_config_request_t* ul_config_req;
extern nfapi_hi_dci0_request_t* hi_dci0_req;
#endif /* PHY_STUB_UE_H_ */
......@@ -1026,10 +1026,8 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
}
proc->subframe_rx=proc->sub_frame_start;
// Initializations for nfapi-L2-emulator mode
dl_config_req = NULL;
ul_config_req = NULL;
hi_dci0_req = NULL;
tx_request_pdu_list = NULL;
hi_dci0_req = NULL;
// waiting for all UE's threads set phy_stub_ticking->num_single_thread[ue_thread_id] = -1.
do {
......@@ -1130,6 +1128,12 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
}
}
nfapi_dl_config_request_t *dl_config_req = get_queue(&dl_config_req_queue);
nfapi_tx_request_pdu_t *tx_request_pdu_list = get_queue(&tx_req_pdu_queue);
// if ((dl_config_req != NULL) != (tx_request_pdu_list != NULL)) {
// LOG_E(MAC, "In behemoth dl_config_req: %p tx_req_pdu_list: %p\n", dl_config_req, tx_request_pdu_list);
// }
if (dl_config_req && tx_request_pdu_list) {
nfapi_dl_config_request_body_t* dl_config_req_body = &dl_config_req->dl_config_request_body;
for (int i = 0; i < dl_config_req_body->number_pdu; ++i) {
......@@ -1148,7 +1152,8 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
NFAPI_SFNSF2SF(dl_config_req->sfn_sf),
pdu,
dlsch,
ue_num);
ue_num,
tx_request_pdu_list);
} else if (pdu->pdu_type == NFAPI_DL_CONFIG_BCH_PDU_TYPE) {
dl_config_req_UE_MAC_bch(NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),
NFAPI_SFNSF2SF(dl_config_req->sfn_sf),
......@@ -1158,7 +1163,8 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
dl_config_req_UE_MAC_mch(NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),
NFAPI_SFNSF2SF(dl_config_req->sfn_sf),
pdu,
ue_num);
ue_num,
tx_request_pdu_list);
}
}
}
......@@ -1473,11 +1479,6 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg)
phy_procedures_UE_SL_RX(UE,proc);
oai_subframe_ind(timer_frame, timer_subframe);
if(dl_config_req!= NULL) {
AssertFatal(0, "dl_config_req_UE_MAC() not handled\n");
//dl_config_req_UE_MAC(dl_config_req, Mod_id);
}
//if(UE_mac_inst[Mod_id].hi_dci0_req!= NULL){
if (hi_dci0_req!=NULL && hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list!=NULL) {
AssertFatal(0, "hi_dci0_req_UE_MAC() not handled\n");
......@@ -1584,13 +1585,13 @@ void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) {
//
struct complex16 v= {0};
void *samplesVoid[UE->frame_parms.nb_antennas_tx];
for ( int i=0; i < UE->frame_parms.nb_antennas_tx; i++)
samplesVoid[i]=(void *)&v;
AssertFatal( 1 == UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+2*UE->frame_parms.samples_per_tti,
samplesVoid,
samplesVoid,
1,
UE->frame_parms.nb_antennas_tx,
1),"");
......@@ -1644,7 +1645,7 @@ void *UE_thread(void *arg)
int instance_cnt_synch = UE->proc.instance_cnt_synch;
int is_synchronized = UE->is_synchronized;
AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), "");
if (is_synchronized == 0) {
if (instance_cnt_synch < 0) { // we can invoke the synch
// grab 10 ms of signal and wakeup synch thread
......@@ -1654,7 +1655,7 @@ void *UE_thread(void *arg)
for(int sf=0; sf<10; sf++) {
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.samples_per_tti*sf];
AssertFatal(UE->frame_parms.samples_per_tti == UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
rxp,
......@@ -1665,7 +1666,7 @@ void *UE_thread(void *arg)
} else {
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&UE->common_vars.rxdata[i][0];
AssertFatal( UE->frame_parms.samples_per_tti*10 ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp,
......@@ -2267,7 +2268,7 @@ static void *timer_thread( void *param )
pdu.header.packet_type = TTI_SYNC;
pdu.header.absSF = (timer_frame*10)+timer_subframe;
if (NFAPI_MODE != NFAPI_UE_STUB_PNF) {
if (NFAPI_MODE != NFAPI_UE_STUB_PNF && NFAPI_MODE != NFAPI_MODE_STANDALONE_PNF) {
multicast_link_write_sock(0,
(char *)&pdu,
sizeof(UE_tport_header_t));
......
......@@ -722,7 +722,10 @@ int main( int argc, char **argv ) {
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
} else if (NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) {
// init thread and open socket
init_queue(&dl_config_req_queue);
init_queue(&tx_req_pdu_queue);
init_queue(&hi_dci0_req_queue);
init_queue(&ul_config_req_queue);
config_sync_var=0;
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
init_UE_standalone_thread();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment