Commit c2fe241d authored by wujing's avatar wujing

merge rrc and mac-scd from develop_multi_cw for TM2/TM3 into oai develop

parent 81d4202b
......@@ -934,7 +934,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
dl_info[i]->n_harq_status = 2;
dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status);
for (j = 0; j < dl_info[i]->n_harq_status; j++) {
dl_info[i]->harq_status[j] = RC.mac[mod_id]->UE_list.UE_sched_ctrl[UE_id].round[UE_PCCID(mod_id, UE_id)][j];
dl_info[i]->harq_status[j] = RC.mac[mod_id]->UE_list.UE_sched_ctrl[UE_id].round[UE_PCCID(mod_id, UE_id)][j][TB1];
// TODO: This should be different per TB
}
// LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d and harq %d (round %d)\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10, dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]);
......
......@@ -270,7 +270,7 @@ uint32_t flexran_get_total_size_ul_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id
uint32_t flexran_get_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id)
{
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].TBS;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].TBS[TB1];
}
uint32_t flexran_get_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id)
......@@ -312,13 +312,13 @@ uint8_t flexran_get_ue_wpmi(mid_t mod_id, mid_t ue_id, uint8_t cc_id)
uint8_t flexran_get_mcs1_dl(mid_t mod_id, mid_t ue_id, int cc_id)
{
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs1;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs[TB1];
}
uint8_t flexran_get_mcs2_dl(mid_t mod_id, mid_t ue_id, int cc_id)
{
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs2;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs[TB2];
}
uint8_t flexran_get_mcs1_ul(mid_t mod_id, mid_t ue_id, int cc_id)
......@@ -372,7 +372,7 @@ uint64_t flexran_get_total_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id)
int flexran_get_harq_round(mid_t mod_id, uint8_t cc_id, mid_t ue_id)
{
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].harq_round;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].harq_round[TB1];
}
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id)
......
......@@ -824,7 +824,7 @@ generate_Msg4(module_id_t module_idP,
dl_req_body->number_pdu++;
ra->state = WAITMSG4ACK;
lcid = 0;
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid][TB1] = 0;
msg4_header = 1 + 6 + 1; // CR header, CR CE, SDU header
AssertFatal((ra->msg4_TBsize - ra->msg4_rrc_sdu_length - msg4_header)>=0,
"msg4_TBS %d is too small, change mcs to increase by %d bytes\n",ra->msg4_TBsize,ra->msg4_rrc_sdu_length+msg4_header-ra->msg4_TBsize);
......@@ -841,7 +841,7 @@ generate_Msg4(module_id_t module_idP,
module_idP, CC_idP, frameP, subframeP, ra->msg4_TBsize, ra->msg4_rrc_sdu_length, msg4_header, msg4_padding, msg4_post_padding);
DevAssert (UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return
// CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0]
offset = generate_dlsch_header ((unsigned char *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], 1, //num_sdus
offset = generate_dlsch_header ((unsigned char *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][TB1], 1, //num_sdus
(unsigned short *) &ra->msg4_rrc_sdu_length, //
&lcid, // sdu_lcid
255, // no drx
......@@ -849,7 +849,7 @@ generate_Msg4(module_id_t module_idP,
ra->cont_res_id, // contention res id
msg4_padding, // no padding
msg4_post_padding);
memcpy ((void *) &mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][(unsigned char) offset], &cc[CC_idP].CCCH_pdu.payload[0], ra->msg4_rrc_sdu_length);
memcpy ((void *) &mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][TB1][(unsigned char) offset], &cc[CC_idP].CCCH_pdu.payload[0], ra->msg4_rrc_sdu_length);
// DL request
mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
TX_req = &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->TX_req[CC_idP].tx_request_body.number_of_pdus];
......@@ -857,7 +857,7 @@ generate_Msg4(module_id_t module_idP,
TX_req->pdu_index = mac->pdu_index[CC_idP]++;
TX_req->num_segments = 1;
TX_req->segments[0].segment_length = ra->msg4_TBsize;
TX_req->segments[0].segment_data = mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0];
TX_req->segments[0].segment_data = mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][TB1];
mac->TX_req[CC_idP].tx_request_body.number_of_pdus++;
// Program ACK/NAK for Msg4 PDSCH
int absSF = (frameP * 10) + subframeP;
......@@ -890,10 +890,10 @@ generate_Msg4(module_id_t module_idP,
ul_req_body->number_of_pdus++;
T (T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT (module_idP), T_INT (CC_idP), T_INT (ra->rnti), T_INT (frameP), T_INT (subframeP),
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], ra->msg4_TBsize));
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0][TB1], ra->msg4_TBsize));
if (opt_enabled == 1) {
trace_pdu (1, (uint8_t *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], ra->msg4_rrc_sdu_length, UE_id, 3, UE_RNTI (module_idP, UE_id), mac->frame, mac->subframe, 0, 0);
trace_pdu (1, (uint8_t *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][TB1], ra->msg4_rrc_sdu_length, UE_id, 3, UE_RNTI (module_idP, UE_id), mac->frame, mac->subframe, 0, 0);
LOG_D (OPT, "[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", module_idP, CC_idP, frameP, UE_RNTI (module_idP, UE_id), ra->msg4_rrc_sdu_length);
}
} // Msg4 frame/subframe
......@@ -993,7 +993,7 @@ generate_Msg4(module_id_t module_idP,
lcid = 0;
// put HARQ process round to 0
ra->harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP);
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0;
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid][TB1] = 0;
if ((ra->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) {
msg4_padding = ra->msg4_TBsize - rrc_sdu_length - msg4_header;
......@@ -1011,7 +1011,7 @@ generate_Msg4(module_id_t module_idP,
DevAssert(UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return
// CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0]
int num_sdus = rrc_sdu_length > 0 ? 1 : 0;
offset = generate_dlsch_header((unsigned char *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0],
offset = generate_dlsch_header((unsigned char *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][TB1],
num_sdus, //num_sdus
(unsigned short *) &rrc_sdu_length, //
&lcid, // sdu_lcid
......@@ -1020,7 +1020,7 @@ generate_Msg4(module_id_t module_idP,
ra->cont_res_id, // contention res id
msg4_padding, // no padding
msg4_post_padding);
memcpy((void *) &mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
memcpy((void *) &mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][TB1][(unsigned char)offset],
&cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length);
// DLSCH Config
fill_nfapi_dlsch_config(mac, dl_req_body, ra->msg4_TBsize, mac->pdu_index[CC_idP], ra->rnti, 2, // resource_allocation_type : format 1A/1B/1D
......@@ -1052,7 +1052,7 @@ generate_Msg4(module_id_t module_idP,
rrc_sdu_length,
mac->pdu_index[CC_idP],
mac->UE_list.
DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]);
DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][TB1]);
mac->pdu_index[CC_idP]++;
dl_req->sfn_sf = mac->TX_req[CC_idP].sfn_sf;
LOG_D(MAC, "Filling UCI ACK/NAK information, cce_idx %d\n",
......@@ -1068,12 +1068,12 @@ generate_Msg4(module_id_t module_idP,
T_INT(CC_idP), T_INT(ra->rnti), T_INT(frameP),
T_INT(subframeP), T_INT(0 /*harq_pid always 0? */ ),
T_BUFFER(&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].
payload[0], ra->msg4_TBsize));
payload[0][TB1], ra->msg4_TBsize));
if (opt_enabled == 1) {
trace_pdu(DIRECTION_DOWNLINK,
(uint8_t *) mac->
UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0],
UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][TB1],
rrc_sdu_length, UE_id, WS_C_RNTI,
UE_RNTI(module_idP, UE_id), mac->frame,
mac->subframe, 0, 0);
......@@ -1157,7 +1157,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
// check HARQ status and retransmit if necessary
UE_id = find_UE_id(module_idP, ra->rnti);
AssertFatal(UE_id >= 0, "Can't find UE for t-crnti\n");
round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid];
round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid][TB1];
vrb_map = cc[CC_idP].vrb_map;
dl_req = &mac->DL_req[CC_idP];
dl_req_body = &dl_req->dl_config_request_body;
......
......@@ -711,11 +711,11 @@ schedule_ue_spec(module_id_t module_idP,
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,
frameP,
subframeP);
round_DL = ue_sched_ctrl->round[CC_id][harq_pid];
round_DL = ue_sched_ctrl->round[CC_id][harq_pid][TB1];
eNB_UE_stats->crnti = rnti;
eNB_UE_stats->rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
eNB_UE_stats->harq_pid = harq_pid;
eNB_UE_stats->harq_round = round_DL;
eNB_UE_stats->harq_round[TB1] = round_DL;
if (eNB_UE_stats->rrc_status < RRC_CONNECTED) {
LOG_D(MAC, "UE %d is not in RRC_CONNECTED\n",
......@@ -733,9 +733,9 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->dl_cqi, MIN_CQI_VALUE, MAX_CQI_VALUE);
*/
if (NFAPI_MODE != NFAPI_MONOLITHIC) {
eNB_UE_stats->dlsch_mcs1 = 10; // cqi_to_mcs[ue_sched_ctrl->dl_cqi[CC_id]];
eNB_UE_stats->dlsch_mcs[TB1] = cqi_to_mcs[ue_sched_ctrl->dl_cqi[CC_id]];
} else { // this operation is also done in the preprocessor
eNB_UE_stats->dlsch_mcs1 = cmin(eNB_UE_stats->dlsch_mcs1,
eNB_UE_stats->dlsch_mcs[TB1] = cmin(eNB_UE_stats->dlsch_mcs[TB1],
eNB->slice_info.dl[slice_idxP].maxmcs); // cmin(eNB_UE_stats->dlsch_mcs1, openair_daq_vars.target_ue_dl_mcs);
}
......@@ -757,14 +757,14 @@ schedule_ue_spec(module_id_t module_idP,
round_DL,
nb_available_rb,
ue_sched_ctrl->dl_cqi[CC_id],
eNB_UE_stats->dlsch_mcs1,
eNB_UE_stats->dlsch_mcs[TB1],
eNB_UE_stats->rrc_status);
/* Process retransmission */
if (round_DL != 8) {
// get freq_allocation
nb_rb = ue_template->nb_rb[harq_pid];
TBS = get_TBS_DL(ue_template->oldmcs1[harq_pid],
TBS = get_TBS_DL(ue_template->oldmcs[harq_pid][TB1],
nb_rb);
if (nb_rb <= nb_available_rb) {
......@@ -846,8 +846,8 @@ schedule_ue_spec(module_id_t module_idP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = harq_pid;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // Don't adjust power when retransmitting
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ue_template->oldNDI[harq_pid];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = ue_template->oldmcs1[harq_pid];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ue_template->oldNDI[harq_pid][TB1];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = ue_template->oldmcs[harq_pid][TB1];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = round_DL & 3;
// TDD
......@@ -859,14 +859,14 @@ schedule_ue_spec(module_id_t module_idP,
harq_pid,
round_DL,
ue_template->DAI - 1,
ue_template->oldmcs1[harq_pid]);
ue_template->oldmcs[harq_pid][TB1]);
} else {
LOG_D(MAC, "[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n",
module_idP,
CC_id,
harq_pid,
round_DL,
ue_template->oldmcs1[harq_pid]);
UE_list->UE_template[CC_id][UE_id].oldmcs[harq_pid][TB1]);
}
if (!CCE_allocation_infeasible(module_idP,
......@@ -888,7 +888,7 @@ schedule_ue_spec(module_id_t module_idP,
0, // type 0 allocation from 7.1.6 in 36.213
0, // virtual_resource_block_assignment_flag, unused here
0, // resource_block_coding, to be filled in later
getQm(ue_template->oldmcs1[harq_pid]),
getQm(UE_list->UE_template[CC_id][UE_id].oldmcs[harq_pid][TB1]),
round_DL & 3, // redundancy version
1, // transport blocks
0, // transport block to codeword swap flag
......@@ -932,7 +932,7 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->num_retransmission += 1;
eNB_UE_stats->rbs_used_retx = nb_rb;
eNB_UE_stats->total_rbs_used_retx += nb_rb;
eNB_UE_stats->dlsch_mcs2 = eNB_UE_stats->dlsch_mcs1;
eNB_UE_stats->dlsch_mcs[TB2] = eNB_UE_stats->dlsch_mcs[TB1];
} else {
LOG_D(MAC,
"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n",
......@@ -946,7 +946,7 @@ schedule_ue_spec(module_id_t module_idP,
rlc_status.bytes_in_buffer = 0;
// Now check RLC information to compute number of required RBs
// get maximum TBS size for RLC request
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1,
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs[TB1],
nb_available_rb);
// add the length for all the control elements (timing adv, drx, etc) : header + payload
......@@ -1278,7 +1278,7 @@ schedule_ue_spec(module_id_t module_idP,
if (ta_len + sdu_length_total + header_length_total > 0) {
// Now compute number of required RBs for total sdu length
// Assume RAH format 2
mcs = eNB_UE_stats->dlsch_mcs1;
mcs = eNB_UE_stats->dlsch_mcs[TB1];
if (mcs == 0) {
nb_rb = 4; // don't let the TBS get too small
......@@ -1293,13 +1293,13 @@ schedule_ue_spec(module_id_t module_idP,
if (nb_rb > nb_available_rb) { // if we've gone beyond the maximum number of RBs
// (can happen if N_RB_DL is odd)
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1,
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs[TB1],
nb_available_rb);
nb_rb = nb_available_rb;
break;
}
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1,
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs[TB1],
nb_rb);
}
......@@ -1342,7 +1342,7 @@ schedule_ue_spec(module_id_t module_idP,
}
LOG_D(MAC, "dlsch_mcs before and after the rate matching = (%d, %d)\n",
eNB_UE_stats->dlsch_mcs1,
eNB_UE_stats->dlsch_mcs[TB1],
mcs);
#ifdef DEBUG_eNB_SCHEDULER
LOG_D(MAC, "[eNB %d] CC_id %d Generated DLSCH header (mcs %d, TBS %d, nb_rb %d)\n",
......@@ -1362,7 +1362,7 @@ schedule_ue_spec(module_id_t module_idP,
post_padding = 1;
}
offset = generate_dlsch_header((unsigned char *) UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
offset = generate_dlsch_header((unsigned char *) UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][TB1],
num_sdus, //num_sdus
sdu_lengths, //
sdu_lcids,
......@@ -1407,19 +1407,19 @@ schedule_ue_spec(module_id_t module_idP,
#endif
// cycle through SDUs and place in dlsch_buffer
dlsch_pdu = &UE_list->DLSCH_pdu[CC_id][0][UE_id];
memcpy(&dlsch_pdu->payload[0][offset],
memcpy(&dlsch_pdu->payload[0][TB1][offset],
dlsch_buffer,
sdu_length_total);
// memcpy(RC.mac[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]);
// fill remainder of DLSCH with 0
for (j = 0; j < (TBS - sdu_length_total - offset); j++) {
dlsch_pdu->payload[0][offset + sdu_length_total + j] = 0;
dlsch_pdu->payload[0][TB1][offset + sdu_length_total + j] = 0;
}
if (opt_enabled == 1) {
trace_pdu(DIRECTION_DOWNLINK,
(uint8_t *) dlsch_pdu->payload[0],
(uint8_t *) dlsch_pdu->payload[0][TB1],
TBS,
module_idP,
WS_C_RNTI,
......@@ -1460,9 +1460,9 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->rbs_used = nb_rb;
eNB_UE_stats->num_mac_sdu_tx = num_sdus;
eNB_UE_stats->total_rbs_used += nb_rb;
eNB_UE_stats->dlsch_mcs2 = mcs;
eNB_UE_stats->TBS = TBS;
eNB_UE_stats->overhead_bytes = TBS - sdu_length_total;
eNB_UE_stats->dlsch_mcs[TB2] = mcs;
eNB_UE_stats->TBS[TB1] = TBS;
eNB_UE_stats->overhead_bytes[TB1] = TBS - sdu_length_total;
eNB_UE_stats->total_sdu_bytes += sdu_length_total;
eNB_UE_stats->total_pdu_bytes += TBS;
eNB_UE_stats->total_num_pdus += 1;
......@@ -1535,7 +1535,7 @@ schedule_ue_spec(module_id_t module_idP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = harq_pid;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = tpc; // dont adjust power when retransmitting
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1 - ue_template->oldNDI[harq_pid];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1 - ue_template->oldNDI[harq_pid][TB1];
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
//deactivate second codeword
......@@ -1567,7 +1567,7 @@ schedule_ue_spec(module_id_t module_idP,
subframeP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
rnti)) {
ue_sched_ctrl->round[CC_id][harq_pid] = 0;
ue_sched_ctrl->round[CC_id][harq_pid][TB1] = 0;
dl_req->number_dci++;
dl_req->number_pdu++;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
......@@ -1597,10 +1597,10 @@ schedule_ue_spec(module_id_t module_idP,
UE_id,
rnti,
harq_pid,
ue_template->oldNDI[harq_pid]);
ue_template->oldNDI[harq_pid] = 1 - ue_template->oldNDI[harq_pid];
ue_template->oldmcs1[harq_pid] = mcs;
ue_template->oldmcs2[harq_pid] = 0;
ue_template->oldNDI[harq_pid][TB1]);
ue_template->oldNDI[harq_pid][TB1] = 1 - ue_template->oldNDI[harq_pid][TB1];
ue_template->oldmcs[harq_pid][TB1] = mcs;
ue_template->oldmcs[harq_pid][TB2] = 0;
AssertFatal(ue_template->physicalConfigDedicated != NULL, "physicalConfigDedicated is NULL\n");
AssertFatal(ue_template->physicalConfigDedicated->pdsch_ConfigDedicated != NULL,
"physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n");
......@@ -1632,7 +1632,7 @@ schedule_ue_spec(module_id_t module_idP,
(frameP * 10) + subframeP,
TBS,
eNB->pdu_index[CC_id],
dlsch_pdu->payload[0]);
dlsch_pdu->payload[0][TB1]);
LOG_D(MAC, "Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",
eNB->pdu_index[CC_id]);
eNB->pdu_index[CC_id]++;
......@@ -1998,7 +1998,7 @@ schedule_ue_spec_br(module_id_t module_idP,
continue;
}
round_DL = ue_sched_ctl->round[CC_id][harq_pid];
round_DL = ue_sched_ctl->round[CC_id][harq_pid][TB1];
AssertFatal (UE_template->physicalConfigDedicated != NULL, "UE_template->physicalConfigDedicated is null\n");
AssertFatal (UE_template->physicalConfigDedicated->ext4 != NULL, "UE_template->physicalConfigDedicated->ext4 is null\n");
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 != NULL, "UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 is null\n");
......@@ -2337,7 +2337,7 @@ schedule_ue_spec_br(module_id_t module_idP,
/* Fill remainder of DLSCH with random data */
for (j = 0; j < (TBS - sdu_length_total - offset); j++) {
UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + sdu_length_total + j] = (char)(taus()&0xff);
UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][TB1][offset + sdu_length_total + j] = (char)(taus()&0xff);
}
if (opt_enabled == 1) {
......@@ -2408,8 +2408,8 @@ schedule_ue_spec_br(module_id_t module_idP,
}
// Toggle NDI in first round
UE_template->oldNDI[harq_pid] = 1 - UE_template->oldNDI[harq_pid];
ue_sched_ctl->round[CC_id][harq_pid] = 0;
UE_template->oldNDI[harq_pid][TB1] = 1 - UE_template->oldNDI[harq_pid][TB1];
ue_sched_ctl->round[CC_id][harq_pid][TB1] = 0;
round_DL = 0;
} // if ((sdu_length_total + header_len_dcch + header_len_dtch) > 0)
}
......@@ -2439,7 +2439,7 @@ schedule_ue_spec_br(module_id_t module_idP,
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = mcs; // adjust according to size of RAR, 208 bits with N1A_PRB=3
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 0; // fix to 4 for now
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = rvseq[round_DL&3];
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = UE_template->oldNDI[harq_pid];
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = UE_template->oldNDI[harq_pid][TB1];
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0;
......@@ -2516,7 +2516,7 @@ schedule_ue_spec_br(module_id_t module_idP,
TX_req->pdu_index = mac->pdu_index[CC_id]++;
TX_req->num_segments = 1;
TX_req->segments[0].segment_length = TX_req->pdu_length;
TX_req->segments[0].segment_data = mac->UE_list.DLSCH_pdu[CC_id][0][(unsigned char) UE_id].payload[0];
TX_req->segments[0].segment_data = mac->UE_list.DLSCH_pdu[CC_id][0][(unsigned char) UE_id].payload[0][TB1];
mac->TX_req[CC_id].tx_request_body.number_of_pdus++;
ackNAK_absSF = absSF + 4;
ul_req = &mac->UL_req_tmp[CC_id][ackNAK_absSF % 10].ul_config_request_body;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -182,7 +182,7 @@ schedule_ue_spec_phy_test(
(frameP*10)+subframeP,
TBS,
eNB->pdu_index[CC_id],
eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]);
eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][TB1]);
}
else {
LOG_W(MAC,"[eNB_scheduler_phytest] DCI allocation infeasible!\n");
......
......@@ -1335,6 +1335,7 @@ program_dlsch_acknak(module_id_t module_idP,
fill_nfapi_harq_information(module_idP,
CC_idP,
rnti,
(frameP * 10) + subframeP,
harq_information,
cce_idx);
}
......@@ -1482,15 +1483,26 @@ void
fill_nfapi_harq_information(module_id_t module_idP,
int CC_idP,
uint16_t rntiP,
uint16_t absSFP,
nfapi_ul_config_harq_information *harq_information,
uint8_t cce_idxP)
//------------------------------------------------------------------------------
{
UE_sched_ctrl *ue_sched_ctl;
uint8_t harq_pid;
frame_t frameP;
sub_frame_t subframeP;
eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
UE_list_t *UE_list = &eNB->UE_list;
int UE_id = find_UE_id(module_idP,
rntiP);
int UE_id = find_UE_id(module_idP, rntiP);
frameP = absSFP / 10;
subframeP = absSFP % 10;
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config, frameP, subframeP);
AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n");
AssertFatal(UE_list != NULL, "UE_list is null\n");
harq_information->harq_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG;
......@@ -1546,14 +1558,22 @@ fill_nfapi_harq_information(module_id_t module_idP,
}
harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG;
if(ue_sched_ctl->cw_num[CC_idP][harq_pid] == MULTI_CW){
harq_information->harq_information_rel10_tdd.harq_size = 2;
}else{
harq_information->harq_information_rel10_tdd.harq_size = 1;
}
harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP;
harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1;
} else {
harq_information->harq_information_rel9_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG;
harq_information->harq_information_rel9_fdd.number_of_pucch_resources = 1;
harq_information->harq_information_rel9_fdd.ack_nack_mode = 0; // 1a/b
if(ue_sched_ctl->cw_num[CC_idP][harq_pid] == MULTI_CW){
harq_information->harq_information_rel9_fdd.harq_size = 2;
}else{
harq_information->harq_information_rel9_fdd.harq_size = 1;
}
harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP;
}
......@@ -1587,6 +1607,7 @@ fill_nfapi_uci_acknak(module_id_t module_idP,
fill_nfapi_harq_information(module_idP,
CC_idP,
rntiP,
absSFP,
&ul_config_pdu->uci_harq_pdu.harq_information,
cce_idxP);
LOG_D(MAC, "Filled in UCI HARQ request for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n",
......@@ -1634,6 +1655,7 @@ fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
uint8_t num_bf_vector)
//------------------------------------------------------------------------------
{
uint8_t subband_num;
nfapi_dl_config_request_pdu_t *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));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
......@@ -1652,7 +1674,11 @@ fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = transmission_scheme;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = number_of_layers;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = number_of_subbands;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = codebook_index;
for(subband_num = 0; subband_num < number_of_subbands; subband_num++){
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index[subband_num] = 0;
}
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = ue_category_capacity;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = pa;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = delta_power_offset_index;
......@@ -1661,6 +1687,18 @@ fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = transmission_mode;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = num_bf_prb_per_subband;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = num_bf_vector;
// Rel10 fields
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
#endif
// Rel13 fields
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF
#endif
dl_req->number_pdu++;
return;
}
......@@ -2193,10 +2231,16 @@ add_new_ue(module_id_t mod_idP,
UE_list->UE_sched_ctrl[UE_id].ta_update = 31;
for (j = 0; j < 8; j++) {
UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j == 0) ? 1 : 0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0
UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j == harq_pidP) ? 0 : 1; // 1st transmission is with Msg3;
UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8;
UE_list->UE_template[cc_idP][UE_id].oldNDI[j][TB1] = (j == 0) ? 1 : 0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0
UE_list->UE_template[cc_idP][UE_id].oldNDI[j][TB2] = 1;
UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j == harq_pidP) ? 0 : 1; // 1st transmission is with Msg3;
UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j][TB1] = 8;
UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j][TB2] = 8;
UE_list->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0;
UE_list->UE_sched_ctrl[UE_id].rsn[cc_idP][j][TB1] = 0;
UE_list->UE_sched_ctrl[UE_id].rsn[cc_idP][j][TB2] = 0;
UE_list->eNB_UE_stats[cc_idP][UE_id].TBS[TB1] = 0;
UE_list->eNB_UE_stats[cc_idP][UE_id].TBS[TB2] = 0;
}
eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING;
......@@ -3943,6 +3987,10 @@ extract_harq(module_id_t mod_idP,
sub_frame_t subframe_tx;
int frame_tx;
uint8_t harq_pid;
uint8_t select_tb;
uint8_t oppose_tb;
uint8_t swap_flg;
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated;
......@@ -3978,106 +4026,144 @@ extract_harq(module_id_t mod_idP,
subframeP,
m);
if (frameP==1023&&subframeP>5) frame_tx=-1;
else frame_tx = subframeP < 4 ? frameP -1 : frameP;
if(frameP==1023&&subframeP>5)
frame_tx=-1;
else
frame_tx = subframeP < 4 ? frameP -1 : frameP;
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame_tx,subframe_tx);
select_tb = sched_ctl->select_tb[CC_idP][harq_pid];
oppose_tb = select_tb ^ 0x1;
swap_flg = sched_ctl->swap_flag[CC_idP][harq_pid];
if (tmode[0] == 1 || tmode[0] == 2 || tmode[0] == 5 || tmode[0] == 6 || tmode[0] == 7) {
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,
frame_tx,
subframe_tx);
RA_t *ra = &eNB->common_channels[CC_idP].ra[0];
if(num_ack_nak == 1) {
if (harq_indication_tdd->harq_data[0].bundling.value_0 == 1) { //ack
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
sched_ctl->round[CC_idP][harq_pid][TB1] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
LOG_D(MAC, "frame %d subframe %d Acking (%d,%d) harq_pid %d round %d\n",
frameP,
subframeP,
frame_tx,
subframe_tx,
harq_pid,
sched_ctl->round[CC_idP][harq_pid]);
LOG_D(MAC,"frame %d subframe %d Acking (%d,%d) harq_pid %d round %d\n",frameP,subframeP,frame_tx,subframe_tx,harq_pid,sched_ctl->round[CC_idP][harq_pid][TB1]);
} else { //nack
if (sched_ctl->round[CC_idP][harq_pid] < 8) sched_ctl->round[CC_idP][harq_pid]++;
if (sched_ctl->round[CC_idP][harq_pid] == 4) {
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
}
LOG_D(MAC,"frame %d subframe %d Nacking (%d,%d) harq_pid %d round %d\n",
frameP,
subframeP,
frame_tx,
subframe_tx,
harq_pid,
sched_ctl->round[CC_idP][harq_pid]);
if (sched_ctl->round[CC_idP][harq_pid] == 8) {
for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) {
if (ra[ra_i].rnti == rnti && ra[ra_i].state == WAITMSG4ACK) {
//Msg NACK num to MAC ,remove UE
// add UE info to freeList
LOG_I(RRC, "put UE %x into freeList\n",
rnti);
put_UE_in_freelist(mod_idP,
rnti,
1);
}
}
}
}
}
for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) {
if (ra[ra_i].rnti == rnti && ra[ra_i].state == MSGCRNTI_ACK && ra[ra_i].crnti_harq_pid == harq_pid) {
LOG_D(MAC,"CRNTI Reconfiguration: ACK %d rnti %x round %d frame %d subframe %d \n",
harq_indication_tdd->harq_data[0].bundling.value_0,
rnti,
sched_ctl->round[CC_idP][harq_pid],
frameP,
subframeP);
if (num_ack_nak == 1 && harq_indication_tdd->harq_data[0].bundling.value_0 == 1) {
cancel_ra_proc(mod_idP,
CC_idP,
frameP,
ra[ra_i].rnti);
} else {
if(sched_ctl->round[CC_idP][harq_pid] == 7) {
cancel_ra_proc(mod_idP,
CC_idP,
frameP,
ra[ra_i].rnti);
}
}
break;
}
if( sched_ctl->round[CC_idP][harq_pid][TB1]<8) sched_ctl->round[CC_idP][harq_pid][TB1]++;
if (sched_ctl->round[CC_idP][harq_pid][TB1] == 4) {
sched_ctl->round[CC_idP][harq_pid][TB1] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
}
LOG_D(MAC,"frame %d subframe %d Nacking (%d,%d) harq_pid %d round %d\n",frameP,subframeP,frame_tx,subframe_tx,harq_pid,sched_ctl->round[CC_idP][harq_pid][TB1]);
if(sched_ctl->round[CC_idP][harq_pid][TB1] == 8){
for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) {
if((ra[ra_i].rnti == rnti) && (ra[ra_i].state == WAITMSG4ACK)){
//Msg NACK num to MAC ,remove UE
// add UE info to freeList
LOG_I(RRC, "put UE %x into freeList\n", rnti);
put_UE_in_freelist(mod_idP, rnti, 1);
}
}
}
}
}
for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) {
if ((ra[ra_i].rnti == rnti) && (ra[ra_i].state == MSGCRNTI_ACK) && (ra[ra_i].crnti_harq_pid == harq_pid)) {
LOG_D(MAC,"CRNTI Reconfiguration: ACK %d rnti %x round %d frame %d subframe %d \n",harq_indication_tdd->harq_data[0].bundling.value_0,rnti,sched_ctl->round[CC_idP][harq_pid][TB1],frameP,subframeP);
if(num_ack_nak == 1 && harq_indication_tdd->harq_data[0].bundling.value_0 == 1) {
cancel_ra_proc(mod_idP, CC_idP, frameP, ra[ra_i].rnti);
}else{
if(sched_ctl->round[CC_idP][harq_pid][TB1] == 7){
cancel_ra_proc(mod_idP, CC_idP, frameP, ra[ra_i].rnti);
}
}
break;
}
break;
case 1: // Channel Selection
case 2: // Format 3
case 3: // Format 4
case 4: // Format 5
break;
}
}else{
if((num_ack_nak==2)
&& (harq_indication_tdd->harq_data[select_tb].bundling.value_0==1)
&& (harq_indication_tdd->harq_data[oppose_tb].bundling.value_0==1)){
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8;
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8;
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
}else if( (num_ack_nak==2)
&& ((harq_indication_tdd->harq_data[select_tb].bundling.value_0==2) || (harq_indication_tdd->harq_data[select_tb].bundling.value_0==4))
&& ((harq_indication_tdd->harq_data[oppose_tb].bundling.value_0==2) || (harq_indication_tdd->harq_data[oppose_tb].bundling.value_0==4))){
sched_ctl->round[CC_idP][harq_pid][select_tb]++;
sched_ctl->round[CC_idP][harq_pid][oppose_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][select_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb]++;
if(sched_ctl->round[CC_idP][harq_pid][select_tb] == 4){
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
}
if(sched_ctl->round[CC_idP][harq_pid][oppose_tb] == 4){
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
}
}else if( (num_ack_nak==2)
&& (harq_indication_tdd->harq_data[select_tb].bundling.value_0==1)
&& ((harq_indication_tdd->harq_data[oppose_tb].bundling.value_0==2) || (harq_indication_tdd->harq_data[oppose_tb].bundling.value_0==4))){
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8;
sched_ctl->round[CC_idP][harq_pid][oppose_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb]++;
if(sched_ctl->round[CC_idP][harq_pid][oppose_tb] == 4){
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
}
}else if( (num_ack_nak==2)
&& ((harq_indication_tdd->harq_data[select_tb].bundling.value_0==2) || (harq_indication_tdd->harq_data[select_tb].bundling.value_0==4))
&& (harq_indication_tdd->harq_data[oppose_tb].bundling.value_0==1)){
sched_ctl->round[CC_idP][harq_pid][select_tb]++;
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8;
sched_ctl->rsn[CC_idP][harq_pid][select_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
if(sched_ctl->round[CC_idP][harq_pid][select_tb] == 4){
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
}
}else if( (num_ack_nak==1)
&& (harq_indication_tdd->harq_data[TB1].bundling.value_0==1)){
sched_ctl->round[CC_idP][harq_pid][swap_flg] = 8;
sched_ctl->rsn[CC_idP][harq_pid][swap_flg] = 0;
}else if( (num_ack_nak==1)
&& ((harq_indication_tdd->harq_data[TB1].bundling.value_0==2) || (harq_indication_tdd->harq_data[TB1].bundling.value_0==4))){
sched_ctl->round[CC_idP][harq_pid][swap_flg]++;
sched_ctl->rsn[CC_idP][harq_pid][swap_flg]++;
if(sched_ctl->round[CC_idP][harq_pid][swap_flg] == 4){
sched_ctl->round[CC_idP][harq_pid][swap_flg] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][swap_flg] = 0;
}
}
}
}
break;
case 1: // Channel Selection
break;
case 2: // Format 3
break;
case 3: // Format 4
break;
case 4: // Format 5
break;
}
} else {
harq_indication_fdd = (nfapi_harq_indication_fdd_rel13_t *) harq_indication;
num_ack_nak = harq_indication_fdd->number_of_ack_nack;
pdu = &harq_indication_fdd->harq_tb_n[0];
harq_pid = ((10 * frameP) + subframeP + 10236) & 7;
LOG_D(MAC, "frame %d subframe %d harq_pid %d mode %d tmode[0] %d num_ack_nak %d round %d\n",
frameP,
subframeP,
harq_pid,
harq_indication_fdd->mode,
tmode[0],
num_ack_nak,
sched_ctl->round[CC_idP][harq_pid]);
select_tb = sched_ctl->select_tb[CC_idP][harq_pid];
oppose_tb = select_tb ^ 0x1;
swap_flg = sched_ctl->swap_flag[CC_idP][harq_pid];
LOG_D(MAC,"frame %d subframe %d harq_pid %d mode %d tmode[0] %d num_ack_nak %d round %d\n",frameP,subframeP,harq_pid,harq_indication_fdd->mode,tmode[0],num_ack_nak,sched_ctl->round[CC_idP][harq_pid][TB1]);
// use 1 HARQ proces of BL/CE UE for now
if (UE_list->UE_template[pCCid][UE_id].rach_resource_type > 0) harq_pid = 0;
......@@ -4097,16 +4183,12 @@ extract_harq(module_id_t mod_idP,
// In case of nFAPI, sometimes timing of eNB and UE become different.
// So if nfapi_mode == 2(VNF), this function don't check assertion to avoid process exit.
if (NFAPI_MODE != NFAPI_MODE_VNF) {
AssertFatal(sched_ctl->round[CC_idP][harq_pid] < 8, "Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",
harq_pid,
UE_id,
rnti);
AssertFatal(sched_ctl->round[CC_idP][harq_pid][TB1] < 8,
"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",
harq_pid, UE_id, rnti);
} else {
if (sched_ctl->round[CC_idP][harq_pid] == 8) {
LOG_E(MAC,"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",
harq_pid,
UE_id,
rnti);
if(sched_ctl->round[CC_idP][harq_pid][TB1] == 8){
LOG_E(MAC,"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",harq_pid, UE_id, rnti);
return;
}
}
......@@ -4126,7 +4208,7 @@ extract_harq(module_id_t mod_idP,
LOG_D(MAC,"CRNTI Reconfiguration: ACK %d rnti %x round %d frame %d subframe %d \n",
pdu[0],
rnti,
sched_ctl->round[CC_idP][harq_pid],
sched_ctl->round[CC_idP][harq_pid][TB1],
frameP,
subframeP);
......@@ -4136,7 +4218,7 @@ extract_harq(module_id_t mod_idP,
frameP,
ra[ra_i].rnti);
} else {
if (sched_ctl->round[CC_idP][harq_pid] == 7) {
if(sched_ctl->round[CC_idP][harq_pid][TB1] == 7){
cancel_ra_proc(mod_idP,
CC_idP,
frameP,
......@@ -4151,24 +4233,24 @@ extract_harq(module_id_t mod_idP,
LOG_D(MAC, "In extract_harq(): pdu[0] = %d for harq_pid = %d\n", pdu[0], harq_pid);
if (pdu[0] == 1) { // ACK
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
sched_ctl->round[CC_idP][harq_pid][TB1] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
/* CDRX: PUCCH gives an ACK, so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
} else if (pdu[0] == 2 || pdu[0] == 4) { // NAK (treat DTX as NAK)
sched_ctl->round[CC_idP][harq_pid]++; // increment round
sched_ctl->round[CC_idP][harq_pid][TB1]++; // increment round
if (sched_ctl->round[CC_idP][harq_pid] == 4) {
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
if (sched_ctl->round[CC_idP][harq_pid][TB1] == 4) {
sched_ctl->round[CC_idP][harq_pid][TB1] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
/* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
if (sched_ctl->round[CC_idP][harq_pid] == 8) {
if (sched_ctl->round[CC_idP][harq_pid][TB1] == 8){
for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) {
if((ra[ra_i].rnti == rnti) && (ra[ra_i].state == WAITMSG4ACK)) {
// Msg NACK num to MAC ,remove UE
......@@ -4186,64 +4268,86 @@ extract_harq(module_id_t mod_idP,
// one or two ACK/NAK bits
AssertFatal(num_ack_nak <= 2, "num_ack_nak %d > 2 for 1 CC and TM3/4/8/9/10\n",
num_ack_nak);
if (num_ack_nak == 2 && sched_ctl->round[CC_idP][harq_pid] < 8 && sched_ctl->tbcnt[CC_idP][harq_pid] == 1 && pdu[0] == 1 && pdu[1] == 1) {
sched_ctl->round[CC_idP][harq_pid] = 8;
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
if ((num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid][select_tb] < 8)
&& (sched_ctl->round[CC_idP][harq_pid][oppose_tb] < 8)
&& (pdu[select_tb] == 1) && (pdu[oppose_tb] == 1)) {
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8;
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8;
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
/* CDRX: PUCCH gives an ACK, so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
if ((num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
&& (sched_ctl->tbcnt[CC_idP][harq_pid] == 1)
&& (pdu[0] == 2) && (pdu[1] == 2)) {
sched_ctl->round[CC_idP][harq_pid]++;
if (sched_ctl->round[CC_idP][harq_pid] == 4) {
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
/* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
} else if (((num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
&& (sched_ctl->tbcnt[0][harq_pid] == 2)
&& (pdu[0] == 1) && (pdu[1] == 2))
|| ((num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
&& (sched_ctl->tbcnt[CC_idP][harq_pid] == 2)
&& (pdu[0] == 2) && (pdu[1] == 1))) {
sched_ctl->round[CC_idP][harq_pid]++;
sched_ctl->tbcnt[CC_idP][harq_pid] = 1;
if (sched_ctl->round[CC_idP][harq_pid] == 4) {
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0; /* TODO: do we have to set it to 0? */
else if( (num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid][select_tb] < 8)
&& (sched_ctl->round[CC_idP][harq_pid][oppose_tb] < 8)
&& ((pdu[select_tb] == 2) || (pdu[select_tb] == 4))
&& ((pdu[oppose_tb] == 2) || (pdu[oppose_tb] == 4))) {
sched_ctl->round[CC_idP][harq_pid][select_tb]++;
sched_ctl->round[CC_idP][harq_pid][oppose_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][select_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb]++;
if (sched_ctl->round[CC_idP][harq_pid][select_tb] == 4) {
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
/* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
} else if ((num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
&& (sched_ctl->tbcnt[CC_idP][harq_pid] == 2)
&& (pdu[0] == 2) && (pdu[1] == 2)) {
sched_ctl->round[CC_idP][harq_pid]++;
if (sched_ctl->round[CC_idP][harq_pid] == 4) {
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
/* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
} else
if (sched_ctl->round[CC_idP][harq_pid][oppose_tb] == 4) {
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
} else if ((num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid][select_tb] < 8)
&& (sched_ctl->round[CC_idP][harq_pid][oppose_tb] < 8)
&& (pdu[select_tb] == 1)
&& ((pdu[oppose_tb] == 2) || pdu[oppose_tb] == 4)){
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8;
sched_ctl->round[CC_idP][harq_pid][oppose_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb]++;
if (sched_ctl->round[CC_idP][harq_pid][oppose_tb] == 4) {
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
/* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
}
else if ((num_ack_nak == 2)
&& (sched_ctl->round[CC_idP][harq_pid][select_tb] < 8)
&& (sched_ctl->round[CC_idP][harq_pid][oppose_tb] < 8)
&& ((pdu[select_tb] == 2) || (pdu[select_tb] == 4))
&& (pdu[oppose_tb] == 1)){
sched_ctl->round[CC_idP][harq_pid][select_tb]++;
sched_ctl->round[CC_idP][harq_pid][oppose_tb] = 8;
sched_ctl->rsn[CC_idP][harq_pid][select_tb]++;
sched_ctl->rsn[CC_idP][harq_pid][oppose_tb] = 0;
if (sched_ctl->round[CC_idP][harq_pid][select_tb] == 4) {
sched_ctl->round[CC_idP][harq_pid][select_tb] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][select_tb] = 0;
/* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */
sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0;
}
} else if( (num_ack_nak == 1)
&& (pdu[TB1] == 2 || pdu[TB1] == 4)) { // NAK (treat DTX as NAK)
sched_ctl->round[CC_idP][harq_pid][swap_flg]++; // increment round
sched_ctl->rsn[CC_idP][harq_pid][swap_flg]++;
if (sched_ctl->round[CC_idP][harq_pid][swap_flg] == 4) {
sched_ctl->round[CC_idP][harq_pid][swap_flg] = 8; // release HARQ process
sched_ctl->rsn[CC_idP][harq_pid][swap_flg] = 0;
}
} else
AssertFatal(1 == 0, "Illegal ACK/NAK/round combination (%d,%d,%d,%d,%d) for harq_pid %d, UE %d/%x\n",
num_ack_nak,
sched_ctl->round[CC_idP][harq_pid],
sched_ctl->round[CC_idP][harq_pid],
sched_ctl->round[CC_idP][harq_pid][TB1],
sched_ctl->round[CC_idP][harq_pid][TB1], pdu[0],
pdu[0],
pdu[1],
harq_pid,
......@@ -4258,8 +4362,8 @@ extract_harq(module_id_t mod_idP,
numCC);
if ((num_ack_nak == 2)
&& (sched_ctl->round[pCCid][harq_pid] < 8)
&& (sched_ctl->round[1 - pCCid][harq_pid] < 8)
&& (sched_ctl->round[pCCid][harq_pid][TB1] < 8)
&& (sched_ctl->round[1 - pCCid][harq_pid][TB1] < 8)
&& (sched_ctl->tbcnt[pCCid][harq_pid] == 1)
&& (sched_ctl->tbcnt[1 - pCCid][harq_pid] == 1)) {
AssertFatal(pdu[0] <= 3, "pdu[0] %d is not ACK/NAK/DTX\n",
......@@ -4268,27 +4372,26 @@ extract_harq(module_id_t mod_idP,
pdu[1]);
if (pdu[0] == 1)
sched_ctl->round[pCCid][harq_pid] = 8;
sched_ctl->round[pCCid][harq_pid][TB1] = 8;
else {
sched_ctl->round[pCCid][harq_pid]++;
sched_ctl->round[pCCid][harq_pid][TB1]++;
if (sched_ctl->round[pCCid][harq_pid] == 4)
sched_ctl->round[pCCid][harq_pid] = 8;
if (sched_ctl->round[pCCid][harq_pid][TB1] == 4)
sched_ctl->round[pCCid][harq_pid][TB1] = 8;
}
if (pdu[1] == 1)
sched_ctl->round[1 - pCCid][harq_pid] = 8;
else {
sched_ctl->round[1 - pCCid][harq_pid]++;
if (sched_ctl->round[1 - pCCid][harq_pid] == 4)
sched_ctl->round[1 - pCCid][harq_pid] = 8;
sched_ctl->round[1 - pCCid][harq_pid][TB1] = 8;
else {
sched_ctl->round[1 - pCCid][harq_pid][TB1]++;
if (sched_ctl->round[1 - pCCid][harq_pid][TB1] == 4)
sched_ctl->round[1 - pCCid][harq_pid][TB1] = 8;
}
} // A=2
else if ((num_ack_nak == 3)
&& (sched_ctl->round[pCCid][harq_pid] < 8)
&& (sched_ctl->tbcnt[pCCid][harq_pid] == 2)
&& (sched_ctl->round[1 - pCCid][harq_pid] < 8)
&& (sched_ctl->round[pCCid][harq_pid][TB1] < 8)
&& (sched_ctl->tbcnt[pCCid][harq_pid] == 2)
&& (sched_ctl->round[1 - pCCid][harq_pid][TB1] < 8)
&& (sched_ctl->tbcnt[1 - pCCid][harq_pid] == 1)) {
AssertFatal(pdu[0] <= 3, "pdu[0] %d is not ACK/NAK/DTX\n",
pdu[0]);
......@@ -4308,38 +4411,36 @@ extract_harq(module_id_t mod_idP,
rnti);
if (pdu[0] == 1 && pdu[1] == 1) { // both ACK
sched_ctl->round[pCCid][harq_pid] = 8;
sched_ctl->round[pCCid][harq_pid][TB1] = 8;
sched_ctl->tbcnt[pCCid][harq_pid] = 0;
} else if ((pdu[0] == 2 && pdu[1] == 1) || (pdu[0] == 1 && pdu[1] == 2)) {
sched_ctl->round[pCCid][harq_pid]++;
sched_ctl->round[pCCid][harq_pid][TB1]++;
sched_ctl->tbcnt[pCCid][harq_pid] = 1;
if (sched_ctl->round[pCCid][harq_pid] == 4) {
sched_ctl->round[pCCid][harq_pid] = 8;
if (sched_ctl->round[pCCid][harq_pid][TB1] == 4) {
sched_ctl->round[pCCid][harq_pid][TB1] = 8;
sched_ctl->tbcnt[pCCid][harq_pid] = 0; /* TODO: do we have to set it to 0? */
}
} else {
sched_ctl->round[pCCid][harq_pid]++;
if (sched_ctl->round[pCCid][harq_pid] == 4) {
sched_ctl->round[pCCid][harq_pid] = 8;
sched_ctl->round[pCCid][harq_pid][TB1]++;
if (sched_ctl->round[pCCid][harq_pid][TB1] == 4) {
sched_ctl->round[pCCid][harq_pid][TB1] = 8;
sched_ctl->tbcnt[pCCid][harq_pid] = 0;
}
}
if (pdu[2] == 1) sched_ctl->round[1 - pCCid][harq_pid] = 8;
if (pdu[2] == 1) sched_ctl->round[1 - pCCid][harq_pid][TB1] = 8;
else {
sched_ctl->round[1 - pCCid][harq_pid]++;
if (sched_ctl->round[1 - pCCid][harq_pid] == 4) {
sched_ctl->round[1 - pCCid][harq_pid] = 8;
}
sched_ctl->round[1 - pCCid][harq_pid][TB1]++;
if (sched_ctl->round[1 - pCCid][harq_pid][TB1] == 4) {
sched_ctl->round[1 - pCCid][harq_pid][TB1] = 8;
}
} // A=3 primary cell has 2 TBs
else if ((num_ack_nak == 3)
&& (sched_ctl->round[1 - pCCid][harq_pid] < 8)
&& (sched_ctl->round[pCCid][harq_pid] < 8)
&& (sched_ctl->tbcnt[1 - pCCid][harq_pid] == 2)
}
} // A=3 primary cell has 2 TBs
else if ((num_ack_nak == 3)
&& (sched_ctl->round[1 - pCCid][harq_pid][TB1] < 8)
&& (sched_ctl->round[pCCid][harq_pid][TB1] < 8)
&& (sched_ctl->tbcnt[1 - pCCid][harq_pid] == 2)
&& (sched_ctl->tbcnt[pCCid][harq_pid] == 1)) {
AssertFatal(pdu[0] <= 3, "pdu[0] %d is not ACK/NAK/DTX\n",
pdu[0]);
......@@ -4359,39 +4460,39 @@ extract_harq(module_id_t mod_idP,
rnti);
if (pdu[0] == 1 && pdu[1] == 1) { // both ACK
sched_ctl->round[1 - pCCid][harq_pid] = 8;
sched_ctl->round[1 - pCCid][harq_pid][TB1] = 8;
sched_ctl->tbcnt[1 - pCCid][harq_pid] = 0;
} else if ((pdu[0] >= 2 && pdu[1] == 1) || (pdu[0] == 1 && pdu[1] >= 2)) { // one ACK
sched_ctl->round[1 - pCCid][harq_pid]++;
sched_ctl->round[1 - pCCid][harq_pid][TB1]++;
sched_ctl->tbcnt[1 - pCCid][harq_pid] = 1;
if (sched_ctl->round[1 - pCCid][harq_pid] == 4) {
sched_ctl->round[1 - pCCid][harq_pid] = 8;
if (sched_ctl->round[1 - pCCid][harq_pid][TB1] == 4) {
sched_ctl->round[1 - pCCid][harq_pid][TB1] = 8;
sched_ctl->tbcnt[1 - pCCid][harq_pid] = 0;
}
} else { // both NAK/DTX
sched_ctl->round[1 - pCCid][harq_pid]++;
sched_ctl->round[1 - pCCid][harq_pid][TB1]++;
if (sched_ctl->round[1 - pCCid][harq_pid] == 4) {
sched_ctl->round[1 - pCCid][harq_pid] = 8;
if (sched_ctl->round[1 - pCCid][harq_pid][TB1] == 4) {
sched_ctl->round[1 - pCCid][harq_pid][TB1] = 8;
sched_ctl->tbcnt[1 - pCCid][harq_pid] = 0;
}
}
if (pdu[2] == 1) sched_ctl->round[pCCid][harq_pid] = 8;
if (pdu[2] == 1) sched_ctl->round[pCCid][harq_pid][TB1] = 8;
else {
sched_ctl->round[pCCid][harq_pid]++;
sched_ctl->round[pCCid][harq_pid][TB1]++;
if (sched_ctl->round[pCCid][harq_pid] == 4) {
sched_ctl->round[pCCid][harq_pid] = 8;
if (sched_ctl->round[pCCid][harq_pid][TB1] == 4) {
sched_ctl->round[pCCid][harq_pid][TB1] = 8;
}
}
} // A=3 secondary cell has 2 TBs
#if MAX_NUM_CCs>1
else if ((num_ack_nak == 4)
&& (sched_ctl->round[0][harq_pid] < 8)
&& (sched_ctl->round[1][harq_pid] < 8)
&& (sched_ctl->round[0][harq_pid][TB1] < 8)
&& (sched_ctl->round[1][harq_pid][TB1] < 8)
&& (sched_ctl->tbcnt[1 - pCCid][harq_pid] == 2)
&& (sched_ctl->tbcnt[pCCid][harq_pid] == 2)) {
AssertFatal(pdu[0] <= 3, "pdu[0] %d is not ACK/NAK/DTX\n",
......@@ -4412,41 +4513,41 @@ extract_harq(module_id_t mod_idP,
rnti);
if (pdu[0] == 1 && pdu[1] == 1) { // both ACK
sched_ctl->round[0][harq_pid] = 8;
sched_ctl->round[0][harq_pid][TB1] = 8;
sched_ctl->tbcnt[0][harq_pid] = 0;
} else if ((pdu[0] >= 2 && pdu[1] == 1) || (pdu[0] == 1 && pdu[1] >= 2)) { // one ACK
sched_ctl->round[0][harq_pid]++;
sched_ctl->round[0][harq_pid][TB1]++;
sched_ctl->tbcnt[0][harq_pid] = 1;
if (sched_ctl->round[0][harq_pid] == 4) {
sched_ctl->round[0][harq_pid] = 8;
if (sched_ctl->round[0][harq_pid][TB1] == 4) {
sched_ctl->round[0][harq_pid][TB1] = 8;
sched_ctl->tbcnt[0][harq_pid] = 0;
}
} else { // both NAK/DTX
sched_ctl->round[0][harq_pid]++;
sched_ctl->round[0][harq_pid][TB1]++;
if (sched_ctl->round[0][harq_pid] == 4) {
sched_ctl->round[0][harq_pid] = 8;
if (sched_ctl->round[0][harq_pid][TB1] == 4) {
sched_ctl->round[0][harq_pid][TB1] = 8;
sched_ctl->tbcnt[0][harq_pid] = 0;
}
}
if (pdu[2] == 1 && pdu[3] == 1) { // both ACK
sched_ctl->round[1][harq_pid] = 8;
sched_ctl->round[1][harq_pid][TB1] = 8;
sched_ctl->tbcnt[1][harq_pid] = 0;
} else if ((pdu[2] >= 2 && pdu[3] == 1) || (pdu[2] == 1 && pdu[3] >= 2)) { // one ACK
sched_ctl->round[1][harq_pid]++;
sched_ctl->round[1][harq_pid][TB1]++;
sched_ctl->tbcnt[1][harq_pid] = 1;
if (sched_ctl->round[1][harq_pid] == 4) {
sched_ctl->round[1][harq_pid] = 8;
if (sched_ctl->round[1][harq_pid][TB1] == 4) {
sched_ctl->round[1][harq_pid][TB1] = 8;
sched_ctl->tbcnt[1][harq_pid] = 0;
}
} else { // both NAK/DTX
sched_ctl->round[1][harq_pid]++;
sched_ctl->round[1][harq_pid][TB1]++;
if (sched_ctl->round[1][harq_pid] == 4) {
sched_ctl->round[1][harq_pid] = 8;
if (sched_ctl->round[1][harq_pid][TB1] == 4) {
sched_ctl->round[1][harq_pid][TB1] = 8;
sched_ctl->tbcnt[1][harq_pid] = 0;
}
}
......@@ -4460,16 +4561,16 @@ extract_harq(module_id_t mod_idP,
numCC);
for (i = 0, j = 0; i < numCC; i++) {
if (sched_ctl->round[i][harq_pid] < 8) {
if ((sched_ctl->round[i][harq_pid][TB1] < 8)) {
if (tmode[i] == 1 || tmode[i] == 2 || tmode[0] == 5 || tmode[0] == 6 || tmode[0] == 7) {
if (pdu[j] == 1) {
sched_ctl->round[i][harq_pid] = 8;
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
} else if (pdu[j] == 2) {
sched_ctl->round[i][harq_pid]++;
sched_ctl->round[i][harq_pid][TB1]++;
if (sched_ctl->round[i][harq_pid] == 4) {
sched_ctl->round[i][harq_pid] = 8;
if (sched_ctl->round[i][harq_pid][TB1] == 4) {
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
}
} else
......@@ -4483,29 +4584,29 @@ extract_harq(module_id_t mod_idP,
j++;
} else if (spatial_bundling == 0) {
if (sched_ctl->tbcnt[i][harq_pid] == 2 && pdu[j] == 1 && pdu[j + 1] == 1) {
sched_ctl->round[i][harq_pid] = 8;
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
} else if (sched_ctl->tbcnt[i][harq_pid] == 2 && pdu[j] == 1 && pdu[j + 1] == 2) {
sched_ctl->round[i][harq_pid]++;
sched_ctl->round[i][harq_pid][TB1]++;
sched_ctl->tbcnt[i][harq_pid] = 1;
if (sched_ctl->round[i][harq_pid] == 4) {
sched_ctl->round[i][harq_pid] = 8;
if (sched_ctl->round[i][harq_pid][TB1] == 4) {
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
}
} else if (sched_ctl->tbcnt[i][harq_pid] == 2 && pdu[j] == 2 && pdu[j + 1] == 1) {
sched_ctl->round[i][harq_pid]++;
sched_ctl->round[i][harq_pid][TB1]++;
sched_ctl->tbcnt[i][harq_pid] = 1;
if (sched_ctl->round[i][harq_pid] == 4) {
sched_ctl->round[i][harq_pid] = 8;
if (sched_ctl->round[i][harq_pid][TB1] == 4) {
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
}
} else if (sched_ctl->tbcnt[i][harq_pid] == 2 && pdu[j] == 2 && pdu[j + 1] == 2) {
sched_ctl->round[i][harq_pid]++;
sched_ctl->round[i][harq_pid][TB1]++;
if (sched_ctl->round[i][harq_pid] == 4) {
sched_ctl->round[i][harq_pid] = 8;
if (sched_ctl->round[i][harq_pid][TB1] == 4) {
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
}
} else
......@@ -4521,13 +4622,13 @@ extract_harq(module_id_t mod_idP,
j += 2;
} else if (spatial_bundling == 1) {
if (pdu[j] == 1) {
sched_ctl->round[i][harq_pid] = 8;
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
} else if (pdu[j] == 2) {
sched_ctl->round[i][harq_pid]++;
sched_ctl->round[i][harq_pid][TB1]++;
if (sched_ctl->round[i][harq_pid] == 4) {
sched_ctl->round[i][harq_pid] = 8;
if (sched_ctl->round[i][harq_pid][TB1] == 4) {
sched_ctl->round[i][harq_pid][TB1] = 8;
sched_ctl->tbcnt[i][harq_pid] = 0;
}
} else {
......
......@@ -471,9 +471,19 @@ typedef struct {
#define BSR_TRIGGER_PADDING (4) /* For Padding BSR Trigger */
#define MAX_NUM_TB 2
#define TB1 0
#define TB2 1
#define SINGLE_RI 1
#define MULTI_RI 2
#define SINGLE_CW 1
#define MULTI_CW 2
#define TX_DIVERSITY 1
#define LARGE_DELAY_CDD 2
/*! \brief Downlink SCH PDU Structure */
typedef struct {
uint8_t payload[8][SCH_PAYLOAD_SIZE_MAX];
uint8_t payload[8][MAX_NUM_TB][SCH_PAYLOAD_SIZE_MAX];
uint16_t Pdu_size[8];
} __attribute__ ((__packed__)) DLSCH_PDU;
......@@ -647,7 +657,7 @@ typedef struct {
/// harq pid
uint8_t harq_pid;
/// harq rounf
uint8_t harq_round;
uint8_t harq_round[MAX_NUM_TB];
/// total available number of PRBs for a new transmission
uint16_t rbs_used;
/// total available number of PRBs for a retransmission
......@@ -657,12 +667,10 @@ typedef struct {
/// total avilable nccc for a retransmission: num control channel element
uint16_t ncce_used_retx;
// mcs1 before the rate adaptaion
uint8_t dlsch_mcs1;
/// Target mcs2 after rate-adaptation
uint8_t dlsch_mcs2;
// current TBS with mcs2
uint32_t TBS;
// mcs
uint8_t dlsch_mcs[MAX_NUM_TB];
// current TBS
uint32_t TBS[MAX_NUM_TB];
// total TBS with mcs2
// uint32_t total_TBS;
// total rb used for a new transmission
......@@ -693,7 +701,7 @@ typedef struct {
//total
uint32_t total_dlsch_bitrate;
/// headers+ CE + padding bytes for a MAC PDU
uint64_t overhead_bytes;
uint64_t overhead_bytes[MAX_NUM_TB];
/// headers+ CE + padding bytes for a MAC PDU
uint64_t total_overhead_bytes;
/// headers+ CE + padding bytes for a MAC PDU
......@@ -786,11 +794,9 @@ typedef struct {
/// C-RNTI of UE
rnti_t rnti;
/// NDI from last scheduling
uint8_t oldNDI[8];
/// mcs1 from last scheduling
uint8_t oldmcs1[8];
/// mcs2 from last scheduling
uint8_t oldmcs2[8];
uint8_t oldNDI[8][MAX_NUM_TB];
/// mcs from last scheduling
uint8_t oldmcs[8][MAX_NUM_TB];
/// NDI from last UL scheduling
uint8_t oldNDI_UL[8];
/// mcs from last UL scheduling
......@@ -947,7 +953,7 @@ typedef struct {
// resource scheduling information
/// Current DL harq round per harq_pid on each CC
uint8_t round[NFAPI_CC_MAX][10];
uint8_t round[NFAPI_CC_MAX][10][MAX_NUM_TB];
/// Current Active TBs per harq_pid on each CC
uint8_t tbcnt[NFAPI_CC_MAX][10];
/// Current UL harq round per harq_pid on each CC
......@@ -1003,6 +1009,11 @@ typedef struct {
uint8_t crnti_reconfigurationcomplete_flag;
uint8_t cqi_req_flag;
uint8_t cw_num[NFAPI_CC_MAX][10];
uint8_t select_tb[NFAPI_CC_MAX][10];
uint8_t swap_flag[NFAPI_CC_MAX][10];
uint8_t rsn[NFAPI_CC_MAX][10][MAX_NUM_TB];
/* HARQ RRT Timers */
/// (UL) HARQ RTT timers, especially used for CDRX operations, one timer per cell per harq process (and per user)
uint8_t harq_rtt_timer[NFAPI_CC_MAX][8];
......@@ -1199,7 +1210,7 @@ typedef struct {
uint32_t bytes_lcid[MAX_MOBILES_PER_ENB][MAX_NUM_LCID];
uint32_t wb_pmi[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
uint8_t mcs[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
uint8_t mcs[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB][MAX_NUM_TB];
} pre_processor_results_t;
......
......@@ -1207,6 +1207,7 @@ void fill_nfapi_dlsch_config(eNB_MAC_INST * eNB,
void fill_nfapi_harq_information(module_id_t module_idP,
int CC_idP,
uint16_t rntiP,
uint16_t absSFP,
nfapi_ul_config_harq_information *
harq_information, uint8_t cce_idxP);
......
......@@ -186,6 +186,7 @@ assign_rbs_required(module_id_t Mod_id,
slice_info_t *sli = &RC.mac[Mod_id]->slice_info;
eNB_UE_STATS *eNB_UE_stats, *eNB_UE_stats_i, *eNB_UE_stats_j;
int N_RB_DL;
int ri;
// clear rb allocations across all CC_id
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
......@@ -200,7 +201,8 @@ assign_rbs_required(module_id_t Mod_id,
CC_id = UE_list->ordered_CCids[n][UE_id];
eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id];
// eNB_UE_stats->dlsch_mcs1 = cmin(cqi_to_mcs[UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]], sli->dl[slice_idx].maxmcs);
eNB_UE_stats->dlsch_mcs1 = cmin(cqi2mcs(UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]), sli->dl[slice_idx].maxmcs);
eNB_UE_stats->dlsch_mcs[TB1] = cmin(cqi2mcs(UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]), sli->dl[slice_idx].maxmcs);
eNB_UE_stats->dlsch_mcs[TB2] = eNB_UE_stats->dlsch_mcs[TB1];
}
// provide the list of CCs sorted according to MCS
......@@ -211,7 +213,7 @@ assign_rbs_required(module_id_t Mod_id,
DevAssert(j < NFAPI_CC_MAX);
eNB_UE_stats_j = &UE_list->eNB_UE_stats[UE_list->ordered_CCids[j][UE_id]][UE_id];
if (eNB_UE_stats_j->dlsch_mcs1 > eNB_UE_stats_i->dlsch_mcs1) {
if (eNB_UE_stats_j->dlsch_mcs[TB1] > eNB_UE_stats_i->dlsch_mcs[TB1]) {
tmp = UE_list->ordered_CCids[i][UE_id];
UE_list->ordered_CCids[i][UE_id] = UE_list->ordered_CCids[j][UE_id];
UE_list->ordered_CCids[j][UE_id] = tmp;
......@@ -226,42 +228,44 @@ assign_rbs_required(module_id_t Mod_id,
CC_id = UE_list->ordered_CCids[i][UE_id];
eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id];
if (eNB_UE_stats->dlsch_mcs1 == 0) {
if (eNB_UE_stats->dlsch_mcs[TB1] == 0) {
nb_rbs_required[CC_id][UE_id] = 4; // don't let the TBS get too small
} else {
nb_rbs_required[CC_id][UE_id] = min_rb_unit[CC_id];
}
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1, nb_rbs_required[CC_id][UE_id]);
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs[TB1], nb_rbs_required[CC_id][UE_id]);
LOG_D(MAC,
"[preprocessor] start RB assignement for UE %d CC_id %d dl buffer %d (RB unit %d, MCS %d, TBS %d) \n",
UE_id, CC_id,
UE_list->UE_template[pCCid][UE_id].dl_buffer_total,
nb_rbs_required[CC_id][UE_id],
eNB_UE_stats->dlsch_mcs1, TBS);
eNB_UE_stats->dlsch_mcs[TB1], TBS);
N_RB_DL = to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_idx] =
nb_rbs_allowed_slice(sli->dl[slice_idx].pct, N_RB_DL);
/* calculating required number of RBs for each UE */
while (TBS < UE_list->UE_template[pCCid][UE_id].dl_buffer_total) {
ri = UE_list->UE_sched_ctrl[UE_id].aperiodic_ri_received[CC_id] - 1;
while ((TBS + ri * TBS) < UE_list->UE_template[pCCid][UE_id].dl_buffer_total) {
nb_rbs_required[CC_id][UE_id] += min_rb_unit[CC_id];
if (nb_rbs_required[CC_id][UE_id] > UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_idx]) {
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1, UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_idx]);
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs[TB1], UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_idx]);
nb_rbs_required[CC_id][UE_id] = UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_idx];
break;
}
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1, nb_rbs_required[CC_id][UE_id]);
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs[TB1], nb_rbs_required[CC_id][UE_id]);
} // end of while
LOG_D(MAC,
"[eNB %d] Frame %d: UE %d on CC %d: RB unit %d, nb_required RB %d (TBS %d, mcs %d)\n",
Mod_id, frameP, UE_id, CC_id, min_rb_unit[CC_id],
nb_rbs_required[CC_id][UE_id], TBS,
eNB_UE_stats->dlsch_mcs1);
sli->pre_processor_results[slice_idx].mcs[CC_id][UE_id] = eNB_UE_stats->dlsch_mcs1;
eNB_UE_stats->dlsch_mcs[TB1]);
sli->pre_processor_results[slice_idx].mcs[CC_id][UE_id][TB1] = eNB_UE_stats->dlsch_mcs[TB1];
sli->pre_processor_results[slice_idx].mcs[CC_id][UE_id][TB2] = eNB_UE_stats->dlsch_mcs[TB2];
}
}
}
......@@ -281,7 +285,7 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame,
cc = &RC.mac[Mod_id]->common_channels[CC_id];
UE_id = find_UE_id(Mod_id, rnti);
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame,subframe);
round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][harq_pid];
round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][harq_pid][TB1];
if (round > round_max) {
round_max = round;
......@@ -617,7 +621,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
cc = &RC.mac[Mod_id]->common_channels[CC_id];
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP);
round = ue_sched_ctl->round[CC_id][harq_pid];
round = ue_sched_ctl->round[CC_id][harq_pid][TB1];
if (nb_rbs_required[CC_id][UE_id] > 0) {
total_ue_count[CC_id]++;
......@@ -738,7 +742,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
cc = &RC.mac[Mod_id]->common_channels[CC_id];
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP);
round = ue_sched_ctl->round[CC_id][harq_pid];
round = ue_sched_ctl->round[CC_id][harq_pid][TB1];
// control channel or retransmission
/* TODO: do we have to check for retransmission? */
......
......@@ -144,9 +144,9 @@ int dump_eNB_l2_stats(char *buffer, int length) {
for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
for (i=0; i<UE_list->numactiveCCs[UE_id]; i++) {
CC_id=UE_list->ordered_CCids[i][UE_id];
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate=((UE_list->eNB_UE_stats[CC_id][UE_id].TBS*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate=(((UE_list->eNB_UE_stats[CC_id][UE_id].TBS[TB1] + UE_list->eNB_UE_stats[CC_id][UE_id].TBS[TB2])*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate= ((UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes+= UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes;
UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes+= UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes[TB1];
UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes=((UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_bitrate=((UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS*8)/((eNB->frame + 1)*10));
UE_list->eNB_UE_stats[CC_id][UE_id].total_ulsch_bitrate= ((UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx*8)/((eNB->frame + 1)*10));
......@@ -155,8 +155,8 @@ int dump_eNB_l2_stats(char *buffer, int length) {
map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1,
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2,
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs[TB1],
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs[TB2],
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used,
UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx,
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used,
......@@ -169,10 +169,10 @@ int dump_eNB_l2_stats(char *buffer, int length) {
"(TTI %"PRIu64", total %"PRIu64", avg %"PRIu64")\n",
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_bitrate,
UE_list->eNB_UE_stats[CC_id][UE_id].total_dlsch_bitrate,
UE_list->eNB_UE_stats[CC_id][UE_id].TBS,
UE_list->eNB_UE_stats[CC_id][UE_id].TBS[TB1],
UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes,
UE_list->eNB_UE_stats[CC_id][UE_id].total_num_pdus,
UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes,
UE_list->eNB_UE_stats[CC_id][UE_id].overhead_bytes[TB1],
UE_list->eNB_UE_stats[CC_id][UE_id].total_overhead_bytes,
UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes
);
......
......@@ -2715,7 +2715,7 @@ do_RRCConnectionSetup(
break;
*/
}
LOG_I(RRC,"UE %x Transmission mode is set to %ld at RRCConnectionSetup because antenna port is %d!\n", ue_context_pP->ue_id_rnti, physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode+1, carrier->p_eNB);
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.present = LTE_AntennaInfoDedicated__ue_TransmitAntennaSelection_PR_release;
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.release = 0;
// SchedulingRequestConfig
......@@ -3101,7 +3101,7 @@ uint8_t do_RRCConnectionSetup_BR(
*/
}
LOG_I(RRC,"UE %x Transmission mode is set to %ld at RRCConnectionSetup_RB because antenna port is %d!\n", ue_context_pP->ue_id_rnti, physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode+1, carrier->p_eNB);
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.present = LTE_AntennaInfoDedicated__ue_TransmitAntennaSelection_PR_release;
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.release = 0;
......@@ -3600,6 +3600,11 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToReleaseList = DRB_list2;
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->sps_Config = sps_Config;
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->physicalConfigDedicated = physicalConfigDedicated;
if (physicalConfigDedicated && physicalConfigDedicated->antennaInfo) {
LOG_I(RRC,"UE %x Transmission mode is set to %ld at this RRCConnectionReconfiguration!\n", ctxt_pP->rnti, physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode+1);
} else {
LOG_I(RRC,"UE %x Transmission mode is not defined at this RRCConnectionReconfiguration!\n", ctxt_pP->rnti);
}
#ifdef CBA
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->cba_RNTI_vlola= cba_rnti;
#endif
......@@ -3860,6 +3865,11 @@ do_RRCConnectionReestablishment(
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.sps_Config = NULL;
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.physicalConfigDedicated = physicalConfigDedicated2;
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.mac_MainConfig = NULL;
if (physicalConfigDedicated2 && physicalConfigDedicated2->antennaInfo) {
LOG_I(RRC,"UE %x Transmission mode is set to %ld at RRCConnectionReestablishment!\n", ue_context_pP->ue_id_rnti, physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode+1);
} else {
LOG_I(RRC,"UE %x Transmission mode is not defined at RRCConnectionReestablishment!\n", ue_context_pP->ue_id_rnti);
}
uint8_t KeNB_star[32] = { 0 };
uint16_t pci = rrc->carrier[CC_id].physCellId;
uint32_t earfcn_dl = (uint32_t)freq_to_arfcn10(RC.mac[ctxt_pP->module_id]->common_channels[CC_id].eutra_band,
......
......@@ -3036,17 +3036,21 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
if (*physicalConfigDedicated) {
if ((*physicalConfigDedicated)->antennaInfo) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode;
LOG_D(RRC,"Setting transmission mode to %ld+1\n",rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode);
LOG_D(RRC,"Setting transmission mode to %ld+1 ue_Category %ld\n",rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode,ue_context_pP->ue_context.UE_Capability->ue_Category);
if (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm3) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1);
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6;
if (ue_context_pP->ue_context.UE_Capability->ue_Category >= 2) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1);
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6;
} else {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm2;
}
} else if (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm4) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
......@@ -3075,6 +3079,8 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.bits_unused=4;
}
LOG_I(RRC,"UE %x Transmission mode is set to %ld at defaultRRCConnectionReconfiguration because ue_Category is %ld and ue_TransmissionMode in configfile is %ld!\n",
ue_context_pP->ue_id_rnti, (*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode+1, ue_context_pP->ue_context.UE_Capability->ue_Category, rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode+1);
} else {
LOG_E(RRC,"antenna_info not present in physical_config_dedicated. Not reconfiguring!\n");
}
......@@ -3660,14 +3666,18 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
LOG_D(RRC,"Setting transmission mode to %ld+1\n",rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode);
if (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm3) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1);
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6;
if (ue_context_pP->ue_context.UE_Capability->ue_Category >= 2) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1);
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6;
} else {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm2;
}
} else if (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm4) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
......@@ -3696,6 +3706,8 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.bits_unused=4;
}
LOG_I(RRC,"UE %x Transmission mode is set to %ld at flexran defaultRRCConnectionReconfiguration because ue_Category is %ld and ue_TransmissionMode in configfile is %ld!\n",
ue_context_pP->ue_id_rnti, (*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode+1, ue_context_pP->ue_context.UE_Capability->ue_Category, rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode+1);
} else {
LOG_E(RRC,"antenna_info not present in physical_config_dedicated. Not reconfiguring!\n");
}
......@@ -4796,14 +4808,18 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
LOG_D(RRC,"Setting transmission mode to %ld+1\n",rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode);
if (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm3) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1);
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6;
if (ue_context_pP->ue_context.UE_Capability->ue_Category >= 2) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1);
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6;
} else {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm2;
}
} else if (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm4) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(LTE_AntennaInfoDedicated__codebookSubsetRestriction_PR));
......@@ -4832,7 +4848,8 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.size=1;
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.bits_unused=4;
}
LOG_I(RRC,"UE %x Transmission mode is set to %ld at handover RRCConnectionReconfiguration because ue_Category is %ld and ue_TransmissionMode in configfile is %ld!\n",
ue_context_pP->ue_id_rnti, (*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode+1, ue_context_pP->ue_context.UE_Capability->ue_Category, rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode+1);
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.present =
LTE_AntennaInfoDedicated__ue_TransmitAntennaSelection_PR_release;
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.release = 0;
......
......@@ -608,8 +608,8 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p,
ie = (X2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequestAcknowledge_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_ignore;
ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID_1;
ie->value.choice.UE_X2AP_ID_1 = id_target;
ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID;
ie->value.choice.UE_X2AP_ID = id_target;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -702,8 +702,8 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2
ie = (X2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(X2AP_UEContextRelease_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID_1;
ie->value.choice.UE_X2AP_ID_1 = id_target;
ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID;
ie->value.choice.UE_X2AP_ID = id_target;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
......@@ -762,8 +762,8 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_
ie = (X2AP_HandoverCancel_IEs_t *)calloc(1, sizeof(X2AP_HandoverCancel_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_ignore;
ie->value.present = X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID_1;
ie->value.choice.UE_X2AP_ID_1 = id_target;
ie->value.present = X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID;
ie->value.choice.UE_X2AP_ID = id_target;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
......
......@@ -778,7 +778,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
return -1;
}
id_target = ie->value.choice.UE_X2AP_ID_1;
id_target = ie->value.choice.UE_X2AP_ID;
ue_id = id_source;
......@@ -867,7 +867,7 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
return -1;
}
id_target = ie->value.choice.UE_X2AP_ID_1;
id_target = ie->value.choice.UE_X2AP_ID;
ue_id = id_source;
if (ue_id != x2ap_find_id_from_id_source(&instance_p->id_manager, id_source)) {
......@@ -944,7 +944,7 @@ int x2ap_eNB_handle_handover_cancel (instance_t instance,
X2AP_INFO("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
id_target = -1;
} else
id_target = ie->value.choice.UE_X2AP_ID_1;
id_target = ie->value.choice.UE_X2AP_ID;
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverCancel_IEs_t, ie, x2HandoverCancel,
X2AP_ProtocolIE_ID_id_Cause, true);
......
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