From 0f42c092b11fc173b2c1ca31727d813766de482a Mon Sep 17 00:00:00 2001 From: winckel <winckel@eurecom.fr> Date: Thu, 9 Jan 2014 16:06:20 +0000 Subject: [PATCH] Fixed an issue with long BSR. Fixed some warnings. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4840 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair2/LAYER2/MAC/defs.h | 2 +- openair2/LAYER2/MAC/eNB_scheduler.c | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index d0b3b47b0bd..40cbea5a23c 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -1124,7 +1124,7 @@ void init_ue_sched_info(void); void add_ue_ulsch_info(u8 Mod_id, u8 UE_id, u8 subframe,UE_ULSCH_STATUS status); void add_ue_dlsch_info(u8 Mod_id, u8 UE_id, u8 subframe,UE_DLSCH_STATUS status); s8 find_UE_id(u8 Mod_id,u16 rnti) ; -s16 find_UE_RNTI(u8 Mod_id, u8 UE_id); +u16 find_UE_RNTI(u8 Mod_id, u8 UE_id); s8 find_active_UEs(u8 Mod_id); u8 is_UE_active(unsigned char Mod_id, unsigned char UE_id ); u16 find_ulgranted_UEs(u8 Mod_id); diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index f4fa4f1b23d..213efc5e150 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -307,7 +307,7 @@ s8 find_UE_id(unsigned char Mod_id,u16 rnti) { } -s16 find_UE_RNTI(unsigned char Mod_id, unsigned char UE_id) { +u16 find_UE_RNTI(unsigned char Mod_id, unsigned char UE_id) { return (eNB_mac_inst[Mod_id].UE_template[UE_id].rnti); @@ -472,14 +472,14 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header, length -= rx_lengths[num_sdu_cnt]; } else { - if (((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F == 0) { - length = ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L; - mac_header_ptr += 2;//sizeof(SCH_SUBHEADER_SHORT); - } - else { // F = 1 - length = ((((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_MSB & 0x7f ) << 8 ) | (((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_LSB & 0xff); - mac_header_ptr += 3;//sizeof(SCH_SUBHEADER_LONG); - } + if (((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F == 0) { + length = ((SCH_SUBHEADER_SHORT *)mac_header_ptr)->L; + mac_header_ptr += 2;//sizeof(SCH_SUBHEADER_SHORT); + } + else { // F = 1 + length = ((((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_MSB & 0x7f ) << 8 ) | (((SCH_SUBHEADER_LONG *)mac_header_ptr)->L_LSB & 0xff); + mac_header_ptr += 3;//sizeof(SCH_SUBHEADER_LONG); + } } LOG_D(MAC,"[eNB] sdu %d lcid %d tb_length %d length %d (offset now %d)\n", num_sdus,lcid,tb_length, length,mac_header_ptr-mac_header); @@ -573,6 +573,7 @@ void rx_sdu(u8 Mod_id,u32 frame,u16 rnti,u8 *sdu, u16 sdu_len) { eNB_mac_inst[Mod_id].UE_template[UE_id].bsr_info[LCGID1], eNB_mac_inst[Mod_id].UE_template[UE_id].bsr_info[LCGID2], eNB_mac_inst[Mod_id].UE_template[UE_id].bsr_info[LCGID3]); + payload_ptr += 3;////sizeof(LONG_BSR); break; default: LOG_E(MAC, "[eNB] Received unknown MAC header (0x%02x)\n", rx_ces[i]); -- GitLab