Commit 17592c5b authored by chenhsunyang0922's avatar chenhsunyang0922

add function read_config_and_init_NB_IoT( ) and fix some warning

parent f6f7994c
......@@ -127,7 +127,7 @@ int DCIrep_to_real_rep(uint8_t DCI_rep, int Rmax)
}
int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
int frame,
uint8_t subframe,
DCI_CONTENT *DCI_Content,
......@@ -217,7 +217,7 @@ int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
}
int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
int frame,
uint8_t subframe,
DCI_CONTENT *DCI_Content,
......
......@@ -17,7 +17,7 @@
#include "PHY/defs_L1_NB_IoT.h"
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
void generate_pilots_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB_NB_IoT,
int32_t **txdataF,
int16_t amp,
uint16_t Ntti, // Ntti = 0..9
......@@ -25,7 +25,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
unsigned short With_NSSS) // With_NSSS = 1; if the frame include a sub-Frame with NSSS signal
{
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->frame_parms;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB_NB_IoT->frame_parms;
uint16_t subframe = Ntti;
uint32_t tti_offset,slot_offset,Nsymb,samples_per_symbol; // tti,
uint8_t first_pilot,second_pilot;
......@@ -44,7 +44,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
//Generate Pilots for slot 0 and 1
//antenna 0 symbol 5 slot 0
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,
&txdataF[0][tti_offset + (first_pilot*samples_per_symbol)], // tti_offset 512 x 32 bits
amp,
slot_offset,
......@@ -53,7 +53,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
RB_IoT_ID);
//antenna 0 symbol 6 slot 0
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (second_pilot*samples_per_symbol)],
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,&txdataF[0][tti_offset + (second_pilot*samples_per_symbol)],
amp,
slot_offset,
1,
......@@ -61,7 +61,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
RB_IoT_ID);
//antenna 0 symbol 5 slot 1
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,&txdataF[0][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
amp,
1+slot_offset,
0,
......@@ -69,7 +69,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
RB_IoT_ID);
//antenna 0 symbol 6 slot 1
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,&txdataF[0][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
amp,
1+slot_offset,
1,
......@@ -79,7 +79,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
if (frame_parms->nb_antennas_tx > 1) { // Pilots generation with two antennas
// antenna 1 symbol 5 slot 0
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (first_pilot*samples_per_symbol)],
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,&txdataF[1][tti_offset + (first_pilot*samples_per_symbol)],
amp,
slot_offset,
0,
......@@ -87,7 +87,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
RB_IoT_ID);
// antenna 1 symbol 6 slot 0
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (second_pilot*samples_per_symbol)],
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,&txdataF[1][tti_offset + (second_pilot*samples_per_symbol)],
amp,
slot_offset,
1,
......@@ -95,7 +95,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
RB_IoT_ID);
//antenna 1 symbol 5 slot 1
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,&txdataF[1][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
amp,
1+slot_offset,
0,
......@@ -103,7 +103,7 @@ void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
RB_IoT_ID);
// antenna 1 symbol 6 slot 1
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
lte_dl_cell_spec_NB_IoT(phy_vars_eNB_NB_IoT,&txdataF[1][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
amp,
1+slot_offset,
1,
......
......@@ -81,7 +81,7 @@ int nsss_extract_NB_IoT(PHY_VARS_UE_NB_IoT *ue,
//NRS
void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
void generate_pilots_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB_NB_IoT,
int32_t **txdataF,
int16_t amp,
......@@ -221,7 +221,7 @@ void add_dci_NB_IoT(DCI_PDU_NB_IoT *DCI_pdu,
/*Use the UL DCI Information to configure PHY and also Pack the DCI*/
int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
int frame,
uint8_t subframe,
DCI_CONTENT *DCI_Content,
......@@ -233,7 +233,7 @@ int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
/*Use the DL DCI Information to configure PHY and also Pack the DCI*/
int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
int frame,
uint8_t subframe,
......
......@@ -231,7 +231,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_I
{
//LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms_NB_IoT;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch;
NB_IoT_eNB_NPBCH_t *broadcast_str = eNB->npbch;
//NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB;
//NB_IoT_eNB_NDLSCH_t *ndlsch = &eNB->ndlsch_SIB1;
NB_IoT_eNB_NDLSCH_t *sib1 = eNB->ndlsch_SIB1;
......
......@@ -250,3 +250,33 @@ void RCConfig_NbIoT(RAN_CONTEXT_t *RC) {
config_getlist( &NbIoT_L1ParamList,NULL,0, NULL);
RC->nb_nb_iot_L1_inst = NbIoT_L1ParamList.numelt;
}
void read_config_and_init_NB_IoT(void) {
int macrlc_has_f1[MAX_MAC_INST];
memset(macrlc_has_f1, 0, MAX_MAC_INST*sizeof(int));
if (RC.nb_nb_iot_macrlc_inst = 0)
AssertFatal(RC.nb_nb_iot_macrlc_inst == RC.nb_nb_iot_rrc_inst,
"Number of NB-IoT MACRLC instances %d != number of NB-IoT RRC instances %d\n",
RC.nb_nb_iot_macrlc_inst, RC.nb_nb_iot_rrc_inst);
RCconfig_NbIoTL1();
LOG_I(PHY, "%s() RC.L1_NB_IoT: %d\n", __FUNCTION__, RC.L1_NB_IoT);
RCconfig_NbIoTmacrlc();
LOG_I(MAC, "%s() RC.nb_nb_iot_macrlc_inst: %d\n", __FUNCTION__, RC.nb_nb_iot_macrlc_inst);
if (RC.L1_NB_IoT > 0)
AssertFatal(l1_north_init_NB_IoT() == 0, "could not initialize NB-IoT L1 north interface\n");
RC.nbiotrrc = malloc(RC.nb_nb_iot_rrc_inst * sizeof(eNB_RRC_INST_NB_IoT *));
AssertFatal(RC.nbiotrrc, "could not allocate memory for RC.nb_iot_rrc\n");
/*
for (int nbiotrrc_id = 0; nbiotrrc_id < RC.nb_nb_iot_rrc_inst; nbiotrrc_id++) {
RC.nbiotrrc[nbiotrrc_id] = malloc(sizeof(eNB_RRC_INST_NB_IoT));
AssertFatal(RC.nbiotrrc[nbiotrrc_id], "RRC context for eNB %d not allocated\n", nbiotrrc_id);
memset((void *)RC.nbiotrrc[nbiotrrc_id], 0, sizeof(eNB_RRC_INST_NB_IoT));
RCconfig_NbIoTRRC(nbiotrrc_id, RC.nbiotrrc[nbiotrrc_id],macrlc_has_f1[nbiotrrc_id]);
}
*/
}
......@@ -34,4 +34,5 @@ extern void RCconfig_NbIoTL1(void) ;
extern void RCconfig_NbIoTmacrlc(void);
extern int RCconfig_NbIoTRRC(MessageDef *msg_p, int nbiotrrc_id,eNB_RRC_INST_NB_IoT *nbiotrrc);
extern void RCConfig_NbIoT(RAN_CONTEXT_t *RC);
extern void read_config_and_init_NB_IoT(void) ;
#endif
......@@ -951,8 +951,8 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
asn_enc_rval_t enc_rval;
uint8_t ecause=0;
long* prioritySRB1 = NULL;
long* prioritySRB1bis = NULL;
//long* prioritySRB1 = NULL;
//long* prioritySRB1bis = NULL;
BOOLEAN_t* logicalChannelSR_Prohibit = NULL; //pag 605
BOOLEAN_t* npusch_AllSymbols = NULL;
long* npusch_repetitions = NULL;
......@@ -960,9 +960,9 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
// At the first moment of MSG4 testing we set NULL to those optional
struct LTE_SRB_ToAddMod_NB_r13* SRB1_config_NB_IoT = NULL;
struct LTE_SRB_ToAddMod_NB_r13__rlc_Config_r13* SRB1_rlc_config_NB_IoT = NULL;
struct LTE_SRB_ToAddMod_NB_r13__logicalChannelConfig_r13* SRB1_lchan_config_NB_IoT = NULL;
//struct LTE_SRB_ToAddMod_NB_r13* SRB1_config_NB_IoT = NULL;
//struct LTE_SRB_ToAddMod_NB_r13__rlc_Config_r13* SRB1_rlc_config_NB_IoT = NULL;
//struct LTE_SRB_ToAddMod_NB_r13__logicalChannelConfig_r13* SRB1_lchan_config_NB_IoT = NULL;
struct LTE_SRB_ToAddMod_NB_r13* SRB1bis_config_NB_IoT = NULL;
struct LTE_SRB_ToAddMod_NB_r13__rlc_Config_r13* SRB1bis_rlc_config_NB_IoT = NULL;
......@@ -1628,7 +1628,7 @@ void cleanup_module_NB_IoT(void)
{
printk("Stopping asn1_msg_nb_iot module\n");
}
#if 0
EXPORT_SYMBOL(do_SIB1_NB_IoT);
EXPORT_SYMBOL(do_SIB23_NB_IoT);
EXPORT_SYMBOL(do_RRCConnectionRequest_NB_IoT);
......@@ -1647,7 +1647,7 @@ EXPORT_SYMBOL(uper_decode_complete);
EXPORT_SYMBOL(uper_decode);
EXPORT_SYMBOL(transmission_mode_rrc);
#endif
#endif
//----------------------------------
......
......@@ -635,13 +635,39 @@ int main( int argc, char **argv ) {
RCconfig_L1();
}
//nbiot Rea configuration
if (RC.nb_nb_iot_rrc_inst > 0) {
read_config_and_init_NB_IoT();
/* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks
* for monolithic/F1 modes */
//init_pdcp();
if (create_tasks(1) < 0) {
printf("cannot create ITTI tasks\n");
exit(-1);
}
for (int nbiotrrc_id = 0; nbiotrrc_id < RC.nb_nb_iot_rrc_inst; nbiotrrc_id++) {
MessageDef *msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ);
RC.nbiotrrc = malloc(RC.nb_nb_iot_rrc_inst * sizeof(eNB_RRC_INST_NB_IoT *));
//RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[nbiotrrc_id]->configuration;
RCconfig_NbIoTRRC(msg_p,nbiotrrc_id,RC.nbiotrrc);
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(nbiotrrc_id), msg_p);
}
} else {
printf("RC.nb_nb_iot_rrc_inst = 0, Initializing L1\n");
RCconfig_NbIoTL1();
}
//end
#if 0
//nbiot L1 config
if (RC.nb_nb_iot_rrc_inst = 0){
printf("RC.nb_nb_iot_rrc_inst = 0, Initializing NB-IoT L1\n");
RCconfig_NbIoTL1();
}
///////end
#endif
if (RC.nb_inst > 0 && NODE_IS_CU(RC.rrc[0]->node_type)) {
protocol_ctxt_t ctxt;
ctxt.module_id = 0 ;
......
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