Commit 4e0e0191 authored by Fabrice Nabet's avatar Fabrice Nabet

Merge branch '8-bugfix-drb-lcid-map' into 'develop1B'

Resolve "OAI UE  does not configure logical-channel ID and data radio bearer ID according to RRCConnectionReconfiguration message"

Closes #8

See merge request !2
parents f8061760 6feb848e
......@@ -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
)
//-----------------------------------------------------------------------------
{
......@@ -1086,6 +1087,8 @@ rrc_pdcp_config_asn1_req (
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc;
hash_key_t key_defaultDRB = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_defaultDRB_rc;
#ifdef Rel10
int i,j;
MBMS_SessionInfoList_r9_t *mbms_SessionInfoList_r9_p = NULL;
......@@ -1106,7 +1109,7 @@ 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;
lc_id = srb_id;// + 2;
lc_id = srb_id;
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 +1189,19 @@ rrc_pdcp_config_asn1_req (
drb_toaddmod_p = drb2add_list_pP->list.array[cnt];
drb_id = drb_toaddmod_p->drb_Identity;// + drb_id_offset;
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;
}
lc_id = drb_id + 2;
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,7 +1217,21 @@ rrc_pdcp_config_asn1_req (
pdcp_p = calloc(1, sizeof(pdcp_t));
h_rc = hashtable_insert(pdcp_coll_p, key, pdcp_p);
if (h_rc != HASH_TABLE_OK) {
// save the first configured DRB-ID as the default DRB-ID
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 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),
key);
......@@ -1297,7 +1325,6 @@ 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;
lc_id = drb_id + 2;
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);
......@@ -1307,6 +1334,7 @@ rrc_pdcp_config_asn1_req (
drb_id);
continue;
}
lc_id = pdcp_p->lcid;
action = CONFIG_ACTION_REMOVE;
pdcp_config_req_asn1 (
......@@ -1326,6 +1354,20 @@ rrc_pdcp_config_asn1_req (
kRRCint_pP,
kUPenc_pP);
h_rc = hashtable_remove(pdcp_coll_p, key);
if ((defaultDRB != NULL) && (*defaultDRB == drb_id)) {
// default DRB being removed. nevertheless this shouldn't happen as removing default DRB 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
}
}
}
......
......@@ -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
));
/*! \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,25 @@ 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))
// 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))
// 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,21 @@ 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);
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 {
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) {
rab_id = pdcp_p->rb_id;
#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
)
{
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)
{
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);)
/*! \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);)
/** @} */
......
......@@ -253,10 +253,11 @@ 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)
{
rlc_pP->rb_id = rb_idP;
rlc_pP->channel_id = chan_idP;
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);)
/** @} */
#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,7 @@ 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);
rlc_tm_set_debug_infos(ctxt_pP, rlc_p, srb_flagP, rb_idP, chan_idP);
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 +152,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)
{
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);)
/*! \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);)
/** @} */
# 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)
{
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;
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);)
/*! \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);)
/*! \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);)
/** @} */
# 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,6 @@ tbs_size_t mac_rlc_data_req(
{
//-----------------------------------------------------------------------------
struct mac_data_req data_request;
rb_id_t rb_id = 0;
rlc_mode_t rlc_mode = RLC_MODE_NONE;
rlc_mbms_id_t *mbms_id_p = NULL;
rlc_union_t *rlc_union_p = NULL;
......@@ -179,13 +178,7 @@ tbs_size_t mac_rlc_data_req(
return (tbs_size_t)0;
}
} else {
if (channel_idP > 2) {
rb_id = channel_idP - 2;
} else {
rb_id = channel_idP;
}
key = RLC_COLL_KEY_VALUE(module_idP, rntiP, enb_flagP, rb_id, srb_flag);
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......@@ -194,7 +187,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 +237,6 @@ void mac_rlc_data_ind (
crc_t *crcs_pP)
{
//-----------------------------------------------------------------------------
rb_id_t rb_id = 0;
rlc_mode_t rlc_mode = RLC_MODE_NONE;
rlc_mbms_id_t *mbms_id_p = NULL;
rlc_union_t *rlc_union_p = NULL;
......@@ -294,13 +286,7 @@ void mac_rlc_data_ind (
return;
}
} else {
if (channel_idP > 2) {
rb_id = channel_idP - 2;
} else {
rb_id = channel_idP;
}
key = RLC_COLL_KEY_VALUE(module_idP, rntiP, enb_flagP, rb_id, srb_flag);
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......@@ -350,7 +336,6 @@ 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;
rlc_mode_t rlc_mode = RLC_MODE_NONE;
rlc_mbms_id_t *mbms_id_p = NULL;
rlc_union_t *rlc_union_p = NULL;
......@@ -399,13 +384,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 {
if (channel_idP > 2) {
rb_id = channel_idP - 2;
} else {
rb_id = channel_idP;
}
key = RLC_COLL_KEY_VALUE(module_idP, rntiP, enb_flagP, rb_id, srb_flag);
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......
This diff is collapsed.
......@@ -506,6 +506,7 @@ 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];
rb_id_t *defaultDRB; // remember the ID of the default DRB
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(
#ifdef Rel10
,(PMCH_InfoList_r9_t *)NULL
#endif
);
,NULL);
// Refresh SRBs
rrc_rlc_config_asn1_req(ctxt_pP,
......@@ -1200,6 +1200,15 @@ rrc_ue_process_radioResourceConfigDedicated(
// Establish DRBs if present
if (radioResourceConfigDedicated->drb_ToAddModList) {
if ( (UE_rrc_inst[ctxt_pP->module_id].defaultDRB == NULL) &&
(radioResourceConfigDedicated->drb_ToAddModList->list.count >= 1) ) {
// configure the first DRB ID as the default DRB ID
UE_rrc_inst[ctxt_pP->module_id].defaultDRB = malloc(sizeof(rb_id_t));
*UE_rrc_inst[ctxt_pP->module_id].defaultDRB = radioResourceConfigDedicated->drb_ToAddModList->list.array[0]->drb_Identity;
LOG_I(RRC,"[UE %d] default DRB = %d\n",ctxt_pP->module_id, *UE_rrc_inst[ctxt_pP->module_id].defaultDRB);
}
uint8_t *kUPenc = NULL;
#if defined(ENABLE_SECURITY)
......@@ -1231,7 +1240,7 @@ rrc_ue_process_radioResourceConfigDedicated(
#ifdef Rel10
,(PMCH_InfoList_r9_t *)NULL
#endif
);
, UE_rrc_inst[ctxt_pP->module_id].defaultDRB);
// Refresh DRBs
rrc_rlc_config_asn1_req(ctxt_pP,
......@@ -1725,7 +1734,7 @@ rrc_ue_process_mobilityControlInfo(
#ifdef Rel10
,NULL
#endif
);
,NULL);
rrc_rlc_config_asn1_req(NB_eNB_INST+ue_mod_idP, frameP,0,eNB_index,
NULL,// SRB_ToAddModList
......@@ -1734,7 +1743,7 @@ rrc_ue_process_mobilityControlInfo(
#ifdef Rel10
,NULL
#endif
);
,NULL);
*/
......@@ -3906,7 +3915,7 @@ static void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_i
#ifdef Rel10
,&(UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9)
#endif
);
,NULL);
rrc_rlc_config_asn1_req(&ctxt,
NULL,// SRB_ToAddModList
......
......@@ -481,7 +481,7 @@ static void init_MBMS(
# ifdef Rel10
, &(eNB_rrc_inst[enb_mod_idP].carrier[CC_id].mcch_message->pmch_InfoList_r9)
# endif
);
,NULL);
rrc_rlc_config_asn1_req(&ctxt,
NULL, // SRB_ToAddModList
......@@ -3282,7 +3282,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
#ifdef Rel10
, (PMCH_InfoList_r9_t *) NULL
#endif
);
,NULL);
rrc_rlc_config_asn1_req(&ctxt,
ue_context_pP->ue_context.SRB_configList,
......@@ -3524,7 +3524,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
#ifdef Rel10
, (PMCH_InfoList_r9_t *) NULL
#endif
);
,NULL);
// Refresh SRBs/DRBs
rrc_rlc_config_asn1_req(
ctxt_pP,
......@@ -4336,7 +4336,7 @@ rrc_eNB_decode_ccch(
# ifdef Rel10
, (PMCH_InfoList_r9_t *) NULL
# endif
);
,NULL);
rrc_rlc_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList,
......
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