Commit 2ac91f05 authored by David Price's avatar David Price
Browse files

uplink data from ue received, corrected scheduling of DCI0/UPLINK_CFG. Fails...

uplink data from ue received, corrected scheduling of DCI0/UPLINK_CFG.  Fails to correctly form (SFNSF) for PHICH ACK
parent 22367109
...@@ -6306,7 +6306,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t ...@@ -6306,7 +6306,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t
uint8_t ret = 255; uint8_t ret = 255;
if (frame_parms->frame_type == FDD) { if (frame_parms->frame_type == FDD) {
ret = (((frame<<1)+subframe)&7); ret = (((frame*10)+subframe)&7);
} else { } else {
switch (frame_parms->tdd_config) { switch (frame_parms->tdd_config) {
......
...@@ -918,7 +918,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf ...@@ -918,7 +918,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
if(frame_parms->soundingrs_ul_config_common.enabled_flag) if(frame_parms->soundingrs_ul_config_common.enabled_flag)
{ {
LOG_D(PHY," SRS SUBFRAMECONFIG: %d\n", frame_parms->soundingrs_ul_config_common.srs_SubframeConfig); //LOG_D(PHY," SRS SUBFRAMECONFIG: %d\n", frame_parms->soundingrs_ul_config_common.srs_SubframeConfig);
uint8_t TSFC; uint8_t TSFC;
uint16_t deltaTSFC; // bitmap uint16_t deltaTSFC; // bitmap
......
...@@ -442,7 +442,7 @@ void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) ...@@ -442,7 +442,7 @@ void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
if (ul_req_body->number_of_pdus>0) if (ul_req_body->number_of_pdus>0)
{ {
LOG_E(PHY, "%s() Copy ul_req pdus:%d\n", __FUNCTION__, ul_req_body->number_of_pdus); LOG_E(PHY, "%s() Copying stored UL_req_tmp to UL_req for activation NOW (frameP:%d subframeP:%d) ul_req_body->number_of_pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req_body->number_of_pdus);
} }
memcpy((void*)ul_req_body->ul_config_pdu_list, memcpy((void*)ul_req_body->ul_config_pdu_list,
......
...@@ -206,6 +206,7 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ ...@@ -206,6 +206,7 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
hi_dci0_req_body->number_of_hi++; hi_dci0_req_body->number_of_hi++;
hi_dci0_req_body->sfnsf = sfnsf_add_subframe(RA_template->Msg3_frame, RA_template->Msg3_subframe, 0);
hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
hi_dci0_req->sfn_sf = sfnsf_add_subframe(RA_template->Msg3_frame, RA_template->Msg3_subframe, 4); hi_dci0_req->sfn_sf = sfnsf_add_subframe(RA_template->Msg3_frame, RA_template->Msg3_subframe, 4);
...@@ -1172,8 +1173,8 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, ...@@ -1172,8 +1173,8 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,
dl_config_pdu = &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu]; dl_config_pdu = &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu];
N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth);
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 for harq_pid %d was acknowledged (round %d)\n", LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 for harq_pid %d was acknowledged (round %d) RA_template[Msg4:SFN/SF:%d/%d]\n",
module_idP,CC_idP,frameP,subframeP,RA_template->harq_pid,round); module_idP,CC_idP,frameP,subframeP,RA_template->harq_pid,round, RA_template->Msg4_frame, RA_template->Msg4_subframe);
if (round!=8) { if (round!=8) {
......
...@@ -538,14 +538,13 @@ void schedule_mib(module_id_t module_idP, ...@@ -538,14 +538,13 @@ void schedule_mib(module_id_t module_idP,
module_idP, module_idP,
0); // not used in this case 0); // not used in this case
LOG_D(MAC,"Frame %d, subframe %d: BCH PDU length %d\n", //LOG_D(MAC,"Frame %d, subframe %d: BCH PDU length %d\n", frameP,subframeP,mib_sdu_length);
frameP,subframeP,mib_sdu_length);
if (mib_sdu_length > 0) { if (mib_sdu_length > 0) {
LOG_D(MAC,"Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n", frameP,subframeP,dl_req->number_pdu,mib_sdu_length); //LOG_D(MAC,"Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n", frameP,subframeP,dl_req->number_pdu,mib_sdu_length);
if ((frameP&1023) < 40) LOG_D(MAC,"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %ld)\n",module_idP,frameP,CC_id,mib_sdu_length,cc->mib->message.schedulingInfoSIB1_BR_r13); if (0 && (frameP&1023) < 40) LOG_D(MAC,"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %ld)\n",module_idP,frameP,CC_id,mib_sdu_length,cc->mib->message.schedulingInfoSIB1_BR_r13);
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
...@@ -575,10 +574,10 @@ void schedule_mib(module_id_t module_idP, ...@@ -575,10 +574,10 @@ void schedule_mib(module_id_t module_idP,
eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG; eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST; eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
if (frameP%100==0){} if (0 && frameP%100==0)
LOG_D(MAC,"%s() TX_REQ: sfn_sf:%u pdus:%u pdu_length:%u pdu_index:%u segments:%u segment_length:%u\n", LOG_D(MAC,"%s() TX_REQ: sfn_sf:%u pdus:%u pdu_length:%u pdu_index:%u segments:%u segment_length:%u\n",
__FUNCTION__, NFAPI_SFNSF2DEC(eNB->TX_req[CC_id].sfn_sf), eNB->TX_req[CC_id].tx_request_body.number_of_pdus, __FUNCTION__, NFAPI_SFNSF2DEC(eNB->TX_req[CC_id].sfn_sf), eNB->TX_req[CC_id].tx_request_body.number_of_pdus,
TX_req->pdu_length, TX_req->pdu_index, TX_req->num_segments, TX_req->segments[0].segment_length); TX_req->pdu_length, TX_req->pdu_index, TX_req->num_segments, TX_req->segments[0].segment_length);
} }
} }
} }
......
...@@ -311,7 +311,7 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram ...@@ -311,7 +311,7 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram
AssertFatal(cc!=NULL,"cc is null\n"); AssertFatal(cc!=NULL,"cc is null\n");
if (cc->tdd_Config == NULL) { // FDD if (cc->tdd_Config == NULL) { // FDD
ret = (((frame<<1)+subframe)&7); ret = (((frame*10)+subframe)&7);
} else { } else {
switch (cc->tdd_Config->subframeAssignment) { switch (cc->tdd_Config->subframeAssignment) {
case 1: case 1:
...@@ -1729,6 +1729,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP ...@@ -1729,6 +1729,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP
for (i = 0; i < NUMBER_OF_UE_MAX; i++) { for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_list->active[i] == TRUE) continue; if (UE_list->active[i] == TRUE) continue;
UE_id = i; UE_id = i;
memset(&UE_list->UE_template[cc_idP][UE_id], 0, sizeof(UE_TEMPLATE));
UE_list->UE_template[cc_idP][UE_id].rnti = rntiP; UE_list->UE_template[cc_idP][UE_id].rnti = rntiP;
UE_list->UE_template[cc_idP][UE_id].configured = FALSE; UE_list->UE_template[cc_idP][UE_id].configured = FALSE;
UE_list->numactiveCCs[UE_id] = 1; UE_list->numactiveCCs[UE_id] = 1;
......
...@@ -63,8 +63,9 @@ ...@@ -63,8 +63,9 @@
extern void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_t frameP, sub_frame_t subframeP); extern void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_t frameP, sub_frame_t subframeP);
extern int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req); extern int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
extern uint16_t sfnsf_add_subframe(uint16_t frameP, uint16_t subframeP, int offset); extern uint16_t sfnsf_add_subframe(uint16_t frameP, uint16_t subframeP, int offset);
extern int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req);
// This table holds the allowable PRB sizes for ULSCH transmissions // This table holds the allowable PRB sizes for ULSCH transmissions
uint8_t rb_table[34] = {1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,64,72,75,80,81,90,96,100}; uint8_t rb_table[34] = {1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,64,72,75,80,81,90,96,100};
...@@ -576,12 +577,13 @@ abort(); ...@@ -576,12 +577,13 @@ abort();
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1; // DJP - wireshark shows this as a NAK who is right? hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1; // DJP - wireshark shows this as a NAK who is right?
hi_dci0_req_body->number_of_hi++; hi_dci0_req_body->number_of_hi++;
hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP,subframeP, 0);
hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP, 4); hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP, 4);
hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
oai_nfapi_hi_dci0_req(hi_dci0_req); //oai_nfapi_hi_dci0_req(hi_dci0_req);
hi_dci0_req_body->number_of_hi=0; //hi_dci0_req_body->number_of_hi=0;
/* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */ /* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */
if ((num_sdu == 0) && (num_ce==0)) { if ((num_sdu == 0) && (num_ce==0)) {
...@@ -827,6 +829,7 @@ void schedule_ulsch(module_id_t module_idP, ...@@ -827,6 +829,7 @@ void schedule_ulsch(module_id_t module_idP,
} }
} }
//schedule_ulsch_rnti(module_idP, frameP, subframeP, subframeP,first_rb); sunday
schedule_ulsch_rnti(module_idP, frameP, subframeP, sched_subframe,first_rb); schedule_ulsch_rnti(module_idP, frameP, subframeP, sched_subframe,first_rb);
stop_meas(&eNB->schedule_ulsch); stop_meas(&eNB->schedule_ulsch);
...@@ -863,15 +866,12 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -863,15 +866,12 @@ void schedule_ulsch_rnti(module_id_t module_idP,
if (sched_subframeP<subframeP) sched_frame++; if (sched_subframeP<subframeP) sched_frame++;
nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; nfapi_hi_dci0_request_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_id];
nfapi_hi_dci0_request_body_t *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
//nfapi_ul_config_request_pdu_t *ul_config_pdu; nfapi_ul_config_request_t *ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP];
nfapi_ul_config_request_body_t *ul_req_tmp_body = &ul_req_tmp->ul_config_request_body;
nfapi_ul_config_request_body_t *ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body;
//ul_config_pdu = &ul_req_tmp->ul_config_pdu_list[0];
//LOG_D(MAC,"entering ulsch preprocesor\n"); //LOG_D(MAC,"entering ulsch preprocesor\n");
ulsch_scheduler_pre_processor(module_idP, ulsch_scheduler_pre_processor(module_idP,
...@@ -881,23 +881,19 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -881,23 +881,19 @@ void schedule_ulsch_rnti(module_id_t module_idP,
//LOG_D(MAC,"exiting ulsch preprocesor\n"); //LOG_D(MAC,"exiting ulsch preprocesor\n");
eNB->HI_DCI0_req[CC_id].sfn_sf = (frameP<<4)+subframeP;
eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
eNB->HI_DCI0_req[CC_id].header.message_id = NFAPI_HI_DCI0_REQUEST;
// loop over all active UEs // loop over all active UEs
for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) { for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) {
// don't schedule if Msg4 is not received yet // don't schedule if Msg4 is not received yet
if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) { if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) {
//LOG_D(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n", module_idP,frameP,subframeP,UE_id); //LOG_D(MAC,"[eNB %d] frame %d subframe %d, UE %d: not configured, skipping UE scheduling \n", module_idP,frameP,subframeP,UE_id);
continue; continue;
} }
rnti = UE_RNTI(module_idP,UE_id); rnti = UE_RNTI(module_idP,UE_id);
if (rnti==NOT_A_RNTI) { if (rnti==NOT_A_RNTI) {
LOG_W(MAC,"[eNB %d] frame %d subfarme %d, UE %d: no RNTI \n", module_idP,frameP,subframeP,UE_id); LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d: no RNTI \n", module_idP,frameP,subframeP,UE_id);
continue; continue;
} }
...@@ -964,7 +960,15 @@ abort(); ...@@ -964,7 +960,15 @@ abort();
UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id];
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = subframe2harqpid(&cc[CC_id],sched_frame,sched_subframeP); {
uint16_t ul_sched_frame = sched_frame;
uint16_t ul_sched_subframeP = sched_subframeP;
add_subframe(&ul_sched_frame, &ul_sched_subframeP, 0);
harq_pid = subframe2harqpid(&cc[CC_id],ul_sched_frame,ul_sched_subframeP);
}
round = UE_sched_ctrl->round_UL[CC_id][harq_pid]; round = UE_sched_ctrl->round_UL[CC_id][harq_pid];
AssertFatal(round<8,"round %d > 7 for UE %d/%x\n",round,UE_id,rnti); AssertFatal(round<8,"round %d > 7 for UE %d/%x\n",round,UE_id,rnti);
//LOG_D(MAC,"[eNB %d] frame %d subframe %d,Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n", module_idP,frameP,subframeP,harq_pid,UE_id,rnti,CC_id, aggregation,N_RB_UL); //LOG_D(MAC,"[eNB %d] frame %d subframe %d,Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n", module_idP,frameP,subframeP,harq_pid,UE_id,rnti,CC_id, aggregation,N_RB_UL);
...@@ -1063,10 +1067,10 @@ abort(); ...@@ -1063,10 +1067,10 @@ abort();
T_INT(UE_template->TBS_UL[harq_pid]), T_INT(ndi)); T_INT(UE_template->TBS_UL[harq_pid]), T_INT(ndi));
if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED)
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d frame %d subframe %d)\n",
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid],
first_rb[CC_id],rb_table[rb_table_index], first_rb[CC_id],rb_table[rb_table_index],
rb_table_index,UE_template->TBS_UL[harq_pid],harq_pid); rb_table_index,UE_template->TBS_UL[harq_pid],harq_pid, sched_frame, sched_subframeP);
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
//store for possible retransmission //store for possible retransmission
...@@ -1089,7 +1093,7 @@ abort(); ...@@ -1089,7 +1093,7 @@ abort();
// save it for a potential retransmission // save it for a potential retransmission
UE_template->cshift[harq_pid] = cshift; UE_template->cshift[harq_pid] = cshift;
hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci+eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi]; hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci+hi_dci0_req_body->number_of_hi];
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_dci_pdu); hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_dci_pdu);
...@@ -1108,13 +1112,18 @@ abort(); ...@@ -1108,13 +1112,18 @@ abort();
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP];
eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; hi_dci0_req_body->number_of_dci++;
hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP, subframeP, 4);
hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
hi_dci0_req->sfn_sf = frameP<<4|subframeP; // sfnsf_add_subframe(sched_frame, sched_subframeP, 0); // sunday!
hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP);
// Add UL_config PDUs // Add UL_config PDUs
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus],
cqi_req, cqi_req,
cc, cc,
UE_template->physicalConfigDedicated, UE_template->physicalConfigDedicated,
...@@ -1136,18 +1145,35 @@ abort(); ...@@ -1136,18 +1145,35 @@ abort();
get_TBS_UL(UE_template->mcs_UL[harq_pid], get_TBS_UL(UE_template->mcs_UL[harq_pid],
rb_table[rb_table_index]) rb_table[rb_table_index])
); );
#ifdef Rel14 #ifdef Rel14
if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation
fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus],
UE_template->rach_resource_type>2 ? 2 : 1, UE_template->rach_resource_type>2 ? 2 : 1,
1, //total_number_of_repetitions 1, //total_number_of_repetitions
1, //repetition_number 1, //repetition_number
(frameP*10)+subframeP); (frameP*10)+subframeP);
} }
#endif #endif
ul_req_tmp->number_of_pdus++; ul_req_tmp_body->number_of_pdus++;
eNB->ul_handle++; eNB->ul_handle++;
ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
//ul_req_tmp->sfn_sf = sfnsf_add_subframe(sched_frame, sched_subframeP, 4); sunday
ul_req_tmp->sfn_sf = sched_frame<<4|sched_subframeP;
ul_req_tmp->header.message_id = NFAPI_UL_CONFIG_REQUEST;
// Scheduler dips into this structure to work out if UE has a grant, so in nfapi mode we still need to populate it
// but we can send it right here, right now
//if (nfapi_mode)
{
//LOG_D(MAC,"Sending out future UE UL_CONFIG_REQ now in nFAPI mode for future frame:%d subframe:%d\n", sched_frame, sched_subframeP);
//oai_nfapi_ul_config_req(ul_req_tmp);
}
add_ue_ulsch_info(module_idP, add_ue_ulsch_info(module_idP,
CC_id, CC_id,
UE_id, UE_id,
...@@ -1166,7 +1192,7 @@ abort(); ...@@ -1166,7 +1192,7 @@ abort();
// fill in NAK information // fill in NAK information
hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci+hi_dci0_req_body->number_of_hi];
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu);
...@@ -1174,8 +1200,13 @@ abort(); ...@@ -1174,8 +1200,13 @@ abort();
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = UE_template->first_rb_ul[harq_pid]; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = UE_template->first_rb_ul[harq_pid];
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid]; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid];
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
hi_dci0_req->number_of_hi++; hi_dci0_req_body->number_of_hi++;
hi_dci0_req->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; hi_dci0_req_body->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0);
hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
hi_dci0_req->sfn_sf = frameP<<4|subframeP; //sfnsf_add_subframe(sched_frame, sched_subframeP, 0); - sunday
hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d,round %d)\n", LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d,round %d)\n",
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid],
UE_template->first_rb_ul[harq_pid], UE_template->nb_rb_ul[harq_pid], UE_template->first_rb_ul[harq_pid], UE_template->nb_rb_ul[harq_pid],
...@@ -1183,7 +1214,7 @@ abort(); ...@@ -1183,7 +1214,7 @@ abort();
// Add UL_config PDUs // Add UL_config PDUs
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP);
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus],
cqi_req, cqi_req,
cc, cc,
UE_template->physicalConfigDedicated, UE_template->physicalConfigDedicated,
...@@ -1206,16 +1237,21 @@ abort(); ...@@ -1206,16 +1237,21 @@ abort();
); );
#ifdef Rel14 #ifdef Rel14
if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation
fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus],
UE_template->rach_resource_type>2 ? 2 : 1, UE_template->rach_resource_type>2 ? 2 : 1,
1, //total_number_of_repetitions 1, //total_number_of_repetitions
1, //repetition_number 1, //repetition_number
(frameP*10)+subframeP); (frameP*10)+subframeP);
} }
#endif #endif
ul_req_tmp->number_of_pdus++; ul_req_tmp_body->number_of_pdus++;
eNB->ul_handle++; eNB->ul_handle++;
ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
ul_req_tmp->sfn_sf = sched_frame<<4|sched_subframeP;
ul_req_tmp->header.message_id = NFAPI_UL_CONFIG_REQUEST;
}/* }/*
else if (round > 0) { //we schedule a retransmission else if (round > 0) { //we schedule a retransmission
......
...@@ -1275,11 +1275,15 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra ...@@ -1275,11 +1275,15 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
int Ncp; int Ncp;
int N_RB_UL; int N_RB_UL;
LOG_D(MAC, "%s() Enter\n", __FUNCTION__);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) { for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_list->active[i] != TRUE) continue; if (UE_list->active[i] != TRUE) continue;
rnti = UE_RNTI(module_idP,i); rnti = UE_RNTI(module_idP,i);
LOG_D(MAC, "%s() UE active rnti:%04x UE_list->UE_sched_ctrl[i].ul_out_of_sync:%d UE_list->UE_sched_ctrl[i].phr_received:%d numactiveULCCs[UE_id]:%d UE_list->UE_template[CC_id][UE_id].ul_total_buffer:%d\n", __FUNCTION__, rnti, UE_list->UE_sched_ctrl[i].ul_out_of_sync, UE_list->UE_sched_ctrl[i].phr_received, UE_list->numactiveULCCs[i], UE_list->UE_template[CC_id][i].ul_total_buffer);
if (rnti==NOT_A_RNTI) if (rnti==NOT_A_RNTI)
continue; continue;
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
...@@ -1328,7 +1332,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra ...@@ -1328,7 +1332,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
while ((((UE_template->phr_info - tx_power) < 0 ) || (tbs > UE_template->ul_total_buffer))&& while ((((UE_template->phr_info - tx_power) < 0 ) || (tbs > UE_template->ul_total_buffer))&&
(mcs > 3)) { (mcs > 3)) {
// LOG_I(MAC,"UE_template->phr_info %d tx_power %d mcs %d\n", UE_template->phr_info,tx_power, mcs); LOG_I(MAC,"UE_template->phr_info %d tx_power %d mcs %d\n", UE_template->phr_info,tx_power, mcs);
mcs--; mcs--;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3;
tx_power = estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,Ncp,0); // fixme: set use_srs tx_power = estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,Ncp,0); // fixme: set use_srs
...@@ -1365,13 +1369,17 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra ...@@ -1365,13 +1369,17 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
UE_template->pre_allocated_nb_rb_ul, UE_template->pre_allocated_nb_rb_ul,
UE_template->phr_info,tx_power); UE_template->phr_info,tx_power);
} else { } else {
LOG_E(MAC,"no ul buffer");
/* if UE has pending scheduling request then pre-allocate 3 RBs */ /* if UE has pending scheduling request then pre-allocate 3 RBs */
//if (UE_template->ul_active == 1 && UE_template->ul_SR == 1) { //if (UE_template->ul_active == 1 && UE_template->ul_SR == 1) {
if (UE_is_to_be_scheduled(module_idP, CC_id, i)) { if (UE_is_to_be_scheduled(module_idP, CC_id, i)) {
UE_template->pre_assigned_mcs_ul = 10;
UE_template->pre_allocated_rb_table_index_ul = 2; UE_template->pre_allocated_rb_table_index_ul = 2;
UE_template->pre_allocated_nb_rb_ul = 3; UE_template->pre_allocated_nb_rb_ul = 3;
} else { } else {
UE_template->pre_allocated_rb_table_index_ul=-1; UE_template->pre_assigned_mcs_ul = 0;
UE_template->pre_allocated_rb_table_index_ul =-1;
UE_template->pre_allocated_nb_rb_ul=0; UE_template->pre_allocated_nb_rb_ul=0;
} }
} }
......
...@@ -147,7 +147,7 @@ mac_rrc_data_req( ...@@ -147,7 +147,7 @@ mac_rrc_data_req(
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
} // All RFN mod 8 transmit SIB2-3 in SF 5 } // All RFN mod 8 transmit SIB2-3 in SF 5
else if ((frameP%8) == 1) { else if ((frameP%8) == 1) {
LOG_D(RRC, "%s() frameP mod 8==1 (frameP:%d) copy into buffer SIB23 size:%d\n", __FUNCTION__, frameP, RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); //LOG_D(RRC, "%s() frameP mod 8==1 (frameP:%d) copy into buffer SIB23 size:%d\n", __FUNCTION__, frameP, RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23, RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
...@@ -197,7 +197,7 @@ mac_rrc_data_req( ...@@ -197,7 +197,7 @@ mac_rrc_data_req(
(void*)mib, (void*)mib,
carrier->MIB, carrier->MIB,
24); 24);
LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded); //LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded);
buffer_pP[0]=carrier->MIB[0]; buffer_pP[0]=carrier->MIB[0];
buffer_pP[1]=carrier->MIB[1]; buffer_pP[1]=carrier->MIB[1];
buffer_pP[2]=carrier->MIB[2]; buffer_pP[2]=carrier->MIB[2];
......
...@@ -246,7 +246,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -246,7 +246,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
if (oai_exit) return(-1); if (oai_exit) return(-1);