Merge remote-tracking branch 'origin/develop' into scs_60_iisc
# Conflicts: # ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf # ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf # openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
This commit is contained in:
@@ -56,7 +56,7 @@ struct nlmsghdr *nas_nlh_rx = NULL;
|
||||
struct iovec nas_iov_tx;
|
||||
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
|
||||
|
||||
int nas_sock_fd[MAX_MOBILES_PER_ENB];
|
||||
int nas_sock_fd[MAX_MOBILES_PER_ENB*2]; //Allocated for both LTE UE and NR UE.
|
||||
|
||||
int nas_sock_mbms_fd;
|
||||
|
||||
@@ -70,7 +70,7 @@ static int tun_alloc(char *dev) {
|
||||
int fd, err;
|
||||
|
||||
if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
|
||||
printf("[TUN] failed to open /dev/net/tun\n");
|
||||
LOG_E(PDCP, "[TUN] failed to open /dev/net/tun\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -95,15 +95,20 @@ static int tun_alloc(char *dev) {
|
||||
}
|
||||
|
||||
|
||||
int netlink_init_mbms_tun(char *ifprefix) {
|
||||
int netlink_init_mbms_tun(char *ifprefix, int id) {//for UE, id = 1, 2, ...,
|
||||
int ret;
|
||||
char ifname[64];
|
||||
|
||||
sprintf(ifname, "oaitun_%.3s1",ifprefix); // added "1": for historical reasons
|
||||
if (id > 0) {
|
||||
sprintf(ifname, "oaitun_%.3s%d", ifprefix, id-1);
|
||||
}
|
||||
else {
|
||||
sprintf(ifname, "oaitun_%.3s1", ifprefix); // added "1": for historical reasons
|
||||
}
|
||||
nas_sock_mbms_fd = tun_alloc(ifname);
|
||||
|
||||
if (nas_sock_mbms_fd == -1) {
|
||||
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
printf("[NETLINK] Error opening mbms socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -123,88 +128,36 @@ int netlink_init_mbms_tun(char *ifprefix) {
|
||||
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, (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 */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
// TX PART
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
|
||||
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh_tx->nlmsg_flags = 0;
|
||||
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
|
||||
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
|
||||
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
|
||||
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
|
||||
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg_tx.msg_iov = &nas_iov_tx;
|
||||
nas_msg_tx.msg_iovlen = 1;
|
||||
// RX PART
|
||||
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
|
||||
nas_msg_rx.msg_name = (void *)&nas_src_addr;
|
||||
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
|
||||
nas_msg_rx.msg_iov = &nas_iov_rx;
|
||||
nas_msg_rx.msg_iovlen = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int netlink_init_tun(char *ifprefix, int num_if) {
|
||||
int netlink_init_tun(char *ifprefix, int num_if, int id) {//for UE, id = 1, 2, ...,
|
||||
int ret;
|
||||
char ifname[64];
|
||||
|
||||
for (int i = 0; i < num_if; i++) {
|
||||
int begx = (id == 0) ? 0 : id - 1;
|
||||
int endx = (id == 0) ? num_if : id;
|
||||
for (int i = begx; i < endx; i++) {
|
||||
sprintf(ifname, "oaitun_%.3s%d",ifprefix,i+1);
|
||||
nas_sock_fd[i] = tun_alloc(ifname);
|
||||
|
||||
if (nas_sock_fd[i] == -1) {
|
||||
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
LOG_E(PDCP, "TUN: Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket %s with fd nas_sock_fd[%d]=%d\n",
|
||||
LOG_I(PDCP, "TUN: 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) {
|
||||
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
LOG_E(PDCP, "TUN: Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
|
||||
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_fd[i], (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 */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
// TX PART
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
|
||||
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh_tx->nlmsg_flags = 0;
|
||||
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
|
||||
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
|
||||
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
|
||||
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
|
||||
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg_tx.msg_iov = &nas_iov_tx;
|
||||
nas_msg_tx.msg_iovlen = 1;
|
||||
// RX PART
|
||||
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
|
||||
nas_msg_rx.msg_name = (void *)&nas_src_addr;
|
||||
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
|
||||
nas_msg_rx.msg_iov = &nas_iov_rx;
|
||||
nas_msg_rx.msg_iovlen = 1;
|
||||
} /* for */
|
||||
|
||||
return 1;
|
||||
@@ -216,7 +169,7 @@ int netlink_init(void) {
|
||||
nas_sock_fd[0] = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
|
||||
|
||||
if (nas_sock_fd[0] == -1) {
|
||||
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
|
||||
printf("[NETLINK] Error opening GRAAL_NETLINK_ID socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
|
||||
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
@@ -244,6 +197,7 @@ int netlink_init(void) {
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
// TX PART
|
||||
free(nas_nlh_tx);
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
@@ -266,3 +220,8 @@ int netlink_init(void) {
|
||||
return(nas_sock_fd[0]);
|
||||
}
|
||||
|
||||
void netlink_cleanup(void)
|
||||
{
|
||||
free(nas_nlh_tx);
|
||||
nas_nlh_tx = NULL;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,8 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
|
||||
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 netlink_init_tun(char *ifsuffix, int num_if, int id);
|
||||
int netlink_init_mbms_tun(char *ifsuffix, int id);
|
||||
void netlink_cleanup(void);
|
||||
|
||||
#endif /* EMU_PROTO_H_ */
|
||||
|
||||
@@ -134,16 +134,16 @@ struct option * parse_oai_options(paramdef_t *options) {
|
||||
|
||||
void display_options_values(paramdef_t *options, int verbose) {
|
||||
for(paramdef_t * ptr=options; ptr->optname[0]!=0; ptr++) {
|
||||
char varText[256]="need specific display";
|
||||
char varText[256]={0};
|
||||
|
||||
if (ptr->voidptr != NULL) {
|
||||
if ( (ptr->paramflags & PARAMFLAG_BOOL) )
|
||||
strcpy(varText, *(bool *)ptr->iptr ? "True": "False" );
|
||||
else switch (ptr->type) {
|
||||
case TYPE_INT:
|
||||
sprintf(varText,"%d",*ptr->iptr);
|
||||
break;
|
||||
|
||||
case TYPE_INT:
|
||||
sprintf(varText,"%d",*ptr->iptr);
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
sprintf(varText,"%.2f",*ptr->dblptr);
|
||||
break;
|
||||
@@ -157,6 +157,7 @@ void display_options_values(paramdef_t *options, int verbose) {
|
||||
break;
|
||||
|
||||
default:
|
||||
strcpy(varText,"Need specific display");
|
||||
printf("not decoded type\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -634,7 +634,7 @@ int main(int argc, char **argv) {
|
||||
// num_layers = 1;
|
||||
perfect_ce = 0;
|
||||
static paramdef_t options[] = {
|
||||
{ "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, strptr:NULL, defintval:0, TYPE_INT, 0, NULL, NULL },
|
||||
{ "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, iptr:&awgn_flag, defintval:0, TYPE_INT, 0, NULL, NULL },
|
||||
{ "Abstx", "Turns on calibration mode for abstraction.", PARAMFLAG_BOOL, iptr:&abstx, defintval:0, TYPE_INT, 0 },
|
||||
{ "bTDD", "Set the tdd configuration mode",0, iptr:&tdd_config, defintval:3, TYPE_INT, 0 },
|
||||
{ "BnbRBs", "The LTE bandwith in RBs (100 is 20MHz)",0, iptr:&N_RB_DL, defintval:25, TYPE_INT, 0 },
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
#include <openair2/RRC/LTE/rrc_vars.h>
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
|
||||
rlc_info_t Rlc_info_um,Rlc_info_am_config;
|
||||
@@ -89,6 +90,13 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
uint32_t N_RB_DL = 106;
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
instance_t DUuniqInstance=0;
|
||||
instance_t CUuniqInstance=0;
|
||||
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
|
||||
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// dummy functions
|
||||
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
|
||||
@@ -131,12 +139,6 @@ rrc_data_ind(
|
||||
{
|
||||
}
|
||||
|
||||
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
|
||||
@@ -34,4 +34,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus) {}
|
||||
uint16_t n_pdus,
|
||||
UE_nr_rxtx_proc_t *proc) {}
|
||||
|
||||
@@ -193,6 +193,7 @@ int main(int argc, char **argv)
|
||||
|
||||
int frame=0;
|
||||
int frame_length_complex_samples;
|
||||
__attribute__((unused))
|
||||
int frame_length_complex_samples_no_prefix;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <executables/softmodem-common.h>
|
||||
#include <openair2/RRC/NR_UE/rrc_defs.h>
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
#define NR_PRACH_DEBUG 1
|
||||
#define PRACH_WRITE_OUTPUT_DEBUG 1
|
||||
@@ -88,6 +89,13 @@ int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); }
|
||||
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); }
|
||||
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); }
|
||||
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); }
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
instance_t DUuniqInstance=0;
|
||||
instance_t CUuniqInstance=0;
|
||||
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
|
||||
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
@@ -99,12 +107,6 @@ rrc_data_ind(
|
||||
{
|
||||
}
|
||||
|
||||
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
//#define DEBUG_ULSIM
|
||||
|
||||
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
|
||||
@@ -85,6 +86,13 @@ THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
uint32_t N_RB_DL = 106;
|
||||
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
instance_t DUuniqInstance=0;
|
||||
instance_t CUuniqInstance=0;
|
||||
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
|
||||
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
|
||||
return 0;
|
||||
}
|
||||
extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
@@ -120,11 +128,6 @@ rrc_data_ind(
|
||||
{
|
||||
}
|
||||
|
||||
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
@@ -1278,8 +1281,10 @@ int main(int argc, char **argv)
|
||||
|
||||
if (n_trials == 1 && round==0) {
|
||||
#ifdef __AVX2__
|
||||
__attribute__((unused))
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
#else
|
||||
__attribute__((unused))
|
||||
int off = 0;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
//#include "SIMULATION/TOOLS/sim.h"
|
||||
|
||||
|
||||
unsigned int s0, s1, s2, b;
|
||||
static unsigned int s0, s1, s2;
|
||||
|
||||
//----------------------------------------------
|
||||
//
|
||||
@@ -34,7 +36,7 @@ unsigned int s0, s1, s2, b;
|
||||
|
||||
unsigned int taus(void)
|
||||
{
|
||||
b = (((s0 << 13) ^ s0) >> 19);
|
||||
unsigned int b = (((s0 << 13) ^ s0) >> 19);
|
||||
s0 = (((s0 & 0xFFFFFFFE) << 12)^ b);
|
||||
b = (((s1 << 2) ^ s1) >> 25);
|
||||
s1 = (((s1 & 0xFFFFFFF8) << 4)^ b);
|
||||
@@ -50,9 +52,20 @@ void set_taus_seed(unsigned int seed_init)
|
||||
unsigned long result = 0;
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
unsigned int data[3];
|
||||
int fd = open("/dev/urandom", O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
if (read(fd, data, sizeof(data)) != sizeof(data))
|
||||
{
|
||||
abort();
|
||||
}
|
||||
close(fd);
|
||||
s0 = data[0];
|
||||
s1 = data[1];
|
||||
s2 = data[2];
|
||||
} else {
|
||||
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
|
||||
Reference in New Issue
Block a user