Commit 2965d79d authored by fnabet's avatar fnabet

Merge branch 'L2_Stabilization-22-BSR_fertilization' of...

Merge branch 'L2_Stabilization-22-BSR_fertilization' of https://gitlab.com/TCL_Communications/openairinterface5g into BSR_fixes_fabrice
rebase
parents 1568b5a1 f0f34c02
...@@ -69,6 +69,7 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index) ...@@ -69,6 +69,7 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
// cancel all pending SRs // cancel all pending SRs
UE_mac_inst[module_idP].scheduling_info.SR_pending=0; UE_mac_inst[module_idP].scheduling_info.SR_pending=0;
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER=0; UE_mac_inst[module_idP].scheduling_info.SR_COUNTER=0;
UE_mac_inst[module_idP].BSR_reporting_active=0;
// stop ongoing RACH procedure // stop ongoing RACH procedure
...@@ -225,13 +226,34 @@ rrc_mac_config_req( ...@@ -225,13 +226,34 @@ rrc_mac_config_req(
if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) { if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) {
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9; UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9;
} else { } else {
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = 0;
} }
if (mac_MainConfig->ext2 && mac_MainConfig->ext2->mac_MainConfig_v1020) {
if (mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10) {
UE_mac_inst[Mod_idP].scheduling_info.extendedBSR_Sizes_r10 = (uint16_t) *mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10;
} else {
UE_mac_inst[Mod_idP].scheduling_info.extendedBSR_Sizes_r10 = (uint16_t)0;
}
if (mac_MainConfig->ext2->mac_MainConfig_v1020->extendedPHR_r10) {
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (uint16_t) *mac_MainConfig->ext2->mac_MainConfig_v1020->extendedPHR_r10;
} else {
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (uint16_t)0;
}
} else {
UE_mac_inst[Mod_idP].scheduling_info.extendedBSR_Sizes_r10 = (uint16_t)0;
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_r10 = (uint16_t)0;
}
#endif #endif
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer); UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer); UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
UE_mac_inst[Mod_idP].BSR_reporting_active = 0;
LOG_D(MAC,"[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n",
Mod_idP,
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF,
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF);
UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config; UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config;
UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config; UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config;
...@@ -252,6 +274,7 @@ rrc_mac_config_req( ...@@ -252,6 +274,7 @@ rrc_mac_config_req(
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer); UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer);
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer); UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer);
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].scheduling_info.PathlossChange); UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].scheduling_info.PathlossChange);
UE_mac_inst[Mod_idP].PHR_reporting_active = 0;
LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n", LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n",
Mod_idP, Mod_idP,
(mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1, (mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1,
......
...@@ -133,6 +133,7 @@ ...@@ -133,6 +133,7 @@
/*!\brief maximum value for channel quality indicator */ /*!\brief maximum value for channel quality indicator */
#define MAX_CQI_VALUE 15 #define MAX_CQI_VALUE 15
#define MAC_UE_BSR_TIMER_NOT_RUNNING (0xFFFF)
#define LCID_EMPTY 0 #define LCID_EMPTY 0
#define LCID_NOT_EMPTY 1 #define LCID_NOT_EMPTY 1
...@@ -945,8 +946,12 @@ typedef enum { ...@@ -945,8 +946,12 @@ typedef enum {
typedef struct { typedef struct {
/// buffer status for each lcgid /// buffer status for each lcgid
uint8_t BSR[MAX_NUM_LCGID]; // should be more for mesh topology uint8_t BSR[MAX_NUM_LCGID]; // should be more for mesh topology
/// keep the number of bytes in rlc buffer for each lcid /// keep the number of bytes in rlc buffer for each lcgid
uint16_t BSR_bytes[MAX_NUM_LCGID]; uint16_t BSR_bytes[MAX_NUM_LCGID];
#if 0 //calvin for BSR test,current buffer greater then previous one, or buffer from 0 to !0
/// after multiplexing buffer remain for each lcid
uint16_t LCID_buffer_remain[MAX_NUM_LCID];
#endif
/// buffer status for each lcid /// buffer status for each lcid
uint8_t LCID_status[MAX_NUM_LCID]; uint8_t LCID_status[MAX_NUM_LCID];
/// SR pending as defined in 36.321 /// SR pending as defined in 36.321
...@@ -958,11 +963,11 @@ typedef struct { ...@@ -958,11 +963,11 @@ typedef struct {
/// retxBSR-Timer, default value is sf2560 /// retxBSR-Timer, default value is sf2560
uint16_t retxBSR_Timer; uint16_t retxBSR_Timer;
/// retxBSR_SF, number of subframe before triggering a regular BSR /// retxBSR_SF, number of subframe before triggering a regular BSR
int16_t retxBSR_SF; uint16_t retxBSR_SF;
/// periodicBSR-Timer, default to infinity /// periodicBSR-Timer, default to infinity
uint16_t periodicBSR_Timer; uint16_t periodicBSR_Timer;
/// periodicBSR_SF, number of subframe before triggering a periodic BSR /// periodicBSR_SF, number of subframe before triggering a periodic BSR
int16_t periodicBSR_SF; uint16_t periodicBSR_SF;
/// default value is 0: not configured /// default value is 0: not configured
uint16_t sr_ProhibitTimer; uint16_t sr_ProhibitTimer;
/// sr ProhibitTime running /// sr ProhibitTime running
...@@ -987,6 +992,12 @@ typedef struct { ...@@ -987,6 +992,12 @@ typedef struct {
int16_t prohibitPHR_SF; int16_t prohibitPHR_SF;
///DL Pathloss Change in db ///DL Pathloss Change in db
uint16_t PathlossChange_db; uint16_t PathlossChange_db;
/// default value is false
uint16_t extendedBSR_Sizes_r10;
/// default value is false
uint16_t extendedPHR_r10;
//Bj bucket usage per lcid //Bj bucket usage per lcid
int16_t Bj[MAX_NUM_LCID]; int16_t Bj[MAX_NUM_LCID];
// Bucket size per lcid // Bucket size per lcid
...@@ -1074,6 +1085,8 @@ typedef struct { ...@@ -1074,6 +1085,8 @@ typedef struct {
uint8_t PHR_reporting_active; uint8_t PHR_reporting_active;
/// power backoff due to power management (as allowed by P-MPRc) for this cell /// power backoff due to power management (as allowed by P-MPRc) for this cell
uint8_t power_backoff_db[NUMBER_OF_eNB_MAX]; uint8_t power_backoff_db[NUMBER_OF_eNB_MAX];
/// BSR report falg management
uint8_t BSR_reporting_active;
/// MBSFN_Subframe Configuration /// MBSFN_Subframe Configuration
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA? struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA?
/// number of subframe allocation pattern available for MBSFN sync area /// number of subframe allocation pattern available for MBSFN sync area
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
//extern uint32_t EBSR_Level[63]; //extern uint32_t EBSR_Level[63];
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
//extern uint32_t Extended_BSR_TABLE[63]; ----currently not used
extern UE_MAC_INST *UE_mac_inst; extern UE_MAC_INST *UE_mac_inst;
extern eNB_MAC_INST *eNB_mac_inst; extern eNB_MAC_INST *eNB_mac_inst;
......
...@@ -551,7 +551,7 @@ int get_bsr_lcgid (module_id_t module_idP); ...@@ -551,7 +551,7 @@ int get_bsr_lcgid (module_id_t module_idP);
\param[in] bufflen size of phy transport block \param[in] bufflen size of phy transport block
\param[out] bsr_len size of bsr control element \param[out] bsr_len size of bsr control element
*/ */
uint8_t get_bsr_len (module_id_t module_idP, uint16_t buflen); uint8_t get_bsr_len (module_id_t module_idP, uint8_t eNB_index,frame_t frameP,uint16_t buflen);
/*! \fn BSR_SHORT * get_bsr_short(module_id_t module_idP, uint8_t bsr_len) /*! \fn BSR_SHORT * get_bsr_short(module_id_t module_idP, uint8_t bsr_len)
\brief get short bsr level \brief get short bsr level
...@@ -577,14 +577,14 @@ BSR_LONG * get_bsr_long(module_id_t module_idP, uint8_t bsr_len); ...@@ -577,14 +577,14 @@ BSR_LONG * get_bsr_long(module_id_t module_idP, uint8_t bsr_len);
*/ */
boolean_t update_bsr(module_id_t module_idP, frame_t frameP, eNB_index_t eNB_index, uint8_t lcid, uint8_t lcgid); boolean_t update_bsr(module_id_t module_idP, frame_t frameP, eNB_index_t eNB_index, uint8_t lcid, uint8_t lcgid);
/*! \fn locate (int *table, int size, int value) /*! \fn locate_BsrIndexByBufferSize (int *table, int size, int value)
\brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table. \brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table.
\param[in] *table Pointer to BSR table \param[in] *table Pointer to BSR table
\param[in] size Size of the table \param[in] size Size of the table
\param[in] value Value of the buffer \param[in] value Value of the buffer
\return the index in the BSR_LEVEL table \return the index in the BSR_LEVEL table
*/ */
uint8_t locate (const uint32_t *table, int size, int value); uint8_t locate_BsrIndexByBufferSize (const uint32_t *table, int size, int value);
/*! \fn int get_sf_periodicBSRTimer(uint8_t periodicBSR_Timer) /*! \fn int get_sf_periodicBSRTimer(uint8_t periodicBSR_Timer)
......
...@@ -391,7 +391,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -391,7 +391,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
1); //post_padding 1); //post_padding
return(&UE_mac_inst[module_idP].RA_prach_resources); return(&UE_mac_inst[module_idP].RA_prach_resources);
} else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DCCH] > 0) { } else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]] > 0) {
// This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example) // This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example)
dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element
rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
......
This diff is collapsed.
...@@ -45,6 +45,15 @@ const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57 ...@@ -45,6 +45,15 @@ const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57
1326,1552,1817,2127,2490,2915,3413,3995,4677,5467,6411,7505,8787,10287,12043,14099, 1326,1552,1817,2127,2490,2915,3413,3995,4677,5467,6411,7505,8787,10287,12043,14099,
16507,19325,22624,26487,31009,36304,42502,49759,58255,68201,79846,93479,109439, 128125,150000, 300000 16507,19325,22624,26487,31009,36304,42502,49759,58255,68201,79846,93479,109439, 128125,150000, 300000
}; };
// extended bsr table--currently not used
const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = {0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,
181,223,274,337,414,509,625,769,945,1162,1429,
1757,2161,2657,3267,4017,4940,6074,7469,9185,
11294,13888,17077,20999,25822,31752,39045,48012,
59039,72598,89272,109774,134986,165989,204111,
250990,308634,379519,466683,573866,705666,867737,
1067031,1312097,1613447,1984009,2439678,3000000,
6000000};
//uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181}; //uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181};
......
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