Merge remote-tracking branch 'origin/develop' into NR_UL_scheduling
This commit is contained in:
@@ -2310,7 +2310,7 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, LTE_SL_Destin
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength, const char *dedicatedInfoNAS) {
|
||||
uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Transaction_id, uint8_t sel_plmn_id, const int dedicatedInfoNASLength, const char *dedicatedInfoNAS) {
|
||||
asn_enc_rval_t enc_rval;
|
||||
LTE_UL_DCCH_Message_t ul_dcch_msg;
|
||||
LTE_RRCConnectionSetupComplete_t *rrcConnectionSetupComplete;
|
||||
@@ -2323,7 +2323,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin
|
||||
rrcConnectionSetupComplete->criticalExtensions.choice.c1.present = LTE_RRCConnectionSetupComplete__criticalExtensions__c1_PR_rrcConnectionSetupComplete_r8;
|
||||
rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.nonCriticalExtension=CALLOC(1,
|
||||
sizeof(*rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.nonCriticalExtension));
|
||||
rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.selectedPLMN_Identity= 1;
|
||||
rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.selectedPLMN_Identity= sel_plmn_id;
|
||||
rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME =
|
||||
NULL;//calloc(1,sizeof(*rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME));
|
||||
/*
|
||||
|
||||
@@ -142,7 +142,11 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, LTE_SL_Destina
|
||||
/** \brief Generate an RRCConnectionSetupComplete UL-DCCH-Message (UE)
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength,
|
||||
uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id,
|
||||
uint8_t *buffer,
|
||||
const uint8_t Transaction_id,
|
||||
uint8_t sel_plmn_id,
|
||||
const int dedicatedInfoNASLength,
|
||||
const char *dedicatedInfoNAS);
|
||||
|
||||
/** \brief Generate an RRCConnectionReconfigurationComplete UL-DCCH-Message (UE)
|
||||
|
||||
+53
-38
@@ -128,8 +128,13 @@ static int decode_SIB1_MBMS( const protocol_ctxt_t *const ctxt_pP, const uint8_t
|
||||
* \param ctxt_pP Running context
|
||||
* \param eNB_index Index of corresponding eNB/CH
|
||||
* \param Transaction_id Transaction identifier
|
||||
* \param sel_plmn_id selected PLMN Identity
|
||||
*/
|
||||
static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id );
|
||||
static void rrc_ue_generate_RRCConnectionSetupComplete(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
const uint8_t Transaction_id,
|
||||
uint8_t sel_plmn_id);
|
||||
|
||||
/** \brief Generates/Encodes RRCConnectionReconfigurationComplete message at UE
|
||||
* \param ctxt_pP Running context
|
||||
@@ -367,6 +372,7 @@ char openair_rrc_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_
|
||||
rrc_set_state (ue_mod_idP, RRC_STATE_INACTIVE);
|
||||
rrc_set_sub_state (ue_mod_idP, RRC_SUB_STATE_INACTIVE);
|
||||
LOG_I(RRC,"[UE %d] INIT State = RRC_IDLE (eNB %d)\n",ctxt.module_id,eNB_index);
|
||||
UE_rrc_inst[ctxt.module_id].selected_plmn_identity = 1;
|
||||
UE_rrc_inst[ctxt.module_id].Info[eNB_index].State=RRC_IDLE;
|
||||
UE_rrc_inst[ctxt.module_id].Info[eNB_index].T300_active = 0;
|
||||
UE_rrc_inst[ctxt.module_id].Info[eNB_index].T304_active = 0;
|
||||
@@ -490,7 +496,11 @@ rrc_t310_expiration(
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id ) {
|
||||
static void rrc_ue_generate_RRCConnectionSetupComplete(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
const uint8_t Transaction_id,
|
||||
uint8_t sel_plmn_id) {
|
||||
uint8_t buffer[100];
|
||||
uint8_t size;
|
||||
const char *nas_msg;
|
||||
@@ -504,7 +514,7 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t *c
|
||||
nas_msg_length = sizeof(nas_attach_req_imsi);
|
||||
}
|
||||
|
||||
size = do_RRCConnectionSetupComplete(ctxt_pP->module_id, buffer, Transaction_id, nas_msg_length, nas_msg);
|
||||
size = do_RRCConnectionSetupComplete(ctxt_pP->module_id, buffer, Transaction_id, sel_plmn_id, nas_msg_length, nas_msg);
|
||||
LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n",
|
||||
ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index);
|
||||
LOG_D(RLC,
|
||||
@@ -624,7 +634,8 @@ int rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const SRB_INFO *co
|
||||
rrc_ue_generate_RRCConnectionSetupComplete(
|
||||
ctxt_pP,
|
||||
eNB_index,
|
||||
dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.rrc_TransactionIdentifier);
|
||||
dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.rrc_TransactionIdentifier,
|
||||
UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity);
|
||||
rval = 0;
|
||||
break;
|
||||
|
||||
@@ -2794,44 +2805,43 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
LTE_SystemInformationBlockType1_t *sib1 = UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index];
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SIB1, VCD_FUNCTION_IN );
|
||||
LOG_I( RRC, "[UE %d] : Dumping SIB 1\n", ctxt_pP->module_id );
|
||||
LTE_PLMN_Identity_t *PLMN_identity = &sib1->cellAccessRelatedInfo.plmn_IdentityList.list.array[0]->plmn_Identity;
|
||||
int mccdigits = PLMN_identity->mcc->list.count;
|
||||
int mncdigits = PLMN_identity->mnc.list.count;
|
||||
int mcc;
|
||||
const int n = sib1->cellAccessRelatedInfo.plmn_IdentityList.list.count;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
LTE_PLMN_Identity_t *PLMN_identity = &sib1->cellAccessRelatedInfo.plmn_IdentityList.list.array[i]->plmn_Identity;
|
||||
int mccdigits = PLMN_identity->mcc->list.count;
|
||||
int mncdigits = PLMN_identity->mnc.list.count;
|
||||
|
||||
if (mccdigits == 2) {
|
||||
mcc = *PLMN_identity->mcc->list.array[0]*10 + *PLMN_identity->mcc->list.array[1];
|
||||
} else {
|
||||
mcc = *PLMN_identity->mcc->list.array[0]*100 + *PLMN_identity->mcc->list.array[1]*10 + *PLMN_identity->mcc->list.array[2];
|
||||
int mcc;
|
||||
if (mccdigits == 2) {
|
||||
mcc = *PLMN_identity->mcc->list.array[0]*10 + *PLMN_identity->mcc->list.array[1];
|
||||
} else {
|
||||
mcc = *PLMN_identity->mcc->list.array[0]*100 + *PLMN_identity->mcc->list.array[1]*10 + *PLMN_identity->mcc->list.array[2];
|
||||
}
|
||||
|
||||
int mnc;
|
||||
if (mncdigits == 2) {
|
||||
mnc = *PLMN_identity->mnc.list.array[0]*10 + *PLMN_identity->mnc.list.array[1];
|
||||
} else {
|
||||
mnc = *PLMN_identity->mnc.list.array[0]*100 + *PLMN_identity->mnc.list.array[1]*10 + *PLMN_identity->mnc.list.array[2];
|
||||
}
|
||||
|
||||
LOG_I( RRC, "PLMN %d MCC %0*d, MNC %0*d\n", i + 1, mccdigits, mcc, mncdigits, mnc);
|
||||
// search internal table for provider name
|
||||
int plmn_ind = 0;
|
||||
|
||||
while (plmn_data[plmn_ind].mcc > 0) {
|
||||
if ((plmn_data[plmn_ind].mcc == mcc) && (plmn_data[plmn_ind].mnc == mnc)) {
|
||||
LOG_I( RRC, "Found %s (name from internal table)\n", plmn_data[plmn_ind].oper_short );
|
||||
break;
|
||||
}
|
||||
|
||||
plmn_ind++;
|
||||
}
|
||||
}
|
||||
|
||||
int mnc;
|
||||
|
||||
if (mncdigits == 2) {
|
||||
mnc = *PLMN_identity->mnc.list.array[0]*10 + *PLMN_identity->mnc.list.array[1];
|
||||
} else {
|
||||
mnc = *PLMN_identity->mnc.list.array[0]*100 + *PLMN_identity->mnc.list.array[1]*10 + *PLMN_identity->mnc.list.array[2];
|
||||
}
|
||||
|
||||
LOG_I( RRC, "PLMN MCC %0*d, MNC %0*d, TAC 0x%04x\n", mccdigits, mcc, mncdigits, mnc,
|
||||
LOG_I( RRC, "TAC 0x%04x\n",
|
||||
((sib1->cellAccessRelatedInfo.trackingAreaCode.size == 2)?((sib1->cellAccessRelatedInfo.trackingAreaCode.buf[0]<<8) + sib1->cellAccessRelatedInfo.trackingAreaCode.buf[1]):0));
|
||||
LOG_I( RRC, "cellReservedForOperatorUse : raw:%ld decoded:%s\n", sib1->cellAccessRelatedInfo.plmn_IdentityList.list.array[0]->cellReservedForOperatorUse,
|
||||
SIBreserved(sib1->cellAccessRelatedInfo.plmn_IdentityList.list.array[0]->cellReservedForOperatorUse) );
|
||||
// search internal table for provider name
|
||||
int plmn_ind = 0;
|
||||
|
||||
while (plmn_data[plmn_ind].mcc > 0) {
|
||||
if ((plmn_data[plmn_ind].mcc == mcc) && (plmn_data[plmn_ind].mnc == mnc)) {
|
||||
LOG_I( RRC, "Found %s (name from internal table)\n", plmn_data[plmn_ind].oper_short );
|
||||
break;
|
||||
}
|
||||
|
||||
plmn_ind++;
|
||||
}
|
||||
|
||||
if (plmn_data[plmn_ind].mcc < 0) {
|
||||
LOG_I( RRC, "Found Unknown operator (no entry in internal table)\n" );
|
||||
}
|
||||
|
||||
LOG_I( RRC, "cellAccessRelatedInfo.cellIdentity : raw:%"PRIu32" decoded:%02x.%02x.%02x.%02x\n",
|
||||
BIT_STRING_to_uint32( &sib1->cellAccessRelatedInfo.cellIdentity ),
|
||||
@@ -2970,6 +2980,7 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
NAS_CELL_SELECTION_CNF (msg_p).rsrp = rsrp;
|
||||
itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p);
|
||||
cell_valid = 1;
|
||||
UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity = plmn + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2980,7 +2991,11 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
MessageDef *msg_p;
|
||||
msg_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_NEXT_CELL_REQ);
|
||||
itti_send_msg_to_task(TASK_PHY_UE, ctxt_pP->instance, msg_p);
|
||||
LOG_E(RRC, "Synched with a cell, but PLMN doesn't match our SIM, the message PHY_FIND_NEXT_CELL_REQ is sent but lost in current UE implementation! \n");
|
||||
LOG_E(RRC,
|
||||
"Synched with a cell, but PLMN doesn't match our SIM "
|
||||
"(selected_plmn_identity %d), the message PHY_FIND_NEXT_CELL_REQ "
|
||||
"is sent but lost in current UE implementation!\n",
|
||||
UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -809,6 +809,7 @@ typedef struct UE_RRC_INST_s {
|
||||
Rrc_Sub_State_t RrcSubState;
|
||||
plmn_t plmnID;
|
||||
Byte_t rat;
|
||||
uint8_t selected_plmn_identity;
|
||||
as_nas_info_t initialNasMsg;
|
||||
OAI_UECapability_t *UECap;
|
||||
uint8_t *UECapability;
|
||||
|
||||
@@ -994,11 +994,14 @@ void put_UE_in_freelist(module_id_t mod_id, rnti_t rnti, boolean_t removeFlag) {
|
||||
pthread_mutex_unlock(&lock_ue_freelist);
|
||||
}
|
||||
|
||||
extern int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
extern int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
extern void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch);
|
||||
extern void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch);
|
||||
|
||||
void release_UE_in_freeList(module_id_t mod_id) {
|
||||
int i, j, CC_id, pdu_number;
|
||||
protocol_ctxt_t ctxt;
|
||||
LTE_eNB_ULSCH_t *ulsch = NULL;
|
||||
LTE_eNB_DLSCH_t *dlsch = NULL;
|
||||
nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
|
||||
PHY_VARS_eNB *eNB_PHY = NULL;
|
||||
struct rrc_eNB_ue_context_s *ue_context_pP = NULL;
|
||||
@@ -1032,6 +1035,25 @@ void release_UE_in_freeList(module_id_t mod_id) {
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
eNB_PHY = RC.eNB[mod_id][CC_id];
|
||||
|
||||
int id;
|
||||
|
||||
// clean ULSCH entries for rnti
|
||||
id = find_ulsch(rnti,eNB_PHY,SEARCH_EXIST);
|
||||
if (id>=0) clean_eNb_ulsch(eNB_PHY->ulsch[id]);
|
||||
|
||||
// clean DLSCH entries for rnti
|
||||
id = find_dlsch(rnti,eNB_PHY,SEARCH_EXIST);
|
||||
if (id>=0) clean_eNb_dlsch(eNB_PHY->dlsch[id][0]);
|
||||
|
||||
// clean UCI entries for rnti
|
||||
for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) {
|
||||
if(eNB_PHY->uci_vars[i].rnti == rnti) {
|
||||
LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n",i, rnti);
|
||||
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
for (i=0; i<MAX_MOBILES_PER_ENB; i++) {
|
||||
ulsch = eNB_PHY->ulsch[i];
|
||||
|
||||
@@ -1064,6 +1086,7 @@ void release_UE_in_freeList(module_id_t mod_id) {
|
||||
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (flexran_agent_get_rrc_xface(mod_id)) {
|
||||
flexran_agent_get_rrc_xface(mod_id)->flexran_agent_notify_ue_state_change(
|
||||
|
||||
@@ -96,36 +96,34 @@ void extract_imsi(uint8_t *pdu_buf, uint32_t pdu_len, rrc_eNB_ue_context_t *ue_c
|
||||
&& pdu_len > NAS_MESSAGE_SECURITY_HEADER_SIZE))
|
||||
return;
|
||||
|
||||
/* Decode plain NAS message */
|
||||
EMM_msg *e_msg = &nas_msg.plain.emm;
|
||||
emm_msg_header_t *emm_header = &e_msg->header;
|
||||
|
||||
if (header->security_header_type != SECURITY_HEADER_TYPE_NOT_PROTECTED) {
|
||||
/* Decode the message authentication code */
|
||||
DECODE_U32((char *) pdu_buf+size, header->message_authentication_code, size);
|
||||
/* Decode the sequence number */
|
||||
DECODE_U8((char *) pdu_buf+size, header->sequence_number, size);
|
||||
}
|
||||
/* Decode the security header type and the protocol discriminator */
|
||||
DECODE_U8(pdu_buf + size, *(uint8_t *)(emm_header), size);
|
||||
|
||||
/* Note: the value of the pointer (i.e. the address) is given by value, so we
|
||||
* can modify it as we want. The callee retains the original address! */
|
||||
/* Check that this is the right message */
|
||||
if (emm_header->protocol_discriminator != EPS_MOBILITY_MANAGEMENT_MESSAGE)
|
||||
return;
|
||||
}
|
||||
pdu_buf += size;
|
||||
pdu_len -= size;
|
||||
/* Decode plain NAS message */
|
||||
EMM_msg *e_msg = &nas_msg.plain.emm;
|
||||
emm_msg_header_t *emm_header = &e_msg->header;
|
||||
/* First decode the EMM message header */
|
||||
int e_head_size = 0;
|
||||
|
||||
/* Check that buffer contains more than only the header */
|
||||
if (pdu_len <= sizeof(emm_msg_header_t))
|
||||
return;
|
||||
|
||||
/* Decode the security header type and the protocol discriminator */
|
||||
DECODE_U8(pdu_buf + e_head_size, *(uint8_t *)(emm_header), e_head_size);
|
||||
/* First decode the EMM message header */
|
||||
int e_head_size = 0;
|
||||
/* Decode the message type */
|
||||
DECODE_U8(pdu_buf + e_head_size, emm_header->message_type, e_head_size);
|
||||
|
||||
/* Check that this is the right message */
|
||||
if (emm_header->protocol_discriminator != EPS_MOBILITY_MANAGEMENT_MESSAGE)
|
||||
return;
|
||||
|
||||
pdu_buf += e_head_size;
|
||||
pdu_len -= e_head_size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user