Commit 5e50a8cc authored by mjoang's avatar mjoang

remove newlines, add space after comma, fix identation

parent 1fac8d69
...@@ -236,7 +236,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -236,7 +236,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
NR_UE_MAC_INST_t *mac, NR_UE_MAC_INST_t *mac,
uint8_t power_headroom, // todo: NR_POWER_HEADROOM_CMD *power_headroom, uint8_t power_headroom, // todo: NR_POWER_HEADROOM_CMD *power_headroom,
uint16_t *crnti, uint16_t *crnti,
NR_BSR_SHORT *truncated_bsr, NR_BSR_SHORT *truncated_bsr,
NR_BSR_SHORT *short_bsr, NR_BSR_SHORT *short_bsr,
NR_BSR_LONG *long_bsr NR_BSR_LONG *long_bsr
......
...@@ -142,48 +142,32 @@ void nr_ue_init_mac(module_id_t module_idP) { ...@@ -142,48 +142,32 @@ void nr_ue_init_mac(module_id_t module_idP) {
// default values as deined in 38.331 sec 9.2.2 // default values as deined in 38.331 sec 9.2.2
LOG_I(NR_MAC, "[UE%d] Applying default macMainConfig\n", module_idP); LOG_I(NR_MAC, "[UE%d] Applying default macMainConfig\n", module_idP);
//mac->scheduling_info.macConfig=NULL; //mac->scheduling_info.macConfig=NULL;
mac->scheduling_info.retxBSR_Timer = mac->scheduling_info.retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf10240;
NR_BSR_Config__retxBSR_Timer_sf10240; mac->scheduling_info.periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_infinity;
mac->scheduling_info.periodicBSR_Timer = // mac->scheduling_info.periodicPHR_Timer = NR_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
NR_BSR_Config__periodicBSR_Timer_infinity; // mac->scheduling_info.prohibitPHR_Timer = NR_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
// mac->scheduling_info.periodicPHR_Timer = // mac->scheduling_info.PathlossChange_db = NR_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
// NR_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; // mac->PHR_state = NR_MAC_MainConfig__phr_Config_PR_setup;
// mac->scheduling_info.prohibitPHR_Timer =
// NR_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
// mac->scheduling_info.PathlossChange_db =
// NR_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
// mac->PHR_state =
// NR_MAC_MainConfig__phr_Config_PR_setup;
mac->scheduling_info.SR_COUNTER = 0; mac->scheduling_info.SR_COUNTER = 0;
mac->scheduling_info.sr_ProhibitTimer = 0; mac->scheduling_info.sr_ProhibitTimer = 0;
mac->scheduling_info.sr_ProhibitTimer_Running = 0; mac->scheduling_info.sr_ProhibitTimer_Running = 0;
// mac->scheduling_info.maxHARQ_Tx = // mac->scheduling_info.maxHARQ_Tx = NR_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
// NR_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
// mac->scheduling_info.ttiBundling = 0; // mac->scheduling_info.ttiBundling = 0;
// mac->scheduling_info.extendedBSR_Sizes_r10 = 0; // mac->scheduling_info.extendedBSR_Sizes_r10 = 0;
// mac->scheduling_info.extendedPHR_r10 = 0; // mac->scheduling_info.extendedPHR_r10 = 0;
// mac->scheduling_info.drx_config = NULL; // mac->scheduling_info.drx_config = NULL;
// mac->scheduling_info.phr_config = NULL; // mac->scheduling_info.phr_config = NULL;
// set init value 0xFFFF, make sure periodic timer and retx time counters are NOT active, after bsr transmission set the value configured by the NW. // set init value 0xFFFF, make sure periodic timer and retx time counters are NOT active, after bsr transmission set the value configured by the NW.
mac->scheduling_info.periodicBSR_SF = mac->scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
MAC_UE_BSR_TIMER_NOT_RUNNING; mac->scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
mac->scheduling_info.retxBSR_SF =
MAC_UE_BSR_TIMER_NOT_RUNNING;
mac->BSR_reporting_active = BSR_TRIGGER_NONE; mac->BSR_reporting_active = BSR_TRIGGER_NONE;
// mac->scheduling_info.periodicPHR_SF = // mac->scheduling_info.periodicPHR_SF = nr_get_sf_perioidicPHR_Timer(mac->scheduling_info.periodicPHR_Timer);
// nr_get_sf_perioidicPHR_Timer(mac-> // mac->scheduling_info.prohibitPHR_SF = nr_get_sf_prohibitPHR_Timer(mac->scheduling_info.prohibitPHR_Timer);
// scheduling_info.periodicPHR_Timer); // mac->scheduling_info.PathlossChange_db = nr_get_db_dl_PathlossChange(mac->scheduling_info.PathlossChange);
// mac->scheduling_info.prohibitPHR_SF =
// nr_get_sf_prohibitPHR_Timer(mac->
// scheduling_info.prohibitPHR_Timer);
// mac->scheduling_info.PathlossChange_db =
// nr_get_db_dl_PathlossChange(mac->
// scheduling_info.PathlossChange);
// mac->PHR_reporting_active = 0; // mac->PHR_reporting_active = 0;
for (i = 0; i < NR_MAX_NUM_LCID; i++) { for (i = 0; i < NR_MAX_NUM_LCID; i++) {
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE%d] Applying default logical channel config for LCGID %d\n",
"[UE%d] Applying default logical channel config for LCGID %d\n",
module_idP, i); module_idP, i);
mac->scheduling_info.Bj[i] = -1; mac->scheduling_info.Bj[i] = -1;
mac->scheduling_info.bucket_size[i] = -1; mac->scheduling_info.bucket_size[i] = -1;
...@@ -194,8 +178,7 @@ void nr_ue_init_mac(module_id_t module_idP) { ...@@ -194,8 +178,7 @@ void nr_ue_init_mac(module_id_t module_idP) {
mac->scheduling_info.LCGID[i] = 1; mac->scheduling_info.LCGID[i] = 1;
} }
mac->scheduling_info.LCID_status[i] = mac->scheduling_info.LCID_status[i] = LCID_EMPTY;
LCID_EMPTY;
mac->scheduling_info.LCID_buffer_remain[i] = 0; mac->scheduling_info.LCID_buffer_remain[i] = 0;
for (int i=0;i<NR_MAX_HARQ_PROCESSES;i++) mac->first_ul_tx[i]=1; for (int i=0;i<NR_MAX_HARQ_PROCESSES;i++) mac->first_ul_tx[i]=1;
} }
...@@ -2216,52 +2199,18 @@ int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, slot_t slot){ ...@@ -2216,52 +2199,18 @@ int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, slot_t slot){
DevCheck(module_idP < (int) NB_UE_INST, module_idP, NB_NR_UE_MAC_INST, 0); DevCheck(module_idP < (int) NB_UE_INST, module_idP, NB_NR_UE_MAC_INST, 0);
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
DSR_TRANSMAX_t dsr_TransMax = sr_n64; // todo DSR_TRANSMAX_t dsr_TransMax = sr_n64; // todo
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE %d] Frame %d slot %d send SR indication (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d\n",
"[UE %d] Frame %d slot %d send SR indication (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d\n",
module_idP, frameP, slot, module_idP, frameP, slot,
mac->scheduling_info.SR_COUNTER, mac->scheduling_info.SR_COUNTER,
(1 << (1 << (2 + dsr_TransMax)),
(2 +
// mac->
// physicalConfigDedicated->schedulingRequestConfig->choice.
// setup.dsr_TransMax)),
dsr_TransMax)),
mac->scheduling_info.SR_pending); // todo mac->scheduling_info.SR_pending); // todo
/*
if ((mac->scheduling_info.sr_ProhibitTimer_Running == 0)) {
mac->scheduling_info.SR_pending = 1;
LOG_D(NR_MAC,
"[UE %d] Frame %d slot %d send SR indication (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d, sr_ProhibitTimer_Running == 0\n",
module_idP, frameP, slot,
mac->scheduling_info.SR_COUNTER,
(1 <<
(2 +
// mac->
// physicalConfigDedicated->schedulingRequestConfig->choice.
// setup.dsr_TransMax)),
dsr_TransMax)),
mac->scheduling_info.SR_pending); // todo
return (0);
}
*/ // todo
if ((mac->scheduling_info.SR_pending == 1) && if ((mac->scheduling_info.SR_pending == 1) &&
(mac->scheduling_info.SR_COUNTER < (mac->scheduling_info.SR_COUNTER < (1 << (2 + dsr_TransMax)))) {
(1 << LOG_D(NR_MAC, "[UE %d] Frame %d slot %d PHY asks for SR (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d, increment SR_COUNTER\n",
(2 +
//mac->
//physicalConfigDedicated->schedulingRequestConfig->choice.setup.
//dsr_TransMax)))) {
dsr_TransMax)))) {
LOG_D(NR_MAC,
"[UE %d] Frame %d slot %d PHY asks for SR (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d, increment SR_COUNTER\n",
module_idP, frameP, slot, module_idP, frameP, slot,
mac->scheduling_info.SR_COUNTER, mac->scheduling_info.SR_COUNTER,
(1 << (1 << (2 + dsr_TransMax)),
(2 +
//mac->
//physicalConfigDedicated->schedulingRequestConfig->choice.
//setup.dsr_TransMax)),
dsr_TransMax)),
mac->scheduling_info.SR_pending); // todo mac->scheduling_info.SR_pending); // todo
mac->scheduling_info.SR_COUNTER++; mac->scheduling_info.SR_COUNTER++;
...@@ -3555,7 +3504,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -3555,7 +3504,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
NR_UE_MAC_INST_t *mac, NR_UE_MAC_INST_t *mac,
uint8_t power_headroom, // todo: NR_POWER_HEADROOM_CMD *power_headroom, uint8_t power_headroom, // todo: NR_POWER_HEADROOM_CMD *power_headroom,
uint16_t *crnti, uint16_t *crnti,
NR_BSR_SHORT *truncated_bsr, NR_BSR_SHORT *truncated_bsr,
NR_BSR_SHORT *short_bsr, NR_BSR_SHORT *short_bsr,
NR_BSR_LONG *long_bsr) { NR_BSR_LONG *long_bsr) {
...@@ -3581,7 +3530,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, ...@@ -3581,7 +3530,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
mac_ce += mac_ce_size; mac_ce += mac_ce_size;
mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_FIXED); mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_FIXED);
LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : power_headroom pdu %p mac_ce %p b\n", LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : power_headroom pdu %p mac_ce %p b\n",
pdu, mac_ce); pdu, mac_ce);
} }
if (crnti && (!get_softmodem_params()->sa && get_softmodem_params()->do_ra && mac->ra.ra_state != RA_SUCCEEDED)) { if (crnti && (!get_softmodem_params()->sa && get_softmodem_params()->do_ra && mac->ra.ra_state != RA_SUCCEEDED)) {
...@@ -3619,7 +3568,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, ...@@ -3619,7 +3568,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
mac_ce += mac_ce_size; mac_ce += mac_ce_size;
mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_FIXED); mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_FIXED);
LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : truncated_bsr Buffer_size %d LcgID %d pdu %p mac_ce %p\n", LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : truncated_bsr Buffer_size %d LcgID %d pdu %p mac_ce %p\n",
truncated_bsr->Buffer_size, truncated_bsr->LcgID, pdu, mac_ce); truncated_bsr->Buffer_size, truncated_bsr->LcgID, pdu, mac_ce);
} else if (short_bsr) { } else if (short_bsr) {
...@@ -3637,7 +3586,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, ...@@ -3637,7 +3586,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
mac_ce += mac_ce_size; mac_ce += mac_ce_size;
mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_FIXED); mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_FIXED);
LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : short_bsr Buffer_size %d LcgID %d pdu %p mac_ce %p\n", LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : short_bsr Buffer_size %d LcgID %d pdu %p mac_ce %p\n",
short_bsr->Buffer_size, short_bsr->LcgID, pdu, mac_ce); short_bsr->Buffer_size, short_bsr->LcgID, pdu, mac_ce);
} else if (long_bsr) { } else if (long_bsr) {
// MAC CE variable subheader // MAC CE variable subheader
...@@ -3657,61 +3606,53 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, ...@@ -3657,61 +3606,53 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID0 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID0 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size0; *Buffer_size_ptr++ = long_bsr->Buffer_size0;
//NR_BSR_LONG_SIZE++;
} }
if (long_bsr->Buffer_size1 == 0) { if (long_bsr->Buffer_size1 == 0) {
((NR_BSR_LONG *) mac_ce)->LcgID1 = 0; ((NR_BSR_LONG *) mac_ce)->LcgID1 = 0;
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID1 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID1 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size1; *Buffer_size_ptr++ = long_bsr->Buffer_size1;
//NR_BSR_LONG_SIZE++;
} }
if (long_bsr->Buffer_size2 == 0) { if (long_bsr->Buffer_size2 == 0) {
((NR_BSR_LONG *) mac_ce)->LcgID2 = 0; ((NR_BSR_LONG *) mac_ce)->LcgID2 = 0;
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID2 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID2 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size2; *Buffer_size_ptr++ = long_bsr->Buffer_size2;
//NR_BSR_LONG_SIZE++;
} }
if (long_bsr->Buffer_size3 == 0) { if (long_bsr->Buffer_size3 == 0) {
((NR_BSR_LONG *) mac_ce)->LcgID3 = 0; ((NR_BSR_LONG *) mac_ce)->LcgID3 = 0;
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID3 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID3 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size3; *Buffer_size_ptr++ = long_bsr->Buffer_size3;
//NR_BSR_LONG_SIZE++;
} }
if (long_bsr->Buffer_size4 == 0) { if (long_bsr->Buffer_size4 == 0) {
((NR_BSR_LONG *) mac_ce)->LcgID4 = 0; ((NR_BSR_LONG *) mac_ce)->LcgID4 = 0;
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID4 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID4 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size4; *Buffer_size_ptr++ = long_bsr->Buffer_size4;
//NR_BSR_LONG_SIZE++;
} }
if (long_bsr->Buffer_size5 == 0) { if (long_bsr->Buffer_size5 == 0) {
((NR_BSR_LONG *) mac_ce)->LcgID5 = 0; ((NR_BSR_LONG *) mac_ce)->LcgID5 = 0;
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID5 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID5 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size5; *Buffer_size_ptr++ = long_bsr->Buffer_size5;
//NR_BSR_LONG_SIZE++;
} }
if (long_bsr->Buffer_size6 == 0) { if (long_bsr->Buffer_size6 == 0) {
((NR_BSR_LONG *) mac_ce)->LcgID6 = 0; ((NR_BSR_LONG *) mac_ce)->LcgID6 = 0;
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID6 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID6 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size6; *Buffer_size_ptr++ = long_bsr->Buffer_size6;
//NR_BSR_LONG_SIZE++;
} }
if (long_bsr->Buffer_size7 == 0) { if (long_bsr->Buffer_size7 == 0) {
((NR_BSR_LONG *) mac_ce)->LcgID7 = 0; ((NR_BSR_LONG *) mac_ce)->LcgID7 = 0;
} else { } else {
((NR_BSR_LONG *) mac_ce)->LcgID7 = 1; ((NR_BSR_LONG *) mac_ce)->LcgID7 = 1;
*Buffer_size_ptr++ = long_bsr->Buffer_size7; *Buffer_size_ptr++ = long_bsr->Buffer_size7;
//NR_BSR_LONG_SIZE++;
} }
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_subheader_ptr)->L = mac_ce_size = (uint8_t*) Buffer_size_ptr - (uint8_t*) mac_ce; ((NR_MAC_SUBHEADER_SHORT *) mac_pdu_subheader_ptr)->L = mac_ce_size = (uint8_t*) Buffer_size_ptr - (uint8_t*) mac_ce;
LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : long_bsr size %d Lcgbit 0x%02x Buffer_size %d %d %d %d %d %d %d %d\n", mac_ce_size, *((uint8_t*) mac_ce), LOG_D(NR_MAC, "[UE] Generating ULSCH PDU : long_bsr size %d Lcgbit 0x%02x Buffer_size %d %d %d %d %d %d %d %d\n", mac_ce_size, *((uint8_t*) mac_ce),
((NR_BSR_LONG *) mac_ce)->Buffer_size0, ((NR_BSR_LONG *) mac_ce)->Buffer_size1, ((NR_BSR_LONG *) mac_ce)->Buffer_size2, ((NR_BSR_LONG *) mac_ce)->Buffer_size3, ((NR_BSR_LONG *) mac_ce)->Buffer_size0, ((NR_BSR_LONG *) mac_ce)->Buffer_size1, ((NR_BSR_LONG *) mac_ce)->Buffer_size2, ((NR_BSR_LONG *) mac_ce)->Buffer_size3,
((NR_BSR_LONG *) mac_ce)->Buffer_size4, ((NR_BSR_LONG *) mac_ce)->Buffer_size5, ((NR_BSR_LONG *) mac_ce)->Buffer_size6, ((NR_BSR_LONG *) mac_ce)->Buffer_size7); ((NR_BSR_LONG *) mac_ce)->Buffer_size4, ((NR_BSR_LONG *) mac_ce)->Buffer_size5, ((NR_BSR_LONG *) mac_ce)->Buffer_size6, ((NR_BSR_LONG *) mac_ce)->Buffer_size7);
// update pointer and length // update pointer and length
mac_ce = Buffer_size_ptr; mac_ce = Buffer_size_ptr;
mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_SHORT); mac_ce_len += mac_ce_size + sizeof(NR_MAC_SUBHEADER_SHORT);
......
...@@ -1002,7 +1002,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -1002,7 +1002,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
} }
if (dl_info) { if (dl_info) {
return (CONNECTION_OK); return (CONNECTION_OK);
} }
module_id_t mod_id = ul_info->module_id; module_id_t mod_id = ul_info->module_id;
frame_t txFrameP = ul_info->frame_tx; frame_t txFrameP = ul_info->frame_tx;
...@@ -1016,16 +1016,12 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -1016,16 +1016,12 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
// First check ReTxBSR Timer because it is always configured // First check ReTxBSR Timer because it is always configured
// Decrement ReTxBSR Timer if it is running and not null // Decrement ReTxBSR Timer if it is running and not null
if ((mac->scheduling_info.retxBSR_SF != if ((mac->scheduling_info.retxBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) && (mac->scheduling_info.retxBSR_SF != 0)) {
MAC_UE_BSR_TIMER_NOT_RUNNING)
&& (mac->scheduling_info.retxBSR_SF != 0)) {
mac->scheduling_info.retxBSR_SF--; mac->scheduling_info.retxBSR_SF--;
} }
// Decrement Periodic Timer if it is running and not null // Decrement Periodic Timer if it is running and not null
if ((mac->scheduling_info.periodicBSR_SF != if ((mac->scheduling_info.periodicBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) && (mac->scheduling_info.periodicBSR_SF != 0)) {
MAC_UE_BSR_TIMER_NOT_RUNNING)
&& (mac->scheduling_info.periodicBSR_SF != 0)) {
mac->scheduling_info.periodicBSR_SF--; mac->scheduling_info.periodicBSR_SF--;
} }
...@@ -1035,10 +1031,8 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -1035,10 +1031,8 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
// outlined in Sections 5.4.4 an 5.4.5 of 38.321 // outlined in Sections 5.4.4 an 5.4.5 of 38.321
mac->scheduling_info.SR_pending = 1; mac->scheduling_info.SR_pending = 1;
// Regular BSR trigger // Regular BSR trigger
mac->BSR_reporting_active |= mac->BSR_reporting_active |= NR_BSR_TRIGGER_REGULAR;
NR_BSR_TRIGGER_REGULAR; LOG_D(NR_MAC, "[UE %d][BSR] Regular BSR Triggered Frame %d slot %d SR for PUSCH is pending\n",
LOG_D(NR_MAC,
"[UE %d][BSR] Regular BSR Triggered Frame %d slot %d SR for PUSCH is pending\n",
mod_id, txFrameP, txSlotP); mod_id, txFrameP, txSlotP);
} }
return UE_CONNECTION_OK; return UE_CONNECTION_OK;
...@@ -1046,8 +1040,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -1046,8 +1040,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
} }
boolean_t boolean_t
nr_update_bsr(module_id_t module_idP, frame_t frameP, nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index) {
slot_t slotP, uint8_t gNB_index) {
mac_rlc_status_resp_t rlc_status; mac_rlc_status_resp_t rlc_status;
boolean_t bsr_regular_triggered = FALSE; boolean_t bsr_regular_triggered = FALSE;
uint8_t lcid; uint8_t lcid;
...@@ -1091,10 +1084,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, ...@@ -1091,10 +1084,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP,
lcgid_buffer_remain[lcgid] += mac->scheduling_info.LCID_buffer_remain[lcid]; lcgid_buffer_remain[lcgid] += mac->scheduling_info.LCID_buffer_remain[lcid];
} }
rlc_status = mac_rlc_status_ind(module_idP, mac->crnti,gNB_index,frameP,slotP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP, mac->crnti,gNB_index,frameP,slotP,ENB_FLAG_NO,MBMS_FLAG_NO, lcid, 0, 0);
lcid,
0, 0
);
lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer; lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer;
...@@ -1132,14 +1122,12 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, ...@@ -1132,14 +1122,12 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP,
// Check whether a regular BSR can be triggered according to the first cases in 38.321 // Check whether a regular BSR can be triggered according to the first cases in 38.321
if (num_lcid_with_data) { if (num_lcid_with_data) {
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE %d] PDCCH Tick at frame %d slot %d: NumLCID with data=%d Reordered LCID0=%d LCID1=%d LCID2=%d\n",
"[UE %d] PDCCH Tick at frame %d slot %d: NumLCID with data=%d Reordered LCID0=%d LCID1=%d LCID2=%d\n",
module_idP, frameP, slotP, num_lcid_with_data, module_idP, frameP, slotP, num_lcid_with_data,
lcid_reordered_array[0], lcid_reordered_array[1], lcid_reordered_array[0], lcid_reordered_array[1],
lcid_reordered_array[2]); lcid_reordered_array[2]);
for (array_index = 0; array_index < num_lcid_with_data; for (array_index = 0; array_index < num_lcid_with_data; array_index++) {
array_index++) {
lcid = lcid_reordered_array[array_index]; lcid = lcid_reordered_array[array_index];
/* UL data, for a logical channel which belongs to a LCG, becomes available for transmission in the RLC entity /* UL data, for a logical channel which belongs to a LCG, becomes available for transmission in the RLC entity
...@@ -1148,8 +1136,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, ...@@ -1148,8 +1136,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP,
*/ */
{ {
bsr_regular_triggered = TRUE; bsr_regular_triggered = TRUE;
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d slot %d\n",
"[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d slot %d\n",
module_idP, lcid, module_idP, lcid,
mac->scheduling_info.LCGID[lcid], mac->scheduling_info.LCGID[lcid],
frameP, slotP); frameP, slotP);
...@@ -1161,10 +1148,8 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, ...@@ -1161,10 +1148,8 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP,
if (mac->scheduling_info.retxBSR_SF == 0) { if (mac->scheduling_info.retxBSR_SF == 0) {
bsr_regular_triggered = TRUE; bsr_regular_triggered = TRUE;
if ((mac->BSR_reporting_active & if ((mac->BSR_reporting_active & NR_BSR_TRIGGER_REGULAR) == 0) {
NR_BSR_TRIGGER_REGULAR) == 0) { LOG_I(NR_MAC, "[UE %d] PDCCH Tick : MAC BSR Triggered ReTxBSR Timer expiry at frame %d slot %d\n",
LOG_I(NR_MAC,
"[UE %d] PDCCH Tick : MAC BSR Triggered ReTxBSR Timer expiry at frame %d slot %d\n",
module_idP, frameP, slotP); module_idP, frameP, slotP);
} }
} }
...@@ -1172,8 +1157,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP, ...@@ -1172,8 +1157,7 @@ nr_update_bsr(module_id_t module_idP, frame_t frameP,
//Store Buffer Occupancy in remain buffers for next TTI //Store Buffer Occupancy in remain buffers for next TTI
for (lcid = DCCH; lcid < NR_MAX_NUM_LCID; lcid++) { for (lcid = DCCH; lcid < NR_MAX_NUM_LCID; lcid++) {
mac->scheduling_info.LCID_buffer_remain[lcid] = mac->scheduling_info.LCID_buffer_remain[lcid] = lcid_bytes_in_buffer[lcid];
lcid_bytes_in_buffer[lcid];
} }
return bsr_regular_triggered; return bsr_regular_triggered;
...@@ -1203,8 +1187,7 @@ nr_locate_BsrIndexByBufferSize(const uint32_t *table, int size, int value) { ...@@ -1203,8 +1187,7 @@ nr_locate_BsrIndexByBufferSize(const uint32_t *table, int size, int value) {
ju = jm; //replace the upper limit ju = jm; //replace the upper limit
} }
LOG_T(NR_MAC, LOG_T(NR_MAC, "[UE] searching BSR index %d for (BSR TABLE %d < value %d)\n",
"[UE] searching BSR index %d for (BSR TABLE %d < value %d)\n",
jm, table[jm], value); jm, table[jm], value);
} }
...@@ -2404,7 +2387,6 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2404,7 +2387,6 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
NR_BSR_SHORT *bsr_t = &bsr_truncated; NR_BSR_SHORT *bsr_t = &bsr_truncated;
//NR_POWER_HEADROOM_CMD phr; //NR_POWER_HEADROOM_CMD phr;
//NR_POWER_HEADROOM_CMD *phr_p = &phr; //NR_POWER_HEADROOM_CMD *phr_p = &phr;
//unsigned short short_padding = 0, post_padding = 0, padding_len = 0;
unsigned short padding_len = 0; unsigned short padding_len = 0;
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
// Compute header length // Compute header length
...@@ -2430,30 +2412,23 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2430,30 +2412,23 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
} }
//Restart ReTxBSR Timer at new grant indication (38.321) //Restart ReTxBSR Timer at new grant indication (38.321)
if (mac->scheduling_info.retxBSR_SF != if (mac->scheduling_info.retxBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) {
MAC_UE_BSR_TIMER_NOT_RUNNING) { mac->scheduling_info.retxBSR_SF = nr_get_sf_retxBSRTimer(mac->scheduling_info.retxBSR_Timer);
mac->scheduling_info.retxBSR_SF =
nr_get_sf_retxBSRTimer(mac->
scheduling_info.retxBSR_Timer);
} }
// periodicBSR-Timer expires, trigger BSR // periodicBSR-Timer expires, trigger BSR
if ((mac->scheduling_info.periodicBSR_Timer != if ((mac->scheduling_info.periodicBSR_Timer != NR_BSR_Config__periodicBSR_Timer_infinity)
NR_BSR_Config__periodicBSR_Timer_infinity)
&& (mac->scheduling_info.periodicBSR_SF == 0)) { && (mac->scheduling_info.periodicBSR_SF == 0)) {
// Trigger BSR Periodic // Trigger BSR Periodic
mac->BSR_reporting_active |= mac->BSR_reporting_active |= NR_BSR_TRIGGER_PERIODIC;
NR_BSR_TRIGGER_PERIODIC; LOG_D(NR_MAC, "[UE %d] MAC BSR Triggered PeriodicBSR Timer expiry at frame%d subframe %d TBS=%d\n",
LOG_D(NR_MAC,
"[UE %d] MAC BSR Triggered PeriodicBSR Timer expiry at frame%d subframe %d TBS=%d\n",
module_idP, frameP, subframe, buflen); module_idP, frameP, subframe, buflen);
} }
//Compute BSR Length if Regular or Periodic BSR is triggered //Compute BSR Length if Regular or Periodic BSR is triggered
//WARNING: if BSR long is computed, it may be changed to BSR short during or after multiplexing if there remains less than 1 LCGROUP with data after Tx //WARNING: if BSR long is computed, it may be changed to BSR short during or after multiplexing if there remains less than 1 LCGROUP with data after Tx
if (mac->BSR_reporting_active) { if (mac->BSR_reporting_active) {
AssertFatal((mac->BSR_reporting_active & AssertFatal((mac->BSR_reporting_active & NR_BSR_TRIGGER_PADDING) == 0,
NR_BSR_TRIGGER_PADDING) == 0,
"Inconsistent BSR Trigger=%d !\n", "Inconsistent BSR Trigger=%d !\n",
mac->BSR_reporting_active); mac->BSR_reporting_active);
...@@ -2479,8 +2454,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2479,8 +2454,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
// Check for DCCH first // Check for DCCH first
// TO DO: Multiplex in the order defined by the logical channel prioritization // TO DO: Multiplex in the order defined by the logical channel prioritization
for (lcid = UL_SCH_LCID_SRB1; for (lcid = UL_SCH_LCID_SRB1; lcid < MAX_LCID; lcid++) {
lcid < MAX_LCID; lcid++) {
buflen_remain = buflen - (total_mac_pdu_header_len + sdu_length_total + sh_size); buflen_remain = buflen - (total_mac_pdu_header_len + sdu_length_total + sh_size);
...@@ -2558,19 +2532,14 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2558,19 +2532,14 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
//Update Buffer remain and BSR bytes after transmission //Update Buffer remain and BSR bytes after transmission
mac->scheduling_info.LCID_buffer_remain[lcid] -= sdu_length; mac->scheduling_info.LCID_buffer_remain[lcid] -= sdu_length;
mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] -= sdu_length; mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] -= sdu_length;
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE %d] Update BSR [%d.%d] num_lcg_id_with_data %d. BSR_bytes for LCG%d=%d\n",
"[UE %d] Update BSR [%d.%d] num_lcg_id_with_data %d. BSR_bytes for LCG%d=%d\n",
module_idP, frameP, subframe, num_lcg_id_with_data, mac->scheduling_info.LCGID[lcid], module_idP, frameP, subframe, num_lcg_id_with_data, mac->scheduling_info.LCGID[lcid],
mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]]); mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]]);
if (mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] < 0) if (mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] < 0)
mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] = 0; mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] = 0;
//Update the number of LCGID with data as BSR shall reflect status after BSR transmission //Update the number of LCGID with data as BSR shall reflect status after BSR transmission
if ((num_lcg_id_with_data > 1) if ((num_lcg_id_with_data > 1) && (mac-> scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] == 0)) {
&& (mac->
scheduling_info.BSR_bytes[mac->
scheduling_info.LCGID[lcid]]
== 0)) {
num_lcg_id_with_data--; num_lcg_id_with_data--;
} }
} }
...@@ -2582,15 +2551,10 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2582,15 +2551,10 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
for (lcg_id = 0; lcg_id < NR_MAX_NUM_LCGID; lcg_id++) { for (lcg_id = 0; lcg_id < NR_MAX_NUM_LCGID; lcg_id++) {
if (bsr_ce_len == sizeof(NR_BSR_SHORT)) { if (bsr_ce_len == sizeof(NR_BSR_SHORT)) {
mac->scheduling_info.BSR[lcg_id] = mac->scheduling_info.BSR[lcg_id] = nr_locate_BsrIndexByBufferSize(NR_SHORT_BSR_TABLE, NR_SHORT_BSR_TABLE_SIZE, mac->scheduling_info.BSR_bytes[lcg_id]);
nr_locate_BsrIndexByBufferSize(NR_SHORT_BSR_TABLE, NR_SHORT_BSR_TABLE_SIZE,
mac->scheduling_info.
BSR_bytes[lcg_id]);
} else { } else {
mac->scheduling_info.BSR[lcg_id] = mac->scheduling_info.BSR[lcg_id] =
nr_locate_BsrIndexByBufferSize(NR_LONG_BSR_TABLE, NR_LONG_BSR_TABLE_SIZE, nr_locate_BsrIndexByBufferSize(NR_LONG_BSR_TABLE, NR_LONG_BSR_TABLE_SIZE, mac->scheduling_info.BSR_bytes[lcg_id]);
mac->scheduling_info.
BSR_bytes[lcg_id]);
} }
if (mac->scheduling_info.BSR_bytes[lcg_id]) { if (mac->scheduling_info.BSR_bytes[lcg_id]) {
num_lcg_id_with_data++; num_lcg_id_with_data++;
...@@ -2608,8 +2572,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2608,8 +2572,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
- else if the number of padding bits is equal to or larger than the size of the Long BSR plus its subheader, report Long BSR. - else if the number of padding bits is equal to or larger than the size of the Long BSR plus its subheader, report Long BSR.
*/ */
if (sdu_length_total) { if (sdu_length_total) {
padding_len = padding_len = buflen - (total_mac_pdu_header_len + sdu_length_total);
buflen - (total_mac_pdu_header_len + sdu_length_total);
} }
if ((padding_len) && (bsr_len == 0)) { if ((padding_len) && (bsr_len == 0)) {
...@@ -2618,37 +2581,18 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2618,37 +2581,18 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
bsr_ce_len = num_lcg_id_with_data + 1; //variable size bsr_ce_len = num_lcg_id_with_data + 1; //variable size
bsr_header_len = sizeof(NR_MAC_SUBHEADER_SHORT); //2 bytes bsr_header_len = sizeof(NR_MAC_SUBHEADER_SHORT); //2 bytes
// Trigger BSR Padding // Trigger BSR Padding
mac->BSR_reporting_active |= mac->BSR_reporting_active |= NR_BSR_TRIGGER_PADDING;
NR_BSR_TRIGGER_PADDING;
} else if (padding_len >= (sizeof(NR_BSR_SHORT)+sizeof(NR_MAC_SUBHEADER_FIXED))) { } else if (padding_len >= (sizeof(NR_BSR_SHORT)+sizeof(NR_MAC_SUBHEADER_FIXED))) {
bsr_ce_len = sizeof(NR_BSR_SHORT); //1 byte bsr_ce_len = sizeof(NR_BSR_SHORT); //1 byte
bsr_header_len = sizeof(NR_MAC_SUBHEADER_FIXED); //1 byte bsr_header_len = sizeof(NR_MAC_SUBHEADER_FIXED); //1 byte
if (num_lcg_id_with_data > 1) { if (num_lcg_id_with_data > 1) {
// REPORT SHORT TRUNCATED BSR // REPORT SHORT TRUNCATED BSR
//Get LCGID of highest priority LCID with data //Get LCGID of highest priority LCID with data (todo)
for (lcid = DCCH; lcid < NR_MAX_NUM_LCID; lcid++) { for (lcid = DCCH; lcid < NR_MAX_NUM_LCID; lcid++) {
// if (mac-> lcg_id = mac->scheduling_info.LCGID[lcid];
// logicalChannelConfig[lcid] != NULL) { if ((lcg_id < NR_MAX_NUM_LCGID) && (mac->scheduling_info.BSR_bytes[lcg_id])) {
if (1) { // todo lcg_id_bsr_trunc = lcg_id;
lcg_id =
mac->scheduling_info.
LCGID[lcid];
if ((lcg_id < NR_MAX_NUM_LCGID)
&& (mac->
scheduling_info.BSR_bytes[lcg_id])
&&
// (mac->logicalChannelConfig
// [lcid]->ul_SpecificParameters->priority <=
// highest_priority)) {
(1)) { //todo
// highest_priority =
// mac->
// logicalChannelConfig[lcid]->
// ul_SpecificParameters->priority;
lcg_id_bsr_trunc = lcg_id;
}
} }
} }
} else { } else {
...@@ -2657,8 +2601,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2657,8 +2601,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
} }
// Trigger BSR Padding // Trigger BSR Padding
mac->BSR_reporting_active |= mac->BSR_reporting_active |= NR_BSR_TRIGGER_PADDING;
NR_BSR_TRIGGER_PADDING;
} }
bsr_len = bsr_header_len + bsr_ce_len; bsr_len = bsr_header_len + bsr_ce_len;
...@@ -2690,8 +2633,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2690,8 +2633,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
mac->scheduling_info.BSR[6]; mac->scheduling_info.BSR[6];
bsr_l->Buffer_size7 = bsr_l->Buffer_size7 =
mac->scheduling_info.BSR[7]; mac->scheduling_info.BSR[7];
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE %d] Frame %d subframe %d BSR Trig=%d report LONG BSR (level LCGID0 %d,level LCGID1 %d,level LCGID2 %d,level LCGID3 %d level LCGID4 %d,level LCGID5 %d,level LCGID6 %d,level LCGID7 %d)\n",
"[UE %d] Frame %d subframe %d BSR Trig=%d report LONG BSR (level LCGID0 %d,level LCGID1 %d,level LCGID2 %d,level LCGID3 %d level LCGID4 %d,level LCGID5 %d,level LCGID6 %d,level LCGID7 %d)\n",
module_idP, frameP, subframe, module_idP, frameP, subframe,
mac->BSR_reporting_active, mac->BSR_reporting_active,
mac->scheduling_info.BSR[0], mac->scheduling_info.BSR[0],
...@@ -2705,33 +2647,23 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2705,33 +2647,23 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
} else if (bsr_header_len == sizeof(NR_MAC_SUBHEADER_FIXED)) { } else if (bsr_header_len == sizeof(NR_MAC_SUBHEADER_FIXED)) {
bsr_l = NULL; bsr_l = NULL;
if ((bsr_t != NULL) if ((bsr_t != NULL) && (mac->BSR_reporting_active & NR_BSR_TRIGGER_PADDING)) {
&& (mac->BSR_reporting_active &
NR_BSR_TRIGGER_PADDING)) {
//Truncated BSR //Truncated BSR
bsr_s = NULL; bsr_s = NULL;
bsr_t->LcgID = lcg_id_bsr_trunc; bsr_t->LcgID = lcg_id_bsr_trunc;
bsr_t->Buffer_size = bsr_t->Buffer_size = mac->scheduling_info.BSR[lcg_id_bsr_trunc];
mac->scheduling_info. LOG_D(NR_MAC, "[UE %d] Frame %d subframe %d BSR Trig=%d report TRUNCATED BSR with level %d for LCGID %d\n",
BSR[lcg_id_bsr_trunc];
LOG_D(NR_MAC,
"[UE %d] Frame %d subframe %d BSR Trig=%d report TRUNCATED BSR with level %d for LCGID %d\n",
module_idP, frameP, subframe, module_idP, frameP, subframe,
mac->BSR_reporting_active, mac->BSR_reporting_active,
mac-> mac->scheduling_info.BSR[lcg_id_bsr_trunc], lcg_id_bsr_trunc);
scheduling_info.BSR[lcg_id_bsr_trunc], lcg_id_bsr_trunc);
} else { } else {
bsr_t = NULL; bsr_t = NULL;
bsr_s->LcgID = lcg_id_bsr_trunc; bsr_s->LcgID = lcg_id_bsr_trunc;
bsr_s->Buffer_size = bsr_s->Buffer_size = mac->scheduling_info.BSR[lcg_id_bsr_trunc];
mac->scheduling_info. LOG_D(NR_MAC, "[UE %d] Frame %d subframe %d BSR Trig=%d report SHORT BSR with level %d for LCGID %d\n",
BSR[lcg_id_bsr_trunc];
LOG_D(NR_MAC,
"[UE %d] Frame %d subframe %d BSR Trig=%d report SHORT BSR with level %d for LCGID %d\n",
module_idP, frameP, subframe, module_idP, frameP, subframe,
mac->BSR_reporting_active, mac->BSR_reporting_active,
mac-> mac->scheduling_info.BSR[lcg_id_bsr_trunc], lcg_id_bsr_trunc);
scheduling_info.BSR[lcg_id_bsr_trunc], lcg_id_bsr_trunc);
} }
} }
...@@ -2753,7 +2685,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2753,7 +2685,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
// Compute final offset for padding and fill remainder of ULSCH with 0 // Compute final offset for padding and fill remainder of ULSCH with 0
if (buflen_remain > 0) { if (buflen_remain > 0) {
LOG_D(NR_MAC, "In %s filling remainder %d bytes to the UL PDU \n", __FUNCTION__, buflen_remain); LOG_D(NR_MAC, "In %s filling remainder %d bytes to the UL PDU \n", __FUNCTION__, buflen_remain);
((NR_MAC_SUBHEADER_FIXED *) pdu)->R = 0; ((NR_MAC_SUBHEADER_FIXED *) pdu)->R = 0;
((NR_MAC_SUBHEADER_FIXED *) pdu)->LCID = UL_SCH_LCID_PADDING; ((NR_MAC_SUBHEADER_FIXED *) pdu)->LCID = UL_SCH_LCID_PADDING;
...@@ -2785,31 +2717,21 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2785,31 +2717,21 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
log_dump(NR_MAC, ulsch_buffer, buflen, LOG_DUMP_CHAR, "\n"); log_dump(NR_MAC, ulsch_buffer, buflen, LOG_DUMP_CHAR, "\n");
#endif #endif
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n", module_idP);
"[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n",
module_idP);
mac->scheduling_info.SR_pending = 0; mac->scheduling_info.SR_pending = 0;
mac->scheduling_info.SR_COUNTER = 0; mac->scheduling_info.SR_COUNTER = 0;
/* Actions when a BSR is sent */ /* Actions when a BSR is sent */
if (bsr_ce_len) { if (bsr_ce_len) {
LOG_D(NR_MAC, LOG_D(NR_MAC, "[UE %d] MAC BSR Sent !! bsr (ce%d,hdr%d) buff_len %d\n",
"[UE %d] MAC BSR Sent !! bsr (ce%d,hdr%d) buff_len %d\n",
module_idP, bsr_ce_len, bsr_header_len, buflen); module_idP, bsr_ce_len, bsr_header_len, buflen);
// Reset ReTx BSR Timer // Reset ReTx BSR Timer
mac->scheduling_info.retxBSR_SF = mac->scheduling_info.retxBSR_SF = nr_get_sf_retxBSRTimer(mac->scheduling_info.retxBSR_Timer);
nr_get_sf_retxBSRTimer(mac-> LOG_D(NR_MAC, "[UE %d] MAC ReTx BSR Timer Reset =%d\n", module_idP, mac->scheduling_info.retxBSR_SF);
scheduling_info.retxBSR_Timer);
LOG_D(NR_MAC, "[UE %d] MAC ReTx BSR Timer Reset =%d\n", module_idP,
mac->scheduling_info.retxBSR_SF);
// Reset Periodic Timer except when BSR is truncated // Reset Periodic Timer except when BSR is truncated
if ((bsr_t == NULL) if ((bsr_t == NULL) && (mac->scheduling_info.periodicBSR_Timer != NR_BSR_Config__periodicBSR_Timer_infinity)) {
&& (mac->scheduling_info. mac->scheduling_info.periodicBSR_SF = nr_get_sf_periodicBSRTimer(mac->scheduling_info.periodicBSR_Timer);
periodicBSR_Timer != NR_BSR_Config__periodicBSR_Timer_infinity)) {
mac->scheduling_info.periodicBSR_SF =
nr_get_sf_periodicBSRTimer(mac->scheduling_info.
periodicBSR_Timer);
LOG_D(NR_MAC, "[UE %d] MAC Periodic BSR Timer Reset =%d\n", LOG_D(NR_MAC, "[UE %d] MAC Periodic BSR Timer Reset =%d\n",
module_idP, module_idP,
mac->scheduling_info.periodicBSR_SF); mac->scheduling_info.periodicBSR_SF);
......
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