Commit 1e8719c1 authored by laurent's avatar laurent

first-fix-rrc-mac-interface

parent f7c3874e
......@@ -901,7 +901,7 @@ unsigned char phy_threegpplte_turbo_decoder_scalar(llr_t *y,
llr_t *yp = y;
unsigned short i,pi;
unsigned char iteration_cnt=0;
unsigned int crc,oldcrc;
uint32_t crc, oldcrc;
unsigned char crc_len,temp;
if (crc_type > 3) {
......
......@@ -1898,7 +1898,7 @@ unsigned char phy_threegpplte_turbo_decoder(short *y,
__m128i *yp128;
unsigned int i,j,iind;//,pi;
unsigned char iteration_cnt=0;
unsigned int crc,oldcrc,crc_len;
uint32_t crc, oldcrc, crc_len;
uint8_t temp;
__m128i tmp128[(n+8)>>3];
__m128i tmp, zeros=_mm_setzero_si128();
......
......@@ -1001,7 +1001,7 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y,
llr_t *s,*s1,*s2,*yp1,*yp2,*yp;
unsigned int i,j,iind;//,pi;
unsigned char iteration_cnt=0;
unsigned int crc,oldcrc,crc_len;
uint32_t crc, oldcrc, crc_len;
uint8_t temp;
#if defined(__x86_64__) || defined(__i386__)
__m128i *yp128;
......@@ -1308,7 +1308,7 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y,
// check status on output
if (iteration_cnt>1) {
oldcrc= *((unsigned int *)(&decoded_bytes[(n>>3)-crc_len]));
memcpy(&oldcrc, &decoded_bytes[(n >> 3) - crc_len], sizeof(oldcrc));
switch (crc_type) {
case CRC24_A:
......
......@@ -298,11 +298,11 @@ crc8 (unsigned char * inptr, int bitlen)
resbit = (bitlen % 8);
while (octetlen-- > 0) {
crc = crc8Table[(*inptr++) ^ (crc >> 24)] << 24;
crc = ((unsigned int)crc8Table[(*inptr++) ^ (crc >> 24)]) << 24;
}
if (resbit > 0)
crc = (crc << resbit) ^ (crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 24);
crc = (crc << resbit) ^ ((unsigned int)(crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]) << 24);
return crc;
}
......
......@@ -289,8 +289,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
ch[13] = (short)(((int)pil[6]*rxF[1] + (int)pil[7]*rxF[0])>>15);
ch[14] = ch[12]>>1;
ch[15] = ch[13]>>1;
ch[10] = (ch[8]/3)+(ch[12]<<1)/3;
ch[11] = (ch[9]/3)+(ch[13]<<1)/3;
ch[10] = (ch[8] / 3) + (ch[12] * 2) / 3;
ch[11] = (ch[9] / 3) + (ch[13] * 2) / 3;
/* printf("rb %d: pil3 (%d,%d) x (%d,%d) = (%d,%d)\n",
rb,pil[6],pil[7],rxF[0],rxF[1],ch[12],ch[13]);*/
// ------------------------5th pilot------------------------
......
......@@ -3076,43 +3076,25 @@ void configure_du_mac(int inst) {
eNB_RRC_INST *rrc = RC.rrc[inst];
rrc_eNB_carrier_data_t *carrier = &rrc->carrier[0];
LOG_I(ENB_APP,"Configuring MAC/L1 %d, carrier->sib2 %p\n",inst,&carrier->sib2->radioResourceConfigCommon);
rrc_mac_config_req_eNB(inst, 0,
carrier->physCellId,
carrier->p_eNB,
carrier->Ncp,
carrier->sib1->freqBandIndicator,
carrier->dl_CarrierFreq,
carrier->pbch_repetition,
0, // rnti
(LTE_BCCH_BCH_Message_t *) &carrier->mib,
(LTE_RadioResourceConfigCommonSIB_t *) &carrier->sib2->radioResourceConfigCommon,
(LTE_RadioResourceConfigCommonSIB_t *) &carrier->sib2_BR->radioResourceConfigCommon,
(struct LTE_PhysicalConfigDedicated *)NULL,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
(LTE_MAC_MainConfig_t *) NULL, 0,
(struct LTE_LogicalChannelConfig *)NULL,
(LTE_MeasGapConfig_t *) NULL,
carrier->sib1->tdd_Config,
NULL,
&carrier->sib1->schedulingInfoList,
carrier->ul_CarrierFreq,
carrier->sib2->freqInfo.ul_Bandwidth,
&carrier->sib2->freqInfo.additionalSpectrumEmission,
(LTE_MBSFN_SubframeConfigList_t *) carrier->sib2->mbsfn_SubframeConfigList,
carrier->MBMS_flag,
(LTE_MBSFN_AreaInfoList_r9_t *) & carrier->sib13->mbsfn_AreaInfoList_r9,
(LTE_PMCH_InfoList_r9_t *) NULL,
NULL,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t*) NULL
);
rrc_mac_config_req_eNB_t tmp = {0};
tmp.physCellId = carrier->physCellId;
tmp.p_eNB = carrier->p_eNB;
tmp.Ncp = carrier->Ncp;
tmp.eutra_band = carrier->sib1->freqBandIndicator;
tmp.dl_CarrierFreq = carrier->dl_CarrierFreq;
tmp.pbch_repetition = carrier->pbch_repetition;
tmp.mib = &carrier->mib;
tmp.radioResourceConfigCommon = &carrier->sib2->radioResourceConfigCommon;
tmp.LTE_radioResourceConfigCommon_BR = &carrier->sib2_BR->radioResourceConfigCommon;
tmp.tdd_Config = carrier->sib1->tdd_Config;
tmp.schedulingInfoList = &carrier->sib1->schedulingInfoList;
tmp.ul_CarrierFreq = carrier->ul_CarrierFreq;
tmp.ul_Bandwidth = carrier->sib2->freqInfo.ul_Bandwidth;
tmp.additionalSpectrumEmission = &carrier->sib2->freqInfo.additionalSpectrumEmission;
tmp.mbsfn_SubframeConfigList = carrier->sib2->mbsfn_SubframeConfigList;
tmp.MBMS_Flag = carrier->MBMS_flag;
tmp.mbsfn_AreaInfoList = &carrier->sib13->mbsfn_AreaInfoList_r9;
rrc_mac_config_req_eNB(inst, &tmp);
}
void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
......
......@@ -256,38 +256,13 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
if (radioResourceConfigDedicated->mac_MainConfig)
mac_MainConfig = &radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
rrc_mac_config_req_eNB(
ctxt.instance,
0, //primaryCC_id,
0,0,0,0,0,0,
ctxt.rnti,
(LTE_BCCH_BCH_Message_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
radioResourceConfigDedicated->physicalConfigDedicated,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
mac_MainConfig,
1,
SRB1_logicalChannelConfig,
NULL, // measGapConfig,
(LTE_TDD_Config_t *) NULL,
NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
, 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t *) NULL
);
rrc_mac_config_req_eNB_t tmp = {0};
tmp.rnti = ctxt.rnti;
tmp.physicalConfigDedicated = radioResourceConfigDedicated->physicalConfigDedicated;
tmp.mac_MainConfig = mac_MainConfig;
tmp.logicalChannelIdentity = 1;
tmp.logicalChannelConfig = SRB1_logicalChannelConfig;
rrc_mac_config_req_eNB(ctxt.instance, &tmp);
break;
} // case
......@@ -433,37 +408,14 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
if (DRB_configList->list.array[i]->logicalChannelIdentity) {
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
}
rrc_mac_config_req_eNB(
ctxt.instance,
0,0,0,0,0,0,
0,
ue_context_p->ue_context.rnti,
(LTE_BCCH_BCH_Message_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
physicalConfigDedicated,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
mac_MainConfig,
DRB2LCHAN[i],
DRB_configList->list.array[i]->logicalChannelConfig,
measGapConfig,
(LTE_TDD_Config_t *) NULL,
NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
, 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t *) NULL
);
rrc_mac_config_req_eNB_t tmp = {0};
tmp.rnti = ue_context_p->ue_context.rnti;
tmp.physicalConfigDedicated = physicalConfigDedicated;
tmp.mac_MainConfig = mac_MainConfig;
tmp.logicalChannelIdentity = DRB2LCHAN[i];
tmp.logicalChannelConfig = DRB_configList->list.array[i]->logicalChannelConfig;
tmp.measGapConfig = measGapConfig;
rrc_mac_config_req_eNB(ctxt.instance, &tmp);
}
} else { // remove LCHAN from MAC/PHY
AssertFatal(1==0,"Can't handle this yet in DU\n");
......
This diff is collapsed.
......@@ -915,43 +915,46 @@ int generate_dlsch_header(unsigned char *mac_header,
@param mbms_AreaConfiguration pointer to eMBMS MBSFN Area Configuration
*/
int rrc_mac_config_req_eNB(module_id_t module_idP,
int CC_id,
int physCellId,
int p_eNB,
int Ncp,
int eutra_band, uint32_t dl_CarrierFreq,
int pbch_repetition,
rnti_t rntiP,
LTE_BCCH_BCH_Message_t *mib,
LTE_RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
LTE_RadioResourceConfigCommonSIB_t *LTE_radioResourceConfigCommon_BR,
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated,
LTE_SCellToAddMod_r10_t *sCellToAddMod_r10,
LTE_MeasObjectToAddMod_t **measObj,
LTE_MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LTE_LogicalChannelConfig_t *logicalChannelConfig,
LTE_MeasGapConfig_t *measGapConfig,
LTE_TDD_Config_t *tdd_Config,
LTE_MobilityControlInfo_t *mobilityControlInfo,
LTE_SchedulingInfoList_t *schedulingInfoList,
uint32_t ul_CarrierFreq,
long *ul_Bandwidth,
LTE_AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
uint8_t MBMS_Flag,
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
LTE_PMCH_InfoList_r9_t *pmch_InfoList,
LTE_SystemInformationBlockType1_v1310_IEs_t *sib1_ext_r13,
uint8_t FeMBMS_Flag,
LTE_BCCH_DL_SCH_Message_MBMS_t *mib_fembms,
LTE_SchedulingInfo_MBMS_r14_t *schedulingInfo_fembms,
struct LTE_NonMBSFN_SubframeConfig_r14 *nonMBSFN_SubframeConfig,
LTE_SystemInformationBlockType1_MBMS_r14_t *sib1_mbms_r14_fembms,
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList_fembms,
LTE_MBSFNAreaConfiguration_r9_t * mbms_AreaConfiguration
);
typedef struct {
int CC_id;
int physCellId;
int p_eNB;
int Ncp;
int eutra_band;
uint32_t dl_CarrierFreq;
int pbch_repetition;
rnti_t rnti;
LTE_BCCH_BCH_Message_t *mib;
LTE_RadioResourceConfigCommonSIB_t *radioResourceConfigCommon;
LTE_RadioResourceConfigCommonSIB_t *LTE_radioResourceConfigCommon_BR;
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated;
LTE_SCellToAddMod_r10_t *sCellToAddMod_r10;
LTE_MeasObjectToAddMod_t **measObj;
LTE_MAC_MainConfig_t *mac_MainConfig;
long logicalChannelIdentity;
LTE_LogicalChannelConfig_t *logicalChannelConfig;
LTE_MeasGapConfig_t *measGapConfig;
LTE_TDD_Config_t *tdd_Config;
LTE_MobilityControlInfo_t *mobilityControlInfo;
LTE_SchedulingInfoList_t *schedulingInfoList;
uint32_t ul_CarrierFreq;
long *ul_Bandwidth;
LTE_AdditionalSpectrumEmission_t *additionalSpectrumEmission;
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigList;
uint8_t MBMS_Flag;
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList;
LTE_PMCH_InfoList_r9_t *pmch_InfoList;
LTE_SystemInformationBlockType1_v1310_IEs_t *sib1_ext_r13;
uint8_t FeMBMS_Flag;
LTE_BCCH_DL_SCH_Message_MBMS_t *mib_fembms;
LTE_SchedulingInfo_MBMS_r14_t *schedulingInfo_fembms;
struct LTE_NonMBSFN_SubframeConfig_r14 *nonMBSFN_SubframeConfig;
LTE_SystemInformationBlockType13_r9_t *sib1_mbms_r14_fembms;
LTE_MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList_fembms;
LTE_MBSFNAreaConfiguration_r9_t *mbms_AreaConfiguration;
} rrc_mac_config_req_eNB_t;
int rrc_mac_config_req_eNB(module_id_t module_idP, rrc_mac_config_req_eNB_t *);
/** \brief RRC eNB Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
@param Mod_id Instance ID of ue
......
......@@ -596,9 +596,16 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
* so we return true afterwards
*/
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB; pdcp_uid++) {
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti )
break;
if (ctxt_pP->enb_flag == ENB_FLAG_NO)
pdcp_uid = 0;
else
for (pdcp_uid = 0; pdcp_uid < MAX_MOBILES_PER_ENB; pdcp_uid++)
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti)
break;
if (pdcp_uid == MAX_MOBILES_PER_ENB) {
LOG_W(PDCP, "stats on not recorded rnti: %x\n", ctxt_pP->rnti);
pdcp_uid = 0;
}
LOG_D(PDCP,"ueid %d lcid %d tx seq num %d\n", pdcp_uid, (int)(rb_idP+rb_offset), current_sn);
......@@ -1158,10 +1165,16 @@ pdcp_data_ind(
}
/* Update PDCP statistics */
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB; pdcp_uid++) {
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti ) {
break;
}
if (ctxt_pP->enb_flag == ENB_FLAG_NO)
pdcp_uid = 0;
else
for (pdcp_uid = 0; pdcp_uid < MAX_MOBILES_PER_ENB; pdcp_uid++)
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti)
break;
if (pdcp_uid == MAX_MOBILES_PER_ENB) {
LOG_W(PDCP, "stats on not recorded rnti: %x\n", ctxt_pP->rnti);
pdcp_uid = 0;
}
Pdcp_stats_rx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
......
......@@ -123,7 +123,6 @@ extern uint32_t Pdcp_stats_rx_outoforder[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX
void pdcp_update_perioidical_stats(const protocol_ctxt_t *const ctxt_pP);
/*Packet Probing for agent PDCP*/
//uint64_t *pdcp_packet_counter;
//uint64_t *pdcp_size_packet;
......
......@@ -704,8 +704,7 @@ typedef struct {
LTE_BCCH_DL_SCH_Message_t systemInformation;
LTE_BCCH_DL_SCH_Message_t systemInformation_BR;
LTE_BCCH_BCH_Message_MBMS_t mib_fembms;
LTE_BCCH_DL_SCH_Message_MBMS_t siblock1_MBMS;
LTE_BCCH_DL_SCH_Message_MBMS_t systemInformation_MBMS;
LTE_BCCH_DL_SCH_Message_MBMS_t siblock1_MBMS;
LTE_SchedulingInfo_MBMS_r14_t schedulingInfo_MBMS;
LTE_PLMN_IdentityInfo_t PLMN_identity_info_MBMS[6];
LTE_MCC_MNC_Digit_t dummy_mcc_MBMS[6][3], dummy_mnc_MBMS[6][3];
......
This diff is collapsed.
This diff is collapsed.
......@@ -190,10 +190,10 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id
//tnl_information->iPMCAddress.buf[2]
//tnl_information->iPMCAddress.buf[3]
//tnl_information->iPMCAddress.buf.size = 4;
uint32_t ip= (224<<24) | (0) << 16 | (0) << 8 | (2);
INT32_TO_OCTET_STRING(ip,&tnl_information->iPMCAddress);
ip= (224<<24) | (0) << 16 | (0) << 8 | (2);
INT32_TO_OCTET_STRING(ip,&tnl_information->iPSourceAddress);
uint32_t ip = (224U << 24) | (0) << 16 | (0) << 8 | (2);
INT32_TO_OCTET_STRING(ip, &tnl_information->iPMCAddress);
ip = (224U << 24) | (0) << 16 | (0) << 8 | (2);
INT32_TO_OCTET_STRING(ip, &tnl_information->iPSourceAddress);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
......
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