Merge branch 'develop' into NR_RRC_PRACH_procedures
This commit is contained in:
@@ -58,7 +58,7 @@ struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
|
||||
|
||||
int nas_sock_fd[MAX_MOBILES_PER_ENB];
|
||||
|
||||
int nas_sock_mbms_fd[8];
|
||||
int nas_sock_mbms_fd;
|
||||
|
||||
struct msghdr nas_msg_tx;
|
||||
struct msghdr nas_msg_rx;
|
||||
@@ -95,21 +95,20 @@ static int tun_alloc(char *dev) {
|
||||
}
|
||||
|
||||
|
||||
int netlink_init_mbms_tun(char *ifprefix, int num_if) {
|
||||
int netlink_init_mbms_tun(char *ifprefix) {
|
||||
int ret;
|
||||
char ifname[64];
|
||||
|
||||
int i= num_if-1;
|
||||
sprintf(ifname, "oaitun_%.3s%d",ifprefix,i+1);
|
||||
nas_sock_mbms_fd[i] = tun_alloc(ifname);
|
||||
sprintf(ifname, "oaitun_%.3s1",ifprefix); // added "1": for historical reasons
|
||||
nas_sock_mbms_fd = tun_alloc(ifname);
|
||||
|
||||
if (nas_sock_mbms_fd[i] == -1) {
|
||||
if (nas_sock_mbms_fd == -1) {
|
||||
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_mbms_fd[i]);
|
||||
ret = fcntl(nas_sock_mbms_fd[i],F_SETFL,O_NONBLOCK);
|
||||
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_mbms_fd);
|
||||
ret = fcntl(nas_sock_mbms_fd,F_SETFL,O_NONBLOCK);
|
||||
|
||||
if (ret == -1) {
|
||||
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
@@ -123,7 +122,7 @@ int netlink_init_mbms_tun(char *ifprefix, int num_if) {
|
||||
nas_src_addr.nl_family = AF_NETLINK;
|
||||
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
|
||||
nas_src_addr.nl_groups = 0; /* not in mcast groups */
|
||||
ret = bind(nas_sock_mbms_fd[i], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
ret = bind(nas_sock_mbms_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
@@ -165,7 +164,8 @@ int netlink_init_tun(char *ifprefix, int num_if) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_fd[i]);
|
||||
printf("[NETLINK]Opened socket %s with fd nas_sock_fd[%d]=%d\n",
|
||||
ifname, i, nas_sock_fd[i]);
|
||||
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
|
||||
|
||||
if (ret == -1) {
|
||||
|
||||
@@ -63,6 +63,6 @@ void clear_eNB_transport_info(uint8_t);
|
||||
void clear_UE_transport_info(uint8_t);
|
||||
int netlink_init(void);
|
||||
int netlink_init_tun(char *ifsuffix, int num_if);
|
||||
int netlink_init_mbms_tun(char *ifsuffix, int num_if);
|
||||
int netlink_init_mbms_tun(char *ifsuffix);
|
||||
|
||||
#endif /* EMU_PROTO_H_ */
|
||||
|
||||
@@ -78,6 +78,7 @@ int sf_ahead=4 ;
|
||||
int sl_ahead=0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
|
||||
// dummy functions
|
||||
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
|
||||
@@ -95,12 +96,17 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
}
|
||||
|
||||
|
||||
//Dummy Functions
|
||||
//lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms, unsigned char subframe) {return(SF_DL);}
|
||||
int rlc_module_init (int eNB_id) {return(0);}
|
||||
|
||||
|
||||
void pdcp_layer_init(void) {}
|
||||
boolean_t
|
||||
pdcp_data_ind(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
mem_block_t *const sdu_buffer_pP
|
||||
) { return(false);}
|
||||
|
||||
int rrc_init_nr_global_param(void){return(0);}
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
@@ -108,28 +114,6 @@ void config_common(int Mod_idP,
|
||||
NR_ServingCellConfigCommon_t *scc
|
||||
);
|
||||
|
||||
mac_rlc_status_resp_t mac_rlc_status_ind(const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id) {mac_rlc_status_resp_t mac_rlc_status_resp = {0}; return mac_rlc_status_resp;}
|
||||
tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id) {return 0;}
|
||||
int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char num_sdus,
|
||||
unsigned short *sdu_lengths,
|
||||
@@ -141,20 +125,6 @@ int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned short post_padding){return 0;}
|
||||
void nr_ip_over_LTE_DRB_preconfiguration(void){}
|
||||
|
||||
void mac_rlc_data_ind (
|
||||
const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
char *buffer_pP,
|
||||
const tb_size_t tb_sizeP,
|
||||
num_tb_t num_tbP,
|
||||
crc_t *crcs_pP)
|
||||
{}
|
||||
|
||||
// needed for some functions
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
|
||||
void nr_phy_config_request_sim_pbchsim(PHY_VARS_gNB *gNB,
|
||||
int N_RB_DL,
|
||||
@@ -409,7 +410,9 @@ int main(int argc, char **argv)
|
||||
uint8_t n_hf = 0;
|
||||
int cyclic_prefix_type = NFAPI_CP_NORMAL;
|
||||
|
||||
double fs,bw,scs,eps;
|
||||
double fs, eps;
|
||||
double scs = 30000;
|
||||
double bw = 100e6;
|
||||
|
||||
switch (mu) {
|
||||
case 1:
|
||||
|
||||
@@ -65,10 +65,10 @@ void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
uint16_t NB_UE_INST=1;
|
||||
|
||||
|
||||
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
uint8_t nfapi_mode=0;
|
||||
|
||||
|
||||
void nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
module_id_t mod_id,
|
||||
int CC_id,
|
||||
@@ -91,6 +91,7 @@ int is_nr_prach_subframe(NR_DL_FRAME_PARMS *fp,uint32_t frame,uint8_t slot) { re
|
||||
|
||||
int get_nr_prach_fmt(int prachConfigIndex,int frame_type,int fr) { return(0xa2); }
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
|
||||
@@ -371,7 +371,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
unsigned char harq_pid = 0;
|
||||
uint8_t is_crnti = 0;
|
||||
unsigned int TBS = 8424;
|
||||
unsigned int available_bits;
|
||||
uint8_t nb_re_dmrs = 6;
|
||||
@@ -385,7 +384,7 @@ int main(int argc, char **argv)
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0];
|
||||
NR_UL_gNB_HARQ_t *harq_process_gNB = ulsch_gNB->harq_processes[harq_pid];
|
||||
nfapi_nr_ul_config_ulsch_pdu_rel15_t *rel15_ul = &harq_process_gNB->ulsch_pdu.ulsch_pdu_rel15;
|
||||
nfapi_nr_pusch_pdu_t *rel15_ul = &harq_process_gNB->ulsch_pdu;
|
||||
|
||||
NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0][0];
|
||||
|
||||
@@ -397,14 +396,15 @@ int main(int argc, char **argv)
|
||||
printf("\nAvailable bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order);
|
||||
|
||||
/////////// setting rel15_ul parameters ///////////
|
||||
rel15_ul->number_rbs = nb_rb;
|
||||
rel15_ul->number_symbols = nb_symb_sch;
|
||||
rel15_ul->Qm = mod_order;
|
||||
rel15_ul->mcs = Imcs;
|
||||
rel15_ul->rv = rvidx;
|
||||
rel15_ul->n_layers = Nl;
|
||||
rel15_ul->length_dmrs = length_dmrs;
|
||||
rel15_ul->R = code_rate;
|
||||
rel15_ul->rb_size = nb_rb;
|
||||
rel15_ul->nr_of_symbols = nb_symb_sch;
|
||||
rel15_ul->qam_mod_order = mod_order;
|
||||
rel15_ul->mcs_index = Imcs;
|
||||
rel15_ul->pusch_data.rv_index = rvidx;
|
||||
rel15_ul->nrOfLayers = Nl;
|
||||
//rel15_ul->length_dmrs = length_dmrs;
|
||||
rel15_ul->target_code_rate = code_rate;
|
||||
rel15_ul->pusch_data.tb_size = TBS>>3;
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
|
||||
@@ -527,8 +527,15 @@ int main(int argc, char **argv)
|
||||
exit(-1);
|
||||
#endif
|
||||
|
||||
ret = nr_ulsch_decoding(gNB, UE_id, channel_output_fixed, frame_parms,
|
||||
frame, nb_symb_sch, nb_re_dmrs, subframe, harq_pid, is_crnti);
|
||||
uint32_t G = nr_get_G(rel15_ul->rb_size,
|
||||
rel15_ul->nr_of_symbols,
|
||||
nb_re_dmrs,
|
||||
1, // FIXME only single dmrs is implemented
|
||||
rel15_ul->qam_mod_order,
|
||||
rel15_ul->nrOfLayers);
|
||||
|
||||
ret = nr_ulsch_decoding(gNB, UE_id, channel_output_fixed, frame_parms, rel15_ul,
|
||||
frame, subframe, harq_pid, G);
|
||||
|
||||
if (ret > ulsch_gNB->max_ldpc_iterations)
|
||||
n_errors++;
|
||||
|
||||
@@ -55,8 +55,9 @@
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
#include "openair2/RRC/NR/MESSAGES/asn1_msg.h"
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
|
||||
//#define DEBUG_ULSIM
|
||||
|
||||
@@ -70,44 +71,11 @@ int sl_ahead=0;
|
||||
double cpuf;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index,
|
||||
const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) { return 0; }
|
||||
void mac_rlc_data_ind ( const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
char *buffer_pP,
|
||||
const tb_size_t tb_sizeP,
|
||||
num_tb_t num_tbP,
|
||||
crc_t *crcs_pP){}
|
||||
mac_rlc_status_resp_t mac_rlc_status_ind( const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id)
|
||||
{mac_rlc_status_resp_t mac_rlc_status_resp = {0}; return mac_rlc_status_resp;}
|
||||
tbs_size_t mac_rlc_data_req( const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id )
|
||||
{return 0;}
|
||||
int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char num_sdus,
|
||||
unsigned short *sdu_lengths,
|
||||
@@ -117,8 +85,16 @@ int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char *ue_cont_res_id,
|
||||
unsigned char short_padding,
|
||||
unsigned short post_padding){return 0;}
|
||||
int rlc_module_init (int enb) {return(0);}
|
||||
void pdcp_layer_init (void) {}
|
||||
boolean_t pdcp_data_ind(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
mem_block_t *const sdu_buffer_pP
|
||||
) { return(false);}
|
||||
|
||||
void pdcp_run (const protocol_ctxt_t *const ctxt_pP) { return;}
|
||||
void nr_ip_over_LTE_DRB_preconfiguration(void){}
|
||||
int rrc_init_nr_global_param(void){return(0);}
|
||||
@@ -398,8 +374,9 @@ int main(int argc, char **argv)
|
||||
|
||||
//memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = (nfapi_rx_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_rx_indication_pdu_t));
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = (nfapi_crc_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_crc_indication_pdu_t));
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
@@ -528,6 +505,7 @@ int main(int argc, char **argv)
|
||||
unsigned int TBS;
|
||||
uint16_t number_dmrs_symbols = 1;
|
||||
unsigned int available_bits;
|
||||
|
||||
uint8_t nb_re_dmrs=12; // no PUSCH REs
|
||||
uint8_t length_dmrs = 1;
|
||||
unsigned char mod_order;
|
||||
@@ -535,6 +513,7 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
mod_order = nr_get_Qm_ul(Imcs, 0);
|
||||
|
||||
code_rate = nr_get_code_rate_ul(Imcs, 0);
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, precod_nbr_layers);
|
||||
@@ -672,6 +651,9 @@ int main(int argc, char **argv)
|
||||
//----------------------------------------------------------
|
||||
//------------------- gNB phy procedures -------------------
|
||||
//----------------------------------------------------------
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
|
||||
phy_procedures_gNB_common_RX(gNB, frame, slot);
|
||||
|
||||
if (n_trials==1)
|
||||
|
||||
Reference in New Issue
Block a user