Commit b0b8c90f authored by Sriharsha Korada's avatar Sriharsha Korada

clean up

parent f248b2fd
...@@ -539,10 +539,10 @@ void configure_ss_coreset(NR_UE_MAC_INST_t *mac, ...@@ -539,10 +539,10 @@ void configure_ss_coreset(NR_UE_MAC_INST_t *mac,
mac->BWP_coresets[i] = NULL; mac->BWP_coresets[i] = NULL;
} }
static int lcid_cmp(const void *lcid1, const void *lcid2, void *mac_inst) static int lcid_cmp(const void *lc1, const void *lc2, void *mac_inst)
{ {
uint8_t id1 = *(uint8_t *)lcid1; uint8_t id1 = ((nr_lcordered_info_t *)lc1)->lcids_ordered;
uint8_t id2 = *(uint8_t *)lcid2; uint8_t id2 = ((nr_lcordered_info_t *)lc2)->lcids_ordered;
NR_UE_MAC_INST_t *mac = (NR_UE_MAC_INST_t *)mac_inst; NR_UE_MAC_INST_t *mac = (NR_UE_MAC_INST_t *)mac_inst;
NR_LogicalChannelConfig_t **lc_config = &mac->logicalChannelConfig[0]; NR_LogicalChannelConfig_t **lc_config = &mac->logicalChannelConfig[0];
...@@ -564,6 +564,32 @@ void nr_release_mac_config_logicalChannelBearer(module_id_t module_id, long chan ...@@ -564,6 +564,32 @@ void nr_release_mac_config_logicalChannelBearer(module_id_t module_id, long chan
} }
} }
static uint16_t nr_get_ms_bucketsizeduration(uint8_t bucketsizeduration)
{
switch (bucketsizeduration) {
case NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50:
return 50;
case NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms100:
return 100;
case NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms150:
return 150;
case NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms300:
return 300;
case NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms500:
return 500;
case NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms1000:
return 1000;
default:
return 0;
}
}
void nr_configure_mac_config_logicalChannelBearer(module_id_t module_id, void nr_configure_mac_config_logicalChannelBearer(module_id_t module_id,
long channel_identity, long channel_identity,
NR_LogicalChannelConfig_t *lc_config) NR_LogicalChannelConfig_t *lc_config)
...@@ -610,7 +636,7 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id, ...@@ -610,7 +636,7 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
for (int i = 0; i < rlc_toadd_list->list.count; i++) { for (int i = 0; i < rlc_toadd_list->list.count; i++) {
NR_RLC_BearerConfig_t *rlc_bearer = rlc_toadd_list->list.array[i]; NR_RLC_BearerConfig_t *rlc_bearer = rlc_toadd_list->list.array[i];
int lc_identity = rlc_bearer->logicalChannelIdentity; int lc_identity = rlc_bearer->logicalChannelIdentity;
mac->lc_ordered_info.lcids_ordered[i] = lc_identity; mac->lc_ordered_info[i].lcids_ordered = lc_identity;
NR_LogicalChannelConfig_t *mac_lc_config; NR_LogicalChannelConfig_t *mac_lc_config;
if (mac->logicalChannelConfig[lc_identity - 1] == NULL) { if (mac->logicalChannelConfig[lc_identity - 1] == NULL) {
/* setup of new LCID*/ /* setup of new LCID*/
...@@ -645,14 +671,12 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id, ...@@ -645,14 +671,12 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
continue; continue;
} }
} }
mac->lc_ordered_info[i].logicalChannelConfig_ordered = mac_lc_config;
nr_configure_mac_config_logicalChannelBearer(module_id, lc_identity, mac_lc_config); nr_configure_mac_config_logicalChannelBearer(module_id, lc_identity, mac_lc_config);
} }
// reorder the logical channels as per its priority // reorder the logical channels as per its priority
qsort_r(mac->lc_ordered_info.lcids_ordered, rlc_toadd_list->list.count, sizeof(uint32_t), lcid_cmp, mac); qsort_r(mac->lc_ordered_info, rlc_toadd_list->list.count, sizeof(nr_lcordered_info_t), lcid_cmp, mac);
for (uint8_t i = 0; i < rlc_toadd_list->list.count; i++) {
mac->lc_ordered_info.logicalChannelConfig_ordered[i] = mac->logicalChannelConfig[mac->lc_ordered_info.lcids_ordered[i] - 1];
}
} }
} }
......
...@@ -435,10 +435,10 @@ typedef struct ssb_list_info { ...@@ -435,10 +435,10 @@ typedef struct ssb_list_info {
typedef struct nr_lcordered_info_s { typedef struct nr_lcordered_info_s {
// logical channels ids ordered as per priority // logical channels ids ordered as per priority
int lcids_ordered[NR_MAX_NUM_LCID]; int lcids_ordered;
// logical channel configurations reordered as per priority // logical channel configurations reordered as per priority
NR_LogicalChannelConfig_t *logicalChannelConfig_ordered[NR_MAX_NUM_LCID]; NR_LogicalChannelConfig_t *logicalChannelConfig_ordered;
} nr_lcordered_info_t; } nr_lcordered_info_t;
/*!\brief Top level UE MAC structure */ /*!\brief Top level UE MAC structure */
...@@ -529,7 +529,7 @@ typedef struct { ...@@ -529,7 +529,7 @@ typedef struct {
NR_LogicalChannelConfig_t *logicalChannelConfig[NR_MAX_NUM_LCID]; NR_LogicalChannelConfig_t *logicalChannelConfig[NR_MAX_NUM_LCID];
// order lc info // order lc info
nr_lcordered_info_t lc_ordered_info; nr_lcordered_info_t lc_ordered_info[NR_MAX_NUM_LCID];
NR_UE_SCHEDULING_INFO scheduling_info; NR_UE_SCHEDULING_INFO scheduling_info;
/// PHR /// PHR
......
...@@ -155,13 +155,6 @@ uint8_t nr_locate_BsrIndexByBufferSize(const uint32_t *table, int size, ...@@ -155,13 +155,6 @@ uint8_t nr_locate_BsrIndexByBufferSize(const uint32_t *table, int size,
*/ */
uint32_t nr_get_pbr(uint8_t prioritizedbitrate); uint32_t nr_get_pbr(uint8_t prioritizedbitrate);
/*! \fn int nr_get_ms_bucketsizeduration(uint8_t bucketSizeduration)
\brief get the time in ms from the bucket size duration configured by the higher layer
\param[in] bucketSize the bucket size duration
\return the time in ms
*/
uint16_t nr_get_ms_bucketsizeduration(uint8_t bucketsizeduration);
/*! \fn int nr_get_sf_periodicBSRTimer(uint8_t periodicBSR_Timer) /*! \fn int nr_get_sf_periodicBSRTimer(uint8_t periodicBSR_Timer)
\brief get the number of subframe from the periodic BSR timer configured by the higher layers \brief get the number of subframe from the periodic BSR timer configured by the higher layers
\param[in] periodicBSR_Timer timer for periodic BSR \param[in] periodicBSR_Timer timer for periodic BSR
......
This diff is collapsed.
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