Commit 19c81e74 authored by Wilson's avatar Wilson

fixed hard-code DRB-ID<->LC-ID mapping (DRB-ID = LC-ID - 2) so they are not fully configurable

fixed hard-code default DRB-ID (1) so it is now fully configurable

(cherry picked from commit 4499124853b8985c3f157721997125370f1ca475)

Conflicts:
	openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c

Conflicts:
	openair2/LAYER2/PDCP_v10.1.0/pdcp.c
parent 12a304e6
......@@ -1065,6 +1065,7 @@ rrc_pdcp_config_asn1_req (
#ifdef Rel10
,PMCH_InfoList_r9_t* const pmch_InfoList_r9_pP
#endif
,rb_id_t *const defaultDRB // 2016-05-28 wilson : remember the default DRB
)
//-----------------------------------------------------------------------------
{
......@@ -1086,6 +1087,10 @@ rrc_pdcp_config_asn1_req (
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc;
#ifndef ASTRI_FIX // 2016-05-28 wilson : remember the default DRB
hash_key_t key_defaultDRB = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_defaultDRB_rc;
#endif
#ifdef Rel10
int i,j;
MBMS_SessionInfoList_r9_t *mbms_SessionInfoList_r9_p = NULL;
......@@ -1106,7 +1111,11 @@ rrc_pdcp_config_asn1_req (
srb_id = srb2add_list_pP->list.array[cnt]->srb_Identity;
srb_toaddmod_p = srb2add_list_pP->list.array[cnt];
rlc_type = RLC_MODE_AM;
#if 0
lc_id = srb_id;// + 2;
#else // 2016-05-27 wilson : fixing the LC-id <-> SRB-id mapping
lc_id = srb_id;
#endif
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, srb_id, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
......@@ -1186,8 +1195,23 @@ rrc_pdcp_config_asn1_req (
drb_toaddmod_p = drb2add_list_pP->list.array[cnt];
drb_id = drb_toaddmod_p->drb_Identity;// + drb_id_offset;
#ifdef ASTRI_FIX
lc_id = drb_id + 2;
#else // 2016-05-27 wilson : fixing the mapping between LC-id and DRB-id
if (drb_toaddmod_p->logicalChannelIdentity) {
lc_id = *(drb_toaddmod_p->logicalChannelIdentity);
} else {
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" logicalChannelIdentity is missing in DRB-ToAddMod information element!\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
continue;
}
if (lc_id == 1 || lc_id == 2) {
LOG_E(RLC, PROTOCOL_CTXT_FMT" logicalChannelIdentity = %d is invalid in RRC message when adding DRB!\n", PROTOCOL_CTXT_ARGS(ctxt_pP), lc_id);
continue;
}
#endif
DevCheck4(drb_id < maxDRB, drb_id, maxDRB, ctxt_pP->module_id, ctxt_pP->rnti);
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, drb_id, SRB_FLAG_NO);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
......@@ -1203,6 +1227,22 @@ rrc_pdcp_config_asn1_req (
pdcp_p = calloc(1, sizeof(pdcp_t));
h_rc = hashtable_insert(pdcp_coll_p, key, pdcp_p);
#ifndef ASTRI_FIX
if ((defaultDRB != NULL) && (*defaultDRB == drb_id)) {
key_defaultDRB = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag);
h_defaultDRB_rc = hashtable_insert(pdcp_coll_p, key_defaultDRB, pdcp_p);
} else {
h_defaultDRB_rc = HASH_TABLE_OK; // do not trigger any error handling if this is not a default DRB
}
if (h_defaultDRB_rc != HASH_TABLE_OK) {
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_ADD ADD default DRB key 0x%"PRIx64" FAILED\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
key_defaultDRB);
free(pdcp_p);
return TRUE;
} else
#endif
if (h_rc != HASH_TABLE_OK) {
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_ADD ADD key 0x%"PRIx64" FAILED\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
......@@ -1297,7 +1337,9 @@ rrc_pdcp_config_asn1_req (
for (cnt=0; cnt<drb2release_list_pP->list.count; cnt++) {
pdrb_id_p = drb2release_list_pP->list.array[cnt];
drb_id = *pdrb_id_p;
#if 0 // 2016-05-27 wilson : fixing the hard-coded mapping between DRB-id <-> LC-id
lc_id = drb_id + 2;
#endif
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, srb_id, SRB_FLAG_NO);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
......@@ -1308,6 +1350,10 @@ rrc_pdcp_config_asn1_req (
continue;
}
#ifndef ASTRI_FIX // 2016-05-27 wilson : fixing the hard-coded mapping between DRB-id <-> LC-id
lc_id = pdcp_p->lcid;
#endif
action = CONFIG_ACTION_REMOVE;
pdcp_config_req_asn1 (
ctxt_pP,
......@@ -1326,6 +1372,22 @@ rrc_pdcp_config_asn1_req (
kRRCint_pP,
kUPenc_pP);
h_rc = hashtable_remove(pdcp_coll_p, key);
#ifndef ASTRI_FIX // 2016-05-28 wilson : remember the default DRB
if ((defaultDRB != NULL) && (*defaultDRB == drb_id)) {
// this is the default DRB being removed, although this is not allowed in standard
key_defaultDRB = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag);
h_defaultDRB_rc = hashtable_get(pdcp_coll_p, key_defaultDRB, (void**)&pdcp_p);
if (h_defaultDRB_rc == HASH_TABLE_OK) {
h_defaultDRB_rc = hashtable_remove(pdcp_coll_p, key_defaultDRB);
} else {
LOG_E(PDCP, PROTOCOL_CTXT_FMT" PDCP REMOVE FAILED default DRB\n", PROTOCOL_CTXT_ARGS(ctxt_pP));
}
} else {
key_defaultDRB = HASH_TABLE_OK; // do not trigger any error handling if this is not a default DRB
}
#endif
}
}
......
......@@ -279,6 +279,7 @@ public_pdcp(void rrc_pdcp_config_req (
* \param[in] kRRCenc RRC encryption key
* \param[in] kRRCint RRC integrity key
* \param[in] kUPenc User-Plane encryption key
* \param[in] defaultDRB Default DRB ID
* \return A status about the processing, OK or error code.
*/
public_pdcp(
......@@ -294,6 +295,7 @@ public_pdcp(
#ifdef Rel10
,PMCH_InfoList_r9_t *pmch_InfoList_r9
#endif
,rb_id_t *const defaultDRB // 2016-05-28 wilson : remember the default DRB
));
/*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
......@@ -467,12 +469,28 @@ protected_pdcp(unsigned char pdcp_input_sdu_buffer[MAX_IP_PACKET_SIZE];
protected_pdcp(sdu_size_t pdcp_input_index_header;)
protected_pdcp(sdu_size_t pdcp_input_sdu_size_read;)
protected_pdcp(sdu_size_t pdcp_input_sdu_remaining_size_to_read;)
#define PDCP_COLL_KEY_VALUE(mODULE_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \
((hash_key_t)mODULE_iD | \
(((hash_key_t)(rNTI)) << 8) | \
(((hash_key_t)(iS_eNB)) << 24) | \
(((hash_key_t)(rB_iD)) << 25) | \
(((hash_key_t)(iS_sRB)) << 33))
(((hash_key_t)(iS_sRB)) << 33) | \
(((hash_key_t)(0x55)) << 34))
#ifndef ASTRI_FIX // 2016-05-28 wilson : for remeber the default DRB
// hash key to the same PDCP as indexed by PDCP_COLL_KEY_VALUE(... rB_iD, iS_sRB=0) where rB_iD
// is the default DRB ID. The hidden code 0x55 indicates the key is indexed by (rB_iD,is_sRB)
// whereas the hidden code 0xaa indicates the key is for default DRB only
#define PDCP_COLL_KEY_DEFAULT_DRB_VALUE(mODULE_iD, rNTI, iS_eNB) \
((hash_key_t)mODULE_iD | \
(((hash_key_t)(rNTI)) << 8) | \
(((hash_key_t)(iS_eNB)) << 24) | \
(((hash_key_t)(0xff)) << 25) | \
(((hash_key_t)(0x00)) << 33) | \
(((hash_key_t)(0xaa)) << 34))
#endif
// service id max val is maxServiceCount = 16 (asn1_constants.h)
......
......@@ -75,6 +75,7 @@ extern int otg_enabled;
#ifdef PDCP_USE_NETLINK
#include <sys/socket.h>
#include <linux/netlink.h>
#include "NETWORK_DRIVER/UE_IP/constant.h"
extern char nl_rx_buf[NL_MAX_PAYLOAD];
extern struct sockaddr_nl nas_src_addr, nas_dest_addr;
......@@ -194,7 +195,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
ret = sendmsg(nas_sock_fd,&nas_msg_tx,0);
if (ret<0) {
LOG_D(PDCP, "[PDCP_FIFOS] sendmsg returns %d (errno: %d)\n", ret, errno);
LOG_E(PDCP, "[PDCP_FIFOS] sendmsg returns %d (errno: %d)\n", ret, errno);
MSC_LOG_TX_MESSAGE_FAILED(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
......@@ -499,6 +500,10 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
ctxt.frame = ctxt_cpy.frame;
ctxt.enb_flag = ctxt_cpy.enb_flag;
#ifdef PDCP_DEBUG
LOG_I(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d\n", pdcp_read_header_g.rb_id);
#endif
if (ctxt_cpy.enb_flag) {
ctxt.module_id = 0;
rab_id = pdcp_read_header_g.rb_id % maxDRB;
......@@ -594,11 +599,26 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
}
} else { // enb_flag
if (rab_id != 0) {
rab_id = rab_id % maxDRB;
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
#ifndef ASTRI_FIX // 2016-05-30 wilson : fix hard-code default DRB ID
if (rab_id == UE_IP_DEFAULT_RAB_ID) {
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
} else
#endif
{
rab_id = rab_id % maxDRB;
LOG_D(PDCP, "PDCP_COLL_KEY_VALUE(module_id=%d, rnti=%x, enb_flag=%d, rab_id=%d, SRB_FLAG=%d)\n",
ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
}
if (h_rc == HASH_TABLE_OK) {
#ifndef ASTRI_FIX // 2016-05-30 wilson : fix default DRB-ID to be configurable
rab_id = pdcp_p->rb_id;
#endif
#ifdef PDCP_DEBUG
LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n",
ctxt.frame,
......
......@@ -120,7 +120,8 @@ config_req_rlc_am (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
rlc_am_info_t * const config_am_pP,
const rb_id_t rb_idP
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP // 2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC
)
{
rlc_union_t *rlc_union_p = NULL;
......@@ -142,7 +143,7 @@ config_req_rlc_am (
config_am_pP->t_reordering,
config_am_pP->t_status_prohibit);
rlc_am_init(ctxt_pP, l_rlc_p);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP, chan_idP);
rlc_am_configure(ctxt_pP, l_rlc_p,
config_am_pP->max_retx_threshold,
config_am_pP->poll_pdu,
......@@ -167,7 +168,8 @@ void config_req_rlc_am_asn1 (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const struct RLC_Config__am * const config_am_pP,
const rb_id_t rb_idP)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP) // 2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC
{
rlc_union_t *rlc_union_p = NULL;
rlc_am_entity_t *l_rlc_p = NULL;
......@@ -208,7 +210,7 @@ void config_req_rlc_am_asn1 (
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
rlc_am_init(ctxt_pP, l_rlc_p);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP, chan_idP);
rlc_am_configure(ctxt_pP, l_rlc_p,
maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold],
pollPDU_tab[config_am_pP->ul_AM_RLC.pollPDU],
......
......@@ -135,31 +135,35 @@ public_rlc_am(void rlc_am_release (
* @{
*/
/*! \fn void config_req_rlc_am (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, rlc_am_info_t * config_amP, rb_id_t rb_idP)
/*! \fn void config_req_rlc_am (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, rlc_am_info_t * config_amP, rb_id_t rb_idP, logical_chan_id_t chan_idP)
* \brief Configure the UL and DL parameters of the RLC AM
* \param[in] ctxt_pP Running context.
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] config_amP Configuration parameters for RLC AM instance.
* \param[in] rb_idP Radio bearer identifier.
* \param[in] chan_idP Transport channel identifier.
*/
public_rlc_am(void config_req_rlc_am (
const protocol_ctxt_t* const ctxtP,
const srb_flag_t srb_flagP,
const rlc_am_info_t * const config_amP,
const rb_id_t rb_idP);)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP);) // 2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC
/*! \fn void config_req_rlc_am_asn1 (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, struct RLC_Config__am * config_amP, rb_id_t rb_idP)
/*! \fn void config_req_rlc_am_asn1 (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, struct RLC_Config__am * config_amP, rb_id_t rb_idP, logical_chan_id_t chan_idP)
* \brief Configure the UL and DL parameters of the RLC AM with the asn1c autogenerated pameters structs
* \param[in] ctxt_pP Running context.
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] config_amP Configuration parameters for RLC AM instance.
* \param[in] rb_idP Radio bearer identifier.
* \param[in] chan_idP Transport channel identifier.
*/
public_rlc_am(void config_req_rlc_am_asn1 (
const protocol_ctxt_t* const ctxtP,
const srb_flag_t srb_flagP,
const struct RLC_Config__am * const config_amP,
const rb_id_t rb_idP);)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP);) // 2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC
/** @} */
......
......@@ -253,10 +253,13 @@ rlc_am_set_debug_infos(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP) // 2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC)
{
rlc_pP->rb_id = rb_idP;
#ifndef ASTRI_FIX // 2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC)
rlc_pP->channel_id = chan_idP;
#endif
if (srb_flagP) {
rlc_pP->is_data_plane = 0;
......
......@@ -112,13 +112,15 @@ public_rlc_am_init( void rlc_am_configure(const protocol_ctxt_t* const ctxtP,
const uint32_t t_reorderingP,
const uint32_t t_status_prohibitP);)
/*! \fn void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP)
* \brief Set informations that will be displayed in traces, helping the debug process.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] rb_idP Radio bearer identifier.
* \param[in] chan_idP Transport channel identifier.
*/
public_rlc_am_init( void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP);)
public_rlc_am_init( void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, const logical_chan_id_t chan_idP /*2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC)*/);)
/** @} */
#endif
......@@ -705,8 +705,8 @@ void rlc_am_v9_3_0_test_tx_rx()
rlc_am_init(&g_am_tx, g_frame);
rlc_am_init(&g_am_rx, g_frame);
rlc_am_set_debug_infos(&g_am_tx, g_frame, 0, 0, 0, 1);
rlc_am_set_debug_infos(&g_am_rx, g_frame, 1, 1, 1, 1);
rlc_am_set_debug_infos(&g_am_tx, g_frame, 0, 0, 0, 1, 1 /* LC-id = DRB-id */);
rlc_am_set_debug_infos(&g_am_rx, g_frame, 1, 1, 1, 1, 1 /* LC-id = DRB-id */);
rlc_am_configure(&g_am_tx, g_frame, max_retx_threshold, poll_pdu, poll_byte, t_poll_retransmit, t_reordering, t_status_prohibit);
rlc_am_configure(&g_am_rx, g_frame, max_retx_threshold, poll_pdu, poll_byte, t_poll_retransmit, t_reordering, t_status_prohibit);
......
......@@ -36,7 +36,8 @@ void config_req_rlc_tm (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rlc_tm_info_t * const config_tmP,
const rb_id_t rb_idP
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP
)
{
rlc_union_t *rlc_union_p = NULL;
......@@ -55,7 +56,11 @@ void config_req_rlc_tm (
rlc_tm_init(ctxt_pP, rlc_p);
rlc_p->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_tm_set_debug_infos(ctxt_pP, rlc_p, rb_idP, srb_flagP);
#ifdef ASTRI_FIX
rlc_tm_set_debug_infos(ctxt_pP, rlc_p, srb_flagP, rb_idP); // 2016-05-27 wilson : fix incorrect argument ordering!
#else
rlc_tm_set_debug_infos(ctxt_pP, rlc_p, srb_flagP, rb_idP, chan_idP); // 2016-05-27 wilson : fix DRB-id <-> LC-id mapping
#endif
rlc_tm_configure(ctxt_pP, rlc_p, config_tmP->is_uplink_downlink);
} else {
LOG_E(RLC, PROTOCOL_RLC_TM_CTXT_FMT" CONFIG_REQ RB %u RLC NOT FOUND\n",
......@@ -151,9 +156,11 @@ void rlc_tm_set_debug_infos(
const protocol_ctxt_t* const ctxt_pP,
rlc_tm_entity_t * const rlcP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP) // 2016-05-27 wilson : fixing the DRB-id <-> LC-id mapping
{
rlcP->rb_id = rb_idP;
rlcP->rb_id = rb_idP;
rlcP->channel_id = chan_idP;
if (srb_flagP) {
rlcP->is_data_plane = 0;
......
......@@ -80,13 +80,14 @@ typedef volatile struct rlc_tm_info_s {
* \param[in] srb_flagP Flag to indicate SRB (1) or DRB (0)
* \param[in] config_tmP Configuration parameters for RLC TM instance.
* \param[in] rb_idP Radio bearer identifier.
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] chan_idP Transport channel identifier.
*/
public_rlc_tm_init( void config_req_rlc_tm (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rlc_tm_info_t * const config_tmP,
const rb_id_t rb_idP);)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP);) // 2016-05-27 wilson : fixing DRB-id <-> LC-id mapping
/*! \fn void rlc_tm_init (const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP)
* \brief Initialize a RLC TM protocol instance, initialize all variables, lists, allocate buffers for making this instance ready to be configured with protocol configuration parameters. After this initialization the RLC TM protocol instance will be in RLC_NULL_STATE state.
......@@ -127,11 +128,14 @@ protected_rlc_tm_init(void rlc_tm_configure(
* \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] rb_idP Radio bearer identifier.
* \param[in] chan_idP Transport channel identifier
*/
protected_rlc_tm_init(void rlc_tm_set_debug_infos(
const protocol_ctxt_t* const ctxt_pP,
rlc_tm_entity_t * const rlcP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP);)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP);) /*2016-05-27 wilson : added this argument for storing the DRB-id <-> LC-id mapping in RLC)*/
/** @} */
# endif
......@@ -47,7 +47,8 @@ void config_req_rlc_um (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rlc_um_info_t * const config_um_pP,
const rb_id_t rb_idP)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP)
{
rlc_union_t *rlc_union_p = NULL;
rlc_um_entity_t *rlc_p = NULL;
......@@ -68,7 +69,7 @@ void config_req_rlc_um (
rlc_um_init(ctxt_pP, rlc_p);
if (rlc_um_fsm_notify_event (ctxt_pP, rlc_p, RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT)) {
rlc_um_set_debug_infos(ctxt_pP, rlc_p, srb_flagP, rb_idP);
rlc_um_set_debug_infos(ctxt_pP, rlc_p, srb_flagP, rb_idP, chan_idP);
rlc_um_configure(
ctxt_pP,
rlc_p,
......@@ -94,7 +95,8 @@ void config_req_rlc_um_asn1 (
const mbms_service_id_t mbms_service_idP,
const UL_UM_RLC_t * const ul_rlc_pP,
const DL_UM_RLC_t * const dl_rlc_pP,
const rb_id_t rb_idP)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP)
{
uint32_t ul_sn_FieldLength = 0;
uint32_t dl_sn_FieldLength = 0;
......@@ -142,7 +144,7 @@ void config_req_rlc_um_asn1 (
if (rlc_um_fsm_notify_event (ctxt_pP, rlc_p, RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT)) {
rlc_um_set_debug_infos(ctxt_pP,rlc_p, srb_flagP, rb_idP);
rlc_um_set_debug_infos(ctxt_pP,rlc_p, srb_flagP, rb_idP, chan_idP);
if (ul_rlc_pP != NULL) {
switch (ul_rlc_pP->sn_FieldLength) {
......@@ -423,14 +425,16 @@ void rlc_um_configure(
void rlc_um_set_debug_infos(
const protocol_ctxt_t* const ctxt_pP,
rlc_um_entity_t * const rlc_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP)
const srb_flag_t srb_flagP,
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP) // 2016-05-27 wilson : fixing DRB-id <-> LC-id mapping
{
LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" [SET DEBUG INFOS] rb_id %d srb_flag %d\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP),
rb_idP,
srb_flagP);
rlc_pP->rb_id = rb_idP;
rlc_pP->rb_id = rb_idP;
rlc_pP->channel_id = chan_idP; // 2016-05-27 wilson : fixing DRB-id <-> LC-id mapping
if (srb_flagP) {
rlc_pP->is_data_plane = 0;
......
......@@ -84,12 +84,14 @@ typedef volatile struct {
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] config_umP Configuration parameters for RLC UM instance.
* \param[in] rb_idP Radio bearer identifier.
* \param[in] chan_idP Transport channel identifier.
*/
public_rlc_um_control_primitives( void config_req_rlc_um (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rlc_um_info_t * const config_umP,
const rb_id_t rb_idP);)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP);) // 2016-05-27 wilson : fixing DRB-id <-> LC-id mapping
/*! \fn void config_req_rlc_um_asn1 (
* const protocol_ctxt_t* const ctxt_pP,
......@@ -109,6 +111,7 @@ public_rlc_um_control_primitives( void config_req_rlc_um (
* \param[in] ul_rlc_pP Configuration parameters for RLC UM UL instance.
* \param[in] dl_rlc_pP Configuration parameters for RLC UM DL instance.
* \param[in] rb_idP Radio bearer identifier.
* \param[in] chan_idP Transport channel identifier.
*/
public_rlc_um_control_primitives( void config_req_rlc_um_asn1 (
const protocol_ctxt_t* const ctxt_pP,
......@@ -118,7 +121,8 @@ public_rlc_um_control_primitives( void config_req_rlc_um_asn1 (
const mbms_service_id_t mbms_service_idP,
const UL_UM_RLC_t * const ul_rlc_pP,
const DL_UM_RLC_t * const dl_rlc_pP,
const rb_id_t rb_idP);)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP);) // 2016-05-27 wilson : fixing DRB-id <-> LC-id mapping
/*! \fn void rlc_um_init (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
* \brief Initialize a RLC UM protocol instance, initialize all variables, lists, allocate buffers for making this instance ready to be configured with protocol configuration parameters. After this initialization the RLC UM protocol instance will be in RLC_NULL_STATE state.
......@@ -176,13 +180,15 @@ protected_rlc_um_control_primitives(void rlc_um_configure(
* \brief Set debug informations for a RLC UM protocol instance, these informations are only for trace purpose.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC UM protocol instance pointer.
* \param[in] rb_idP Radio bearer identifier.
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] rb_idP Radio bearer identifier.
* \param[in] chan_idP Transport channel identifier.
*/
protected_rlc_um_control_primitives(void rlc_um_set_debug_infos(
const protocol_ctxt_t* const ctxt_pP,
rlc_um_entity_t * const rlc_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP);)
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP);) // 2016-05-27 wilson : fixing DRB-id <-> LC-id mapping
/** @} */
# endif
......@@ -195,8 +195,8 @@ void rlc_um_v9_3_0_test_windows_10()
rlc_um_init(&um1);
rlc_um_init(&um2);
rlc_um_set_debug_infos(&um1, g_frame, 0, 0, 0, 1);
rlc_um_set_debug_infos(&um2, g_frame, 1, 1, 1, 1);
rlc_um_set_debug_infos(&um1, g_frame, 0, 0, 0, 1, 1 /*LC-id = RAB-id*/);
rlc_um_set_debug_infos(&um2, g_frame, 1, 1, 1, 1, 1 /*LC-id = RAB-id*/);
rlc_um_configure(&um1, g_frame, timer_reordering, sn_field_length, sn_field_length, is_mXch);
rlc_um_configure(&um2, g_frame, timer_reordering, sn_field_length, sn_field_length, is_mXch);
......@@ -249,8 +249,8 @@ void rlc_um_v9_3_0_test_windows_5()
rlc_um_init(&um1);
rlc_um_init(&um2);
rlc_um_set_debug_infos(&um1, g_frame, 0, 0, 0, 1);
rlc_um_set_debug_infos(&um2, g_frame, 1, 1, 1, 1);
rlc_um_set_debug_infos(&um1, g_frame, 0, 0, 0, 1, 1 /* LC-id = DRB-id */);
rlc_um_set_debug_infos(&um2, g_frame, 1, 1, 1, 1, 1 /* LC-id = DRB-id */);
rlc_um_configure(&um1, g_frame, timer_reordering, sn_field_length, sn_field_length, is_mXch);
rlc_um_configure(&um2, g_frame, timer_reordering, sn_field_length, sn_field_length, is_mXch);
......@@ -621,8 +621,8 @@ void rlc_um_v9_3_0_test_reordering(uint32_t sn_field_lengthP)
um_info.is_mXch = 0;
srand (0);
config_req_rlc_um (&um_tx, 0,0,0, &um_info, 0, SIGNALLING_RADIO_BEARER);
config_req_rlc_um (&um_rx, 0,1,1, &um_info, 1, SIGNALLING_RADIO_BEARER);
config_req_rlc_um (&um_tx, 0,0,0, &um_info, 0, SIGNALLING_RADIO_BEARER, SIGNALLING_RADIO_BEARER /*LC-id = DRB-id*/);
config_req_rlc_um (&um_rx, 0,1,1, &um_info, 1, SIGNALLING_RADIO_BEARER, SIGNALLING_RADIO_BEARER /*LC-id = DRB-id*/);
rlc_um_display_rx_window(&um_tx);
......@@ -743,8 +743,8 @@ void rlc_um_v9_3_0_test_tx_rx_10(void)
um_info.is_mXch = 0;
srand (0);
config_req_rlc_um (&um_tx, 0,0,0, &um_info, 0, SIGNALLING_RADIO_BEARER);
config_req_rlc_um (&um_rx, 0,1,1, &um_info, 1, SIGNALLING_RADIO_BEARER);
config_req_rlc_um (&um_tx, 0,0,0, &um_info, 0, SIGNALLING_RADIO_BEARER, SIGNALLING_RADIO_BEARER /*LC-id = DRB-id*/);
config_req_rlc_um (&um_rx, 0,1,1, &um_info, 1, SIGNALLING_RADIO_BEARER, SIGNALLING_RADIO_BEARER /*LC-id = DRB-id*/);
rlc_um_display_rx_window(&um_tx);
......@@ -1072,8 +1072,8 @@ void rlc_um_v9_3_0_test_tx_rx_5(void)
um_info.is_mXch = 0;
srand (0);
config_req_rlc_um (&um_tx, 0,0,0, &um_info, 0, SIGNALLING_RADIO_BEARER);
config_req_rlc_um (&um_rx, 0,1,1, &um_info, 1, SIGNALLING_RADIO_BEARER);
config_req_rlc_um (&um_tx, 0,0,0, &um_info, 0, SIGNALLING_RADIO_BEARER, SIGNALLING_RADIO_BEARER /*LC-id = DRB-id*/);
config_req_rlc_um (&um_rx, 0,1,1, &um_info, 1, SIGNALLING_RADIO_BEARER, SIGNALLING_RADIO_BEARER /*LC-id = DRB-id*/);
rlc_um_display_rx_window(&um_tx);
......
......@@ -269,7 +269,18 @@ public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[NUMBER_OF_eNB_MAX][NB_RB_
(((hash_key_t)(rNTI)) << 8) | \
(((hash_key_t)(iS_eNB)) << 24) | \
(((hash_key_t)(rB_iD)) << 25) | \
(((hash_key_t)(iS_sRB)) << 33))
(((hash_key_t)(iS_sRB)) << 33) | \
(((hash_key_t)(0x05)) << 34))
// index to the same RLC entity as RLC_COLL_KEY_VALUE(), but using LC_id instead
// the hidden last key indicates if this is a hash-key with RB_id (0x05) or LC_id (0x0a)
#define RLC_COLL_KEY_LCID_VALUE(eNB_iD, rNTI, iS_eNB, lC_iD, iS_sRB) \
((hash_key_t)eNB_iD | \
(((hash_key_t)(rNTI)) << 8) | \
(((hash_key_t)(iS_eNB)) << 24) | \
(((hash_key_t)(lC_iD)) << 25) | \
(((hash_key_t)(iS_sRB)) << 33) | \
(((hash_key_t)(0x0a)) << 34))
// service id max val is maxServiceCount = 16 (asn1_constants.h)
......
......@@ -136,7 +136,7 @@ tbs_size_t mac_rlc_data_req(
{
//-----------------------------------------------------------------------------
struct mac_data_req data_request;
rb_id_t rb_id = 0;
// rb_id_t rb_id = 0; // 2016-05-27 wilson : not needed after DRB-id <-> LC-id mapping fix
rlc_mode_t rlc_mode = RLC_MODE_NONE;
rlc_mbms_id_t *mbms_id_p = NULL;
rlc_union_t *rlc_union_p = NULL;
......@@ -179,6 +179,7 @@ tbs_size_t mac_rlc_data_req(
return (tbs_size_t)0;
}
} else {
#ifdef ASTRI_FIX // 2016-05-27 wilson : fixing the DRB-id <-> LC-id mapping
if (channel_idP > 2) {
rb_id = channel_idP - 2;
} else {
......@@ -186,6 +187,9 @@ tbs_size_t mac_rlc_data_req(
}
key = RLC_COLL_KEY_VALUE(module_idP, rntiP, enb_flagP, rb_id, srb_flag);
#else
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
#endif
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......@@ -194,7 +198,7 @@ tbs_size_t mac_rlc_data_req(
rlc_mode = rlc_union_p->mode;
} else {
rlc_mode = RLC_MODE_NONE;
AssertFatal (0 , "RLC not configured rb id %u lcid %u RNTI %x!\n", rb_id, channel_idP, rntiP);
AssertFatal (0 , "RLC not configured lcid %u RNTI %x!\n", channel_idP, rntiP);
}
switch (rlc_mode) {
......@@ -244,7 +248,7 @@ void mac_rlc_data_ind (
crc_t *crcs_pP)
{
//-----------------------------------------------------------------------------
rb_id_t rb_id = 0;
// rb_id_t rb_id = 0; // 2016-05-27 wilson : not needed after DRB-id <-> LC-id mapping fix
rlc_mode_t rlc_mode = RLC_MODE_NONE;
rlc_mbms_id_t *mbms_id_p = NULL;
rlc_union_t *rlc_union_p = NULL;
......@@ -294,6 +298,7 @@ void mac_rlc_data_ind (
return;
}
} else {
#ifdef ASTRI_FIX // 2016-05-27 wilson : fixing the DRB-id <-> LC-id mapping
if (channel_idP > 2) {
rb_id = channel_idP - 2;
} else {
......@@ -301,6 +306,9 @@ void mac_rlc_data_ind (
}
key = RLC_COLL_KEY_VALUE(module_idP, rntiP, enb_flagP, rb_id, srb_flag);
#else
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
#endif
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......@@ -350,7 +358,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
mac_rlc_status_resp_t mac_rlc_status_resp;
struct mac_status_ind tx_status;
struct mac_status_resp status_resp;
rb_id_t rb_id = 0;
// rb_id_t rb_id = 0; // 2016-05-27 wilson : not needed after DRB-id <-> LC-id mapping fix
rlc_mode_t rlc_mode = RLC_MODE_NONE;
rlc_mbms_id_t *mbms_id_p = NULL;
rlc_union_t *rlc_union_p = NULL;
......@@ -399,6 +407,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
key = RLC_COLL_KEY_MBMS_VALUE(module_idP, rntiP, enb_flagP, mbms_id_p->service_id, mbms_id_p->session_id);
} else {
#ifdef ASTRI_FIX // 2016-05-27 wilson : fixing the DRB-id <-> LC-id mapping
if (channel_idP > 2) {
rb_id = channel_idP - 2;
} else {
......@@ -406,6 +415,9 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
}
key = RLC_COLL_KEY_VALUE(module_idP, rntiP, enb_flagP, rb_id, srb_flag);
#else
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
#endif
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......
This diff is collapsed.
......@@ -506,6 +506,9 @@ typedef struct UE_RRC_INST_s {
struct SRB_ToAddMod *SRB1_config[NB_CNX_UE];
struct SRB_ToAddMod *SRB2_config[NB_CNX_UE];
struct DRB_ToAddMod *DRB_config[NB_CNX_UE][8];
#ifndef ASTRI_FIX
rb_id_t *defaultDRB; // 2015-05-27 wilson : remember the default DRB ID
#endif
MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
struct ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG];
struct QuantityConfig *QuantityConfig[NB_CNX_UE];
......
......@@ -1060,7 +1060,7 @@ rrc_ue_process_radioResourceConfigDedicated(