Commit 319ae6fb authored by calvin wang's avatar calvin wang

fix bsr report inaccurate value

parent 3bd591bf
/* /*******************************************************************************
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more OpenAirInterface
* contributor license agreements. See the NOTICE file distributed with Copyright(c) 1999 - 2014 Eurecom
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under OpenAirInterface is free software: you can redistribute it and/or modify
* the OAI Public License, Version 1.0 (the "License"); you may not use this file it under the terms of the GNU General Public License as published by
* except in compliance with the License. the Free Software Foundation, either version 3 of the License, or
* You may obtain a copy of the License at (at your option) any later version.
*
* http://www.openairinterface.org/?page_id=698
* OpenAirInterface is distributed in the hope that it will be useful,
* Unless required by applicable law or agreed to in writing, software but WITHOUT ANY WARRANTY; without even the implied warranty of
* distributed under the License is distributed on an "AS IS" BASIS, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. GNU General Public License for more details.
* See the License for the specific language governing permissions and
* limitations under the License. You should have received a copy of the GNU General Public License
*------------------------------------------------------------------------------- along with OpenAirInterface.The full GNU General Public License is
* For more information about the OpenAirInterface (OAI) Software Alliance: included in this distribution in the file called "COPYING". If not,
* contact@openairinterface.org see <http://www.gnu.org/licenses/>.
*/
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file config.c /*! \file config.c
* \brief UE and eNB configuration performed by RRC or as a consequence of RRC procedures * \brief UE and eNB configuration performed by RRC or as a consequence of RRC procedures
* \author Navid Nikaein and Raymond Knopp * \author Navid Nikaein and Raymond Knopp
...@@ -73,6 +80,7 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index) ...@@ -73,6 +80,7 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
UE_mac_inst[module_idP].BSR_reporting_active[PADDING_BSR]=0; UE_mac_inst[module_idP].BSR_reporting_active[PADDING_BSR]=0;
UE_mac_inst[module_idP].BSR_reporting_active[PERIODIC_BSR]=0; UE_mac_inst[module_idP].BSR_reporting_active[PERIODIC_BSR]=0;
UE_mac_inst[module_idP].retxBSRTimer_expires_flag = 0; UE_mac_inst[module_idP].retxBSRTimer_expires_flag = 0;
UE_mac_inst[module_idP].periodBSRTimer_expires_flag = 0;
// stop ongoing RACH procedure // stop ongoing RACH procedure
// discard explicitly signaled ra_PreambleIndex and ra_RACH_MaskIndex, if any // discard explicitly signaled ra_PreambleIndex and ra_RACH_MaskIndex, if any
...@@ -247,12 +255,13 @@ rrc_mac_config_req( ...@@ -247,12 +255,13 @@ rrc_mac_config_req(
UE_mac_inst[Mod_idP].scheduling_info.extendedPHR_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 = 0xFFFF; UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = 0xFFFF; UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING;
UE_mac_inst[Mod_idP].BSR_reporting_active[REGULAR_BSR]=0; UE_mac_inst[Mod_idP].BSR_reporting_active[REGULAR_BSR]=0;
UE_mac_inst[Mod_idP].BSR_reporting_active[PADDING_BSR]=0; UE_mac_inst[Mod_idP].BSR_reporting_active[PADDING_BSR]=0;
UE_mac_inst[Mod_idP].BSR_reporting_active[PERIODIC_BSR]=0; UE_mac_inst[Mod_idP].BSR_reporting_active[PERIODIC_BSR]=0;
UE_mac_inst[Mod_idP].retxBSRTimer_expires_flag = 0; UE_mac_inst[Mod_idP].retxBSRTimer_expires_flag = 0;
UE_mac_inst[Mod_idP].periodBSRTimer_expires_flag = 0;
LOG_D(MAC,"[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n", LOG_D(MAC,"[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n",
Mod_idP, Mod_idP,
......
...@@ -133,6 +133,8 @@ ...@@ -133,6 +133,8 @@
/*!\brief maximum value for channel quality indicator */ /*!\brief maximum value for channel quality indicator */
#define MAX_CQI_VALUE 15 #define MAX_CQI_VALUE 15
//if value equal oxFFFF means counters are NOT active
#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
...@@ -226,7 +228,6 @@ typedef struct { ...@@ -226,7 +228,6 @@ typedef struct {
uint32_t Buffer_size2:6; uint32_t Buffer_size2:6;
uint32_t Buffer_size1:6; uint32_t Buffer_size1:6;
uint32_t Buffer_size0:6; uint32_t Buffer_size0:6;
uint32_t padding:8;
} __attribute__((__packed__))BSR_LONG; } __attribute__((__packed__))BSR_LONG;
#define BSR_LONG_SIZE (sizeof(BSR_LONG)) #define BSR_LONG_SIZE (sizeof(BSR_LONG))
...@@ -345,6 +346,7 @@ typedef enum { ...@@ -345,6 +346,7 @@ typedef enum {
PERIODIC_BSR PERIODIC_BSR
} UE_FIRST_LEVEL_BSR_TYPE; } UE_FIRST_LEVEL_BSR_TYPE;
/*! \brief Downlink SCH PDU Structure */ /*! \brief Downlink SCH PDU Structure */
typedef struct { typedef struct {
int8_t payload[8][SCH_PAYLOAD_SIZE_MAX]; int8_t payload[8][SCH_PAYLOAD_SIZE_MAX];
...@@ -1096,6 +1098,8 @@ typedef struct { ...@@ -1096,6 +1098,8 @@ typedef struct {
uint8_t BSR_reporting_active[BSR_TYPE_FIRST_LEVEL]; uint8_t BSR_reporting_active[BSR_TYPE_FIRST_LEVEL];
/// retxBSR-Timer expires flag /// retxBSR-Timer expires flag
uint8_t retxBSRTimer_expires_flag; uint8_t retxBSRTimer_expires_flag;
/// periodBSR-Timer expires flag
uint8_t periodBSRTimer_expires_flag;
/// 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?
......
...@@ -538,14 +538,14 @@ UE_L2_STATE_t ue_scheduler( ...@@ -538,14 +538,14 @@ UE_L2_STATE_t ue_scheduler(
*/ */
int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen); int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen);
/*! \fn int get_bsr_lcgid (module_id_t module_idP); /*! \fn int update_bsr_and_get_bsr_lcgid (module_id_t module_idP);
\brief determine the lcgid for the bsr \brief determine the lcgid for the bsr
\param[in] Mod_id instance of the UE \param[in] Mod_id instance of the UE
\param[out] lcgid \param[out] lcgid
*/ */
int get_bsr_lcgid (module_id_t module_idP); int update_bsr_and_get_bsr_lcgid (module_id_t module_idP);
/*! \fn int get_bsr_type (module_id_t module_idP,uint16_t bufflen); /*! \fn int get_bsr_type (module_id_t module_idP, uint8_t eNB_index,frame_t frameP,uint16_t buflen);
\brief determine whether the bsr is short or long assuming that the MAC pdu is built \brief determine whether the bsr is short or long assuming that the MAC pdu is built
\param[in] Mod_id instance of the UE \param[in] Mod_id instance of the UE
\param[in] bufflen size of phy transport block \param[in] bufflen size of phy transport block
......
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