Commit f8464b9e authored by francescomani's avatar francescomani

MAC configuration of logical channel identities

parent 0982bf26
...@@ -511,16 +511,26 @@ void configure_ss_coreset(NR_UE_MAC_INST_t *mac, ...@@ -511,16 +511,26 @@ void configure_ss_coreset(NR_UE_MAC_INST_t *mac,
mac->BWP_coresets[i] = NULL; mac->BWP_coresets[i] = NULL;
} }
// todo handle mac_LogicalChannelConfig void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
int nr_rrc_mac_config_req_ue_logicalChannelBearer( struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_toadd_list,
module_id_t module_id, struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_list)
int cc_idP, {
uint8_t gNB_index, NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
long logicalChannelIdentity, if(rlc_toadd_list) {
bool status){ for (int i = 0; i < rlc_toadd_list->list.count; i++) {
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_RLC_BearerConfig_t *rlc_bearer = rlc_toadd_list->list.array[i];
mac->logicalChannelBearer_exist[logicalChannelIdentity] = status; int id = rlc_bearer->logicalChannelIdentity - 1;
return 0; mac->active_RLC_bearer[id] = true;
}
}
if (rlc_torelease_list) {
for (int i = 0; i < rlc_torelease_list->list.count; i++) {
if(rlc_torelease_list->list.array[i]) {
int id = *rlc_torelease_list->list.array[i] - 1;
mac->active_RLC_bearer[id] = false;
}
}
}
} }
......
...@@ -503,8 +503,8 @@ typedef struct { ...@@ -503,8 +503,8 @@ typedef struct {
uint8_t BSR_reporting_active; uint8_t BSR_reporting_active;
/// LogicalChannelConfig has bearer. /// LogicalChannelConfig has bearer.
bool logicalChannelBearer_exist[NR_MAX_NUM_LCID]; bool active_RLC_bearer[NR_MAX_NUM_LCID];
NR_UE_SCHEDULING_INFO scheduling_info; NR_UE_SCHEDULING_INFO scheduling_info;
/// PHR /// PHR
uint8_t PHR_reporting_active; uint8_t PHR_reporting_active;
......
...@@ -63,17 +63,9 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id, ...@@ -63,17 +63,9 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
uint8_t *pduP, uint8_t *pduP,
uint32_t pdu_len); uint32_t pdu_len);
/**\brief primitive from RRC layer to MAC layer to set if bearer exists for a logical channel. todo handle mac_LogicalChannelConfig void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
\param module_id module id struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_toadd_list,
\param cc_id component carrier id struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_list);
\param gNB_index gNB index
\param long logicalChannelIdentity
\param bool status*/
int nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
int cc_idP,
uint8_t gNB_index,
long logicalChannelIdentity,
bool status);
void nr_rrc_mac_config_req_scg(module_id_t module_id, void nr_rrc_mac_config_req_scg(module_id_t module_id,
int cc_idP, int cc_idP,
......
...@@ -78,7 +78,10 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) { ...@@ -78,7 +78,10 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
nr_pdcp_layer_init(); nr_pdcp_layer_init();
nr_pdcp_add_drbs(ENB_FLAG_NO, nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList, 0, NULL, NULL); nr_pdcp_add_drbs(ENB_FLAG_NO, nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList, 0, NULL, NULL);
nr_rlc_add_drb(nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig); nr_rlc_add_drb(nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig);
nr_ue_mac_inst->logicalChannelBearer_exist[4] = true; struct NR_CellGroupConfig__rlc_BearerToAddModList rlc_toadd_list;
rlc_toadd_list.list.count = 1;
rlc_toadd_list.list.array[0] = rlc_rbconfig;
nr_rrc_mac_config_req_ue_logicalChannelBearer(0, &rlc_toadd_list, NULL);
// free memory // free memory
free_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig); free_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig);
......
...@@ -1119,8 +1119,6 @@ void nr_ue_ul_scheduler(nr_uplink_indication_t *ul_info) ...@@ -1119,8 +1119,6 @@ void nr_ue_ul_scheduler(nr_uplink_indication_t *ul_info)
bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index) bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t gNB_index)
{ {
bool bsr_regular_triggered = false; bool bsr_regular_triggered = false;
uint8_t lcid;
uint8_t lcgid;
uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined
uint32_t lcgid_buffer_remain[NR_MAX_NUM_LCGID] = {0,0,0,0,0,0,0,0}; uint32_t lcgid_buffer_remain[NR_MAX_NUM_LCGID] = {0,0,0,0,0,0,0,0};
int32_t lcid_bytes_in_buffer[NR_MAX_NUM_LCID]; int32_t lcid_bytes_in_buffer[NR_MAX_NUM_LCID];
...@@ -1137,37 +1135,38 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t ...@@ -1137,37 +1135,38 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
// Reset All BSR Infos // Reset All BSR Infos
lcid_bytes_in_buffer[0] = 0; lcid_bytes_in_buffer[0] = 0;
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
for (lcid=DCCH; lcid < NR_MAX_NUM_LCID; lcid++) { // TO BE NOTED LCID = 0 is excluded from buffers
// so they need to be addressed with lcid - 1
for (int lcid = 1; lcid <= NR_MAX_NUM_LCID; lcid++) {
// Reset transmission status // Reset transmission status
lcid_bytes_in_buffer[lcid] = 0; lcid_bytes_in_buffer[lcid - 1] = 0;
mac->scheduling_info.LCID_status[lcid]=LCID_EMPTY; mac->scheduling_info.LCID_status[lcid - 1] = LCID_EMPTY;
} }
for (lcgid=0; lcgid < NR_MAX_NUM_LCGID; lcgid++) { for (int lcgid = 0; lcgid < NR_MAX_NUM_LCGID; lcgid++) {
// Reset Buffer Info // Reset Buffer Info
mac->scheduling_info.BSR[lcgid]=0; mac->scheduling_info.BSR[lcgid] = 0;
mac->scheduling_info.BSR_bytes[lcgid]=0; mac->scheduling_info.BSR_bytes[lcgid] = 0;
} }
//Get Buffer Occupancy and fill lcid_reordered_array //Get Buffer Occupancy and fill lcid_reordered_array
for (lcid=DCCH; lcid < NR_MAX_NUM_LCID; lcid++) { for (int lcid = 1; lcid <= NR_MAX_NUM_LCID; lcid++) {
//if (mac->logicalChannelConfig[lcid]) { if (mac->active_RLC_bearer[lcid - 1]) { // todo
if (mac->logicalChannelBearer_exist[lcid] ) { // todo int lcgid = mac->scheduling_info.LCGID[lcid - 1];
lcgid = mac->scheduling_info.LCGID[lcid];
// Store already available data to transmit per Group // Store already available data to transmit per Group
if (lcgid < NR_MAX_NUM_LCGID) { if (lcgid < NR_MAX_NUM_LCGID) {
lcgid_buffer_remain[lcgid] += mac->scheduling_info.LCID_buffer_remain[lcid]; lcgid_buffer_remain[lcgid] += mac->scheduling_info.LCID_buffer_remain[lcid - 1];
} }
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(module_idP, mac->crnti,gNB_index,frameP,slotP,ENB_FLAG_NO,MBMS_FLAG_NO, lcid, 0, 0); mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(module_idP, mac->crnti,gNB_index,frameP,slotP,ENB_FLAG_NO,MBMS_FLAG_NO, lcid, 0, 0);
lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer; lcid_bytes_in_buffer[lcid - 1] = rlc_status.bytes_in_buffer;
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
LOG_D(NR_MAC,"[UE %d] PDCCH Tick : LCID%d LCGID%d has data to transmit =%d bytes at frame %d slot %d\n", LOG_D(NR_MAC,"[UE %d] PDCCH Tick : LCID%d LCGID%d has data to transmit =%d bytes at frame %d slot %d\n",
module_idP, lcid,lcgid,rlc_status.bytes_in_buffer,frameP,slotP); module_idP, lcid,lcgid,rlc_status.bytes_in_buffer,frameP,slotP);
mac->scheduling_info.LCID_status[lcid] = LCID_NOT_EMPTY; mac->scheduling_info.LCID_status[lcid - 1] = LCID_NOT_EMPTY;
//Update BSR_bytes and position in lcid_reordered_array only if Group is defined //Update BSR_bytes and position in lcid_reordered_array only if Group is defined
if (lcgid < NR_MAX_NUM_LCGID) { if (lcgid < NR_MAX_NUM_LCGID) {
...@@ -1181,7 +1180,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t ...@@ -1181,7 +1180,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
//if (mac->logicalChannelConfig[lcid]->ul_SpecificParameters->priority <= highest_priority) { //if (mac->logicalChannelConfig[lcid]->ul_SpecificParameters->priority <= highest_priority) {
if (1) { // todo if (1) { // todo
//Insert if priority is higher or equal (lower or equal in value) //Insert if priority is higher or equal (lower or equal in value)
for (pos_next=num_lcid_with_data-1; pos_next > array_index; pos_next--) { for (pos_next = num_lcid_with_data - 1; pos_next > array_index; pos_next--) {
lcid_reordered_array[pos_next] = lcid_reordered_array[pos_next - 1]; lcid_reordered_array[pos_next] = lcid_reordered_array[pos_next - 1];
} }
...@@ -1190,7 +1189,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t ...@@ -1190,7 +1189,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
} }
array_index ++; array_index ++;
} while ((array_index < num_lcid_with_data) && (array_index < NR_MAX_NUM_LCID)); } while ((array_index < num_lcid_with_data) && (array_index <= NR_MAX_NUM_LCID));
} }
} }
} }
...@@ -1204,7 +1203,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t ...@@ -1204,7 +1203,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
lcid_reordered_array[2]); lcid_reordered_array[2]);
for (array_index = 0; array_index < num_lcid_with_data; array_index++) { for (array_index = 0; array_index < num_lcid_with_data; array_index++) {
lcid = lcid_reordered_array[array_index]; int 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
either the data belongs to a logical channel with higher priority than the priorities of the logical channels either the data belongs to a logical channel with higher priority than the priorities of the logical channels
...@@ -1214,7 +1213,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t ...@@ -1214,7 +1213,7 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
bsr_regular_triggered = true; bsr_regular_triggered = true;
LOG_D(NR_MAC, "[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d slot %d\n", LOG_D(NR_MAC, "[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 - 1],
frameP, slotP); frameP, slotP);
break; break;
} }
...@@ -1232,8 +1231,8 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t ...@@ -1232,8 +1231,8 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
} }
//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 (int lcid = 1; lcid <= NR_MAX_NUM_LCID; lcid++) {
mac->scheduling_info.LCID_buffer_remain[lcid] = lcid_bytes_in_buffer[lcid]; mac->scheduling_info.LCID_buffer_remain[lcid - 1] = lcid_bytes_in_buffer[lcid - 1];
} }
return bsr_regular_triggered; return bsr_regular_triggered;
...@@ -2694,21 +2693,21 @@ void nr_ue_get_sdu_mac_ce_post(module_id_t module_idP, ...@@ -2694,21 +2693,21 @@ void nr_ue_get_sdu_mac_ce_post(module_id_t module_idP,
uint8_t gNB_index, uint8_t gNB_index,
uint8_t *ulsch_buffer, uint8_t *ulsch_buffer,
uint16_t buflen, uint16_t buflen,
NR_UE_MAC_CE_INFO *mac_ce_p) { NR_UE_MAC_CE_INFO *mac_ce_p)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
// Compute BSR Values and update Nb LCGID with data after multiplexing // Compute BSR Values and update Nb LCGID with data after multiplexing
unsigned short padding_len = 0; unsigned short padding_len = 0;
uint8_t lcid = 0;
int lcg_id = 0; int lcg_id = 0;
int num_lcg_id_with_data = 0; int num_lcg_id_with_data = 0;
int lcg_id_bsr_trunc = 0; int lcg_id_bsr_trunc = 0;
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 (mac_ce_p->bsr_ce_len == sizeof(NR_BSR_SHORT)) { if (mac_ce_p->bsr_ce_len == sizeof(NR_BSR_SHORT)) {
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]); 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]);
} else { } else {
mac->scheduling_info.BSR[lcg_id] = nr_locate_BsrIndexByBufferSize(NR_LONG_BSR_TABLE, NR_LONG_BSR_TABLE_SIZE, mac->scheduling_info.BSR_bytes[lcg_id]); mac->scheduling_info.BSR[lcg_id] = nr_locate_BsrIndexByBufferSize(NR_LONG_BSR_TABLE, NR_LONG_BSR_TABLE_SIZE, 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++;
lcg_id_bsr_trunc = lcg_id; lcg_id_bsr_trunc = lcg_id;
...@@ -2742,8 +2741,8 @@ void nr_ue_get_sdu_mac_ce_post(module_id_t module_idP, ...@@ -2742,8 +2741,8 @@ void nr_ue_get_sdu_mac_ce_post(module_id_t module_idP,
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 (todo) //Get LCGID of highest priority LCID with data (todo)
for (lcid = DCCH; lcid < NR_MAX_NUM_LCID; lcid++) { for (int lcid = 1; lcid <= NR_MAX_NUM_LCID; lcid++) {
lcg_id = mac->scheduling_info.LCGID[lcid]; lcg_id = mac->scheduling_info.LCGID[lcid - 1];
if ((lcg_id < NR_MAX_NUM_LCGID) && (mac->scheduling_info.BSR_bytes[lcg_id])) { if ((lcg_id < NR_MAX_NUM_LCGID) && (mac->scheduling_info.BSR_bytes[lcg_id])) {
lcg_id_bsr_trunc = lcg_id; lcg_id_bsr_trunc = lcg_id;
} }
...@@ -2855,7 +2854,8 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2855,7 +2854,8 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
sub_frame_t subframe, sub_frame_t subframe,
uint8_t gNB_index, uint8_t gNB_index,
uint8_t *ulsch_buffer, uint8_t *ulsch_buffer,
uint16_t buflen) { uint16_t buflen)
{
NR_UE_MAC_CE_INFO mac_ce_info; NR_UE_MAC_CE_INFO mac_ce_info;
NR_UE_MAC_CE_INFO *mac_ce_p=&mac_ce_info; NR_UE_MAC_CE_INFO *mac_ce_p=&mac_ce_info;
int16_t buflen_remain = 0; int16_t buflen_remain = 0;
...@@ -2891,11 +2891,12 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2891,11 +2891,12 @@ 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 (int lcid = UL_SCH_LCID_SRB1; lcid < NR_MAX_NUM_LCID; lcid++) { for (int lcid = 1; lcid <= NR_MAX_NUM_LCID; lcid++) {
if (!mac->active_RLC_bearer[lcid - 1])
continue;
buflen_remain = buflen - (mac_ce_p->total_mac_pdu_header_len + mac_ce_p->sdu_length_total + sh_size); buflen_remain = buflen - (mac_ce_p->total_mac_pdu_header_len + mac_ce_p->sdu_length_total + sh_size);
LOG_D(NR_MAC, "In %s: [UE %d] [%d.%d] UL-DXCH -> ULSCH, RLC with LCID 0x%02x (TBS %d bytes, sdu_length_total %d bytes, MAC header len %d bytes, buflen_remain %d bytes)\n", LOG_D(NR_MAC, "[UE %d] [%d.%d] UL-DXCH -> ULSCH, RLC with LCID 0x%02x (TBS %d bytes, sdu_length_total %d bytes, MAC header len %d bytes, buflen_remain %d bytes)\n",
__FUNCTION__,
module_idP, module_idP,
frameP, frameP,
subframe, subframe,
...@@ -2905,7 +2906,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2905,7 +2906,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
mac_ce_p->tot_mac_ce_len, mac_ce_p->tot_mac_ce_len,
buflen_remain); buflen_remain);
while (buflen_remain > 0){ while (buflen_remain > 0) {
// Pointer used to build the MAC sub-PDU headers in the ULSCH buffer for each SDU // Pointer used to build the MAC sub-PDU headers in the ULSCH buffer for each SDU
NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) pdu; NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) pdu;
...@@ -2924,16 +2925,14 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2924,16 +2925,14 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
0, 0,
0); 0);
AssertFatal(buflen_remain >= sdu_length, "In %s: LCID = 0x%02x RLC has segmented %d bytes but MAC has max %d remaining bytes\n", AssertFatal(buflen_remain >= sdu_length, "LCID = 0x%02x RLC has segmented %d bytes but MAC has max %d remaining bytes\n",
__FUNCTION__,
lcid, lcid,
sdu_length, sdu_length,
buflen_remain); buflen_remain);
if (sdu_length > 0) { if (sdu_length > 0) {
LOG_D(NR_MAC, "In %s: [UE %d] [%d.%d] UL-DXCH -> ULSCH, Generating UL MAC sub-PDU for SDU %d, length %d bytes, RB with LCID 0x%02x (buflen (TBS) %d bytes)\n", LOG_D(NR_MAC, "[UE %d] [%d.%d] UL-DXCH -> ULSCH, Generating UL MAC sub-PDU for SDU %d, length %d bytes, RB with LCID 0x%02x (buflen (TBS) %d bytes)\n",
__FUNCTION__,
module_idP, module_idP,
frameP, frameP,
subframe, subframe,
...@@ -2962,20 +2961,20 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, ...@@ -2962,20 +2961,20 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
} else { } else {
pdu -= sh_size; pdu -= sh_size;
LOG_D(NR_MAC, "In %s: no data to transmit for RB with LCID 0x%02x\n", __FUNCTION__, lcid); LOG_D(NR_MAC, "no data to transmit for RB with LCID 0x%02x\n", lcid);
break; break;
} }
buflen_remain = buflen - (mac_ce_p->total_mac_pdu_header_len + mac_ce_p->sdu_length_total + sh_size); buflen_remain = buflen - (mac_ce_p->total_mac_pdu_header_len + mac_ce_p->sdu_length_total + sh_size);
//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 - 1] -= sdu_length;
mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] -= sdu_length; mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid- 1]] -= sdu_length;
LOG_D(NR_MAC, "[UE %d] Update BSR [%d.%d] BSR_bytes for LCG%d=%d\n", LOG_D(NR_MAC, "[UE %d] Update BSR [%d.%d] BSR_bytes for LCG%d=%d\n",
module_idP, frameP, subframe, mac->scheduling_info.LCGID[lcid], module_idP, frameP, subframe, mac->scheduling_info.LCGID[lcid - 1],
mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]]); mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid - 1]]);
if (mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] < 0) if (mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid - 1]] < 0)
mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid]] = 0; mac->scheduling_info.BSR_bytes[mac->scheduling_info.LCGID[lcid - 1]] = 0;
} }
} }
......
...@@ -163,7 +163,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR ...@@ -163,7 +163,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
return -1; return -1;
} }
nr_rrc_manage_rlc_bearers(cellGroupConfig, &NR_UE_rrc_inst[module_id], 0, NR_UE_rrc_inst[module_id].rnti); if(get_softmodem_params()->sa || get_softmodem_params()->nsa)
nr_rrc_manage_rlc_bearers(cellGroupConfig, &NR_UE_rrc_inst[module_id], 0, module_id, NR_UE_rrc_inst[module_id].rnti);
if(get_softmodem_params()->sa || get_softmodem_params()->nsa) { if(get_softmodem_params()->sa || get_softmodem_params()->nsa) {
if (LOG_DEBUGFLAG(DEBUG_ASN1)) { if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
...@@ -222,7 +223,8 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ ...@@ -222,7 +223,8 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){
} }
void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message,int msg_len) { void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message,int msg_len)
{
module_id_t module_id=0; // TODO module_id_t module_id=0; // TODO
switch (nsa_message_type) { switch (nsa_message_type) {
case nr_SecondaryCellGroupConfig_r15: case nr_SecondaryCellGroupConfig_r15:
...@@ -338,8 +340,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi ...@@ -338,8 +340,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi
fclose(fd); fclose(fd);
process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len); process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len);
} }
else if (get_softmodem_params()->nsa) else if (get_softmodem_params()->nsa) {
{
LOG_D(NR_RRC, "In NSA mode \n"); LOG_D(NR_RRC, "In NSA mode \n");
} }
...@@ -755,6 +756,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id, ...@@ -755,6 +756,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id,
void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig, void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
NR_UE_RRC_INST_t *rrc, NR_UE_RRC_INST_t *rrc,
int gNB_index, int gNB_index,
module_id_t module_id,
int rnti) int rnti)
{ {
if(cellGroupConfig->rlc_BearerToReleaseList != NULL) { if(cellGroupConfig->rlc_BearerToReleaseList != NULL) {
...@@ -790,6 +792,9 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig, ...@@ -790,6 +792,9 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
} }
} }
} }
nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id,
cellGroupConfig->rlc_BearerToAddModList,
cellGroupConfig->rlc_BearerToReleaseList);
} }
void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP, void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP,
...@@ -814,7 +819,7 @@ void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP, ...@@ -814,7 +819,7 @@ void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP,
rrc->cell_group_config = calloc(1,sizeof(NR_CellGroupConfig_t)); rrc->cell_group_config = calloc(1,sizeof(NR_CellGroupConfig_t));
} }
nr_rrc_manage_rlc_bearers(cellGroupConfig, rrc, gNB_index, ctxt_pP->rntiMaybeUEid); nr_rrc_manage_rlc_bearers(cellGroupConfig, rrc, gNB_index, ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
if(cellGroupConfig->mac_CellGroupConfig != NULL){ if(cellGroupConfig->mac_CellGroupConfig != NULL){
//TODO (configure the MAC entity of this cell group as specified in 5.3.5.5.5) //TODO (configure the MAC entity of this cell group as specified in 5.3.5.5.5)
......
...@@ -166,6 +166,7 @@ void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc, ...@@ -166,6 +166,7 @@ void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc,
void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig, void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
NR_UE_RRC_INST_t *rrc, NR_UE_RRC_INST_t *rrc,
int gNB_index, int gNB_index,
module_id_t module_id,
int rnti); int rnti);
int configure_NR_SL_Preconfig(int sync_source); int configure_NR_SL_Preconfig(int sync_source);
......
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