Commit cb172803 authored by Lionel Gauthier's avatar Lionel Gauthier

tweaks for eMBMS

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5249 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent fee4a83f
......@@ -275,12 +275,12 @@ boolean_t pdcp_data_req(
if ((pdcp_p->security_activated != 0) &&
((pdcp_p->cipheringAlgorithm) != 0) &&
((pdcp_p->integrityProtAlgorithm) != 0)) {
if (enb_flagP == ENB_FLAG_NO)
start_meas(&eNB_pdcp_stats[enb_mod_idP].apply_security);
else
start_meas(&UE_pdcp_stats[ue_mod_idP].apply_security);
pdcp_apply_security(pdcp_p, rb_idP % maxDRB,
pdcp_header_len, current_sn, pdcp_pdu_p->data,
sdu_buffer_sizeP);
......@@ -534,7 +534,7 @@ boolean_t pdcp_data_ind(
start_meas(&eNB_pdcp_stats[enb_mod_idP].validate_security);
else
start_meas(&UE_pdcp_stats[ue_mod_idP].validate_security);
pdcp_validate_security(pdcp_p, rb_idP, pdcp_header_len,
sequence_number, sdu_buffer_pP->data,
sdu_buffer_sizeP - pdcp_tailer_len);
......@@ -542,7 +542,7 @@ boolean_t pdcp_data_ind(
stop_meas(&eNB_pdcp_stats[enb_mod_idP].validate_security);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].validate_security);
}
#endif
//rrc_lite_data_ind(module_id, //Modified MW - L2 Interface
......@@ -775,7 +775,7 @@ void pdcp_run (
#if defined(USER_MODE) && defined(OAI_EMU)
pdcp_t *pdcp_p = NULL;
// add other rb_ids
// add other rb_ids
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_drb_ue[ue_mod_idP][DTCH-1];
} else {
......@@ -784,7 +784,7 @@ void pdcp_run (
if (pdcp_p->instanciated_instance == TRUE )
pdcp_fifo_read_input_sdus_from_otg(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
#endif
#endif
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
#if defined(LINK_PDCP_TO_GTPV1U)
......@@ -798,7 +798,7 @@ void pdcp_run (
start_meas(&eNB_pdcp_stats[enb_mod_idP].pdcp_ip);
else
start_meas(&UE_pdcp_stats[ue_mod_idP].pdcp_ip);
pdcp_fifo_flush_sdus(frameP, enb_flagP, enb_mod_idP, ue_mod_idP);
if (enb_flagP)
......@@ -1058,14 +1058,14 @@ boolean_t rrc_pdcp_config_asn1_req (
// can set the mch_id = i
if (enb_flagP) {
drb_id = (mch_id * maxSessionPerPMCH ) + lc_id + (maxDRB + 3)*MAX_MOBILES_PER_ENB; // 1
drb_id = (mch_id * maxSessionPerPMCH ) + lc_id ;//+ (maxDRB + 3)*MAX_MOBILES_PER_ENB; // 1
if (pdcp_mbms_array_eNB[enb_mod_idP][mch_id][lc_id].instanciated_instance == TRUE) {
action = CONFIG_ACTION_MBMS_MODIFY;
}else {
action = CONFIG_ACTION_MBMS_ADD;
}
} else {
drb_id = (mch_id * maxSessionPerPMCH ) + lc_id + (maxDRB + 3); // 15
drb_id = (mch_id * maxSessionPerPMCH ) + lc_id; // + (maxDRB + 3); // 15
if (pdcp_mbms_array_ue[ue_mod_idP][mch_id][lc_id].instanciated_instance == TRUE) {
action = CONFIG_ACTION_MBMS_MODIFY;
} else {
......
......@@ -121,7 +121,17 @@ void config_req_rlc_um_asn1 (
#if defined(Rel10)
if (mbms_flagP) {
AssertFatal(dl_rlc_pP, "No RLC UM DL config");
AssertFatal(ul_rlc_pP == NULL, "RLC UM UL config present");
key = RLC_COLL_KEY_MBMS_VALUE(enb_module_idP, ue_module_idP, eNB_flagP, mbms_service_idP, mbms_session_idP);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u ue id %i enb flag %u service id %u, session id %u",
enb_module_idP,
ue_module_idP,
eNB_flagP,
mbms_service_idP,
mbms_session_idP);
rlc_p = &rlc_union_p->rlc.um;
}
else
#endif
......@@ -228,6 +238,7 @@ rlc_um_init (rlc_um_entity_t * const rlc_pP)
{
//-----------------------------------------------------------------------------
AssertFatal(rlc_pP, "Bad RLC UM pointer (NULL)");
int saved_allocation = rlc_pP->allocation;
memset (rlc_pP, 0, sizeof (rlc_um_entity_t));
rlc_pP->allocation = saved_allocation;
......
......@@ -251,18 +251,28 @@ typedef struct rlc_mbms_id_s {
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
#define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD - (NB_RB_MAX*MAX_MOBILES_PER_ENB)]
//#define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD - (NB_RB_MAX*MAX_MOBILES_PER_ENB)]
#define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD]
//#define rlc_mbms_enb_set_lcid_by_rb_id(Enb_mOD,rB_iD,lOG_cH_iD) do { \
// AssertFatal(rB_iD>=(NB_RB_MAX*MAX_MOBILES_PER_ENB), "INVALID RB ID %u", rB_iD);
// rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD-(NB_RB_MAX*MAX_MOBILES_PER_ENB)] = lOG_cH_iD; \
// } while (0);
#define rlc_mbms_enb_set_lcid_by_rb_id(Enb_mOD,rB_iD,lOG_cH_iD) do { \
AssertFatal(rB_iD>=(NB_RB_MAX*MAX_MOBILES_PER_ENB), "INVALID RB ID %u", rB_iD); \
rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD - (NB_RB_MAX*MAX_MOBILES_PER_ENB)] = lOG_cH_iD; \
rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD] = lOG_cH_iD; \
} while (0);
#define rlc_mbms_ue_get_lcid_by_rb_id(uE_mOD,rB_iD) rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD - NB_RB_MAX]
//#define rlc_mbms_ue_get_lcid_by_rb_id(uE_mOD,rB_iD) rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD - NB_RB_MAX]
#define rlc_mbms_ue_get_lcid_by_rb_id(uE_mOD,rB_iD) rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD]
//#define rlc_mbms_ue_set_lcid_by_rb_id(uE_mOD,rB_iD,lOG_cH_iD) do { \
// AssertFatal(rB_iD>=NB_RB_MAX, "INVALID RB ID %u", rB_iD); \
// rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD - NB_RB_MAX] = lOG_cH_iD; \
// } while (0);
#define rlc_mbms_ue_set_lcid_by_rb_id(uE_mOD,rB_iD,lOG_cH_iD) do { \
AssertFatal(rB_iD>=NB_RB_MAX, "INVALID RB ID %u", rB_iD); \
rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD - NB_RB_MAX] = lOG_cH_iD; \
AssertFatal(rB_iD<NB_RB_MAX, "INVALID RB ID %u", rB_iD); \
rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD] = lOG_cH_iD; \
} while (0);
public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_ue [NUMBER_OF_UE_MAX][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
......
......@@ -373,13 +373,13 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const module_id_t enb_mod_idP
// can set the mch_id = i
if (enb_flagP) {
rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id + (maxDRB + 3) * MAX_MOBILES_PER_ENB; // 1
rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id;//+ (maxDRB + 3) * MAX_MOBILES_PER_ENB; // 1
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].service_id = mbms_service_id;
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].session_id = mbms_session_id;
rlc_mbms_enb_set_lcid_by_rb_id(enb_mod_idP,rb_id,lc_id);
} 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
rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][lc_id].service_id = mbms_service_id;
rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][lc_id].session_id = mbms_session_id;
rlc_mbms_ue_set_lcid_by_rb_id(ue_mod_idP,rb_id,lc_id);
......@@ -609,25 +609,31 @@ rlc_union_t* rrc_rlc_add_rlc (
oai_emulation.info.first_ue_local);
}
#endif
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
AssertFatal (chan_idP < RLC_MAX_LC, "LC id is too high (%u/%d)!\n", chan_idP, RLC_MAX_LC);
if (MBMS_flagP == FALSE) {
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
AssertFatal (chan_idP < RLC_MAX_LC, "LC id is too high (%u/%d)!\n", chan_idP, RLC_MAX_LC);
}
#ifdef Rel10
if (MBMS_flagP == TRUE) {
if (enb_flagP) {
lcid = rlc_mbms_enb_get_lcid_by_rb_id(enb_mod_idP,rb_idP);
mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lcid];
LOG_I(RLC,
"[Frame %05u] lcid %d = rlc_mbms_enb_get_lcid_by_rb_id(enb_mod_idP %u, rb_idP %u)\n",
frameP,lcid, enb_mod_idP, rb_idP);
mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lcid];
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lcid].service_id = 0;
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lcid].session_id = 0;
rlc_mbms_rbid2lcid_ue[enb_mod_idP][rb_idP] = RLC_LC_UNALLOCATED;
//LG 2014-04-15rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lcid].service_id = 0;
//LG 2014-04-15rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lcid].session_id = 0;
//LG 2014-04-15rlc_mbms_rbid2lcid_eNB[enb_mod_idP][rb_idP] = RLC_LC_UNALLOCATED;
} else {
lcid = rlc_mbms_ue_get_lcid_by_rb_id(ue_mod_idP,rb_idP);
mbms_id_p = &rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][lcid];
mbms_id_p = &rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][lcid];
rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lcid].service_id = 0;
rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lcid].session_id = 0;
rlc_mbms_rbid2lcid_ue[ue_mod_idP][rb_idP] = RLC_LC_UNALLOCATED;
//LG 2014-04-15rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lcid].service_id = 0;
//LG 2014-04-15rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lcid].session_id = 0;
//LG 2014-04-15rlc_mbms_rbid2lcid_ue[ue_mod_idP][rb_idP] = RLC_LC_UNALLOCATED;
}
key = RLC_COLL_KEY_MBMS_VALUE(enb_mod_idP, ue_mod_idP, enb_flagP, mbms_id_p->service_id, mbms_id_p->session_id);
} else
......@@ -652,14 +658,27 @@ rlc_union_t* rrc_rlc_add_rlc (
rlc_union_p = calloc(1, sizeof(rlc_union_t));
h_rc = hashtable_insert(rlc_coll_p, key, rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
LOG_I(RLC, "[Frame %05u][%s][RLC_RRC][INST %u/%u][%s %u] rrc_rlc_add_rlc %s\n",
frameP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
(srb_flagP) ? "SRB" : "DRB",
rb_idP,
(srb_flagP) ? "SRB" : "DRB");
#ifdef Rel10
if (MBMS_flagP == TRUE) {
LOG_I(RLC, "[Frame %05u][%s][RLC_RRC][INST %u/%u] RLC service id %u session id %u rrc_rlc_add_rlc\n",
frameP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
mbms_id_p->service_id,
mbms_id_p->session_id);
} else
#endif
{
LOG_I(RLC, "[Frame %05u][%s][RLC_RRC][INST %u/%u][%s %u] rrc_rlc_add_rlc %s\n",
frameP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
(srb_flagP) ? "SRB" : "DRB",
rb_idP,
(srb_flagP) ? "SRB" : "DRB");
}
rlc_union_p->mode = rlc_modeP;
return rlc_union_p;
} else {
......
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