Commit e90b729e authored by Lionel Gauthier's avatar Lionel Gauthier

Commit for e-MBMS DUY, to be debugged/harmonized with MAC (lcid, rbid)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5119 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent b6c164d5
...@@ -860,6 +860,10 @@ rlc_module_init (void) ...@@ -860,6 +860,10 @@ rlc_module_init (void)
memset(&rlc_mbms_array_ue[module_id1][service_id][session_id], 0, sizeof(rlc_mbms_t)); memset(&rlc_mbms_array_ue[module_id1][service_id][session_id], 0, sizeof(rlc_mbms_t));
} }
} }
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
rlc_mbms_lcid2service_session_id_ue[module_id1][k].service_id = 0;
rlc_mbms_lcid2service_session_id_ue[module_id1][k].session_id = 0;
}
#endif #endif
for (rb_id=0; rb_id < NB_RB_MAX; rb_id++) { for (rb_id=0; rb_id < NB_RB_MAX; rb_id++) {
memset(&rlc_array_ue[module_id1][rb_id], 0, sizeof(rlc_t)); memset(&rlc_array_ue[module_id1][rb_id], 0, sizeof(rlc_t));
...@@ -873,6 +877,10 @@ rlc_module_init (void) ...@@ -873,6 +877,10 @@ rlc_module_init (void)
memset(&rlc_mbms_array_eNB[module_id1][service_id][session_id], 0, sizeof(rlc_mbms_t)); memset(&rlc_mbms_array_eNB[module_id1][service_id][session_id], 0, sizeof(rlc_mbms_t));
} }
} }
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
rlc_mbms_lcid2service_session_id_eNB[module_id1][k].service_id = 0;
rlc_mbms_lcid2service_session_id_eNB[module_id1][k].session_id = 0;
}
#endif #endif
for (module_id2=0; module_id2 < NUMBER_OF_UE_MAX; module_id2++) { for (module_id2=0; module_id2 < NUMBER_OF_UE_MAX; module_id2++) {
for (rb_id=0; rb_id < NB_RB_MAX; rb_id++) { for (rb_id=0; rb_id < NB_RB_MAX; rb_id++) {
......
...@@ -169,11 +169,8 @@ typedef struct { ...@@ -169,11 +169,8 @@ typedef struct {
// PRIVATE INTERNALS OF RLC // PRIVATE INTERNALS OF RLC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef Rel10 #define RLC_MAX_MBMS_LC (maxSessionPerPMCH * maxServiceCount)
#define RLC_MAX_LC ((max_val_DRB_Identity+1) * NUMBER_OF_UE_MAX + maxSessionPerPMCH * maxServiceCount)
#else
#define RLC_MAX_LC ((max_val_DRB_Identity+1)* NUMBER_OF_UE_MAX) #define RLC_MAX_LC ((max_val_DRB_Identity+1)* NUMBER_OF_UE_MAX)
#endif
protected_rlc(void (*rlc_rrc_data_ind) (module_id_t, module_id_t, frame_t, eNB_flag_t, rb_id_t , sdu_size_t , uint8_t* );) protected_rlc(void (*rlc_rrc_data_ind) (module_id_t, module_id_t, frame_t, eNB_flag_t, rb_id_t , sdu_size_t , uint8_t* );)
protected_rlc(void (*rlc_rrc_data_conf) (module_id_t , module_id_t , eNB_flag_t, rb_id_t , mui_t, rlc_tx_status_t );) protected_rlc(void (*rlc_rrc_data_conf) (module_id_t , module_id_t , eNB_flag_t, rb_id_t , mui_t, rlc_tx_status_t );)
...@@ -199,6 +196,11 @@ typedef struct rlc_mbms_s { ...@@ -199,6 +196,11 @@ typedef struct rlc_mbms_s {
rlc_um_entity_t um; rlc_um_entity_t um;
} rlc_mbms_t; } rlc_mbms_t;
typedef struct rlc_mbms_id_s {
mbms_service_id_t service_id;
mbms_session_id_t session_id;
} rlc_mbms_id_t;
#if !defined(Rel10) #if !defined(Rel10)
# if !defined(maxServiceCount) # if !defined(maxServiceCount)
//unused arrays rlc_mbms_array_ue rlc_mbms_array_eNB //unused arrays rlc_mbms_array_ue rlc_mbms_array_eNB
...@@ -210,7 +212,9 @@ typedef struct rlc_mbms_s { ...@@ -210,7 +212,9 @@ typedef struct rlc_mbms_s {
# endif # endif
#endif #endif
public_rlc(rlc_mbms_t rlc_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h public_rlc(rlc_mbms_t rlc_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h public_rlc(rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[NUMBER_OF_UE_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[NUMBER_OF_eNB_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rb_id_t lcid2rbid_ue[NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ public_rlc(rb_id_t lcid2rbid_ue[NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(rb_id_t lcid2rbid_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ public_rlc(rb_id_t lcid2rbid_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
......
...@@ -17,13 +17,16 @@ ...@@ -17,13 +17,16 @@
#define DEBUG_MAC_INTERFACE 1 #define DEBUG_MAC_INTERFACE 1
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct mac_data_ind mac_rlc_deserialize_tb (char* buffer_pP, tb_size_t tb_sizeP, num_tb_t num_tbP, crc_t *crcs_pP) { struct mac_data_ind mac_rlc_deserialize_tb (
char *buffer_pP,
tb_size_t tb_sizeP,
num_tb_t num_tbP,
crc_t *crcs_pP) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct mac_data_ind data_ind; struct mac_data_ind data_ind;
mem_block_t* tb_p; mem_block_t* tb_p;
num_tb_t nb_tb_read; num_tb_t nb_tb_read;
tbs_size_t tbs_size; tbs_size_t tbs_size;
nb_tb_read = 0; nb_tb_read = 0;
tbs_size = 0; tbs_size = 0;
...@@ -60,7 +63,7 @@ struct mac_data_ind mac_rlc_deserialize_tb (char* buffer_pP, tb_size_t tb_sizeP, ...@@ -60,7 +63,7 @@ struct mac_data_ind mac_rlc_deserialize_tb (char* buffer_pP, tb_size_t tb_sizeP,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
tbs_size_t mac_rlc_serialize_tb (char* buffer_pP, list_t transport_blocksP) { tbs_size_t mac_rlc_serialize_tb (char* buffer_pP, list_t transport_blocksP) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mem_block_t* tb_p; mem_block_t *tb_p;
tbs_size_t tbs_size; tbs_size_t tbs_size;
tbs_size_t tb_size; tbs_size_t tb_size;
...@@ -81,18 +84,20 @@ tbs_size_t mac_rlc_serialize_tb (char* buffer_pP, list_t transport_blocksP) { ...@@ -81,18 +84,20 @@ tbs_size_t mac_rlc_serialize_tb (char* buffer_pP, list_t transport_blocksP) {
return tbs_size; return tbs_size;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP, tbs_size_t mac_rlc_data_req(
module_id_t ue_mod_idP, module_id_t enb_mod_idP,
frame_t frameP, module_id_t ue_mod_idP,
eNB_flag_t enb_flagP, frame_t frameP,
MBMS_flag_t MBMS_flagP, eNB_flag_t enb_flagP,
logical_chan_id_t channel_idP, MBMS_flag_t MBMS_flagP,
char *buffer_pP) { logical_chan_id_t channel_idP,
char *buffer_pP) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct mac_data_req data_request; struct mac_data_req data_request;
rb_id_t rb_id = 0; rb_id_t rb_id = 0;
rlc_mode_t rlc_mode = RLC_MODE_NONE; rlc_mode_t rlc_mode = RLC_MODE_NONE;
void *rlc_p = NULL; void *rlc_p = NULL;
rlc_mbms_id_t *mbms_id_p = NULL;
#ifdef DEBUG_MAC_INTERFACE #ifdef DEBUG_MAC_INTERFACE
LOG_D(RLC, "\n[RLC] Inst %s enb id %d ue id %d: MAC_RLC_DATA_REQ channel %d (%d) MAX RB %d, Num_tb %d\n", LOG_D(RLC, "\n[RLC] Inst %s enb id %d ue id %d: MAC_RLC_DATA_REQ channel %d (%d) MAX RB %d, Num_tb %d\n",
...@@ -100,7 +105,7 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP, ...@@ -100,7 +105,7 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP,
#endif // DEBUG_MAC_INTERFACE #endif // DEBUG_MAC_INTERFACE
if (MBMS_flagP) if (MBMS_flagP)
AssertFatal (channel_idP < RLC_MAX_LC, "channel id is too high (%u/%d)!\n", channel_idP, RLC_MAX_LC); AssertFatal (channel_idP < RLC_MAX_MBMS_LC, "channel id is too high (%u/%d)!\n", channel_idP, RLC_MAX_MBMS_LC);
else else
AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n", channel_idP, NB_RB_MAX); AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n", channel_idP, NB_RB_MAX);
...@@ -118,6 +123,8 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP, ...@@ -118,6 +123,8 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP,
ue_mod_idP, ue_mod_idP,
oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local); oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local);
} else { } else {
AssertFatal (MBMS_flagP == MBMS_FLAG_NO ," MBMS FLAG SHOULD NOT BE SET IN mac_rlc_data_req in UE\n");
AssertFatal (ue_mod_idP < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local), AssertFatal (ue_mod_idP < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local),
"UE module id is too high (%u/%d)!\n", "UE module id is too high (%u/%d)!\n",
ue_mod_idP, ue_mod_idP,
...@@ -130,24 +137,32 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP, ...@@ -130,24 +137,32 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP,
if (enb_flagP) { if (enb_flagP) {
rb_id = lcid2rbid_eNB[enb_mod_idP][ue_mod_idP][channel_idP]; if (MBMS_flagP) {
rlc_mode = rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].mode; mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][channel_idP];
switch (rlc_mode) { rb_id = rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
case RLC_MODE_NONE: rlc_p = (void*)&rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
AssertFatal (0 , "enB RLC not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP); AssertFatal (rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
return (tbs_size_t)0; "enB MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
break; } else {
case RLC_MODE_AM: rb_id = lcid2rbid_eNB[enb_mod_idP][ue_mod_idP][channel_idP];
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.am; rlc_mode = rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].mode;
break; switch (rlc_mode) {
case RLC_MODE_UM: case RLC_MODE_NONE:
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.um; AssertFatal (0 , "enB RLC not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
break; return (tbs_size_t)0;
case RLC_MODE_TM: break;
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.tm; case RLC_MODE_AM:
break; rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.am;
default: break;
AssertFatal (0 , "enB RLC internal memory error rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP); case RLC_MODE_UM:
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.um;
break;
case RLC_MODE_TM:
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.tm;
break;
default:
AssertFatal (0 , "enB RLC internal memory error rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
}
} }
} else { } else {
rb_id = lcid2rbid_ue[ue_mod_idP][channel_idP]; rb_id = lcid2rbid_ue[ue_mod_idP][channel_idP];
...@@ -195,20 +210,22 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP, ...@@ -195,20 +210,22 @@ tbs_size_t mac_rlc_data_req (module_id_t enb_mod_idP,
return (tbs_size_t)0; return (tbs_size_t)0;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void mac_rlc_data_ind (module_id_t enb_mod_idP, void mac_rlc_data_ind (
module_id_t ue_mod_idP, module_id_t enb_mod_idP,
frame_t frameP, module_id_t ue_mod_idP,
eNB_flag_t enb_flagP, frame_t frameP,
MBMS_flag_t MBMS_flagP, eNB_flag_t enb_flagP,
logical_chan_id_t channel_idP, MBMS_flag_t MBMS_flagP,
char *buffer_pP, logical_chan_id_t channel_idP,
tb_size_t tb_sizeP, char *buffer_pP,
num_tb_t num_tbP, tb_size_t tb_sizeP,
crc_t *crcs_pP) { num_tb_t num_tbP,
crc_t *crcs_pP) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rb_id_t rb_id = 0; rb_id_t rb_id = 0;
rlc_mode_t rlc_mode = RLC_MODE_NONE; rlc_mode_t rlc_mode = RLC_MODE_NONE;
void *rlc_p = NULL; void *rlc_p = NULL;
rlc_mbms_id_t *mbms_id_p = NULL;
#ifdef DEBUG_MAC_INTERFACE #ifdef DEBUG_MAC_INTERFACE
if (num_tbP) { if (num_tbP) {
LOG_D(RLC, "[Frame %5u][%s][RLC][MOD %u/%u] MAC_RLC_DATA_IND on channel %d (%d), rb max %d, Num_tb %d\n", LOG_D(RLC, "[Frame %5u][%s][RLC][MOD %u/%u] MAC_RLC_DATA_IND on channel %d (%d), rb max %d, Num_tb %d\n",
...@@ -224,9 +241,11 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP, ...@@ -224,9 +241,11 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP,
#endif // DEBUG_MAC_INTERFACE #endif // DEBUG_MAC_INTERFACE
#ifdef OAI_EMU #ifdef OAI_EMU
if (MBMS_flagP) if (MBMS_flagP)
AssertFatal (channel_idP < RLC_MAX_LC, "channel id is too high (%u/%d)!\n", channel_idP, RLC_MAX_LC); AssertFatal (channel_idP < RLC_MAX_MBMS_LC, "channel id is too high (%u/%d)!\n",
channel_idP, RLC_MAX_MBMS_LC);
else else
AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n", channel_idP, NB_RB_MAX); AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n",
channel_idP, NB_RB_MAX);
if (enb_flagP) { if (enb_flagP) {
AssertFatal ((enb_mod_idP >= oai_emulation.info.first_enb_local) && (oai_emulation.info.nb_enb_local > 0), AssertFatal ((enb_mod_idP >= oai_emulation.info.first_enb_local) && (oai_emulation.info.nb_enb_local > 0),
...@@ -241,6 +260,7 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP, ...@@ -241,6 +260,7 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP,
"UE module id is too high (%u/%d)!\n", "UE module id is too high (%u/%d)!\n",
ue_mod_idP, ue_mod_idP,
oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local); oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local);
AssertFatal (MBMS_flagP == MBMS_FLAG_NO ," MBMS FLAG SHOULD NOT BE SET IN mac_rlc_data_ind in eNB\n");
} else { } else {
AssertFatal (ue_mod_idP < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local), AssertFatal (ue_mod_idP < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local),
"UE module id is too high (%u/%d)!\n", "UE module id is too high (%u/%d)!\n",
...@@ -273,24 +293,32 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP, ...@@ -273,24 +293,32 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP,
AssertFatal (0 , "enB RLC internal memory error rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP); AssertFatal (0 , "enB RLC internal memory error rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
} }
} else { } else {
rb_id = lcid2rbid_ue[ue_mod_idP][channel_idP]; if (MBMS_flagP) {
AssertFatal (rb_id < NB_RB_MAX, "UE RB id is too high (%u/%d) lcid %u enb module %u ue module id %u!\n", rb_id, NB_RB_MAX, channel_idP, enb_mod_idP, ue_mod_idP); mbms_id_p = &rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][channel_idP];
rlc_mode = rlc_array_ue[ue_mod_idP][rb_id].mode; rb_id = rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
switch (rlc_mode) { rlc_p = (void*)&rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
case RLC_MODE_NONE: AssertFatal (rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
AssertFatal (0 , "UE RLC not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP); "UE MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP);
break; } else {
case RLC_MODE_AM: rb_id = lcid2rbid_ue[ue_mod_idP][channel_idP];
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.am; AssertFatal (rb_id < NB_RB_MAX, "UE RB id is too high (%u/%d) lcid %u enb module %u ue module id %u!\n", rb_id, NB_RB_MAX, channel_idP, enb_mod_idP, ue_mod_idP);
break; rlc_mode = rlc_array_ue[ue_mod_idP][rb_id].mode;
case RLC_MODE_UM: switch (rlc_mode) {
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.um; case RLC_MODE_NONE:
break; AssertFatal (0 , "UE RLC not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP);
case RLC_MODE_TM: break;
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.tm; case RLC_MODE_AM:
break; rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.am;
default: break;
AssertFatal (0 , "UE RLC internal memory error rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP); case RLC_MODE_UM:
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.um;
break;
case RLC_MODE_TM:
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.tm;
break;
default:
AssertFatal (0 , "UE RLC internal memory error rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP);
}
} }
} }
struct mac_data_ind data_ind = mac_rlc_deserialize_tb(buffer_pP, tb_sizeP, num_tbP, crcs_pP); struct mac_data_ind data_ind = mac_rlc_deserialize_tb(buffer_pP, tb_sizeP, num_tbP, crcs_pP);
...@@ -322,23 +350,43 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP, ...@@ -322,23 +350,43 @@ void mac_rlc_data_ind (module_id_t enb_mod_idP,
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mac_rlc_status_resp_t mac_rlc_status_ind (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t enb_flagP, MBMS_flag_t MBMS_flagP, logical_chan_id_t channel_idP, tb_size_t tb_sizeP) { mac_rlc_status_resp_t mac_rlc_status_ind(
module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
frame_t frameP,
eNB_flag_t enb_flagP,
MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP,
tb_size_t tb_sizeP) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mac_rlc_status_resp_t mac_rlc_status_resp; mac_rlc_status_resp_t mac_rlc_status_resp;
struct mac_status_ind tx_status; struct mac_status_ind tx_status;
struct mac_status_resp status_resp; struct mac_status_resp status_resp;
rb_id_t rb_id = 0; rb_id_t rb_id = 0;
rlc_mode_t rlc_mode = RLC_MODE_NONE; rlc_mode_t rlc_mode = RLC_MODE_NONE;
void *rlc_p = NULL; void *rlc_p = NULL;
rlc_mbms_id_t *mbms_id_p = NULL;
memset (&mac_rlc_status_resp, 0, sizeof(mac_rlc_status_resp_t)); memset (&mac_rlc_status_resp, 0, sizeof(mac_rlc_status_resp_t));
memset (&tx_status , 0, sizeof(struct mac_status_ind)); memset (&tx_status , 0, sizeof(struct mac_status_ind));
#ifdef OAI_EMU #ifdef OAI_EMU
if (MBMS_flagP) if (MBMS_flagP)
AssertFatal (channel_idP < RLC_MAX_LC, "%s channel id is too high (%u/%d) enb module id %u ue module id %u!\n",(enb_flagP) ? "eNB" : "UE", channel_idP, RLC_MAX_LC, enb_mod_idP, ue_mod_idP); AssertFatal (channel_idP < RLC_MAX_MBMS_LC,
"%s channel id is too high (%u/%d) enb module id %u ue module id %u!\n",
(enb_flagP) ? "eNB" : "UE",
channel_idP,
RLC_MAX_MBMS_LC,
enb_mod_idP,
ue_mod_idP);
else else
AssertFatal (channel_idP < NB_RB_MAX, "%s channel id is too high (%u/%d) enb module id %u ue module id %u!\n",(enb_flagP) ? "eNB" : "UE", channel_idP, NB_RB_MAX, enb_mod_idP, ue_mod_idP); AssertFatal (channel_idP < NB_RB_MAX,
"%s channel id is too high (%u/%d) enb module id %u ue module id %u!\n",
(enb_flagP) ? "eNB" : "UE",
channel_idP,
NB_RB_MAX,
enb_mod_idP,
ue_mod_idP);
if (enb_flagP) { if (enb_flagP) {
AssertFatal ((enb_mod_idP >= oai_emulation.info.first_enb_local) && (oai_emulation.info.nb_enb_local > 0), AssertFatal ((enb_mod_idP >= oai_emulation.info.first_enb_local) && (oai_emulation.info.nb_enb_local > 0),
...@@ -367,62 +415,78 @@ mac_rlc_status_resp_t mac_rlc_status_ind (module_id_t enb_mod_idP, module_id ...@@ -367,62 +415,78 @@ mac_rlc_status_resp_t mac_rlc_status_ind (module_id_t enb_mod_idP, module_id
if (enb_flagP) { if (enb_flagP) {
rb_id = lcid2rbid_eNB[enb_mod_idP][ue_mod_idP][channel_idP]; if (MBMS_flagP) {
if (rb_id >= NB_RB_MAX) { mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][channel_idP];
/*LOG_D(RLC, "[FRAME %05d][%s][RLC][MOD %u/%u] MAC STATUS IND TO NOT CONFIGURED BEARER lc id %u \n", rb_id = rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
AssertFatal (rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
"enB MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
} else {
rb_id = lcid2rbid_eNB[enb_mod_idP][ue_mod_idP][channel_idP];
if (rb_id >= NB_RB_MAX) {
/*LOG_D(RLC, "[FRAME %05d][%s][RLC][MOD %u/%u] MAC STATUS IND TO NOT CONFIGURED BEARER lc id %u \n",
frameP, frameP,
(enb_flagP) ? "eNB" : "UE", (enb_flagP) ? "eNB" : "UE",
enb_mod_idP, enb_mod_idP,
ue_mod_idP, ue_mod_idP,
channel_idP);*/ channel_idP);*/
return mac_rlc_status_resp; return mac_rlc_status_resp;
} }
rlc_mode = rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].mode; rlc_mode = rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].mode;
switch (rlc_mode) { switch (rlc_mode) {
case RLC_MODE_NONE: case RLC_MODE_NONE:
//LOG_E (RLC, "enB RLC not configured rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP); //LOG_E (RLC, "enB RLC not configured rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP);
return mac_rlc_status_resp; return mac_rlc_status_resp;
break; break;
case RLC_MODE_AM: case RLC_MODE_AM:
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.am; rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.am;
break; break;
case RLC_MODE_UM: case RLC_MODE_UM:
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.um; rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.um;
break; break;
case RLC_MODE_TM: case RLC_MODE_TM:
rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.tm; rlc_p = (void*)&rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_id].rlc.tm;
break; break;
default: default:
AssertFatal (0 , "enB RLC internal memory error rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP); AssertFatal (0 , "enB RLC internal memory error rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP);
}
} }
} else { } else {
rb_id = lcid2rbid_ue[ue_mod_idP][channel_idP]; if (MBMS_flagP) {
if (rb_id >= NB_RB_MAX) { mbms_id_p = &rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][channel_idP];
/*LOG_D(RLC, "[FRAME %05d][%s][RLC][MOD %u/%u] MAC STATUS IND TO NOT CONFIGURED BEARER lc id %u \n", rb_id = rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
AssertFatal (rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
"UE MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP);
} else {
rb_id = lcid2rbid_ue[ue_mod_idP][channel_idP];
if (rb_id >= NB_RB_MAX) {
/*LOG_D(RLC, "[FRAME %05d][%s][RLC][MOD %u/%u] MAC STATUS IND TO NOT CONFIGURED BEARER lc id %u \n",
frameP, frameP,
(enb_flagP) ? "eNB" : "UE", (enb_flagP) ? "eNB" : "UE",
enb_mod_idP, enb_mod_idP,
ue_mod_idP, ue_mod_idP,
channel_idP);*/ channel_idP);*/
return mac_rlc_status_resp; return mac_rlc_status_resp;
} }
rlc_mode = rlc_array_ue[ue_mod_idP][rb_id].mode; rlc_mode = rlc_array_ue[ue_mod_idP][rb_id].mode;
switch (rlc_mode) { switch (rlc_mode) {
case RLC_MODE_NONE: case RLC_MODE_NONE:
AssertFatal (0 , "UE RLC not configured rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP); AssertFatal (0 , "UE RLC not configured rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP);
return mac_rlc_status_resp; return mac_rlc_status_resp;
break; break;
case RLC_MODE_AM: case RLC_MODE_AM:
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.am; rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.am;
break; break;
case RLC_MODE_UM: case RLC_MODE_UM:
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.um; rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.um;
break; break;
case RLC_MODE_TM: case RLC_MODE_TM:
rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.tm; rlc_p = (void*)&rlc_array_ue[ue_mod_idP][rb_id].rlc.tm;
break; break;
default: default:
AssertFatal (0 , "UE RLC internal memory error rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP); AssertFatal (0 , "UE RLC internal memory error rb id %u lcid %u enb id %u ue id %u!\n", rb_id, channel_idP, enb_mod_idP, ue_mod_idP);
}
} }
} }
......
...@@ -393,38 +393,34 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t enb_mod_idP, ...@@ -393,38 +393,34 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t enb_mod_idP,
} }
} }
if (drb2release_listP != NULL) { if (drb2release_listP != NULL) {
for (cnt=0;cnt<drb2release_listP->list.count;cnt++) { for (cnt=0;cnt<drb2release_listP->list.count;cnt++) {
pdrb_id = drb2release_listP->list.array[cnt]; pdrb_id = drb2release_listP->list.array[cnt];
rrc_rlc_remove_rlc(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, *pdrb_id); rrc_rlc_remove_rlc(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, *pdrb_id);
} }
} }
#if defined(Rel10) #if defined(Rel10)
if (pmch_InfoList_r9_pP != NULL) { if (pmch_InfoList_r9_pP != NULL) {
for (i=0;i<pmch_InfoList_r9_pP->list.count;i++) { for (i=0;i<pmch_InfoList_r9_pP->list.count;i++) {
#warning TO DO REMOVE MBMS RLC
mbms_SessionInfoList_r9_p = &(pmch_InfoList_r9_pP->list.array[i]->mbms_SessionInfoList_r9); mbms_SessionInfoList_r9_p = &(pmch_InfoList_r9_pP->list.array[i]->mbms_SessionInfoList_r9);
for (j=0;j<mbms_SessionInfoList_r9_p->list.count;j++) { for (j=0;j<mbms_SessionInfoList_r9_p->list.count;j++) {
MBMS_SessionInfo_p = mbms_SessionInfoList_r9_p->list.array[j]; MBMS_SessionInfo_p = mbms_SessionInfoList_r9_p->list.array[j];
mbms_session_id = MBMS_SessionInfo_p->sessionId_r9->buf[0]; mbms_session_id = MBMS_SessionInfo_p->sessionId_r9->buf[0];
lc_id = mbms_session_id; lc_id = mbms_session_id;
mbms_service_id = MBMS_SessionInfo_p->tmgi_r9.serviceId_r9.buf[2]; //serviceId is 3-octet string mbms_service_id = MBMS_SessionInfo_p->tmgi_r9.serviceId_r9.buf[2]; //serviceId is 3-octet string
mch_id = mbms_service_id; mch_id = mbms_service_id;
// can set the mch_id = i // can set the mch_id = i
if (enb_flagP) { if (enb_flagP) {
rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id; // 1 rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id; // 1
// NO CHECK rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].service_id = mbms_service_id;
/*if (rlc_mbms_array_eNB[enb_mod_idP][mbms_service_id][mbms_session_id].instanciated_instance == enb_mod_idP + 1) rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].session_id = mbms_session_id;
action = CONFIG_ACTION_MBMS_MODIFY;
else
action = CONFIG_ACTION_MBMS_ADD;*/
} else { } else {
rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id + (maxDRB + 3); // 15 rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id + (maxDRB + 3); // 15
/*if (rlc_mbms_array_ue[ue_mod_idP][mbms_service_id][mbms_session_id].instanciated_instance == ue_mod_idP + 1) rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lc_id].service_id = mbms_service_id;
action = CONFIG_ACTION_MBMS_MODIFY; rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lc_id].session_id = mbms_session_id;
else
action = CONFIG_ACTION_MBMS_ADD;*/
} }
dl_um_rlc.sn_FieldLength = SN_FieldLength_size5; dl_um_rlc.sn_FieldLength = SN_FieldLength_size5;
dl_um_rlc.t_Reordering = T_Reordering_ms0; dl_um_rlc.t_Reordering = T_Reordering_ms0;
...@@ -869,14 +865,13 @@ rlc_op_status_t rrc_rlc_config_req (module_id_t enb_mod_idP, module_id_t ue_mo ...@@ -869,14 +865,13 @@ rlc_op_status_t rrc_rlc_config_req (module_id_t enb_mod_idP, module_id_t ue_mo
} }
#endif #endif
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX); AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
#warning TO DO rrc_rlc_config_req
switch (actionP) { switch (actionP) {
case CONFIG_ACTION_ADD: case CONFIG_ACTION_ADD:
if ((status = rrc_rlc_add_rlc(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, rb_idP, rb_idP, rlc_infoP.rlc_mode)) != RLC_OP_STATUS_OK) { if ((status = rrc_rlc_add_rlc(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, rb_idP, rb_idP, rlc_infoP.rlc_mode)) != RLC_OP_STATUS_OK) {
return status; return status;
} }
// no break, fall to next case
case CONFIG_ACTION_MODIFY: case CONFIG_ACTION_MODIFY:
switch (rlc_infoP.rlc_mode) { switch (rlc_infoP.rlc_mode) {
case RLC_MODE_AM: case RLC_MODE_AM:
......
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
ntohs((addr)->s6_addr16[7]) ntohs((addr)->s6_addr16[7])
#define OAI_DRV_DEBUG_SEND //#define OAI_DRV_DEBUG_SEND
#define OAI_DRV_DEBUG_RECEIVE //#define OAI_DRV_DEBUG_RECEIVE
void oai_nw_drv_common_class_wireless2ip(uint16_t dlen, void oai_nw_drv_common_class_wireless2ip(uint16_t dlen,
void *pdcp_sdu, void *pdcp_sdu,
int inst, int inst,
......
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