Commit 560dd1f3 authored by Vaibhav Shrivastava's avatar Vaibhav Shrivastava

8318 Rebase Changes on Rebase_March_Latest_3GPP_FRD_299 Branch

parent 041902f6
...@@ -160,7 +160,7 @@ typedef struct AS_CipheringInfo_s { ...@@ -160,7 +160,7 @@ typedef struct AS_CipheringInfo_s {
}AS_CipheringInfo; }AS_CipheringInfo;
typedef struct RrcAsSecurityConfigReq_s { typedef struct RrcAsSecurityConfigReq_s {
bool isIntegrityInfroPresent; bool isIntegrityInfoPresent;
AS_IntegrityInfo Integrity; AS_IntegrityInfo Integrity;
bool isCipheringInfoPresent; bool isCipheringInfoPresent;
AS_CipheringInfo Ciphering; AS_CipheringInfo Ciphering;
...@@ -365,6 +365,17 @@ typedef struct IntraFreqNeighCellInfo_s { ...@@ -365,6 +365,17 @@ typedef struct IntraFreqNeighCellInfo_s {
long q_OffsetCell; long q_OffsetCell;
}IntraFreqNeighCellInfo_t; }IntraFreqNeighCellInfo_t;
typedef struct Rar_s {
uint16_t Temp_C_RNTI;
}Rar_t;
typedef struct Cell_ActiveParam_s {
bool b_C_RNTI_Present;
uint16_t C_RNTI;
uint8_t numRar;
Rar_t Rar[10];
}Cell_ActiveParam_t;
// eNB: ENB_APP -> RRC messages // eNB: ENB_APP -> RRC messages
typedef struct RrcConfigurationReq_s { typedef struct RrcConfigurationReq_s {
uint32_t cell_identity; uint32_t cell_identity;
...@@ -556,6 +567,7 @@ typedef struct RrcConfigurationReq_s { ...@@ -556,6 +567,7 @@ typedef struct RrcConfigurationReq_s {
long q_QualMin[MAX_NUM_CCs]; long q_QualMin[MAX_NUM_CCs];
bool ActiveParamPresent[MAX_NUM_CCs]; bool ActiveParamPresent[MAX_NUM_CCs];
Cell_ActiveParam_t ActiveParam[MAX_NUM_CCs];
//SS: Cell Config Active Params //SS: Cell Config Active Params
bool RlcPduCCCH_Present[MAX_NUM_CCs]; bool RlcPduCCCH_Present[MAX_NUM_CCs];
uint8_t RlcPduCCCH_Size[MAX_NUM_CCs]; uint8_t RlcPduCCCH_Size[MAX_NUM_CCs];
......
...@@ -184,7 +184,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP, ...@@ -184,7 +184,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10, ra->msg3_nb_rb); ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(ra->msg3_mcs, ra->msg3_nb_rb);
ul_req_body->number_of_pdus++; ul_req_body->number_of_pdus++;
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe; ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe;
...@@ -1419,7 +1419,11 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1419,7 +1419,11 @@ initiate_ra_proc(module_id_t module_idP,
} }
ra[i].rnti = drnti[nb_ue]; ra[i].rnti = drnti[nb_ue];
} else { } else if ((RC.ss.mode > SS_ENB) && RC.ss.ss_crnti[CC_id].b_Temp_RNTI_Present) {
// SS_MODE configured setup the CRNTI from the Cell_config
ra[i].rnti = RC.ss.ss_crnti[CC_id].Temp_C_RNTI;
break;
}else {
ra[i].rnti = taus(); ra[i].rnti = taus();
LOG_D(MAC, "[RAPROC] try rnti:0x%x\n",ra[i].rnti); LOG_D(MAC, "[RAPROC] try rnti:0x%x\n",ra[i].rnti);
} }
...@@ -1430,7 +1434,7 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1430,7 +1434,7 @@ initiate_ra_proc(module_id_t module_idP,
*/ */
!(find_UE_id(module_idP, ra[i].rnti) == -1 && !(find_UE_id(module_idP, ra[i].rnti) == -1 &&
/* 1024 and 60000 arbirarily chosen, not coming from standard */ /* 1024 and 60000 arbirarily chosen, not coming from standard */
ra[i].rnti >= 1024 && ra[i].rnti < 60000)); ra[i].rnti >= 1024 && ra[i].rnti < 60000 && (RC.ss.mode > SS_ENB)));
if (loop == 100) { if (loop == 100) {
printf("%s:%d:%s: FATAL ERROR! contact the authors\n", printf("%s:%d:%s: FATAL ERROR! contact the authors\n",
...@@ -1452,7 +1456,7 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1452,7 +1456,7 @@ initiate_ra_proc(module_id_t module_idP,
MessageDef *m = itti_alloc_new_message(TASK_MAC_ENB, 0, SS_SYSTEM_IND); MessageDef *m = itti_alloc_new_message(TASK_MAC_ENB, 0, SS_SYSTEM_IND);
SS_SYSTEM_IND(m).bitmask = false; SS_SYSTEM_IND(m).bitmask = false;
SS_SYSTEM_IND(m).sfn = frameP; SS_SYSTEM_IND(m).sfn = frameP;
SS_SYSTEM_IND(m).sf = subframeP; SS_SYSTEM_IND(m).sf = subframeP;
SS_SYSTEM_IND(m).ra_PreambleIndex = preamble_index; SS_SYSTEM_IND(m).ra_PreambleIndex = preamble_index;
SS_SYSTEM_IND(m).prtPower_Type = true; SS_SYSTEM_IND(m).prtPower_Type = true;
SS_SYSTEM_IND(m).repetitionsPerPreambleAttempt = 0; SS_SYSTEM_IND(m).repetitionsPerPreambleAttempt = 0;
......
...@@ -2190,7 +2190,7 @@ add_new_ue(module_id_t mod_idP, ...@@ -2190,7 +2190,7 @@ add_new_ue(module_id_t mod_idP,
if (UE_info->active[cc_idP][i] == true) if (UE_info->active[cc_idP][i] == true)
continue; continue;
UE_id = i; UE_id = i + cc_idP;
memset(&UE_info->UE_template[cc_idP][UE_id], 0, sizeof(UE_TEMPLATE)); memset(&UE_info->UE_template[cc_idP][UE_id], 0, sizeof(UE_TEMPLATE));
UE_info->UE_template[cc_idP][UE_id].rnti = rntiP; UE_info->UE_template[cc_idP][UE_id].rnti = rntiP;
UE_info->UE_template[cc_idP][UE_id].configured = false; UE_info->UE_template[cc_idP][UE_id].configured = false;
......
...@@ -87,6 +87,13 @@ fill_rar(const module_id_t module_idP, ...@@ -87,6 +87,13 @@ fill_rar(const module_id_t module_idP,
rar[1] |= (rballoc >> 7) & 7; // Hopping = 0 (bit 3), 3 MSBs of rballoc rar[1] |= (rballoc >> 7) & 7; // Hopping = 0 (bit 3), 3 MSBs of rballoc
rar[2] = ((uint8_t) (rballoc & 0xff)) << 1; // 7 LSBs of rballoc rar[2] = ((uint8_t) (rballoc & 0xff)) << 1; // 7 LSBs of rballoc
ra->msg3_mcs = 10; ra->msg3_mcs = 10;
if (RC.ss.mode > SS_ENB)
{
/* update the RAR mcs to 9 for SS mode configuration this shall be updated
* as per the TTCN request for each TC
*/
ra->msg3_mcs = 9;
}
ra->msg3_TPC = 3; ra->msg3_TPC = 3;
ra->msg3_ULdelay = 0; ra->msg3_ULdelay = 0;
ra->msg3_cqireq = 0; ra->msg3_cqireq = 0;
......
...@@ -1395,8 +1395,14 @@ int pdcp_fill_ss_pdcp_cnt ( ...@@ -1395,8 +1395,14 @@ int pdcp_fill_ss_pdcp_cnt (
pc->rb_info[rb_id].is_srb = true; pc->rb_info[rb_id].is_srb = true;
pc->rb_info[rb_id].ul_format = E_PdcpCount_Srb; pc->rb_info[rb_id].ul_format = E_PdcpCount_Srb;
pc->rb_info[rb_id].dl_format = E_PdcpCount_Srb; pc->rb_info[rb_id].dl_format = E_PdcpCount_Srb;
pc->rb_info[rb_id].ul_count = pdcp_get_next_count_rx(pdcp_p, 1, pdcp_p->rx_hfn, pdcp_p->next_pdcp_rx_sn - 1); if (pdcp_p->next_pdcp_rx_sn > 0)
pc->rb_info[rb_id].dl_count = pdcp_get_next_count_tx(pdcp_p, 1, pdcp_p->next_pdcp_tx_sn - 1); pc->rb_info[rb_id].ul_count = pdcp_get_next_count_rx(pdcp_p, 1, pdcp_p->rx_hfn, pdcp_p->next_pdcp_rx_sn - 1);
else
pc->rb_info[rb_id].ul_count = pdcp_get_next_count_rx(pdcp_p, 1, pdcp_p->rx_hfn, 0);
if (pdcp_p->next_pdcp_tx_sn)
pc->rb_info[rb_id].dl_count = pdcp_get_next_count_tx(pdcp_p, 1, pdcp_p->next_pdcp_tx_sn - 1);
else
pc->rb_info[rb_id].dl_count = pdcp_get_next_count_tx(pdcp_p, 1, 0);
LOG_D (PDCP, "SRB DL Count (dec): %d UL Count (dec): %d \n \ LOG_D (PDCP, "SRB DL Count (dec): %d UL Count (dec): %d \n \
RX_HFN: %d TX_HFN: %d \n \ RX_HFN: %d TX_HFN: %d \n \
RX Seq Num: %d TX Seq Num: %d \n", RX Seq Num: %d TX Seq Num: %d \n",
...@@ -1418,8 +1424,14 @@ int pdcp_fill_ss_pdcp_cnt ( ...@@ -1418,8 +1424,14 @@ int pdcp_fill_ss_pdcp_cnt (
pc->rb_info[rb_id].dl_format = E_PdcpCount_DrbLongSQN; pc->rb_info[rb_id].dl_format = E_PdcpCount_DrbLongSQN;
LOG_D (PDCP, "DRB Long SQN\n"); LOG_D (PDCP, "DRB Long SQN\n");
} }
pc->rb_info[rb_id].ul_count = pdcp_get_next_count_rx(pdcp_p, 0, pdcp_p->rx_hfn, pdcp_p->next_pdcp_rx_sn - 1); if (pdcp_p->next_pdcp_rx_sn > 0)
pc->rb_info[rb_id].dl_count = pdcp_get_next_count_tx(pdcp_p, 0, pdcp_p->next_pdcp_tx_sn - 1); pc->rb_info[rb_id].ul_count = pdcp_get_next_count_rx(pdcp_p, 0, pdcp_p->rx_hfn, pdcp_p->next_pdcp_rx_sn - 1);
else
pc->rb_info[rb_id].ul_count = pdcp_get_next_count_rx(pdcp_p, 0, pdcp_p->rx_hfn, 0);
if (pdcp_p->next_pdcp_tx_sn > 0)
pc->rb_info[rb_id].dl_count = pdcp_get_next_count_tx(pdcp_p, 0, pdcp_p->next_pdcp_tx_sn - 1);
else
pc->rb_info[rb_id].dl_count = pdcp_get_next_count_tx(pdcp_p, 0, 0);
LOG_D (PDCP, "DRB DL Count (dec): %d UL Count (dec): %d \n \ LOG_D (PDCP, "DRB DL Count (dec): %d UL Count (dec): %d \n \
RX_HFN: %d TX_HFN: %d \n \ RX_HFN: %d TX_HFN: %d \n \
RX Seq Num: %d TX Seq Num: %d \n", RX Seq Num: %d TX Seq Num: %d \n",
...@@ -2449,14 +2461,17 @@ pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP, ...@@ -2449,14 +2461,17 @@ pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP,
/* Security keys */ /* Security keys */
if (pdcp_pP->kUPenc != NULL) { if (pdcp_pP->kUPenc != NULL) {
free(pdcp_pP->kUPenc); free(pdcp_pP->kUPenc);
pdcp_pP->kUPenc = NULL;
} }
if (pdcp_pP->kRRCint != NULL) { if (pdcp_pP->kRRCint != NULL) {
free(pdcp_pP->kRRCint); free(pdcp_pP->kRRCint);
pdcp_pP->kRRCint = NULL;
} }
if (pdcp_pP->kRRCenc != NULL) { if (pdcp_pP->kRRCenc != NULL) {
free(pdcp_pP->kRRCenc); free(pdcp_pP->kRRCenc);
pdcp_pP->kRRCenc = NULL;
} }
memset(pdcp_pP, 0, sizeof(pdcp_t)); memset(pdcp_pP, 0, sizeof(pdcp_t));
...@@ -2761,18 +2776,22 @@ pdcp_free ( ...@@ -2761,18 +2776,22 @@ pdcp_free (
if (pdcp_p != NULL) { if (pdcp_p != NULL) {
if (pdcp_p->kUPenc != NULL) { if (pdcp_p->kUPenc != NULL) {
free(pdcp_p->kUPenc); free(pdcp_p->kUPenc);
pdcp_p->kUPenc = NULL;
} }
if (pdcp_p->kRRCint != NULL) { if (pdcp_p->kRRCint != NULL) {
free(pdcp_p->kRRCint); free(pdcp_p->kRRCint);
pdcp_p->kRRCint = NULL;
} }
if (pdcp_p->kRRCenc != NULL) { if (pdcp_p->kRRCenc != NULL) {
free(pdcp_p->kRRCenc); free(pdcp_p->kRRCenc);
pdcp_p->kRRCenc = NULL;
} }
memset(pdcp_pP, 0, sizeof(pdcp_t)); memset(pdcp_pP, 0, sizeof(pdcp_t));
free(pdcp_pP); free(pdcp_pP);
pdcp_pP = NULL;
} }
} }
......
...@@ -211,10 +211,13 @@ pdcp_validate_security( ...@@ -211,10 +211,13 @@ pdcp_validate_security(
decrypt_params.key = pdcp_pP->kUPenc;// + 128; decrypt_params.key = pdcp_pP->kUPenc;// + 128;
} }
/* Uncipher the block */ /* Don't need to uncipher the block if sdu buffer is empty */
stream_decrypt(pdcp_pP->cipheringAlgorithm, if((sdu_buffer_size - pdcp_header_len) != 0) {
&decrypt_params, /* Uncipher the block */
&buffer_decrypted); stream_decrypt(pdcp_pP->cipheringAlgorithm,
&decrypt_params,
&buffer_decrypted);
}
if (!IS_SOFTMODEM_IQPLAYER) { if (!IS_SOFTMODEM_IQPLAYER) {
if (srb_flagP) { if (srb_flagP) {
/* Now check the integrity of the complete PDU */ /* Now check the integrity of the complete PDU */
......
...@@ -4900,14 +4900,16 @@ int do_HandoverPreparation(char *ho_buf, int ho_size, LTE_UE_EUTRA_Capability_t ...@@ -4900,14 +4900,16 @@ int do_HandoverPreparation(char *ho_buf, int ho_size, LTE_UE_EUTRA_Capability_t
LTE_UE_CapabilityRAT_Container_t *ue_cap_rat_container; LTE_UE_CapabilityRAT_Container_t *ue_cap_rat_container;
char rrc_buf[rrc_size]; char rrc_buf[rrc_size];
memset(rrc_buf, 0, rrc_size); memset(rrc_buf, 0, rrc_size);
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_EUTRA_Capability, if (RC.ss.mode == SS_ENB) {
NULL, enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_EUTRA_Capability,
ue_eutra_cap, NULL,
rrc_buf, ue_eutra_cap,
rrc_size); rrc_buf,
/* TODO: free the OCTET_STRING */ rrc_size);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", /* TODO: free the OCTET_STRING */
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
}
memset(&ho, 0, sizeof(ho)); memset(&ho, 0, sizeof(ho));
ho.criticalExtensions.present = LTE_HandoverPreparationInformation__criticalExtensions_PR_c1; ho.criticalExtensions.present = LTE_HandoverPreparationInformation__criticalExtensions_PR_c1;
ho.criticalExtensions.choice.c1.present = LTE_HandoverPreparationInformation__criticalExtensions__c1_PR_handoverPreparationInformation_r8; ho.criticalExtensions.choice.c1.present = LTE_HandoverPreparationInformation__criticalExtensions__c1_PR_handoverPreparationInformation_r8;
...@@ -4920,14 +4922,16 @@ int do_HandoverPreparation(char *ho_buf, int ho_size, LTE_UE_EUTRA_Capability_t ...@@ -4920,14 +4922,16 @@ int do_HandoverPreparation(char *ho_buf, int ho_size, LTE_UE_EUTRA_Capability_t
rrc_buf, rrc_size) != -1, "fatal: OCTET_STRING_fromBuf failed\n"); rrc_buf, rrc_size) != -1, "fatal: OCTET_STRING_fromBuf failed\n");
asn1cSeqAdd(&ho_info->ue_RadioAccessCapabilityInfo.list, ue_cap_rat_container); asn1cSeqAdd(&ho_info->ue_RadioAccessCapabilityInfo.list, ue_cap_rat_container);
} }
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_HandoverPreparationInformation, if (RC.ss.mode == SS_ENB) {
NULL, enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_HandoverPreparationInformation,
&ho, NULL,
ho_buf, &ho,
ho_size); ho_buf,
/* TODO: free the OCTET_STRING */ ho_size);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", /* TODO: free the OCTET_STRING */
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
}
return((enc_rval.encoded+7)/8); return((enc_rval.encoded+7)/8);
} }
......
...@@ -400,6 +400,8 @@ typedef struct HANDOVER_INFO_s { ...@@ -400,6 +400,8 @@ typedef struct HANDOVER_INFO_s {
uint32_t x2u_teid; uint32_t x2u_teid;
DATA_FORWARDING_STATE_t forwarding_state; DATA_FORWARDING_STATE_t forwarding_state;
DATA_ENDMARK_STATE_t endmark_state; DATA_ENDMARK_STATE_t endmark_state;
int ss_source_ue_rnti;
int ss_target_ue_rnti;
} HANDOVER_INFO; } HANDOVER_INFO;
typedef struct PER_EVENT_s { typedef struct PER_EVENT_s {
......
This diff is collapsed.
...@@ -154,6 +154,8 @@ void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf) ...@@ -154,6 +154,8 @@ void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf)
case SystemConfirm_Type_Sps: case SystemConfirm_Type_Sps:
case SystemConfirm_Type_RlcIndCtrl: case SystemConfirm_Type_RlcIndCtrl:
case SystemConfirm_Type_PdcpHandoverControl: case SystemConfirm_Type_PdcpHandoverControl:
cnf.Confirm.v.PdcpHandoverControl = true;
break;
case SystemConfirm_Type_L1_TestMode: case SystemConfirm_Type_L1_TestMode:
case SystemConfirm_Type_ActivateScell: case SystemConfirm_Type_ActivateScell:
case SystemConfirm_Type_MbmsConfig: case SystemConfirm_Type_MbmsConfig:
......
...@@ -271,7 +271,7 @@ static void ss_task_handle_rrc_pdu_req(struct EUTRA_RRC_PDU_REQ *req) ...@@ -271,7 +271,7 @@ static void ss_task_handle_rrc_pdu_req(struct EUTRA_RRC_PDU_REQ *req)
{ {
msg_queued = vt_timer_setup(timer_tinfo, TASK_RRC_ENB, instance_g,message_p); msg_queued = vt_timer_setup(timer_tinfo, TASK_RRC_ENB, instance_g,message_p);
} }
LOG_A(ENB_SS, "RRC_PDU Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d", LOG_A(ENB_SS, "RRC_PDU Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf); tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
} }
......
This diff is collapsed.
...@@ -45,6 +45,20 @@ typedef enum ss_mode { ...@@ -45,6 +45,20 @@ typedef enum ss_mode {
#define SS_SOFTMODEM (0x01) #define SS_SOFTMODEM (0x01)
#define SS_SOFTMODEM_SRB (0x02) #define SS_SOFTMODEM_SRB (0x02)
#endif #endif
typedef struct ss_crnti_config_s {
bool b_C_RNTI_Present;
uint16_t C_RNTI;
bool b_Temp_RNTI_Present;
uint16_t Temp_C_RNTI;
}ss_crnti_config_t;
typedef struct RrcHOAsSecurityConfigReq_s {
bool isIntegrityInfoPresent;
AS_IntegrityInfo Integrity;
bool isCipheringInfoPresent;
AS_CipheringInfo Ciphering;
int rnti;
}RrcHOAsSecurityConfig_t;
typedef struct ss_config_s { typedef struct ss_config_s {
/** SS mode of operation */ /** SS mode of operation */
...@@ -75,6 +89,8 @@ typedef struct ss_config_s { ...@@ -75,6 +89,8 @@ typedef struct ss_config_s {
ss_l1macind_ctrl_t l1macind[MAX_NUM_CCs]; ss_l1macind_ctrl_t l1macind[MAX_NUM_CCs];
uint8_t CC_conf_flag[MAX_NUM_CCs]; uint8_t CC_conf_flag[MAX_NUM_CCs];
ss_rrc_pdcp_api_t *ss_pdcp_api; ss_rrc_pdcp_api_t *ss_pdcp_api;
ss_crnti_config_t ss_crnti[MAX_NUM_CCs];
RrcHOAsSecurityConfig_t HOASSecurityCOnfig;
} ss_config_t; } ss_config_t;
/** /**
typedef enum { typedef enum {
......
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