Commit 04d27b9c authored by Andrew Burger's avatar Andrew Burger

Finalized Raymond changes

parent 898d402a
...@@ -50,6 +50,9 @@ queue_t tx_req_pdu_queue; ...@@ -50,6 +50,9 @@ queue_t tx_req_pdu_queue;
queue_t ul_config_req_queue; queue_t ul_config_req_queue;
queue_t hi_dci0_req_queue; queue_t hi_dci0_req_queue;
int subframe_sf = 0;
int frame_sfn = 0;
void init_queue(queue_t *q) { void init_queue(queue_t *q) {
memset(q, 0, sizeof(*q)); memset(q, 0, sizeof(*q));
pthread_mutex_init(&q->mutex, NULL); pthread_mutex_init(&q->mutex, NULL);
...@@ -1152,14 +1155,11 @@ void *ue_standalone_pnf_task(void *context) ...@@ -1152,14 +1155,11 @@ void *ue_standalone_pnf_task(void *context)
continue; continue;
} }
if (len == 2 && len > 0) if (len == sizeof(uint16_t))
{ {
memcpy((void *)&sfn_sf, buffer, sizeof(sfn_sf)); memcpy((void *)&sfn_sf, buffer, sizeof(sfn_sf));
if (sfn_sf % 300 == 0) subframe_sf = NFAPI_SFNSF2SF(sfn_sf);
{ frame_sfn = NFAPI_SFNSF2SFN(sfn_sf);
LOG_I(MAC, "Unpacked sfn_sf sf: %u sfn: %u\n", NFAPI_SFNSF2SFN(sfn_sf),
NFAPI_SFNSF2SF(sfn_sf));
}
} }
else else
{ {
......
...@@ -156,4 +156,7 @@ extern queue_t hi_dci0_req_queue; ...@@ -156,4 +156,7 @@ extern queue_t hi_dci0_req_queue;
extern nfapi_ul_config_request_t* ul_config_req; extern nfapi_ul_config_request_t* ul_config_req;
extern nfapi_hi_dci0_request_t* hi_dci0_req; extern nfapi_hi_dci0_request_t* hi_dci0_req;
extern int subframe_sf;
extern int frame_sfn;
#endif /* PHY_STUB_UE_H_ */ #endif /* PHY_STUB_UE_H_ */
...@@ -94,7 +94,6 @@ extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind); ...@@ -94,7 +94,6 @@ extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP); extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
//extern int tx_req_UE_MAC1(); //extern int tx_req_UE_MAC1();
...@@ -1056,6 +1055,10 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) ...@@ -1056,6 +1055,10 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
int num_pairs = 0; int num_pairs = 0;
int num_lone = 0; int num_lone = 0;
int last_sf = 0;
int last_sfn = 0;
bool sfn_sf_changed = false;
while (!oai_exit) { while (!oai_exit) {
if (ue_thread_id == 0) { if (ue_thread_id == 0) {
...@@ -1078,15 +1081,19 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) ...@@ -1078,15 +1081,19 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
exit_fun("nothing to add"); exit_fun("nothing to add");
} }
} }
proc->subframe_rx = timer_subframe; // set this to sf from proxy **Get from Queue - Andrew proc->subframe_rx = subframe_sf;
proc->frame_rx = timer_frame; // set this to sfn from proxy **Get from Queue - Andrew proc->frame_rx = frame_sfn;
// variable to say that there has been a change in sf and sfn - Andrew
if (proc->subframe_rx != last_sf && proc->frame_rx != last_sfn) {
last_sf = proc->subframe_rx;
last_sfn = proc->frame_rx;
sfn_sf_changed = true;
}
// FDD and TDD tx timing settings. // FDD and TDD tx timing settings.
// XXX:It is the result of timing adjustment in debug. // XXX:It is the result of timing adjustment in debug.
// It is necessary to investigate why this will work in the future. // It is necessary to investigate why this will work in the future.
proc->subframe_tx = (timer_subframe + sf_ahead) % 10; proc->subframe_tx = (proc->subframe_rx + sf_ahead) % 10;
proc->frame_tx = proc->frame_rx + (proc->subframe_rx > (9 - sf_ahead) ? 1 : 0); proc->frame_tx = proc->frame_rx + (proc->subframe_rx > (9 - sf_ahead) ? 1 : 0);
//oai_subframe_ind(proc->frame_rx, proc->subframe_rx); //oai_subframe_ind(proc->frame_rx, proc->subframe_rx);
if (NFAPI_MODE != NFAPI_MODE_STANDALONE_PNF) { if (NFAPI_MODE != NFAPI_MODE_STANDALONE_PNF) {
...@@ -1226,7 +1233,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) ...@@ -1226,7 +1233,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
} }
//for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++) { //for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++) {
// if sfn_sf change variable is true if (sfn_sf_changed) {
for (ue_index = 0; ue_index < ue_num; ue_index++) { for (ue_index = 0; ue_index < ue_num; ue_index++) {
ue_Mod_id = ue_thread_id + NB_THREAD_INST * ue_index; ue_Mod_id = ue_thread_id + NB_THREAD_INST * ue_index;
UE = PHY_vars_UE_g[ue_Mod_id][0]; UE = PHY_vars_UE_g[ue_Mod_id][0];
...@@ -1291,6 +1298,9 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) ...@@ -1291,6 +1298,9 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
// LOG_I(MAC, "is_prach_subframe: %d UE_mac_inst[ue_MOD_id].SI_Decoded: %u\n", // LOG_I(MAC, "is_prach_subframe: %d UE_mac_inst[ue_MOD_id].SI_Decoded: %u\n",
// is_prach_subframe(&UE->frame_parms, proc->frame_tx, proc->subframe_tx), // is_prach_subframe(&UE->frame_parms, proc->frame_tx, proc->subframe_tx),
// UE_mac_inst[ue_Mod_id].SI_Decoded); // UE_mac_inst[ue_Mod_id].SI_Decoded);
LOG_I(MAC, "is_prach_subframe: %d UE_mac_inst %d\n",
is_prach_subframe(&UE->frame_parms, proc->frame_tx, proc->subframe_tx),
UE_mac_inst[ue_Mod_id].SI_Decoded);
if (is_prach_subframe(&UE->frame_parms, proc->frame_tx, proc->subframe_tx) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) { if (is_prach_subframe(&UE->frame_parms, proc->frame_tx, proc->subframe_tx) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) {
// The one working strangely... // The one working strangely...
//if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx && Mod_id == (module_id_t) init_ra_UE) ) { //if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx && Mod_id == (module_id_t) init_ra_UE) ) {
...@@ -1322,7 +1332,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) ...@@ -1322,7 +1332,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
phy_procedures_UE_SL_RX(UE, proc); phy_procedures_UE_SL_RX(UE, proc);
} //for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++) } //for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++)
// end of if - Andrew Burger }
if (phy_stub_ticking != NULL) { if (phy_stub_ticking != NULL) {
phy_stub_ticking->num_single_thread[ue_thread_id] = -1; phy_stub_ticking->num_single_thread[ue_thread_id] = -1;
} }
......
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