Merge branch 'enhancement-10-harmony' into develop_integration_w03
Conflicts: targets/RT/USER/lte-enb.c targets/RT/USER/lte-softmodem.c
This commit is contained in:
@@ -135,6 +135,14 @@ typedef struct {
|
||||
double offset;
|
||||
} rx_gain_calib_table_t;
|
||||
|
||||
/*! \brief Clock source types */
|
||||
typedef enum {
|
||||
//! This tells the underlying hardware to use the internal reference
|
||||
internal=0,
|
||||
//! This tells the underlying hardware to use the external reference
|
||||
external=1
|
||||
} clock_source_t;
|
||||
|
||||
/*! \brief RF frontend parameters set by application */
|
||||
typedef struct {
|
||||
//! Module ID for this configuration
|
||||
@@ -187,6 +195,8 @@ typedef struct {
|
||||
double rx_bw;
|
||||
//! TX bandwidth in Hz
|
||||
double tx_bw;
|
||||
//! clock source
|
||||
clock_source_t clock_source;
|
||||
//! Auto calibration flag
|
||||
int autocal[4];
|
||||
//! rf devices work with x bits iqs when oai have its own iq format
|
||||
@@ -238,8 +248,10 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
//! Tx buffer for if device
|
||||
void *tx;
|
||||
//! Tx buffer for if device, keep one per subframe now to allow multithreading
|
||||
void *tx[10];
|
||||
//! Tx buffer (PRACH) for if device
|
||||
void *tx_prach;
|
||||
//! Rx buffer for if device
|
||||
void *rx;
|
||||
} if_buffer_t;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/*! \file ethernet_lib.c
|
||||
* \brief API to stream I/Q samples over standard ethernet
|
||||
* \author add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp
|
||||
* \author add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp, Tien-Thinh Nguyen
|
||||
* \date 2015
|
||||
* \version 0.2
|
||||
* \company Eurecom
|
||||
@@ -45,18 +45,16 @@
|
||||
#include "common_lib.h"
|
||||
#include "ethernet_lib.h"
|
||||
|
||||
#define DEBUG 0
|
||||
//#define DEBUG 0
|
||||
|
||||
struct sockaddr_ll dest_addr[MAX_INST];
|
||||
struct sockaddr_ll local_addr[MAX_INST];
|
||||
int addr_len[MAX_INST];
|
||||
struct ifreq if_index[MAX_INST];
|
||||
//struct sockaddr_ll dest_addr[MAX_INST];
|
||||
//struct sockaddr_ll local_addr[MAX_INST];
|
||||
//int addr_len[MAX_INST];
|
||||
//struct ifreq if_index[MAX_INST];
|
||||
|
||||
int eth_socket_init_raw(openair0_device *device) {
|
||||
|
||||
int i = 0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
const char *local_mac, *remote_mac;
|
||||
int sock_dom=0;
|
||||
int sock_type=0;
|
||||
@@ -78,30 +76,33 @@ int eth_socket_init_raw(openair0_device *device) {
|
||||
sock_dom=AF_PACKET;
|
||||
sock_type=SOCK_RAW;
|
||||
sock_proto=IPPROTO_RAW;
|
||||
if ((eth->sockfd[Mod_id] = socket(sock_dom, sock_type, sock_proto)) == -1) {
|
||||
if ((eth->sockfd = socket(sock_dom, sock_type, sock_proto)) == -1) {
|
||||
perror("ETHERNET: Error opening RAW socket");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* initialize destination address */
|
||||
for (i=0; i< MAX_INST; i++) {
|
||||
bzero((void *)&(local_addr[i]), sizeof(struct sockaddr_ll));
|
||||
bzero((void *)&(if_index[i]), sizeof(struct ifreq));
|
||||
}
|
||||
bzero((void *)&(eth->local_addr_ll), sizeof(struct sockaddr_ll));
|
||||
bzero((void *)&(eth->if_index), sizeof(struct ifreq));
|
||||
|
||||
/* Get the index of the interface to send on */
|
||||
strcpy(if_index[Mod_id].ifr_name,eth->if_name[Mod_id]);
|
||||
if (ioctl(eth->sockfd[Mod_id], SIOCGIFINDEX, &(if_index[Mod_id])) < 0)
|
||||
strcpy(eth->if_index.ifr_name,eth->if_name);
|
||||
if (ioctl(eth->sockfd, SIOCGIFINDEX, &(eth->if_index)) < 0)
|
||||
perror("SIOCGIFINDEX");
|
||||
|
||||
local_addr[Mod_id].sll_family = AF_PACKET;
|
||||
local_addr[Mod_id].sll_ifindex = if_index[Mod_id].ifr_ifindex;
|
||||
eth->local_addr_ll.sll_family = AF_PACKET;
|
||||
eth->local_addr_ll.sll_ifindex = eth->if_index.ifr_ifindex;
|
||||
/* hear traffic from specific protocol*/
|
||||
local_addr[Mod_id].sll_protocol = htons((short)device->openair0_cfg->my_port);
|
||||
local_addr[Mod_id].sll_halen = ETH_ALEN;
|
||||
local_addr[Mod_id].sll_pkttype = PACKET_OTHERHOST;
|
||||
addr_len[Mod_id] = sizeof(struct sockaddr_ll);
|
||||
if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
|
||||
eth->local_addr_ll.sll_protocol = htons(0xbffe);
|
||||
} else{
|
||||
eth->local_addr_ll.sll_protocol = htons((short)device->openair0_cfg->my_port);
|
||||
}
|
||||
eth->local_addr_ll.sll_halen = ETH_ALEN;
|
||||
eth->local_addr_ll.sll_pkttype = PACKET_OTHERHOST;
|
||||
eth->addr_len = sizeof(struct sockaddr_ll);
|
||||
|
||||
if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&local_addr[Mod_id],addr_len[Mod_id])<0) {
|
||||
if (bind(eth->sockfd,(struct sockaddr *)ð->local_addr_ll,eth->addr_len)<0) {
|
||||
perror("ETHERNET: Cannot bind to socket");
|
||||
exit(0);
|
||||
}
|
||||
@@ -114,7 +115,7 @@ int eth_socket_init_raw(openair0_device *device) {
|
||||
} else {
|
||||
eth->eh.ether_type = htons((short)device->openair0_cfg->my_port);
|
||||
}
|
||||
printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eth->eh.ether_shost[0],eth->eh.ether_shost[1],eth->eh.ether_shost[2],eth->eh.ether_shost[3],eth->eh.ether_shost[4],eth->eh.ether_shost[5]);
|
||||
printf("[%s] binding to hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),eth->eh.ether_shost[0],eth->eh.ether_shost[1],eth->eh.ether_shost[2],eth->eh.ether_shost[3],eth->eh.ether_shost[4],eth->eh.ether_shost[5]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -124,7 +125,6 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
|
||||
int bytes_sent=0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
int sendto_flag =0;
|
||||
int i=0;
|
||||
//sendto_flag|=flags;
|
||||
@@ -157,7 +157,7 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
bytes_sent);
|
||||
#endif
|
||||
/* Send packet */
|
||||
bytes_sent += send(eth->sockfd[Mod_id],
|
||||
bytes_sent += send(eth->sockfd,
|
||||
buff2,
|
||||
RAW_PACKET_SIZE_BYTES(nsamps),
|
||||
sendto_flag);
|
||||
@@ -195,7 +195,6 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
int bytes_sent = 0;
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
|
||||
ssize_t packet_size;
|
||||
|
||||
@@ -203,6 +202,8 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
packet_size = RAW_IF4p5_PDLFFT_SIZE_BYTES(nblocks);
|
||||
} else if (flags == IF4p5_PULFFT) {
|
||||
packet_size = RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks);
|
||||
} else if (flags == IF4p5_PULTICK) {
|
||||
packet_size = RAW_IF4p5_PULTICK_SIZE_BYTES;
|
||||
} else if (flags == IF5_MOBIPASS) {
|
||||
packet_size = RAW_IF5_MOBIPASS_SIZE_BYTES;
|
||||
} else {
|
||||
@@ -214,7 +215,7 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
memcpy(buff[0], (void*)ð->eh, MAC_HEADER_SIZE_BYTES);
|
||||
|
||||
|
||||
bytes_sent = send(eth->sockfd[Mod_id],
|
||||
bytes_sent = send(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
0);
|
||||
@@ -238,7 +239,6 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
int bytes_received=0;
|
||||
int i=0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
int rcvfrom_flag =0;
|
||||
|
||||
eth->rx_nsamps=nsamps;
|
||||
@@ -256,7 +256,7 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
bytes_received=0;
|
||||
|
||||
while(bytes_received < RAW_PACKET_SIZE_BYTES(nsamps)) {
|
||||
bytes_received +=recv(eth->sockfd[Mod_id],
|
||||
bytes_received +=recv(eth->sockfd,
|
||||
buff2,
|
||||
RAW_PACKET_SIZE_BYTES(nsamps),
|
||||
rcvfrom_flag);
|
||||
@@ -300,13 +300,15 @@ int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestam
|
||||
int nblocks = nsamps;
|
||||
int bytes_received=0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
|
||||
ssize_t packet_size = MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t;
|
||||
IF4p5_header_t *test_header = (IF4p5_header_t*)(buff[0] + MAC_HEADER_SIZE_BYTES);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("Reading from device %p, eth %p, sockfd %d\n",device,eth,eth->sockfd);
|
||||
#endif
|
||||
|
||||
bytes_received = recv(eth->sockfd[Mod_id],
|
||||
bytes_received = recv(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
MSG_PEEK);
|
||||
@@ -315,7 +317,12 @@ int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestam
|
||||
perror("ETHERNET IF4p5 READ (header): ");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
for (int i=0;i<packet_size;i++)
|
||||
printf("%2x.",((uint8_t*)buff[0])[i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
*timestamp = test_header->sub_type;
|
||||
|
||||
if (test_header->sub_type == IF4p5_PDLFFT) {
|
||||
@@ -328,7 +335,7 @@ int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestam
|
||||
|
||||
|
||||
while(bytes_received < packet_size) {
|
||||
bytes_received = recv(eth->sockfd[Mod_id],
|
||||
bytes_received = recv(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
0);
|
||||
@@ -347,10 +354,81 @@ int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestam
|
||||
}
|
||||
|
||||
|
||||
int trx_eth_read_raw_IF5_mobipass(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
|
||||
// Read nblocks info from packet itself
|
||||
|
||||
int nblocks = nsamps;
|
||||
int bytes_received=0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
ssize_t packet_size = 28; //MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t ;
|
||||
// ssize_t packet_size = MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + 640*sizeof(int16_t);
|
||||
|
||||
bytes_received = recv(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
MSG_PEEK);
|
||||
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
perror("[MOBIPASS]ETHERNET IF5 READ (header): ");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
IF5_mobipass_header_t *test_header = (IF5_mobipass_header_t*)((uint8_t *)buff[0] + MAC_HEADER_SIZE_BYTES);
|
||||
*timestamp = test_header->time_stamp;
|
||||
packet_size = MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + 640*sizeof(int16_t);
|
||||
|
||||
while(bytes_received < packet_size) {
|
||||
bytes_received = recv(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
0);
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
perror("[MOBIPASS] ETHERNET IF5 READ (payload): ");
|
||||
exit(-1);
|
||||
} else {
|
||||
eth->rx_actual_nsamps = bytes_received>>1;
|
||||
eth->rx_count++;
|
||||
}
|
||||
}
|
||||
|
||||
eth->rx_nsamps = nsamps;
|
||||
return(bytes_received);
|
||||
|
||||
|
||||
/*
|
||||
if (bytes_received > 0) {
|
||||
while(bytes_received < packet_size) {
|
||||
bytes_received = recv(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
0);
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
perror("ETHERNET IF5_MOBIPASS READ (payload): ");
|
||||
exit(-1);
|
||||
} else {
|
||||
eth->rx_actual_nsamps = bytes_received>>1;
|
||||
eth->rx_count++;
|
||||
}
|
||||
}
|
||||
if (bytes_received == packet_size){
|
||||
IF5_mobipass_header_t *test_header = (IF5_mobipass_header_t*)((uint8_t *)buff[0] + MAC_HEADER_SIZE_BYTES);
|
||||
*timestamp = test_header->time_stamp;
|
||||
}
|
||||
|
||||
eth->rx_nsamps = nsamps;
|
||||
}
|
||||
|
||||
return(bytes_received);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
int eth_set_dev_conf_raw(openair0_device *device) {
|
||||
|
||||
int Mod_id = device->Mod_id;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
void *msg;
|
||||
ssize_t msg_len;
|
||||
@@ -366,7 +444,7 @@ int eth_set_dev_conf_raw(openair0_device *device) {
|
||||
memcpy(msg,(void*)ð->eh,MAC_HEADER_SIZE_BYTES);
|
||||
memcpy((msg+MAC_HEADER_SIZE_BYTES),(void*)device->openair0_cfg,sizeof(openair0_config_t));
|
||||
|
||||
if (send(eth->sockfd[Mod_id],
|
||||
if (send(eth->sockfd,
|
||||
msg,
|
||||
msg_len,
|
||||
0)==-1) {
|
||||
@@ -382,7 +460,6 @@ int eth_set_dev_conf_raw(openair0_device *device) {
|
||||
int eth_set_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
// use for cc_id info
|
||||
|
||||
int Mod_id = device->Mod_id;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
void *msg;
|
||||
ssize_t msg_len;
|
||||
@@ -398,7 +475,7 @@ int eth_set_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
memcpy(msg,(void*)ð->eh,MAC_HEADER_SIZE_BYTES);
|
||||
memcpy((msg+MAC_HEADER_SIZE_BYTES),(void*)device->openair0_cfg,sizeof(openair0_config_t));
|
||||
|
||||
if (send(eth->sockfd[Mod_id],
|
||||
if (send(eth->sockfd,
|
||||
msg,
|
||||
msg_len,
|
||||
0)==-1) {
|
||||
@@ -413,7 +490,6 @@ int eth_set_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
int eth_get_dev_conf_raw(openair0_device *device) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
void *msg;
|
||||
ssize_t msg_len;
|
||||
|
||||
@@ -421,7 +497,7 @@ int eth_get_dev_conf_raw(openair0_device *device) {
|
||||
msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t);
|
||||
|
||||
/* RRH receives from BBU openair0_config_t */
|
||||
if (recv(eth->sockfd[Mod_id],
|
||||
if (recv(eth->sockfd,
|
||||
msg,
|
||||
msg_len,
|
||||
0)==-1) {
|
||||
@@ -433,7 +509,7 @@ int eth_get_dev_conf_raw(openair0_device *device) {
|
||||
memcpy(eth->eh.ether_dhost,(msg+ETH_ALEN),ETH_ALEN);
|
||||
//memcpy((void*)&device->openair0_cfg,(msg + MAC_HEADER_SIZE_BYTES), sizeof(openair0_config_t));
|
||||
device->openair0_cfg=(openair0_config_t *)(msg + MAC_HEADER_SIZE_BYTES);
|
||||
printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eth->eh.ether_shost[0],eth->eh.ether_shost[1],eth->eh.ether_shost[2],eth->eh.ether_shost[3],eth->eh.ether_shost[4],eth->eh.ether_shost[5],eth->eh.ether_dhost[0],eth->eh.ether_dhost[1],eth->eh.ether_dhost[2],eth->eh.ether_dhost[3],eth->eh.ether_dhost[4],eth->eh.ether_dhost[5]);
|
||||
printf("[%s] binding mod to hardware address %x:%x:%x:%x:%x:%x hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),eth->eh.ether_shost[0],eth->eh.ether_shost[1],eth->eh.ether_shost[2],eth->eh.ether_shost[3],eth->eh.ether_shost[4],eth->eh.ether_shost[5],eth->eh.ether_dhost[0],eth->eh.ether_dhost[1],eth->eh.ether_dhost[2],eth->eh.ether_dhost[3],eth->eh.ether_dhost[4],eth->eh.ether_dhost[5]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -443,7 +519,6 @@ int eth_get_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
// use for cc_id info
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
void *msg;
|
||||
ssize_t msg_len;
|
||||
|
||||
@@ -451,7 +526,7 @@ int eth_get_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t);
|
||||
|
||||
/* RRH receives from BBU openair0_config_t */
|
||||
if (recv(eth->sockfd[Mod_id],
|
||||
if (recv(eth->sockfd,
|
||||
msg,
|
||||
msg_len,
|
||||
0)==-1) {
|
||||
@@ -463,7 +538,7 @@ int eth_get_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
memcpy(eth->eh.ether_dhost,(msg+ETH_ALEN),ETH_ALEN);
|
||||
//memcpy((void*)&device->openair0_cfg,(msg + MAC_HEADER_SIZE_BYTES), sizeof(openair0_config_t));
|
||||
//device->openair0_cfg=(openair0_config_t *)(msg + MAC_HEADER_SIZE_BYTES);
|
||||
printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eth->eh.ether_shost[0],eth->eh.ether_shost[1],eth->eh.ether_shost[2],eth->eh.ether_shost[3],eth->eh.ether_shost[4],eth->eh.ether_shost[5],eth->eh.ether_dhost[0],eth->eh.ether_dhost[1],eth->eh.ether_dhost[2],eth->eh.ether_dhost[3],eth->eh.ether_dhost[4],eth->eh.ether_dhost[5]);
|
||||
printf("[%s] binding mod to hardware address %x:%x:%x:%x:%x:%x hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),eth->eh.ether_shost[0],eth->eh.ether_shost[1],eth->eh.ether_shost[2],eth->eh.ether_shost[3],eth->eh.ether_shost[4],eth->eh.ether_shost[5],eth->eh.ether_dhost[0],eth->eh.ether_dhost[1],eth->eh.ether_dhost[2],eth->eh.ether_dhost[3],eth->eh.ether_dhost[4],eth->eh.ether_dhost[5]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
#include "ethernet_lib.h"
|
||||
|
||||
#define DEBUG 0
|
||||
struct sockaddr_in dest_addr[MAX_INST];
|
||||
struct sockaddr_in local_addr[MAX_INST];
|
||||
int addr_len[MAX_INST];
|
||||
//struct sockaddr_in dest_addr[MAX_INST];
|
||||
//struct sockaddr_in local_addr[MAX_INST];
|
||||
//int addr_len[MAX_INST];
|
||||
|
||||
|
||||
uint16_t pck_seq_num = 1;
|
||||
@@ -58,9 +58,7 @@ uint16_t pck_seq_num_prev=0;
|
||||
|
||||
int eth_socket_init_udp(openair0_device *device) {
|
||||
|
||||
int i = 0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
char str_local[INET_ADDRSTRLEN];
|
||||
char str_remote[INET_ADDRSTRLEN];
|
||||
const char *local_ip, *remote_ip;
|
||||
@@ -89,43 +87,42 @@ int eth_socket_init_udp(openair0_device *device) {
|
||||
sock_type=SOCK_DGRAM;
|
||||
sock_proto=IPPROTO_UDP;
|
||||
|
||||
if ((eth->sockfd[Mod_id] = socket(sock_dom, sock_type, sock_proto)) == -1) {
|
||||
if ((eth->sockfd = socket(sock_dom, sock_type, sock_proto)) == -1) {
|
||||
perror("ETHERNET: Error opening socket");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* initialize addresses */
|
||||
for (i=0; i< MAX_INST; i++) {
|
||||
bzero((void *)&(dest_addr[i]), sizeof(dest_addr[i]));
|
||||
bzero((void *)&(local_addr[i]), sizeof(local_addr[i]));
|
||||
}
|
||||
bzero((void *)&(eth->dest_addr), sizeof(eth->dest_addr));
|
||||
bzero((void *)&(eth->local_addr), sizeof(eth->local_addr));
|
||||
|
||||
|
||||
addr_len[Mod_id] = sizeof(struct sockaddr_in);
|
||||
eth->addr_len = sizeof(struct sockaddr_in);
|
||||
|
||||
dest_addr[Mod_id].sin_family = AF_INET;
|
||||
inet_pton(AF_INET,remote_ip,&(dest_addr[Mod_id].sin_addr.s_addr));
|
||||
dest_addr[Mod_id].sin_port=htons(remote_port);
|
||||
inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str_remote, INET_ADDRSTRLEN);
|
||||
eth->dest_addr.sin_family = AF_INET;
|
||||
inet_pton(AF_INET,remote_ip,&(eth->dest_addr.sin_addr.s_addr));
|
||||
eth->dest_addr.sin_port=htons(remote_port);
|
||||
inet_ntop(AF_INET, &(eth->dest_addr.sin_addr), str_remote, INET_ADDRSTRLEN);
|
||||
|
||||
|
||||
local_addr[Mod_id].sin_family = AF_INET;
|
||||
inet_pton(AF_INET,local_ip,&(local_addr[Mod_id].sin_addr.s_addr));
|
||||
local_addr[Mod_id].sin_port=htons(local_port);
|
||||
inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str_local, INET_ADDRSTRLEN);
|
||||
eth->local_addr.sin_family = AF_INET;
|
||||
inet_pton(AF_INET,local_ip,&(eth->local_addr.sin_addr.s_addr));
|
||||
eth->local_addr.sin_port=htons(local_port);
|
||||
inet_ntop(AF_INET, &(eth->local_addr.sin_addr), str_local, INET_ADDRSTRLEN);
|
||||
|
||||
|
||||
/* set reuse address flag */
|
||||
if (setsockopt(eth->sockfd[Mod_id], SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) {
|
||||
if (setsockopt(eth->sockfd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) {
|
||||
perror("ETHERNET: Cannot set SO_REUSEADDR option on socket");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* want to receive -> so bind */
|
||||
if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&local_addr[Mod_id],addr_len[Mod_id])<0) {
|
||||
if (bind(eth->sockfd,(struct sockaddr *)ð->local_addr,eth->addr_len)<0) {
|
||||
perror("ETHERNET: Cannot bind to socket");
|
||||
exit(0);
|
||||
} else {
|
||||
printf("[%s] binding mod_%d to %s:%d\n","RRH",Mod_id,str_local,ntohs(local_addr[Mod_id].sin_port));
|
||||
printf("[%s] binding to %s:%d\n","RRH",str_local,ntohs(eth->local_addr.sin_port));
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -135,54 +132,62 @@ int trx_eth_read_udp_IF4p5(openair0_device *device, openair0_timestamp *timestam
|
||||
|
||||
// Read nblocks info from packet itself
|
||||
int nblocks = nsamps;
|
||||
int bytes_received=0;
|
||||
int bytes_received=-1;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
|
||||
|
||||
ssize_t packet_size = sizeof_IF4p5_header_t;
|
||||
IF4p5_header_t *test_header = (IF4p5_header_t*)(buff[0]);
|
||||
|
||||
int block_cnt=0;
|
||||
int again_cnt=0;
|
||||
packet_size = max(UDP_IF4p5_PRACH_SIZE_BYTES, max(UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks), UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks)));
|
||||
|
||||
|
||||
bytes_received = recvfrom(eth->sockfd[Mod_id],
|
||||
buff[0],
|
||||
packet_size,
|
||||
0,
|
||||
(struct sockaddr *)&dest_addr[Mod_id],
|
||||
(socklen_t *)&addr_len[Mod_id]);
|
||||
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
perror("ETHERNET IF4p5 READ (header): ");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
*timestamp = test_header->sub_type;
|
||||
|
||||
if (test_header->sub_type == IF4p5_PDLFFT) {
|
||||
packet_size = UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks);
|
||||
} else if (test_header->sub_type == IF4p5_PULFFT) {
|
||||
packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks);
|
||||
} else {
|
||||
packet_size = UDP_IF4p5_PRACH_SIZE_BYTES;
|
||||
}
|
||||
|
||||
|
||||
while(bytes_received < packet_size) {
|
||||
bytes_received = recvfrom(eth->sockfd[Mod_id],
|
||||
buff[0],
|
||||
packet_size,
|
||||
0,
|
||||
(struct sockaddr *)&dest_addr[Mod_id],
|
||||
(socklen_t *)&addr_len[Mod_id]);
|
||||
while(bytes_received == -1) {
|
||||
again:
|
||||
bytes_received = recvfrom(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
0,
|
||||
(struct sockaddr *)ð->dest_addr,
|
||||
(socklen_t *)ð->addr_len);
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
perror("ETHERNET IF4p5 READ (payload): ");
|
||||
exit(-1);
|
||||
if (errno == EAGAIN) {
|
||||
/*
|
||||
again_cnt++;
|
||||
usleep(10);
|
||||
if (again_cnt == 1000) {
|
||||
perror("ETHERNET IF4p5 READ (EAGAIN): ");
|
||||
exit(-1);
|
||||
} else {
|
||||
printf("AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN \n");
|
||||
goto again;
|
||||
}
|
||||
*/
|
||||
printf("Lost IF4p5 connection with %s\n", inet_ntoa(eth->dest_addr.sin_addr));
|
||||
exit(-1);
|
||||
} else if (errno == EWOULDBLOCK) {
|
||||
block_cnt++;
|
||||
usleep(10);
|
||||
if (block_cnt == 1000) {
|
||||
perror("ETHERNET IF4p5 READ (EWOULDBLOCK): ");
|
||||
exit(-1);
|
||||
} else {
|
||||
printf("BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK \n");
|
||||
goto again;
|
||||
}
|
||||
} else {
|
||||
perror("ETHERNET IF4p5 READ");
|
||||
printf("(%s):\n", strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
eth->rx_actual_nsamps = bytes_received>>1;
|
||||
*timestamp = test_header->sub_type;
|
||||
eth->rx_actual_nsamps = bytes_received>>1;
|
||||
eth->rx_count++;
|
||||
}
|
||||
}
|
||||
//printf("size of third %d subtype %d frame %d subframe %d symbol %d \n", bytes_received, test_header->sub_type, ((test_header->frame_status)>>6)&0xffff, ((test_header->frame_status)>>22)&0x000f, ((test_header->frame_status)>>26)&0x000f) ;
|
||||
|
||||
eth->rx_nsamps = nsamps;
|
||||
return(bytes_received);
|
||||
@@ -194,7 +199,6 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
int bytes_sent = 0;
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
|
||||
ssize_t packet_size;
|
||||
|
||||
@@ -202,6 +206,8 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
packet_size = UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks);
|
||||
} else if (flags == IF4p5_PULFFT) {
|
||||
packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks);
|
||||
} else if (flags == IF4p5_PULTICK) {
|
||||
packet_size = UDP_IF4p5_PULTICK_SIZE_BYTES;
|
||||
} else if (flags == IF4p5_PRACH) {
|
||||
packet_size = UDP_IF4p5_PRACH_SIZE_BYTES;
|
||||
} else {
|
||||
@@ -211,12 +217,12 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
|
||||
eth->tx_nsamps = nblocks;
|
||||
|
||||
bytes_sent = sendto(eth->sockfd[Mod_id],
|
||||
bytes_sent = sendto(eth->sockfd,
|
||||
buff[0],
|
||||
packet_size,
|
||||
0,
|
||||
(struct sockaddr*)&dest_addr[Mod_id],
|
||||
addr_len[Mod_id]);
|
||||
(struct sockaddr*)ð->dest_addr,
|
||||
eth->addr_len);
|
||||
|
||||
if (bytes_sent == -1) {
|
||||
eth->num_tx_errors++;
|
||||
@@ -234,7 +240,6 @@ int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
|
||||
int bytes_sent=0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
int sendto_flag =0;
|
||||
int i=0;
|
||||
//sendto_flag|=flags;
|
||||
@@ -268,12 +273,12 @@ int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
bytes_sent);
|
||||
#endif
|
||||
/* Send packet */
|
||||
bytes_sent += sendto(eth->sockfd[Mod_id],
|
||||
bytes_sent += sendto(eth->sockfd,
|
||||
buff2,
|
||||
UDP_PACKET_SIZE_BYTES(nsamps),
|
||||
sendto_flag,
|
||||
(struct sockaddr*)&dest_addr[Mod_id],
|
||||
addr_len[Mod_id]);
|
||||
(struct sockaddr*)ð->dest_addr,
|
||||
eth->addr_len);
|
||||
|
||||
if ( bytes_sent == -1) {
|
||||
eth->num_tx_errors++;
|
||||
@@ -291,7 +296,7 @@ int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
eth->tx_actual_nsamps=bytes_sent>>2;
|
||||
eth->tx_count++;
|
||||
pck_seq_num++;
|
||||
if ( pck_seq_num > MAX_PACKET_SEQ_NUM(nsamps,76800) ) pck_seq_num = 1;
|
||||
if ( pck_seq_num > MAX_PACKET_SEQ_NUM(nsamps,device->openair0_cfg->samples_per_frame) ) pck_seq_num = 1;
|
||||
}
|
||||
}
|
||||
/* tx buffer values restored */
|
||||
@@ -309,7 +314,6 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
int bytes_received=0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
// openair0_timestamp prev_timestamp = -1;
|
||||
int Mod_id = device->Mod_id;
|
||||
int rcvfrom_flag =0;
|
||||
int block_cnt=0;
|
||||
int again_cnt=0;
|
||||
@@ -338,12 +342,12 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
UDP_PACKET_SIZE_BYTES(nsamps) - bytes_received,
|
||||
bytes_received);
|
||||
#endif
|
||||
bytes_received +=recvfrom(eth->sockfd[Mod_id],
|
||||
bytes_received +=recvfrom(eth->sockfd,
|
||||
buff2,
|
||||
UDP_PACKET_SIZE_BYTES(nsamps),
|
||||
rcvfrom_flag,
|
||||
(struct sockaddr *)&dest_addr[Mod_id],
|
||||
(socklen_t *)&addr_len[Mod_id]);
|
||||
(struct sockaddr *)ð->dest_addr,
|
||||
(socklen_t *)ð->addr_len);
|
||||
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
@@ -389,7 +393,7 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
/* get the packet sequence number from packet's header */
|
||||
pck_seq_num_cur = *(uint16_t *)buff2;
|
||||
//printf("cur=%d prev=%d buff=%d\n",pck_seq_num_cur,pck_seq_num_prev,*(uint16_t *)(buff2));
|
||||
if ( ( pck_seq_num_cur != (pck_seq_num_prev + 1) ) && !((pck_seq_num_prev==75) && (pck_seq_num_cur==1 ))){
|
||||
if ( ( pck_seq_num_cur != (pck_seq_num_prev + 1) ) && !((pck_seq_num_prev==MAX_PACKET_SEQ_NUM(nsamps,device->openair0_cfg->samples_per_frame)) && (pck_seq_num_cur==1 )) && !((pck_seq_num_prev==1) && (pck_seq_num_cur==1))) {
|
||||
printf("out of order packet received1! %d|%d|%d\n",pck_seq_num_cur,pck_seq_num_prev,(int)*timestamp);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM,pck_seq_num_cur);
|
||||
@@ -412,7 +416,6 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
|
||||
int eth_set_dev_conf_udp(openair0_device *device) {
|
||||
|
||||
int Mod_id = device->Mod_id;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
void *msg;
|
||||
ssize_t msg_len;
|
||||
@@ -425,9 +428,10 @@ int eth_set_dev_conf_udp(openair0_device *device) {
|
||||
msg=malloc(sizeof(openair0_config_t));
|
||||
msg_len=sizeof(openair0_config_t);
|
||||
memcpy(msg,(void*)device->openair0_cfg,msg_len);
|
||||
|
||||
if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&dest_addr[Mod_id],addr_len[Mod_id])==-1) {
|
||||
perror("ETHERNET: ");
|
||||
|
||||
if (sendto(eth->sockfd,msg,msg_len,0,(struct sockaddr *)ð->dest_addr,eth->addr_len)==-1) {
|
||||
perror("ETHERNET: sendto conf_udp");
|
||||
printf("addr_len : %d, msg_len %d\n",eth->addr_len,msg_len);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -437,7 +441,6 @@ int eth_set_dev_conf_udp(openair0_device *device) {
|
||||
int eth_get_dev_conf_udp(openair0_device *device) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
char str1[INET_ADDRSTRLEN],str[INET_ADDRSTRLEN];
|
||||
void *msg;
|
||||
ssize_t msg_len;
|
||||
@@ -445,31 +448,31 @@ int eth_get_dev_conf_udp(openair0_device *device) {
|
||||
msg=malloc(sizeof(openair0_config_t));
|
||||
msg_len=sizeof(openair0_config_t);
|
||||
|
||||
inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN);
|
||||
inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str1, INET_ADDRSTRLEN);
|
||||
inet_ntop(AF_INET, &(eth->local_addr.sin_addr), str, INET_ADDRSTRLEN);
|
||||
inet_ntop(AF_INET, &(eth->dest_addr.sin_addr), str1, INET_ADDRSTRLEN);
|
||||
|
||||
/* RRH receives from BBU openair0_config_t */
|
||||
if (recvfrom(eth->sockfd[Mod_id],
|
||||
if (recvfrom(eth->sockfd,
|
||||
msg,
|
||||
msg_len,
|
||||
0,
|
||||
(struct sockaddr *)&dest_addr[Mod_id],
|
||||
(socklen_t *)&addr_len[Mod_id])==-1) {
|
||||
perror("ETHERNET: ");
|
||||
(struct sockaddr *)ð->dest_addr,
|
||||
(socklen_t *)ð->addr_len)==-1) {
|
||||
perror("ETHERNET: recv_from conf_udp");
|
||||
exit(0);
|
||||
}
|
||||
device->openair0_cfg=(openair0_config_t *)msg;
|
||||
|
||||
/* get remote ip address and port */
|
||||
/* inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str1, INET_ADDRSTRLEN); */
|
||||
/* device->openair0_cfg->remote_port =ntohs(dest_addr[Mod_id].sin_port); */
|
||||
/* inet_ntop(AF_INET, &(eth->dest_addr.sin_addr), str1, INET_ADDRSTRLEN); */
|
||||
/* device->openair0_cfg->remote_port =ntohs(eth->dest_addr.sin_port); */
|
||||
/* device->openair0_cfg->remote_addr =str1; */
|
||||
|
||||
/* /\* restore local ip address and port *\/ */
|
||||
/* inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN); */
|
||||
/* device->openair0_cfg->my_port =ntohs(local_addr[Mod_id].sin_port); */
|
||||
/* inet_ntop(AF_INET, &(eth->local_addr.sin_addr), str, INET_ADDRSTRLEN); */
|
||||
/* device->openair0_cfg->my_port =ntohs(eth->local_addr.sin_port); */
|
||||
/* device->openair0_cfg->my_addr =str; */
|
||||
|
||||
/* printf("[RRH] mod_%d socket %d connected to BBU %s:%d %s:%d\n", Mod_id, eth->sockfd[Mod_id],str1, device->openair0_cfg->remote_port, str, device->openair0_cfg->my_port); */
|
||||
/* printf("[RRH] mod_%d socket %d connected to BBU %s:%d %s:%d\n", Mod_id, eth->sockfd,str1, device->openair0_cfg->remote_port, str, device->openair0_cfg->my_port); */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -45,117 +45,114 @@
|
||||
#include "common_lib.h"
|
||||
#include "ethernet_lib.h"
|
||||
|
||||
int num_devices_eth = 0;
|
||||
struct sockaddr_in dest_addr[MAX_INST];
|
||||
int dest_addr_len[MAX_INST];
|
||||
|
||||
|
||||
int trx_eth_start(openair0_device *device) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
/* initialize socket */
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
printf("Setting ETHERNET to ETH_RAW_IF5_MODE\n");
|
||||
if (eth_socket_init_raw(device)!=0) return -1;
|
||||
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_raw(device)!=0) return -1;
|
||||
} else {
|
||||
if(eth_get_dev_conf_raw(device)!=0) return -1;
|
||||
}
|
||||
/* adjust MTU wrt number of samples per packet */
|
||||
if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1;
|
||||
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
|
||||
} else if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
|
||||
printf("Setting ETHERNET to ETH_RAW_IF4p5_MODE\n");
|
||||
if (eth_socket_init_raw(device)!=0) return -1;
|
||||
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_raw_IF4p5(device)!=0) return -1;
|
||||
} else {
|
||||
if(eth_get_dev_conf_raw_IF4p5(device)!=0) return -1;
|
||||
}
|
||||
/* adjust MTU wrt number of samples per packet */
|
||||
if(ethernet_tune (device,MTU_SIZE,RAW_IF4p5_PRACH_SIZE_BYTES)!=0) return -1;
|
||||
|
||||
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
|
||||
} else if (eth->flags == ETH_UDP_IF4p5_MODE) {
|
||||
printf("Setting ETHERNET to UDP_IF4p5_MODE\n");
|
||||
if (eth_socket_init_udp(device)!=0) return -1;
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_udp(device)!=0) return -1;
|
||||
} else {
|
||||
if(eth_get_dev_conf_udp(device)!=0) return -1;
|
||||
}
|
||||
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
|
||||
printf("Setting ETHERNET to RAW_IF5_MODE\n");
|
||||
if (eth_socket_init_raw(device)!=0) return -1;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
/* initialize socket */
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
printf("Setting ETHERNET to ETH_RAW_IF5_MODE\n");
|
||||
if (eth_socket_init_raw(device)!=0) return -1;
|
||||
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_raw(device)!=0) return -1;
|
||||
} else {
|
||||
if (eth_socket_init_udp(device)!=0) return -1;
|
||||
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_udp(device)!=0) return -1;
|
||||
} else {
|
||||
if(eth_get_dev_conf_udp(device)!=0) return -1;
|
||||
}
|
||||
if(eth_get_dev_conf_raw(device)!=0) return -1;
|
||||
}
|
||||
/* apply additional configuration */
|
||||
if(ethernet_tune (device, SND_BUF_SIZE,2000000000)!=0) return -1;
|
||||
if(ethernet_tune (device, RCV_BUF_SIZE,2000000000)!=0) return -1;
|
||||
/* adjust MTU wrt number of samples per packet */
|
||||
if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1;
|
||||
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
|
||||
} else if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
|
||||
printf("Setting ETHERNET to ETH_RAW_IF4p5_MODE\n");
|
||||
if (eth_socket_init_raw(device)!=0) return -1;
|
||||
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_raw_IF4p5(device)!=0) return -1;
|
||||
} else {
|
||||
if(eth_get_dev_conf_raw_IF4p5(device)!=0) return -1;
|
||||
}
|
||||
/* adjust MTU wrt number of samples per packet */
|
||||
if(ethernet_tune (device,MTU_SIZE,RAW_IF4p5_PRACH_SIZE_BYTES)!=0) return -1;
|
||||
|
||||
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
|
||||
} else if (eth->flags == ETH_UDP_IF4p5_MODE) {
|
||||
printf("Setting ETHERNET to UDP_IF4p5_MODE\n");
|
||||
if (eth_socket_init_udp(device)!=0) return -1;
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_udp(device)!=0) return -1;
|
||||
} else {
|
||||
if(eth_get_dev_conf_udp(device)!=0) return -1;
|
||||
}
|
||||
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
|
||||
printf("Setting ETHERNET to RAW_IF5_MODE\n");
|
||||
if (eth_socket_init_raw(device)!=0) return -1;
|
||||
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
printf("Setting ETHERNET to UDP_IF5_MODE\n");
|
||||
if (eth_socket_init_udp(device)!=0) return -1;
|
||||
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
|
||||
if (device->host_type == BBU_HOST) {
|
||||
if(eth_set_dev_conf_udp(device)!=0) return -1;
|
||||
} else {
|
||||
if(eth_get_dev_conf_udp(device)!=0) return -1;
|
||||
}
|
||||
}
|
||||
/* apply additional configuration */
|
||||
if(ethernet_tune (device, SND_BUF_SIZE,2000000000)!=0) return -1;
|
||||
if(ethernet_tune (device, RCV_BUF_SIZE,2000000000)!=0) return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void trx_eth_end(openair0_device *device) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
/* destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
|
||||
if ( close(eth->sockfd[Mod_id]) <0 ) {
|
||||
perror("ETHERNET: Failed to close socket");
|
||||
exit(0);
|
||||
} else {
|
||||
printf("[%s] socket for mod_id %d has been successfully closed.\n",(device->host_type == BBU_HOST)? "BBU":"RRH",Mod_id);
|
||||
}
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
/* destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
|
||||
if ( close(eth->sockfd) <0 ) {
|
||||
perror("ETHERNET: Failed to close socket");
|
||||
exit(0);
|
||||
} else {
|
||||
printf("[%s] socket has been successfully closed.\n",(device->host_type == BBU_HOST)? "BBU":"RRH");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int trx_eth_request(openair0_device *device, void *msg, ssize_t msg_len) {
|
||||
|
||||
int Mod_id = device->Mod_id;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
/* BBU sends a message to RRH */
|
||||
if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&dest_addr[Mod_id],dest_addr_len[Mod_id])==-1) {
|
||||
perror("ETHERNET: ");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
/* BBU sends a message to RRH */
|
||||
|
||||
if (sendto(eth->sockfd,msg,msg_len,0,(struct sockaddr *)ð->dest_addr,eth->addr_len)==-1) {
|
||||
perror("ETHERNET: ");
|
||||
exit(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int trx_eth_reply(openair0_device *device, void *msg, ssize_t msg_len) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
/* RRH receives from BBU a message */
|
||||
if (recvfrom(eth->sockfd[Mod_id],
|
||||
msg,
|
||||
msg_len,
|
||||
0,
|
||||
(struct sockaddr *)&dest_addr[Mod_id],
|
||||
(socklen_t *)&dest_addr_len[Mod_id])==-1) {
|
||||
perror("ETHERNET: ");
|
||||
exit(0);
|
||||
}
|
||||
/* RRH receives from BBU a message */
|
||||
|
||||
return 0;
|
||||
if (recvfrom(eth->sockfd,
|
||||
msg,
|
||||
msg_len,
|
||||
0,
|
||||
(struct sockaddr *)ð->dest_addr,
|
||||
(socklen_t *)ð->addr_len)==-1) {
|
||||
perror("ETHERNET: recv_from in trx_eth_reply ");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,236 +179,233 @@ int trx_eth_reset_stats(openair0_device* device) {
|
||||
|
||||
|
||||
int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id=device->Mod_id;
|
||||
struct timeval timeout;
|
||||
struct ifreq ifr;
|
||||
char system_cmd[256];
|
||||
// char* if_name=DEFAULT_IF;
|
||||
// struct in_addr ia;
|
||||
// struct if_nameindex *ids;
|
||||
int ret=0;
|
||||
// int i=0;
|
||||
|
||||
/****************** socket level options ************************/
|
||||
switch(option) {
|
||||
case SND_BUF_SIZE: /* transmit socket buffer size */
|
||||
if (setsockopt(eth->sockfd[Mod_id],
|
||||
SOL_SOCKET,
|
||||
SO_SNDBUF,
|
||||
&value,sizeof(value))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf("send buffer size= %d bytes\n",value);
|
||||
}
|
||||
break;
|
||||
|
||||
case RCV_BUF_SIZE: /* receive socket buffer size */
|
||||
if (setsockopt(eth->sockfd[Mod_id],
|
||||
SOL_SOCKET,
|
||||
SO_RCVBUF,
|
||||
&value,sizeof(value))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf("receive bufffer size= %d bytes\n",value);
|
||||
}
|
||||
break;
|
||||
|
||||
case RCV_TIMEOUT:
|
||||
timeout.tv_sec = value/1000000;
|
||||
timeout.tv_usec = value%1000000;//less than rt_period?
|
||||
if (setsockopt(eth->sockfd[Mod_id],
|
||||
SOL_SOCKET,
|
||||
SO_RCVTIMEO,
|
||||
(char *)&timeout,sizeof(timeout))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf( "receive timeout= %u usec\n",(unsigned int)timeout.tv_usec);
|
||||
}
|
||||
break;
|
||||
|
||||
case SND_TIMEOUT:
|
||||
timeout.tv_sec = value/1000000000;
|
||||
timeout.tv_usec = value%1000000000;//less than rt_period?
|
||||
if (setsockopt(eth->sockfd[Mod_id],
|
||||
SOL_SOCKET,
|
||||
SO_SNDTIMEO,
|
||||
(char *)&timeout,sizeof(timeout))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf( "send timeout= %d,%d sec\n",(int)timeout.tv_sec,(int)timeout.tv_usec);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
/******************* interface level options *************************/
|
||||
case MTU_SIZE: /* change MTU of the eth interface */
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
strncpy(ifr.ifr_name,eth->if_name[Mod_id], sizeof(ifr.ifr_name));
|
||||
ifr.ifr_mtu =value;
|
||||
if (ioctl(eth->sockfd[Mod_id],SIOCSIFMTU,(caddr_t)&ifr) < 0 )
|
||||
perror ("[ETHERNET] Can't set the MTU");
|
||||
else
|
||||
printf("[ETHERNET] %s MTU size has changed to %d\n",eth->if_name[Mod_id],ifr.ifr_mtu);
|
||||
break;
|
||||
|
||||
case TX_Q_LEN: /* change TX queue length of eth interface */
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
strncpy(ifr.ifr_name,eth->if_name[Mod_id], sizeof(ifr.ifr_name));
|
||||
ifr.ifr_qlen =value;
|
||||
if (ioctl(eth->sockfd[Mod_id],SIOCSIFTXQLEN,(caddr_t)&ifr) < 0 )
|
||||
perror ("[ETHERNET] Can't set the txqueuelen");
|
||||
else
|
||||
printf("[ETHERNET] %s txqueuelen size has changed to %d\n",eth->if_name[Mod_id],ifr.ifr_qlen);
|
||||
break;
|
||||
|
||||
/******************* device level options *************************/
|
||||
case COALESCE_PAR:
|
||||
ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -C %s rx-usecs %d",eth->if_name[Mod_id],value);
|
||||
if (ret > 0) {
|
||||
ret=system(system_cmd);
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Coalesce parameters %s\n",system_cmd);
|
||||
} else {
|
||||
perror("[ETHERNET] Can't set coalesce parameters\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case PAUSE_PAR:
|
||||
if (value==1) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg off rx off tx off",eth->if_name[Mod_id]);
|
||||
else if (value==0) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg on rx on tx on",eth->if_name[Mod_id]);
|
||||
else break;
|
||||
if (ret > 0) {
|
||||
ret=system(system_cmd);
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Pause parameters %s\n",system_cmd);
|
||||
} else {
|
||||
perror("[ETHERNET] Can't set pause parameters\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case RING_PAR:
|
||||
ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -G %s val %d",eth->if_name[Mod_id],value);
|
||||
if (ret > 0) {
|
||||
ret=system(system_cmd);
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Ring parameters %s\n",system_cmd);
|
||||
} else {
|
||||
perror("[ETHERNET] Can't set ring parameters\n");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
struct timeval timeout;
|
||||
struct ifreq ifr;
|
||||
char system_cmd[256];
|
||||
// char* if_name=DEFAULT_IF;
|
||||
// struct in_addr ia;
|
||||
// struct if_nameindex *ids;
|
||||
int ret=0;
|
||||
// int i=0;
|
||||
|
||||
/****************** socket level options ************************/
|
||||
switch(option) {
|
||||
case SND_BUF_SIZE: /* transmit socket buffer size */
|
||||
if (setsockopt(eth->sockfd,
|
||||
SOL_SOCKET,
|
||||
SO_SNDBUF,
|
||||
&value,sizeof(value))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf("send buffer size= %d bytes\n",value);
|
||||
}
|
||||
break;
|
||||
|
||||
case RCV_BUF_SIZE: /* receive socket buffer size */
|
||||
if (setsockopt(eth->sockfd,
|
||||
SOL_SOCKET,
|
||||
SO_RCVBUF,
|
||||
&value,sizeof(value))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf("receive bufffer size= %d bytes\n",value);
|
||||
}
|
||||
break;
|
||||
|
||||
case RCV_TIMEOUT:
|
||||
timeout.tv_sec = value/1000000;
|
||||
timeout.tv_usec = value%1000000;//less than rt_period?
|
||||
if (setsockopt(eth->sockfd,
|
||||
SOL_SOCKET,
|
||||
SO_RCVTIMEO,
|
||||
(char *)&timeout,sizeof(timeout))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf( "receive timeout= %u usec\n",(unsigned int)timeout.tv_usec);
|
||||
}
|
||||
break;
|
||||
|
||||
case SND_TIMEOUT:
|
||||
timeout.tv_sec = value/1000000000;
|
||||
timeout.tv_usec = value%1000000000;//less than rt_period?
|
||||
if (setsockopt(eth->sockfd,
|
||||
SOL_SOCKET,
|
||||
SO_SNDTIMEO,
|
||||
(char *)&timeout,sizeof(timeout))) {
|
||||
perror("[ETHERNET] setsockopt()");
|
||||
} else {
|
||||
printf( "send timeout= %d,%d sec\n",(int)timeout.tv_sec,(int)timeout.tv_usec);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
/******************* interface level options *************************/
|
||||
case MTU_SIZE: /* change MTU of the eth interface */
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
strncpy(ifr.ifr_name,eth->if_name, sizeof(ifr.ifr_name));
|
||||
ifr.ifr_mtu =value;
|
||||
if (ioctl(eth->sockfd,SIOCSIFMTU,(caddr_t)&ifr) < 0 )
|
||||
perror ("[ETHERNET] Can't set the MTU");
|
||||
else
|
||||
printf("[ETHERNET] %s MTU size has changed to %d\n",eth->if_name,ifr.ifr_mtu);
|
||||
break;
|
||||
|
||||
case TX_Q_LEN: /* change TX queue length of eth interface */
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
strncpy(ifr.ifr_name,eth->if_name, sizeof(ifr.ifr_name));
|
||||
ifr.ifr_qlen =value;
|
||||
if (ioctl(eth->sockfd,SIOCSIFTXQLEN,(caddr_t)&ifr) < 0 )
|
||||
perror ("[ETHERNET] Can't set the txqueuelen");
|
||||
else
|
||||
printf("[ETHERNET] %s txqueuelen size has changed to %d\n",eth->if_name,ifr.ifr_qlen);
|
||||
break;
|
||||
|
||||
/******************* device level options *************************/
|
||||
case COALESCE_PAR:
|
||||
ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -C %s rx-usecs %d",eth->if_name,value);
|
||||
if (ret > 0) {
|
||||
ret=system(system_cmd);
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Coalesce parameters %s\n",system_cmd);
|
||||
} else {
|
||||
perror("[ETHERNET] Can't set coalesce parameters\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case PAUSE_PAR:
|
||||
if (value==1) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg off rx off tx off",eth->if_name);
|
||||
else if (value==0) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg on rx on tx on",eth->if_name);
|
||||
else break;
|
||||
if (ret > 0) {
|
||||
ret=system(system_cmd);
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Pause parameters %s\n",system_cmd);
|
||||
} else {
|
||||
perror("[ETHERNET] Can't set pause parameters\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case RING_PAR:
|
||||
ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -G %s val %d",eth->if_name,value);
|
||||
if (ret > 0) {
|
||||
ret=system(system_cmd);
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Ring parameters %s\n",system_cmd);
|
||||
} else {
|
||||
perror("[ETHERNET] Can't set ring parameters\n");
|
||||
}
|
||||
break;
|
||||
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params ) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)malloc(sizeof(eth_state_t));
|
||||
memset(eth, 0, sizeof(eth_state_t));
|
||||
eth_state_t *eth = (eth_state_t*)malloc(sizeof(eth_state_t));
|
||||
memset(eth, 0, sizeof(eth_state_t));
|
||||
|
||||
if (eth_params->transp_preference == 1) {
|
||||
eth->flags = ETH_RAW_MODE;
|
||||
} else if (eth_params->transp_preference == 0) {
|
||||
eth->flags = ETH_UDP_MODE;
|
||||
} else if (eth_params->transp_preference == 3) {
|
||||
eth->flags = ETH_RAW_IF4p5_MODE;
|
||||
} else if (eth_params->transp_preference == 2) {
|
||||
eth->flags = ETH_UDP_IF4p5_MODE;
|
||||
} else if (eth_params->transp_preference == 4) {
|
||||
eth->flags = ETH_RAW_IF5_MOBIPASS;
|
||||
} else {
|
||||
printf("transport_init: Unknown transport preference %d - default to RAW", eth_params->transp_preference);
|
||||
eth->flags = ETH_RAW_MODE;
|
||||
}
|
||||
|
||||
printf("[ETHERNET]: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
device->Mod_id = 0;//num_devices_eth++;
|
||||
device->transp_type = ETHERNET_TP;
|
||||
device->trx_start_func = trx_eth_start;
|
||||
device->trx_request_func = trx_eth_request;
|
||||
device->trx_reply_func = trx_eth_reply;
|
||||
device->trx_get_stats_func = trx_eth_get_stats;
|
||||
device->trx_reset_stats_func = trx_eth_reset_stats;
|
||||
device->trx_end_func = trx_eth_end;
|
||||
device->trx_stop_func = trx_eth_stop;
|
||||
device->trx_set_freq_func = trx_eth_set_freq;
|
||||
device->trx_set_gains_func = trx_eth_set_gains;
|
||||
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
device->trx_write_func = trx_eth_write_raw;
|
||||
device->trx_read_func = trx_eth_read_raw;
|
||||
} else if (eth->flags == ETH_UDP_MODE) {
|
||||
device->trx_write_func = trx_eth_write_udp;
|
||||
device->trx_read_func = trx_eth_read_udp;
|
||||
} else if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
device->trx_write_func = trx_eth_write_raw_IF4p5;
|
||||
device->trx_read_func = trx_eth_read_raw_IF4p5;
|
||||
} else if (eth->flags == ETH_UDP_IF4p5_MODE) {
|
||||
device->trx_write_func = trx_eth_write_udp_IF4p5;
|
||||
device->trx_read_func = trx_eth_read_udp_IF4p5;
|
||||
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
|
||||
device->trx_write_func = trx_eth_write_raw_IF4p5;
|
||||
device->trx_read_func = trx_eth_read_raw_IF5_mobipass;
|
||||
} else {
|
||||
//device->trx_write_func = trx_eth_write_udp_IF4p5;
|
||||
//device->trx_read_func = trx_eth_read_udp_IF4p5;
|
||||
}
|
||||
|
||||
eth->if_name = eth_params->local_if_name;
|
||||
device->priv = eth;
|
||||
|
||||
/* device specific */
|
||||
openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
|
||||
openair0_cfg[0].iq_txshift = eth_params->iq_txshift;// shift
|
||||
openair0_cfg[0].tx_sample_advance = eth_params->tx_sample_advance;
|
||||
|
||||
if (eth_params->transp_preference == 1) {
|
||||
eth->flags = ETH_RAW_MODE;
|
||||
} else if (eth_params->transp_preference == 0) {
|
||||
eth->flags = ETH_UDP_MODE;
|
||||
} else if (eth_params->transp_preference == 3) {
|
||||
eth->flags = ETH_RAW_IF4p5_MODE;
|
||||
} else if (eth_params->transp_preference == 2) {
|
||||
eth->flags = ETH_UDP_IF4p5_MODE;
|
||||
} else if (eth_params->transp_preference == 4) {
|
||||
eth->flags = ETH_RAW_IF5_MOBIPASS;
|
||||
} else {
|
||||
printf("transport_init: Unknown transport preference %d - default to RAW", eth_params->transp_preference);
|
||||
eth->flags = ETH_RAW_MODE;
|
||||
/* RRH does not have any information to make this configuration atm */
|
||||
if (device->host_type == BBU_HOST) {
|
||||
/*Note scheduling advance values valid only for case 7680000 */
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 30720000:
|
||||
openair0_cfg[0].samples_per_packet = 3840;
|
||||
break;
|
||||
case 23040000:
|
||||
openair0_cfg[0].samples_per_packet = 2880;
|
||||
break;
|
||||
case 15360000:
|
||||
openair0_cfg[0].samples_per_packet = 1920;
|
||||
break;
|
||||
case 7680000:
|
||||
openair0_cfg[0].samples_per_packet = 960;
|
||||
break;
|
||||
case 1920000:
|
||||
openair0_cfg[0].samples_per_packet = 240;
|
||||
break;
|
||||
default:
|
||||
printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
printf("[ETHERNET]: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
device->Mod_id = num_devices_eth++;
|
||||
device->transp_type = ETHERNET_TP;
|
||||
device->trx_start_func = trx_eth_start;
|
||||
device->trx_request_func = trx_eth_request;
|
||||
device->trx_reply_func = trx_eth_reply;
|
||||
device->trx_get_stats_func = trx_eth_get_stats;
|
||||
device->trx_reset_stats_func = trx_eth_reset_stats;
|
||||
device->trx_end_func = trx_eth_end;
|
||||
device->trx_stop_func = trx_eth_stop;
|
||||
device->trx_set_freq_func = trx_eth_set_freq;
|
||||
device->trx_set_gains_func = trx_eth_set_gains;
|
||||
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
device->trx_write_func = trx_eth_write_raw;
|
||||
device->trx_read_func = trx_eth_read_raw;
|
||||
} else if (eth->flags == ETH_UDP_MODE) {
|
||||
device->trx_write_func = trx_eth_write_udp;
|
||||
device->trx_read_func = trx_eth_read_udp;
|
||||
} else if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
device->trx_write_func = trx_eth_write_raw_IF4p5;
|
||||
device->trx_read_func = trx_eth_read_raw_IF4p5;
|
||||
} else if (eth->flags == ETH_UDP_IF4p5_MODE) {
|
||||
device->trx_write_func = trx_eth_write_udp_IF4p5;
|
||||
device->trx_read_func = trx_eth_read_udp_IF4p5;
|
||||
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
|
||||
device->trx_write_func = trx_eth_write_raw_IF4p5;
|
||||
device->trx_read_func = trx_eth_read_raw_IF4p5;
|
||||
} else {
|
||||
//device->trx_write_func = trx_eth_write_udp_IF4p5;
|
||||
//device->trx_read_func = trx_eth_read_udp_IF4p5;
|
||||
}
|
||||
|
||||
eth->if_name[device->Mod_id] = eth_params->local_if_name;
|
||||
device->priv = eth;
|
||||
|
||||
/* device specific */
|
||||
openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
|
||||
openair0_cfg[0].iq_txshift = eth_params->iq_txshift;// shift
|
||||
openair0_cfg[0].tx_sample_advance = eth_params->tx_sample_advance;
|
||||
|
||||
/* RRH does not have any information to make this configuration atm */
|
||||
if (device->host_type == BBU_HOST) {
|
||||
/*Note scheduling advance values valid only for case 7680000 */
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 30720000:
|
||||
openair0_cfg[0].samples_per_packet = 3840;
|
||||
break;
|
||||
case 23040000:
|
||||
openair0_cfg[0].samples_per_packet = 2880;
|
||||
break;
|
||||
case 15360000:
|
||||
openair0_cfg[0].samples_per_packet = 1920;
|
||||
break;
|
||||
case 7680000:
|
||||
openair0_cfg[0].samples_per_packet = 960;
|
||||
break;
|
||||
case 1920000:
|
||||
openair0_cfg[0].samples_per_packet = 240;
|
||||
break;
|
||||
default:
|
||||
printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
device->openair0_cfg=&openair0_cfg[0];
|
||||
return 0;
|
||||
}
|
||||
device->openair0_cfg=&openair0_cfg[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,11 +55,23 @@
|
||||
typedef struct {
|
||||
|
||||
/*!\brief socket file desc */
|
||||
int sockfd[MAX_INST];
|
||||
int sockfd;
|
||||
/*!\brief interface name */
|
||||
char *if_name[MAX_INST];
|
||||
char *if_name;
|
||||
/*!\brief buffer size */
|
||||
unsigned int buffer_size;
|
||||
/*!\brief destination address for UDP socket*/
|
||||
struct sockaddr_in dest_addr;
|
||||
/*!\brief local address for UDP socket*/
|
||||
struct sockaddr_in local_addr;
|
||||
/*!\brief address length for both UDP and RAW socket*/
|
||||
int addr_len;
|
||||
/*!\brief destination address for RAW socket*/
|
||||
struct sockaddr_ll dest_addr_ll;
|
||||
/*!\brief local address for RAW socket*/
|
||||
struct sockaddr_ll local_addr_ll;
|
||||
/*!\brief inteface index for RAW socket*/
|
||||
struct ifreq if_index;
|
||||
/*!\brief timeout ms */
|
||||
unsigned int rx_timeout_ms;
|
||||
/*!\brief timeout ms */
|
||||
@@ -218,6 +230,7 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
|
||||
int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
|
||||
int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
|
||||
int trx_eth_read_raw_IF5_mobipass(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
|
||||
int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
|
||||
int trx_eth_read_udp_IF4p5(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
|
||||
int eth_get_dev_conf_raw(openair0_device *device);
|
||||
|
||||
@@ -56,15 +56,19 @@
|
||||
|
||||
// Packet sizes for IF4p5 interface format
|
||||
#define DATA_BLOCK_SIZE_BYTES(scaled_nblocks) (sizeof(uint16_t)*scaled_nblocks)
|
||||
#define PRACH_BLOCK_SIZE_BYTES (sizeof(int16_t)*839*2) // FIX hard coded prach size (uncompressed)
|
||||
#define PRACH_HARD_CODED_NUM_SAMPLES (839*2)
|
||||
#define PRACH_BLOCK_SIZE_BYTES (sizeof(int16_t)*PRACH_HARD_CODED_NUM_SAMPLES) // FIX hard coded prach size
|
||||
|
||||
#define RAW_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define RAW_IF4p5_PULTICK_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t)
|
||||
#define RAW_IF4p5_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES)
|
||||
#define UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define UDP_IF4p5_PULTICK_SIZE_BYTES (sizeof_IF4p5_header_t)
|
||||
#define UDP_IF4p5_PRACH_SIZE_BYTES (sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES)
|
||||
|
||||
// Mobipass packet sizes
|
||||
#define RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES 1280
|
||||
#define RAW_IF5_MOBIPASS_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES)
|
||||
#define PAYLOAD_MOBIPASS_NUM_SAMPLES 640
|
||||
|
||||
@@ -177,10 +177,27 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
|
||||
s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate);
|
||||
|
||||
|
||||
if(flags)
|
||||
if(flags>0)
|
||||
s->tx_md.has_time_spec = true;
|
||||
else
|
||||
s->tx_md.has_time_spec = false;
|
||||
|
||||
if (flags == 2) { // start of burst
|
||||
s->tx_md.start_of_burst = true;
|
||||
s->tx_md.end_of_burst = false;
|
||||
}
|
||||
else if (flags == 3) { // end of burst
|
||||
s->tx_md.start_of_burst = false;
|
||||
s->tx_md.end_of_burst = true;
|
||||
}
|
||||
else if (flags == 4) { // start and end
|
||||
s->tx_md.start_of_burst = true;
|
||||
s->tx_md.end_of_burst = true;
|
||||
}
|
||||
else if (flags==1) { // middle of burst
|
||||
s->tx_md.start_of_burst = false;
|
||||
s->tx_md.end_of_burst = false;
|
||||
}
|
||||
|
||||
if (cc>1) {
|
||||
std::vector<void *> buff_ptrs;
|
||||
@@ -190,7 +207,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
|
||||
else
|
||||
ret = (int)s->tx_stream->send(buff[0], nsamps, s->tx_md,1e-3);
|
||||
|
||||
s->tx_md.start_of_burst = false;
|
||||
|
||||
|
||||
if (ret != nsamps) {
|
||||
printf("[xmit] tx samples %d != %d\n",ret,nsamps);
|
||||
@@ -352,19 +369,34 @@ static bool is_equal(double a, double b)
|
||||
return std::fabs(a-b) < std::numeric_limits<double>::epsilon();
|
||||
}
|
||||
|
||||
/*! \brief Set frequencies (TX/RX)
|
||||
void *freq_thread(void *arg) {
|
||||
|
||||
openair0_device *device=(openair0_device *)arg;
|
||||
usrp_state_t *s = (usrp_state_t*)device->priv;
|
||||
|
||||
s->usrp->set_tx_freq(device->openair0_cfg[0].tx_freq[0]);
|
||||
s->usrp->set_rx_freq(device->openair0_cfg[0].rx_freq[0]);
|
||||
}
|
||||
/*! \brief Set frequencies (TX/RX). Spawns a thread to handle the frequency change to not block the calling thread
|
||||
* \param device the hardware to use
|
||||
* \param openair0_cfg RF frontend parameters set by application
|
||||
* \param dummy dummy variable not used
|
||||
* \returns 0 in success
|
||||
*/
|
||||
int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) {
|
||||
int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, int dont_block) {
|
||||
|
||||
usrp_state_t *s = (usrp_state_t*)device->priv;
|
||||
pthread_t f_thread;
|
||||
|
||||
printf("Setting USRP TX Freq %f, RX Freq %f\n",openair0_cfg[0].tx_freq[0],openair0_cfg[0].rx_freq[0]);
|
||||
s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]);
|
||||
s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]);
|
||||
|
||||
// spawn a thread to handle the frequency change to not block the calling thread
|
||||
if (dont_block == 1)
|
||||
pthread_create(&f_thread,NULL,freq_thread,(void*)device);
|
||||
else {
|
||||
s->usrp->set_tx_freq(device->openair0_cfg[0].tx_freq[0]);
|
||||
s->usrp->set_rx_freq(device->openair0_cfg[0].rx_freq[0]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
|
||||
@@ -579,7 +611,10 @@ extern "C" {
|
||||
// s->usrp->set_tx_subdev_spec(tx_subdev);
|
||||
|
||||
// lock mboard clocks
|
||||
s->usrp->set_clock_source("internal");
|
||||
if (openair0_cfg[0].clock_source == internal)
|
||||
s->usrp->set_clock_source("internal");
|
||||
else
|
||||
s->usrp->set_clock_source("external");
|
||||
|
||||
//Setting device type to USRP X300/X310
|
||||
device->type=USRP_X300_DEV;
|
||||
@@ -635,6 +670,12 @@ extern "C" {
|
||||
// s->usrp->set_clock_source("internal");
|
||||
// set master clock rate and sample rate for tx & rx for streaming
|
||||
|
||||
// lock mboard clocks
|
||||
if (openair0_cfg[0].clock_source == internal)
|
||||
s->usrp->set_clock_source("internal");
|
||||
else
|
||||
s->usrp->set_clock_source("external");
|
||||
|
||||
device->type = USRP_B200_DEV;
|
||||
|
||||
|
||||
@@ -735,7 +776,10 @@ extern "C" {
|
||||
|
||||
// create tx & rx streamer
|
||||
uhd::stream_args_t stream_args_rx("sc16", "sc16");
|
||||
//stream_args_rx.args["spp"] = str(boost::format("%d") % 2048);//(openair0_cfg[0].rx_num_channels*openair0_cfg[0].samples_per_packet));
|
||||
int samples=openair0_cfg[0].sample_rate;
|
||||
samples/=24000;
|
||||
// stream_args_rx.args["spp"] = str(boost::format("%d") % samples);
|
||||
|
||||
for (i = 0; i<openair0_cfg[0].rx_num_channels; i++)
|
||||
stream_args_rx.channels.push_back(i);
|
||||
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
|
||||
|
||||
@@ -31,7 +31,7 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2680000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 100;
|
||||
@@ -70,7 +70,7 @@ eNBs =
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -100;
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
@@ -149,7 +149,7 @@ eNBs =
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
@@ -40,7 +40,7 @@ eNBs =
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
rx_gain = 120;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
@@ -70,7 +70,7 @@ eNBs =
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -100;
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
|
||||
@@ -17,7 +17,7 @@ eNBs =
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
mobile_network_code = "92";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
@@ -129,7 +129,7 @@ eNBs =
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_zero_correlation = 3;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
@@ -265,7 +265,7 @@ eNBs =
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw_if5_mobipass";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
iq_txshift = 0;
|
||||
tx_sample_advance = 80;
|
||||
tx_scheduling_advance = 9;
|
||||
}
|
||||
|
||||
+6
-5
@@ -31,11 +31,12 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2680000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 100;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
@@ -100,7 +101,7 @@ eNBs =
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
ue_TransmissionMode = 1;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -156,12 +157,12 @@ eNBs =
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "74:d4:35:cc:8d:15";
|
||||
local_address = "34:e6:d7:3c:ae:fc";
|
||||
remote_address = "10.10.10.60";
|
||||
local_address = "10.10.10.215";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw_if4p5";
|
||||
tr_preference = "udp_if4p5";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
@@ -31,11 +31,12 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
@@ -67,9 +68,9 @@ eNBs =
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
@@ -100,7 +101,7 @@ eNBs =
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
ue_TransmissionMode = 1;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -149,19 +150,19 @@ eNBs =
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "74:d4:35:cc:8d:15";
|
||||
local_address = "34:e6:d7:3c:ae:fc";
|
||||
remote_address = "10.10.10.60";
|
||||
local_address = "10.10.10.215";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw_if4p5";
|
||||
tr_preference = "udp_if4p5";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
|
||||
+10
-8
@@ -31,11 +31,12 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
@@ -49,7 +50,7 @@ eNBs =
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
@@ -67,9 +68,9 @@ eNBs =
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
@@ -100,6 +101,7 @@ eNBs =
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
}
|
||||
);
|
||||
@@ -149,19 +151,19 @@ eNBs =
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "74:d4:35:cc:8d:15";
|
||||
local_address = "34:e6:d7:3c:ae:fc";
|
||||
remote_address = "10.10.10.60";
|
||||
local_address = "10.10.10.215";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw_if4p5";
|
||||
tr_preference = "udp_if4p5";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
@@ -0,0 +1,191 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "eNodeB_3GPP_BBU";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -104;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "127.0.0.3";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "10.10.10.60";
|
||||
local_address = "10.10.10.215";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "udp";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
tx_scheduling_advance = 9;
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
+9
-4
@@ -36,6 +36,7 @@ eNBs =
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
@@ -100,6 +101,10 @@ eNBs =
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
@@ -155,13 +160,13 @@ eNBs =
|
||||
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "74:d4:35:cc:8d:15";
|
||||
local_address = "34:e6:d7:3c:ae:fc";
|
||||
local_if_name = "eth2";
|
||||
remote_address = "10.10.10.60";
|
||||
local_address = "10.10.10.215";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw_if5";
|
||||
tr_preference = "udp";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
@@ -155,9 +155,9 @@ eNBs =
|
||||
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "34:e6:d7:3c:ae:fc";
|
||||
local_address = "74:d4:35:cc:8d:15";
|
||||
local_if_name = "eth0";
|
||||
remote_address = "90:e2:ba:c5:fc:04";
|
||||
local_address = "00:13:95:1f:a0:af";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
|
||||
@@ -31,15 +31,16 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2680000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 100;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
tx_gain = 90;
|
||||
rx_gain = 120;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
@@ -67,9 +68,9 @@ eNBs =
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_p0_Nominal = -95;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
@@ -85,7 +86,7 @@ eNBs =
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleInitialReceivedTargetPower = -104;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
@@ -101,6 +102,8 @@ eNBs =
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
@@ -156,12 +159,12 @@ eNBs =
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "34:e6:d7:3c:ae:fc";
|
||||
local_address = "74:d4:35:cc:8d:15";
|
||||
remote_address = "10.10.10.215";
|
||||
local_address = "10.10.10.60";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw_if4p5";
|
||||
tr_preference = "udp_if4p5";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "NGFI_RRU_IF4p5";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 120;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -95;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -104;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.11";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth3";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "10.10.10.155";
|
||||
local_address = "10.10.10.60";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "udp_if4p5";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
tx_scheduling_advance = 9;
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -31,15 +31,16 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
rx_gain = 120;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
@@ -67,9 +68,9 @@ eNBs =
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_p0_Nominal = -95;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
@@ -85,7 +86,7 @@ eNBs =
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleInitialReceivedTargetPower = -104;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
@@ -101,6 +102,8 @@ eNBs =
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
@@ -156,12 +159,12 @@ eNBs =
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "34:e6:d7:3c:ae:fc";
|
||||
local_address = "74:d4:35:cc:8d:15";
|
||||
remote_address = "10.10.10.215";
|
||||
local_address = "10.10.10.60";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "raw_if4p5";
|
||||
tr_preference = "udp_if4p5";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "NGFI_RRU_IF5";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 120;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -95;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -104;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.11";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth3";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
rrh_gw_config = (
|
||||
{
|
||||
local_if_name = "eth0";
|
||||
remote_address = "10.10.10.155";
|
||||
local_address = "10.10.10.60";
|
||||
local_port = 50000; #for raw option local port must be the same to remote
|
||||
remote_port = 50000;
|
||||
rrh_gw_active = "yes";
|
||||
tr_preference = "udp";
|
||||
rf_preference = "usrp_b200";
|
||||
iq_txshift = 4;
|
||||
tx_sample_advance = 80;
|
||||
tx_scheduling_advance = 9;
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
+489
-117
@@ -157,7 +157,7 @@ extern double cpuf;
|
||||
|
||||
void exit_fun(const char* s);
|
||||
|
||||
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *,int);
|
||||
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *,int,int);
|
||||
void stop_eNB(int nb_inst);
|
||||
|
||||
|
||||
@@ -279,6 +279,7 @@ static inline void wait_sync(char *thread_name) {
|
||||
void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
|
||||
{
|
||||
|
||||
int CC_id = phy_vars_eNB->proc.CC_id;
|
||||
unsigned int aa,slot_offset;
|
||||
//int dummy_tx_b[7680*4] __attribute__((aligned(32)));
|
||||
int i, tx_offset;
|
||||
@@ -298,14 +299,16 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
|
||||
do_OFDM_mod_symbol(&phy_vars_eNB->common_vars,
|
||||
0,
|
||||
subframe<<1,
|
||||
&phy_vars_eNB->frame_parms);
|
||||
&phy_vars_eNB->frame_parms,
|
||||
phy_vars_eNB->do_precoding);
|
||||
|
||||
// if S-subframe generate first slot only
|
||||
if (subframe_select(&phy_vars_eNB->frame_parms,subframe) == SF_DL) {
|
||||
do_OFDM_mod_symbol(&phy_vars_eNB->common_vars,
|
||||
0,
|
||||
1+(subframe<<1),
|
||||
&phy_vars_eNB->frame_parms);
|
||||
&phy_vars_eNB->frame_parms,
|
||||
phy_vars_eNB->do_precoding);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_OFDM_MODULATION,0);
|
||||
@@ -368,9 +371,9 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
|
||||
|
||||
((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[1] = ((short*)dummy_tx_b)[2*i+1]<<openair0_cfg[0].iq_txshift; */
|
||||
|
||||
((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[0] = ((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[0]<<openair0_cfg[0].iq_txshift;
|
||||
((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[0] = ((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[0]<<openair0_cfg[CC_id].iq_txshift;
|
||||
|
||||
((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[1] = ((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[1]<<openair0_cfg[0].iq_txshift;
|
||||
((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[1] = ((short*)&phy_vars_eNB->common_vars.txdata[0][aa][tx_offset])[1]<<openair0_cfg[CC_id].iq_txshift;
|
||||
}
|
||||
// if S-subframe switch to RX in second subframe
|
||||
if (subframe_select(&phy_vars_eNB->frame_parms,subframe) == SF_S) {
|
||||
@@ -404,16 +407,25 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
|
||||
|
||||
void tx_fh_if5(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, proc->timestamp_tx&0xffffffff );
|
||||
send_IF5(eNB, proc->timestamp_tx, proc->subframe_tx, &seqno, IF5_RRH_GW_DL);
|
||||
if ((eNB->frame_parms.frame_type==FDD) ||
|
||||
((eNB->frame_parms.frame_type==TDD) &&
|
||||
(subframe_select(&eNB->frame_parms,proc->subframe_tx) != SF_UL)))
|
||||
send_IF5(eNB, proc->timestamp_tx, proc->subframe_tx, &seqno, IF5_RRH_GW_DL);
|
||||
}
|
||||
|
||||
void tx_fh_if5_mobipass(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, proc->timestamp_tx&0xffffffff );
|
||||
send_IF5(eNB, proc->timestamp_tx, proc->subframe_tx, &seqno, IF5_MOBIPASS);
|
||||
if ((eNB->frame_parms.frame_type==FDD) ||
|
||||
((eNB->frame_parms.frame_type==TDD) &&
|
||||
(subframe_select(&eNB->frame_parms,proc->subframe_tx) != SF_UL)))
|
||||
send_IF5(eNB, proc->timestamp_tx, proc->subframe_tx, &seqno, IF5_MOBIPASS);
|
||||
}
|
||||
|
||||
void tx_fh_if4p5(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
|
||||
send_IF4p5(eNB,proc->frame_tx, proc->subframe_tx, IF4p5_PDLFFT, 0);
|
||||
void tx_fh_if4p5(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
|
||||
if ((eNB->frame_parms.frame_type==FDD) ||
|
||||
((eNB->frame_parms.frame_type==TDD) &&
|
||||
(subframe_select(&eNB->frame_parms,proc->subframe_tx) != SF_UL)))
|
||||
send_IF4p5(eNB,proc->frame_tx,proc->subframe_tx, IF4p5_PDLFFT, 0);
|
||||
}
|
||||
|
||||
void proc_tx_high0(PHY_VARS_eNB *eNB,
|
||||
@@ -551,9 +563,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
|
||||
start_meas(&softmodem_stats_rxtx_sf);
|
||||
|
||||
// ****************************************
|
||||
// ****************************************
|
||||
// Common RX procedures subframe n
|
||||
phy_procedures_eNB_common_RX(eNB);
|
||||
|
||||
if ((eNB->do_prach)&&((eNB->node_function != NGFI_RCC_IF4p5)))
|
||||
eNB->do_prach(eNB,proc->frame_rx,proc->subframe_rx);
|
||||
phy_procedures_eNB_common_RX(eNB,proc);
|
||||
|
||||
// UE-specific RX processing for subframe n
|
||||
if (eNB->proc_uespec_rx) eNB->proc_uespec_rx(eNB, proc, no_relay );
|
||||
@@ -609,7 +624,8 @@ static void* eNB_thread_rxtx( void* param ) {
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
if (rxtx(eNB,proc,thread_name) < 0) break;
|
||||
if (eNB->CC_id==0)
|
||||
if (rxtx(eNB,proc,thread_name) < 0) break;
|
||||
|
||||
} // while !oai_exit
|
||||
|
||||
@@ -641,32 +657,43 @@ static void wait_system_ready (char *message, volatile int *start_flag) {
|
||||
#endif
|
||||
|
||||
|
||||
// asynchronous UL with IF4p5 (RCC,RAU,eNodeB_BBU)
|
||||
// asynchronous UL with IF5 (RCC,RAU,eNodeB_BBU)
|
||||
void fh_if5_asynch_UL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
|
||||
recv_IF5(eNB, &proc->timestamp_rx, *subframe, IF5_RRH_GW_UL);
|
||||
recv_IF5(eNB, &proc->timestamp_rx, *subframe, IF5_MOBIPASS);
|
||||
|
||||
proc->subframe_rx = (proc->timestamp_rx/fp->samples_per_tti)%10;
|
||||
proc->frame_rx = (proc->timestamp_rx/(10*fp->samples_per_tti))&1023;
|
||||
|
||||
if (proc->first_rx != 0) {
|
||||
proc->first_rx = 0;
|
||||
int offset_mobipass = 40120;
|
||||
pthread_mutex_lock(&proc->mutex_asynch_rxtx);
|
||||
proc->subframe_rx = ((proc->timestamp_rx-offset_mobipass)/fp->samples_per_tti)%10;
|
||||
proc->frame_rx = ((proc->timestamp_rx-offset_mobipass)/(fp->samples_per_tti*10))&1023;
|
||||
|
||||
if (proc->first_rx == 1) {
|
||||
proc->first_rx =2;
|
||||
*subframe = proc->subframe_rx;
|
||||
*frame = proc->frame_rx;
|
||||
LOG_E(PHY,"[Mobipass]timestamp_rx:%llu, frame_rx %d, subframe: %d\n",proc->timestamp_rx,proc->frame_rx,proc->subframe_rx);
|
||||
}
|
||||
else {
|
||||
if (proc->subframe_rx != *subframe) {
|
||||
LOG_E(PHY,"subframe_rx %d is not what we expect %d\n",proc->subframe_rx,*subframe);
|
||||
exit_fun("Exiting");
|
||||
proc->first_rx++;
|
||||
LOG_E(PHY,"[Mobipass]timestamp:%llu, subframe_rx %d is not what we expect %d, first_rx:%d\n",proc->timestamp_rx, proc->subframe_rx,*subframe, proc->first_rx);
|
||||
//exit_fun("Exiting");
|
||||
}
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"subframe_rx %d is not what we expect %d\n",proc->frame_rx,*frame);
|
||||
exit_fun("Exiting");
|
||||
proc->first_rx++;
|
||||
LOG_E(PHY,"[Mobipass]timestamp:%llu, frame_rx %d is not what we expect %d, first_rx:%d\n",proc->timestamp_rx,proc->frame_rx,*frame, proc->first_rx);
|
||||
// exit_fun("Exiting");
|
||||
}
|
||||
// temporary solution
|
||||
*subframe = proc->subframe_rx;
|
||||
*frame = proc->frame_rx;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
|
||||
|
||||
} // eNodeB_3GPP_BBU
|
||||
|
||||
// asynchronous UL with IF4p5 (RCC,RAU,eNodeB_BBU)
|
||||
@@ -693,11 +720,11 @@ void fh_if4p5_asynch_UL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
}
|
||||
else {
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"frame_rx %d is not what we expect %d\n",proc->frame_rx,*frame);
|
||||
LOG_E(PHY,"fh_if4p5_asynch_UL: frame_rx %d is not what we expect %d\n",proc->frame_rx,*frame);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
if (proc->subframe_rx != *subframe) {
|
||||
LOG_E(PHY,"subframe_rx %d is not what we expect %d\n",proc->subframe_rx,*subframe);
|
||||
LOG_E(PHY,"fh_if4p5_asynch_UL: subframe_rx %d is not what we expect %d\n",proc->subframe_rx,*subframe);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
}
|
||||
@@ -721,11 +748,14 @@ void fh_if5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
openair0_timestamp timestamp_tx;
|
||||
|
||||
recv_IF5(eNB, ×tamp_tx, *subframe, IF5_RRH_GW_DL);
|
||||
// printf("Received subframe %d (TS %llu) from RCC\n",subframe_tx,timestamp_tx);
|
||||
//printf("Received subframe %d (TS %llu) from RCC\n",subframe_tx,timestamp_tx);
|
||||
|
||||
subframe_tx = (timestamp_tx/fp->samples_per_tti)%10;
|
||||
frame_tx = (timestamp_tx/(fp->samples_per_tti*10))&1023;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB, frame_tx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB, subframe_tx );
|
||||
|
||||
if (proc->first_tx != 0) {
|
||||
*subframe = subframe_tx;
|
||||
*frame = frame_tx;
|
||||
@@ -733,11 +763,11 @@ void fh_if5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
}
|
||||
else {
|
||||
if (subframe_tx != *subframe) {
|
||||
LOG_E(PHY,"subframe_tx %d is not what we expect %d\n",subframe_tx,*subframe);
|
||||
LOG_E(PHY,"fh_if5_asynch_DL: subframe_tx %d is not what we expect %d\n",subframe_tx,*subframe);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
if (frame_tx != *frame) {
|
||||
LOG_E(PHY,"frame_tx %d is not what we expect %d\n",frame_tx,*frame);
|
||||
LOG_E(PHY,"fh_if5_asynch_DL: frame_tx %d is not what we expect %d\n",frame_tx,*frame);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
}
|
||||
@@ -749,40 +779,67 @@ void fh_if4p5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
|
||||
uint16_t packet_type;
|
||||
uint32_t symbol_number,symbol_mask,symbol_mask_full;
|
||||
uint32_t symbol_number,symbol_mask_full;
|
||||
int subframe_tx,frame_tx;
|
||||
|
||||
symbol_number = 0;
|
||||
symbol_mask = 0;
|
||||
symbol_mask_full = (1<<fp->symbols_per_tti)-1;
|
||||
|
||||
LOG_D(PHY,"fh_asynch_DL_IF4p5: in, frame %d, subframe %d\n",*frame,*subframe);
|
||||
|
||||
// correct for TDD
|
||||
if (fp->frame_type == TDD) {
|
||||
while (subframe_select(fp,*subframe) == SF_UL) {
|
||||
*subframe=*subframe+1;
|
||||
if (*subframe==10) {
|
||||
*subframe=0;
|
||||
*frame=*frame+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(PHY,"fh_asynch_DL_IF4p5: after TDD correction, frame %d, subframe %d\n",*frame,*subframe);
|
||||
|
||||
symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<<fp->dl_symbols_in_S_subframe) : (1<<fp->symbols_per_tti))-1;
|
||||
do { // Blocking, we need a timeout on this !!!!!!!!!!!!!!!!!!!!!!!
|
||||
recv_IF4p5(eNB, &frame_tx, &subframe_tx, &packet_type, &symbol_number);
|
||||
if (proc->first_tx != 0) {
|
||||
*frame = frame_tx;
|
||||
*subframe = subframe_tx;
|
||||
proc->first_tx = 0;
|
||||
proc->frame_offset = frame_tx - proc->frame_tx;
|
||||
symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<<fp->dl_symbols_in_S_subframe) : (1<<fp->symbols_per_tti))-1;
|
||||
|
||||
}
|
||||
else {
|
||||
if (frame_tx != *frame) {
|
||||
LOG_E(PHY,"frame_tx %d is not what we expect %d\n",frame_tx,*frame);
|
||||
LOG_E(PHY,"fh_if4p5_asynch_DL: frame_tx %d is not what we expect %d\n",frame_tx,*frame);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
if (subframe_tx != *subframe) {
|
||||
LOG_E(PHY,"subframe_tx %d is not what we expect %d\n",subframe_tx,*subframe);
|
||||
LOG_E(PHY,"fh_if4p5_asynch_DL: (frame %d) subframe_tx %d is not what we expect %d\n",frame_tx,subframe_tx,*subframe);
|
||||
//*subframe = subframe_tx;
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
}
|
||||
if (packet_type == IF4p5_PDLFFT) {
|
||||
symbol_mask = symbol_mask | (1<<symbol_number);
|
||||
proc->symbol_mask[subframe_tx] =proc->symbol_mask[subframe_tx] | (1<<symbol_number);
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"Illegal IF4p5 packet type (should only be IF4p5_PDLFFT%d\n",packet_type);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
} while (symbol_mask != symbol_mask_full);
|
||||
} while (proc->symbol_mask[*subframe] != symbol_mask_full);
|
||||
|
||||
*frame = frame_tx;
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB, frame_tx );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB, subframe_tx );
|
||||
|
||||
// intialize this to zero after we're done with the subframe
|
||||
proc->symbol_mask[*subframe] = 0;
|
||||
|
||||
do_OFDM_mod_rt(subframe_tx, eNB);
|
||||
do_OFDM_mod_rt(*subframe, eNB);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -848,61 +905,113 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
void *rxp[fp->nb_antennas_rx],*txp[fp->nb_antennas_tx];
|
||||
unsigned int rxs,txs;
|
||||
int i;
|
||||
int tx_sfoffset = 3;//(eNB->single_thread_flag == 1) ? 3 : 3;
|
||||
int tx_sfoffset = (eNB->single_thread_flag == 1) ? 3 : 2;
|
||||
openair0_timestamp ts,old_ts;
|
||||
|
||||
if (proc->first_rx==0) {
|
||||
|
||||
// Transmit TX buffer based on timestamp from RX
|
||||
// printf("trx_write -> USRP TS %llu (sf %d)\n", (proc->timestamp_rx+(3*fp->samples_per_tti)),(proc->subframe_rx+2)%10);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_rx+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance)&0xffffffff );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
||||
// prepare tx buffer pointers
|
||||
|
||||
for (i=0; i<fp->nb_antennas_tx; i++)
|
||||
txp[i] = (void*)&eNB->common_vars.txdata[0][i][((proc->subframe_rx+tx_sfoffset)%10)*fp->samples_per_tti];
|
||||
|
||||
txs = eNB->rfdevice.trx_write_func(&eNB->rfdevice,
|
||||
proc->timestamp_rx+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance,
|
||||
txp,
|
||||
fp->samples_per_tti,
|
||||
fp->nb_antennas_tx,
|
||||
1);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
|
||||
|
||||
|
||||
if (txs != fp->samples_per_tti) {
|
||||
LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, fp->samples_per_tti);
|
||||
exit_fun( "problem transmitting samples" );
|
||||
}
|
||||
|
||||
lte_subframe_t SF_type = subframe_select(fp,(proc->subframe_rx+tx_sfoffset)%10);
|
||||
lte_subframe_t prevSF_type = subframe_select(fp,(proc->subframe_rx+tx_sfoffset+9)%10);
|
||||
lte_subframe_t nextSF_type = subframe_select(fp,(proc->subframe_rx+tx_sfoffset+1)%10);
|
||||
if ((SF_type == SF_DL) ||
|
||||
(SF_type == SF_S)) {
|
||||
|
||||
for (i=0; i<fp->nb_antennas_tx; i++)
|
||||
txp[i] = (void*)&eNB->common_vars.txdata[0][i][((proc->subframe_rx+tx_sfoffset)%10)*fp->samples_per_tti];
|
||||
|
||||
int siglen=fp->samples_per_tti,flags=1;
|
||||
|
||||
if (SF_type == SF_S) {
|
||||
siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0);
|
||||
flags=3; // end of burst
|
||||
}
|
||||
if ((fp->frame_type == TDD) &&
|
||||
(SF_type == SF_DL)&&
|
||||
(prevSF_type == SF_UL) &&
|
||||
(nextSF_type == SF_DL))
|
||||
flags = 2; // start of burst
|
||||
|
||||
if ((fp->frame_type == TDD) &&
|
||||
(SF_type == SF_DL)&&
|
||||
(prevSF_type == SF_UL) &&
|
||||
(nextSF_type == SF_UL))
|
||||
flags = 4; // start of burst and end of burst (only one DL SF between two UL)
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS,flags);
|
||||
txs = eNB->rfdevice.trx_write_func(&eNB->rfdevice,
|
||||
proc->timestamp_rx+eNB->ts_offset+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance,
|
||||
txp,
|
||||
siglen,
|
||||
fp->nb_antennas_tx,
|
||||
flags);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
|
||||
|
||||
|
||||
if (txs != siglen) {
|
||||
LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, fp->samples_per_tti);
|
||||
exit_fun( "problem transmitting samples" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][*subframe*fp->samples_per_tti];
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
|
||||
|
||||
old_ts = proc->timestamp_rx;
|
||||
|
||||
rxs = eNB->rfdevice.trx_read_func(&eNB->rfdevice,
|
||||
&(proc->timestamp_rx),
|
||||
&ts,
|
||||
rxp,
|
||||
fp->samples_per_tti,
|
||||
fp->nb_antennas_rx);
|
||||
|
||||
proc->timestamp_rx = ts-eNB->ts_offset;
|
||||
|
||||
if (rxs != fp->samples_per_tti)
|
||||
LOG_E(PHY,"rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
|
||||
|
||||
|
||||
if (proc->first_rx == 1) {
|
||||
eNB->ts_offset = proc->timestamp_rx;
|
||||
proc->timestamp_rx=0;
|
||||
}
|
||||
else {
|
||||
|
||||
if (proc->timestamp_rx - old_ts != fp->samples_per_tti) {
|
||||
LOG_I(PHY,"rx_rf: rfdevice timing drift of %d samples\n",proc->timestamp_rx - old_ts - fp->samples_per_tti);
|
||||
eNB->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti);
|
||||
proc->timestamp_rx = ts-eNB->ts_offset;
|
||||
}
|
||||
}
|
||||
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
|
||||
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
|
||||
proc->frame_rx = (proc->frame_rx+proc->frame_offset)&1023;
|
||||
proc->frame_tx = proc->frame_rx;
|
||||
if (proc->subframe_rx > 5) proc->frame_tx=(proc->frame_tx+1)&1023;
|
||||
// synchronize first reception to frame 0 subframe 0
|
||||
|
||||
proc->timestamp_tx = proc->timestamp_rx+(4*fp->samples_per_tti);
|
||||
//printf("trx_read <- RX TS %llu (sf %d, first_rx %d)\n", proc->timestamp_rx,proc->subframe_rx,proc->first_rx);
|
||||
// printf("trx_read <- USRP TS %lu (offset %d sf %d, f %d, first_rx %d)\n", proc->timestamp_rx,eNB->ts_offset,proc->subframe_rx,proc->frame_rx,proc->first_rx);
|
||||
|
||||
if (proc->first_rx == 0) {
|
||||
if (proc->subframe_rx != *subframe){
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,*subframe);
|
||||
LOG_E(PHY,"rx_rf: Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->timestamp_rx,proc->subframe_rx,*subframe);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame);
|
||||
int f2 = (*frame+proc->frame_offset)&1023;
|
||||
if (proc->frame_rx != f2) {
|
||||
LOG_E(PHY,"rx_rf: Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d, frame_offset %d, f2 %d)\n",proc->timestamp_rx,proc->frame_rx,*frame,proc->frame_offset,f2);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
} else {
|
||||
@@ -934,12 +1043,12 @@ void rx_fh_if5(PHY_VARS_eNB *eNB,int *frame, int *subframe) {
|
||||
|
||||
if (proc->first_rx == 0) {
|
||||
if (proc->subframe_rx != *subframe){
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,*subframe);
|
||||
LOG_E(PHY,"rx_fh_if5: Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,*subframe);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame);
|
||||
LOG_E(PHY,"rx_fh_if5: Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
} else {
|
||||
@@ -947,6 +1056,10 @@ void rx_fh_if5(PHY_VARS_eNB *eNB,int *frame, int *subframe) {
|
||||
*frame = proc->frame_rx;
|
||||
*subframe = proc->subframe_rx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
|
||||
|
||||
@@ -957,50 +1070,80 @@ void rx_fh_if4p5(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
|
||||
int prach_rx;
|
||||
int f,sf;
|
||||
|
||||
uint16_t packet_type;
|
||||
uint32_t symbol_number=0;
|
||||
uint32_t symbol_mask, symbol_mask_full;
|
||||
uint32_t symbol_mask_full;
|
||||
|
||||
symbol_mask = 0;
|
||||
symbol_mask_full = (1<<fp->symbols_per_tti)-1;
|
||||
prach_rx = 0;
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,*subframe)==SF_S))
|
||||
symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1;
|
||||
else
|
||||
symbol_mask_full = (1<<fp->symbols_per_tti)-1;
|
||||
|
||||
if (eNB->CC_id==1) LOG_I(PHY,"rx_fh_if4p5: frame %d, subframe %d\n",*frame,*subframe);
|
||||
do { // Blocking, we need a timeout on this !!!!!!!!!!!!!!!!!!!!!!!
|
||||
recv_IF4p5(eNB, &proc->frame_rx, &proc->subframe_rx, &packet_type, &symbol_number);
|
||||
recv_IF4p5(eNB, &f, &sf, &packet_type, &symbol_number);
|
||||
|
||||
//proc->frame_rx = (proc->frame_rx + proc->frame_offset)&1023;
|
||||
if (packet_type == IF4p5_PULFFT) {
|
||||
symbol_mask = symbol_mask | (1<<symbol_number);
|
||||
prach_rx = (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>0) ? 1 : 0;
|
||||
LOG_D(PHY,"rx_fh_if4p5: frame %d, subframe %d, PULFFT symbol %d\n",f,sf,symbol_number);
|
||||
|
||||
proc->symbol_mask[sf] = proc->symbol_mask[sf] | (1<<symbol_number);
|
||||
} else if (packet_type == IF4p5_PULTICK) {
|
||||
|
||||
if ((proc->first_rx==0) && (f!=*frame))
|
||||
LOG_E(PHY,"rx_fh_if4p5: PULTICK received frame %d != expected %d\n",f,*frame);
|
||||
if ((proc->first_rx==0) && (sf!=*subframe))
|
||||
LOG_E(PHY,"rx_fh_if4p5: PULTICK received subframe %d != expected %d (first_rx %d)\n",sf,*subframe,proc->first_rx);
|
||||
break;
|
||||
} else if (packet_type == IF4p5_PRACH) {
|
||||
prach_rx = 0;
|
||||
LOG_D(PHY,"rx_fh:if4p5: frame %d, subframe %d, PRACH\n",f,sf);
|
||||
// wakeup prach processing
|
||||
if (eNB->do_prach) eNB->do_prach(eNB,f,sf);
|
||||
}
|
||||
|
||||
} while( (symbol_mask != symbol_mask_full) || (prach_rx == 1));
|
||||
if (eNB->CC_id==1) LOG_I(PHY,"rx_fh_if4p5: symbol_mask[%d] %x\n",*subframe,proc->symbol_mask[*subframe]);
|
||||
|
||||
} while(proc->symbol_mask[*subframe] != symbol_mask_full);
|
||||
|
||||
proc->subframe_rx = sf;
|
||||
proc->frame_rx = f;
|
||||
|
||||
proc->symbol_mask[*subframe] = 0;
|
||||
proc->symbol_mask[(9+*subframe)%10]= 0; // to handle a resynchronization event
|
||||
|
||||
if (eNB->CC_id==1) LOG_I(PHY,"Clearing symbol_mask[%d]\n",*subframe);
|
||||
|
||||
//caculate timestamp_rx, timestamp_tx based on frame and subframe
|
||||
proc->timestamp_rx = ((proc->frame_rx * 10) + proc->subframe_rx ) * fp->samples_per_tti ;
|
||||
proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti);
|
||||
|
||||
proc->timestamp_rx = ((proc->frame_rx * 10) + proc->subframe_rx ) * fp->samples_per_tti ;
|
||||
proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti);
|
||||
|
||||
|
||||
if (proc->first_rx == 0) {
|
||||
if (proc->subframe_rx != *subframe){
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,*subframe);
|
||||
exit_fun("Exiting");
|
||||
LOG_E(PHY,"rx_fh_if4p5, CC_id %d: Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d,CCid %d)\n",eNB->CC_id,proc->subframe_rx,*subframe,eNB->CC_id);
|
||||
}
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame);
|
||||
exit_fun("Exiting");
|
||||
if (proc->frame_rx == proc->frame_offset) // This means that the RRU has adjusted its frame timing
|
||||
proc->frame_offset = 0;
|
||||
else
|
||||
LOG_E(PHY,"rx_fh_if4p5: Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d,CCid %d)\n",proc->frame_rx,*frame,eNB->CC_id);
|
||||
}
|
||||
} else {
|
||||
proc->first_rx--;
|
||||
*frame = proc->frame_rx;
|
||||
proc->first_rx = 0;
|
||||
if (eNB->CC_id==0)
|
||||
proc->frame_offset = 0;
|
||||
else
|
||||
proc->frame_offset = PHY_vars_eNB_g[0][0]->proc.frame_rx;
|
||||
|
||||
*frame = proc->frame_rx;//(proc->frame_rx + proc->frame_offset)&1023;
|
||||
*subframe = proc->subframe_rx;
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
|
||||
|
||||
|
||||
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
|
||||
|
||||
}
|
||||
|
||||
@@ -1089,11 +1232,16 @@ void wakeup_slaves(eNB_proc_t *proc) {
|
||||
exit_fun( "error locking mutex_rxtx" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
while (slave_proc->instance_cnt_FH == 0) {
|
||||
// LOG_W( PHY,"[eNB] Frame:%d , eNB rx_fh_slave thread busy!! (cnt_FH %i)\n", proc->frame_rx,slave_proc->instance_cnt_FH );
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
int cnt_slave = ++slave_proc->instance_cnt_FH;
|
||||
slave_proc->frame_rx = proc->frame_rx;
|
||||
slave_proc->subframe_rx = proc->subframe_rx;
|
||||
slave_proc->timestamp_rx = proc->timestamp_rx;
|
||||
//slave_proc->timestamp_rx = proc->timestamp_rx;
|
||||
slave_proc->timestamp_tx = proc->timestamp_tx;
|
||||
|
||||
pthread_mutex_unlock( &slave_proc->mutex_FH );
|
||||
@@ -1113,6 +1261,117 @@ void wakeup_slaves(eNB_proc_t *proc) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t sync_corr[307200] __attribute__((aligned(32)));
|
||||
|
||||
// This thread run the initial synchronization like a UE
|
||||
void *eNB_thread_synch(void *arg) {
|
||||
|
||||
PHY_VARS_eNB *eNB = (PHY_VARS_eNB*)arg;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int32_t sync_pos,sync_pos2;
|
||||
uint32_t peak_val;
|
||||
|
||||
thread_top_init("eNB_thread_synch",0,5000000,10000000,10000000);
|
||||
|
||||
wait_sync("eNB_thread_synch");
|
||||
|
||||
// initialize variables for PSS detection
|
||||
lte_sync_time_init(&eNB->frame_parms);
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
// wait to be woken up
|
||||
pthread_mutex_lock(&eNB->proc.mutex_synch);
|
||||
while (eNB->proc.instance_cnt_synch < 0)
|
||||
pthread_cond_wait(&eNB->proc.cond_synch,&eNB->proc.mutex_synch);
|
||||
pthread_mutex_unlock(&eNB->proc.mutex_synch);
|
||||
|
||||
// if we're not in synch, then run initial synch
|
||||
if (eNB->in_synch == 0) {
|
||||
// run intial synch like UE
|
||||
LOG_I(PHY,"Running initial synchronization\n");
|
||||
|
||||
sync_pos = lte_sync_time_eNB(eNB->common_vars.rxdata[0],
|
||||
fp,
|
||||
fp->samples_per_tti*5,
|
||||
&peak_val,
|
||||
sync_corr);
|
||||
LOG_I(PHY,"eNB synch: %d, val %d\n",sync_pos,peak_val);
|
||||
|
||||
if (sync_pos >= 0) {
|
||||
if (sync_pos >= fp->nb_prefix_samples)
|
||||
sync_pos2 = sync_pos - fp->nb_prefix_samples;
|
||||
else
|
||||
sync_pos2 = sync_pos + (fp->samples_per_tti*10) - fp->nb_prefix_samples;
|
||||
|
||||
if (fp->frame_type == FDD) {
|
||||
|
||||
// PSS is hypothesized in last symbol of first slot in Frame
|
||||
int sync_pos_slot = (fp->samples_per_tti>>1) - fp->ofdm_symbol_size - fp->nb_prefix_samples;
|
||||
|
||||
if (sync_pos2 >= sync_pos_slot)
|
||||
eNB->rx_offset = sync_pos2 - sync_pos_slot;
|
||||
else
|
||||
eNB->rx_offset = (fp->samples_per_tti*10) + sync_pos2 - sync_pos_slot;
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
LOG_I(PHY,"Estimated sync_pos %d, peak_val %d => timing offset %d\n",sync_pos,peak_val,eNB->rx_offset);
|
||||
|
||||
/*
|
||||
if ((peak_val > 300000) && (sync_pos > 0)) {
|
||||
// if (sync_pos++ > 3) {
|
||||
write_output("eNB_sync.m","sync",(void*)&sync_corr[0],fp->samples_per_tti*5,1,2);
|
||||
write_output("eNB_rx.m","rxs",(void*)eNB->common_vars.rxdata[0][0],fp->samples_per_tti*10,1,1);
|
||||
exit(-1);
|
||||
}
|
||||
*/
|
||||
eNB->in_synch=1;
|
||||
}
|
||||
}
|
||||
|
||||
// release thread
|
||||
pthread_mutex_lock(&eNB->proc.mutex_synch);
|
||||
eNB->proc.instance_cnt_synch--;
|
||||
pthread_mutex_unlock(&eNB->proc.mutex_synch);
|
||||
} // oai_exit
|
||||
|
||||
lte_sync_time_free();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int wakeup_synch(PHY_VARS_eNB *eNB){
|
||||
|
||||
struct timespec wait;
|
||||
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
// wake up synch thread
|
||||
// lock the synch mutex and make sure the thread is ready
|
||||
if (pthread_mutex_timedlock(&eNB->proc.mutex_synch,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB synch thread (IC %d)\n", eNB->proc.instance_cnt_synch );
|
||||
exit_fun( "error locking mutex_synch" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
++eNB->proc.instance_cnt_synch;
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&eNB->proc.cond_synch) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB synch thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &eNB->proc.mutex_synch );
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief The Fronthaul thread of RRU/RAU/RCC/eNB
|
||||
* In the case of RRU/eNB, handles interface with external RF
|
||||
@@ -1233,6 +1492,8 @@ static void* eNB_thread_prach( void* param ) {
|
||||
return &eNB_thread_prach_status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void* eNB_thread_single( void* param ) {
|
||||
|
||||
static int eNB_thread_single_status;
|
||||
@@ -1240,9 +1501,25 @@ static void* eNB_thread_single( void* param ) {
|
||||
eNB_proc_t *proc = (eNB_proc_t*)param;
|
||||
eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0];
|
||||
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
eNB->CC_id = proc->CC_id;
|
||||
|
||||
void *rxp[2],*rxp2[2];
|
||||
|
||||
int subframe=0, frame=0;
|
||||
|
||||
int32_t dummy_rx[fp->nb_antennas_rx][fp->samples_per_tti] __attribute__((aligned(32)));
|
||||
|
||||
int ic;
|
||||
|
||||
int rxs;
|
||||
|
||||
int i;
|
||||
|
||||
// initialize the synchronization buffer to the common_vars.rxdata
|
||||
for (int i=0;i<fp->nb_antennas_rx;i++)
|
||||
rxp[i] = &eNB->common_vars.rxdata[0][i][0];
|
||||
|
||||
// set default return value
|
||||
eNB_thread_single_status = 0;
|
||||
|
||||
@@ -1271,6 +1548,74 @@ static void* eNB_thread_single( void* param ) {
|
||||
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
|
||||
pthread_cond_signal(&proc->cond_asynch_rxtx);
|
||||
|
||||
|
||||
|
||||
// if this is a slave eNB, try to synchronize on the DL frequency
|
||||
if ((eNB->is_slave) &&
|
||||
((eNB->node_function >= NGFI_RRU_IF5))) {
|
||||
// if FDD, switch RX on DL frequency
|
||||
|
||||
double temp_freq1 = eNB->rfdevice.openair0_cfg->rx_freq[0];
|
||||
double temp_freq2 = eNB->rfdevice.openair0_cfg->tx_freq[0];
|
||||
for (i=0;i<4;i++) {
|
||||
eNB->rfdevice.openair0_cfg->rx_freq[i] = eNB->rfdevice.openair0_cfg->tx_freq[i];
|
||||
eNB->rfdevice.openair0_cfg->tx_freq[i] = temp_freq1;
|
||||
}
|
||||
eNB->rfdevice.trx_set_freq_func(&eNB->rfdevice,eNB->rfdevice.openair0_cfg,0);
|
||||
|
||||
while ((eNB->in_synch ==0)&&(!oai_exit)) {
|
||||
// read in frame
|
||||
rxs = eNB->rfdevice.trx_read_func(&eNB->rfdevice,
|
||||
&(proc->timestamp_rx),
|
||||
rxp,
|
||||
fp->samples_per_tti*10,
|
||||
fp->nb_antennas_rx);
|
||||
|
||||
if (rxs != (fp->samples_per_tti*10))
|
||||
exit_fun("Problem receiving samples\n");
|
||||
|
||||
// wakeup synchronization processing thread
|
||||
wakeup_synch(eNB);
|
||||
ic=0;
|
||||
|
||||
while ((ic>=0)&&(!oai_exit)) {
|
||||
// continuously read in frames, 1ms at a time,
|
||||
// until we are done with the synchronization procedure
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||
rxp2[i] = (void*)&dummy_rx[i][0];
|
||||
for (i=0;i<10;i++)
|
||||
rxs = eNB->rfdevice.trx_read_func(&eNB->rfdevice,
|
||||
&(proc->timestamp_rx),
|
||||
rxp2,
|
||||
fp->samples_per_tti,
|
||||
fp->nb_antennas_rx);
|
||||
if (rxs != fp->samples_per_tti)
|
||||
exit_fun( "problem receiving samples" );
|
||||
|
||||
pthread_mutex_lock(&eNB->proc.mutex_synch);
|
||||
ic = eNB->proc.instance_cnt_synch;
|
||||
pthread_mutex_unlock(&eNB->proc.mutex_synch);
|
||||
} // ic>=0
|
||||
} // in_synch==0
|
||||
// read in rx_offset samples
|
||||
LOG_I(PHY,"Resynchronizing by %d samples\n",eNB->rx_offset);
|
||||
rxs = eNB->rfdevice.trx_read_func(&eNB->rfdevice,
|
||||
&(proc->timestamp_rx),
|
||||
rxp,
|
||||
eNB->rx_offset,
|
||||
fp->nb_antennas_rx);
|
||||
if (rxs != eNB->rx_offset)
|
||||
exit_fun( "problem receiving samples" );
|
||||
|
||||
for (i=0;i<4;i++) {
|
||||
eNB->rfdevice.openair0_cfg->rx_freq[i] = temp_freq1;
|
||||
eNB->rfdevice.openair0_cfg->tx_freq[i] = temp_freq2;
|
||||
}
|
||||
eNB->rfdevice.trx_set_freq_func(&eNB->rfdevice,eNB->rfdevice.openair0_cfg,1);
|
||||
} // if RRU and slave
|
||||
|
||||
|
||||
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
|
||||
while (!oai_exit) {
|
||||
|
||||
@@ -1284,7 +1629,9 @@ static void* eNB_thread_single( void* param ) {
|
||||
subframe++;
|
||||
}
|
||||
|
||||
LOG_D(PHY,"eNB Fronthaul thread, frame %d, subframe %d\n",frame,subframe);
|
||||
if (eNB->CC_id==1)
|
||||
LOG_D(PHY,"eNB thread single %p (proc %p, CC_id %d), frame %d (%p), subframe %d (%p)\n",
|
||||
pthread_self(), proc, eNB->CC_id, frame,&frame,subframe,&subframe);
|
||||
|
||||
// synchronization on FH interface, acquire signals/data and block
|
||||
if (eNB->rx_fh) eNB->rx_fh(eNB,&frame,&subframe);
|
||||
@@ -1295,8 +1642,11 @@ static void* eNB_thread_single( void* param ) {
|
||||
proc_rxtx->subframe_rx = proc->subframe_rx;
|
||||
proc_rxtx->frame_rx = proc->frame_rx;
|
||||
proc_rxtx->subframe_tx = (proc->subframe_rx+4)%10;
|
||||
proc_rxtx->frame_tx = (proc->subframe_rx < 6) ? proc->frame_rx : (proc->frame_rx+1)&1023;
|
||||
proc_rxtx->frame_tx = (proc->subframe_rx>5) ? (1+proc->frame_rx)&1023 : proc->frame_rx;
|
||||
proc->frame_tx = proc_rxtx->frame_tx;
|
||||
proc_rxtx->timestamp_tx = proc->timestamp_tx;
|
||||
// adjust for timing offset between RRU
|
||||
if (eNB->CC_id!=0) proc_rxtx->frame_tx = (proc_rxtx->frame_tx+proc->frame_offset)&1023;
|
||||
|
||||
// At this point, all information for subframe has been received on FH interface
|
||||
// If this proc is to provide synchronization, do so
|
||||
@@ -1324,7 +1674,7 @@ void init_eNB_proc(int inst) {
|
||||
PHY_VARS_eNB *eNB;
|
||||
eNB_proc_t *proc;
|
||||
eNB_rxtx_proc_t *proc_rxtx;
|
||||
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL,*attr_fep=NULL,*attr_td=NULL,*attr_te;
|
||||
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL,*attr_fep=NULL,*attr_td=NULL,*attr_te=NULL,*attr_synch=NULL;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
eNB = PHY_vars_eNB_g[inst][CC_id];
|
||||
@@ -1340,9 +1690,13 @@ void init_eNB_proc(int inst) {
|
||||
proc->instance_cnt_FH = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->CC_id = CC_id;
|
||||
|
||||
proc->first_rx=4;
|
||||
proc->instance_cnt_synch = -1;
|
||||
|
||||
proc->first_rx=1;
|
||||
proc->first_tx=1;
|
||||
proc->frame_offset = 0;
|
||||
|
||||
for (i=0;i<10;i++) proc->symbol_mask[i]=0;
|
||||
|
||||
pthread_mutex_init( &proc_rxtx[0].mutex_rxtx, NULL);
|
||||
pthread_mutex_init( &proc_rxtx[1].mutex_rxtx, NULL);
|
||||
@@ -1351,13 +1705,16 @@ void init_eNB_proc(int inst) {
|
||||
|
||||
pthread_mutex_init( &proc->mutex_prach, NULL);
|
||||
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
|
||||
pthread_mutex_init( &proc->mutex_synch,NULL);
|
||||
|
||||
pthread_cond_init( &proc->cond_prach, NULL);
|
||||
pthread_cond_init( &proc->cond_FH, NULL);
|
||||
pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
|
||||
pthread_cond_init( &proc->cond_synch,NULL);
|
||||
|
||||
pthread_attr_init( &proc->attr_FH);
|
||||
pthread_attr_init( &proc->attr_prach);
|
||||
pthread_attr_init( &proc->attr_synch);
|
||||
pthread_attr_init( &proc->attr_asynch_rxtx);
|
||||
pthread_attr_init( &proc->attr_single);
|
||||
pthread_attr_init( &proc->attr_fep);
|
||||
@@ -1370,6 +1727,7 @@ void init_eNB_proc(int inst) {
|
||||
attr1 = &proc_rxtx[1].attr_rxtx;
|
||||
attr_FH = &proc->attr_FH;
|
||||
attr_prach = &proc->attr_prach;
|
||||
attr_synch = &proc->attr_synch;
|
||||
attr_asynch = &proc->attr_asynch_rxtx;
|
||||
attr_single = &proc->attr_single;
|
||||
attr_fep = &proc->attr_fep;
|
||||
@@ -1389,6 +1747,7 @@ void init_eNB_proc(int inst) {
|
||||
init_te_thread(eNB,attr_te);
|
||||
}
|
||||
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, &eNB->proc );
|
||||
pthread_create( &proc->pthread_synch, attr_synch, eNB_thread_synch, eNB);
|
||||
if ((eNB->node_timing == synch_to_other) ||
|
||||
(eNB->node_function == NGFI_RRU_IF5) ||
|
||||
(eNB->node_function == NGFI_RRU_IF4p5))
|
||||
@@ -1412,6 +1771,7 @@ void init_eNB_proc(int inst) {
|
||||
}
|
||||
|
||||
//for multiple CCs: setup master and slaves
|
||||
/*
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
eNB = PHY_vars_eNB_g[inst][CC_id];
|
||||
|
||||
@@ -1424,8 +1784,8 @@ void init_eNB_proc(int inst) {
|
||||
if (i >= CC_id) eNB->proc.slave_proc[i] = &(PHY_vars_eNB_g[inst][i+1]->proc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
/* setup PHY proc TX sync mechanism */
|
||||
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
|
||||
@@ -1610,12 +1970,12 @@ int start_rf(PHY_VARS_eNB *eNB) {
|
||||
return(eNB->rfdevice.trx_start_func(&eNB->rfdevice));
|
||||
}
|
||||
|
||||
extern void eNB_fep_rru_if5(PHY_VARS_eNB *eNB);
|
||||
extern void eNB_fep_full(PHY_VARS_eNB *eNB);
|
||||
extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB);
|
||||
extern void do_prach(PHY_VARS_eNB *eNB);
|
||||
extern void eNB_fep_rru_if5(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
extern void eNB_fep_full(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
extern void do_prach(PHY_VARS_eNB *eNB,int frame,int subframe);
|
||||
|
||||
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *eth_params,int single_thread_flag) {
|
||||
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *eth_params,int single_thread_flag,int wait_for_sync) {
|
||||
|
||||
int CC_id;
|
||||
int inst;
|
||||
@@ -1629,6 +1989,11 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
eNB->node_timing = node_timing[CC_id];
|
||||
eNB->abstraction_flag = 0;
|
||||
eNB->single_thread_flag = single_thread_flag;
|
||||
eNB->ts_offset = 0;
|
||||
eNB->in_synch = 0;
|
||||
eNB->is_slave = (wait_for_sync>0) ? 1 : 0;
|
||||
|
||||
|
||||
#ifndef OCP_FRAMEWORK
|
||||
LOG_I(PHY,"Initializing eNB %d CC_id %d : (%s,%s)\n",inst,CC_id,eNB_functions[node_function[CC_id]],eNB_timing[node_timing[CC_id]]);
|
||||
#endif
|
||||
@@ -1636,6 +2001,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
switch (node_function[CC_id]) {
|
||||
case NGFI_RRU_IF5:
|
||||
eNB->do_prach = NULL;
|
||||
eNB->do_precoding = 0;
|
||||
eNB->fep = eNB_fep_rru_if5;
|
||||
eNB->td = NULL;
|
||||
eNB->te = NULL;
|
||||
@@ -1661,6 +2027,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
}
|
||||
break;
|
||||
case NGFI_RRU_IF4p5:
|
||||
eNB->do_precoding = 0;
|
||||
eNB->do_prach = do_prach;
|
||||
eNB->fep = eNB_fep_full;//(single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full;
|
||||
eNB->td = NULL;
|
||||
@@ -1679,6 +2046,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
}
|
||||
eNB->rfdevice.host_type = RRH_HOST;
|
||||
eNB->ifdevice.host_type = RRH_HOST;
|
||||
printf("loading transport interface ...\n");
|
||||
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], (eth_params+CC_id));
|
||||
printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id);
|
||||
if (ret<0) {
|
||||
@@ -1690,6 +2058,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
|
||||
break;
|
||||
case eNodeB_3GPP:
|
||||
eNB->do_precoding = (eNB->frame_parms.nb_antennas_tx==1) ? 0 : 1;
|
||||
eNB->do_prach = do_prach;
|
||||
eNB->fep = eNB_fep_full;//(single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full;
|
||||
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||
@@ -1710,26 +2079,27 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
eNB->ifdevice.host_type = BBU_HOST;
|
||||
break;
|
||||
case eNodeB_3GPP_BBU:
|
||||
eNB->do_prach = do_prach;
|
||||
eNB->fep = eNB_fep_full;//(single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full;
|
||||
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||
eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
|
||||
eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX;
|
||||
eNB->proc_tx = proc_tx_full;
|
||||
eNB->do_precoding = (eNB->frame_parms.nb_antennas_tx==1) ? 0 : 1;
|
||||
eNB->do_prach = do_prach;
|
||||
eNB->fep = eNB_fep_full;//(single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full;
|
||||
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||
eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
|
||||
eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX;
|
||||
eNB->proc_tx = proc_tx_full;
|
||||
if (eNB->node_timing == synch_to_other) {
|
||||
eNB->tx_fh = tx_fh_if5_mobipass;
|
||||
eNB->rx_fh = rx_fh_slave;
|
||||
eNB->fh_asynch = fh_if5_asynch_UL;
|
||||
eNB->tx_fh = tx_fh_if5_mobipass;
|
||||
eNB->rx_fh = rx_fh_slave;
|
||||
eNB->fh_asynch = fh_if5_asynch_UL;
|
||||
|
||||
}
|
||||
else {
|
||||
eNB->tx_fh = tx_fh_if5;
|
||||
eNB->rx_fh = rx_fh_if5;
|
||||
eNB->fh_asynch = NULL;
|
||||
eNB->tx_fh = tx_fh_if5;
|
||||
eNB->rx_fh = rx_fh_if5;
|
||||
eNB->fh_asynch = NULL;
|
||||
}
|
||||
|
||||
eNB->start_rf = NULL;
|
||||
eNB->start_if = start_if;
|
||||
eNB->start_rf = NULL;
|
||||
eNB->start_if = start_if;
|
||||
eNB->rfdevice.host_type = BBU_HOST;
|
||||
|
||||
eNB->ifdevice.host_type = BBU_HOST;
|
||||
@@ -1742,6 +2112,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
}
|
||||
break;
|
||||
case NGFI_RCC_IF4p5:
|
||||
eNB->do_precoding = 0;
|
||||
eNB->do_prach = do_prach;
|
||||
eNB->fep = NULL;
|
||||
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||
@@ -1765,6 +2136,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
|
||||
break;
|
||||
case NGFI_RAU_IF4p5:
|
||||
eNB->do_precoding = 0;
|
||||
eNB->do_prach = do_prach;
|
||||
eNB->fep = NULL;
|
||||
|
||||
@@ -1792,7 +2164,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
|
||||
}
|
||||
}
|
||||
|
||||
if (setup_eNB_buffers(PHY_vars_eNB_g[inst],&openair0_cfg[0])!=0) {
|
||||
if (setup_eNB_buffers(PHY_vars_eNB_g[inst],&openair0_cfg[CC_id])!=0) {
|
||||
printf("Exiting, cannot initialize eNodeB Buffers\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ extern int netlink_init(void);
|
||||
|
||||
// In lte-enb.c
|
||||
extern int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_cfg);
|
||||
extern void init_eNB(eNB_func_t *, eNB_timing_t *,int,eth_params_t *,int);
|
||||
extern void init_eNB(eNB_func_t *, eNB_timing_t *,int,eth_params_t *,int,int);
|
||||
extern void stop_eNB(int);
|
||||
extern void kill_eNB_proc(void);
|
||||
|
||||
@@ -160,6 +160,9 @@ volatile int oai_exit = 0;
|
||||
|
||||
|
||||
|
||||
static clock_source_t clock_source = internal;
|
||||
|
||||
static wait_for_sync = 0;
|
||||
|
||||
static char UE_flag=0;
|
||||
unsigned int mmapped_dma=0;
|
||||
@@ -379,6 +382,7 @@ void help (void) {
|
||||
printf(" --ue-scan_carrier set UE to scan around carrier\n");
|
||||
printf(" --loop-memory get softmodem (UE) to loop through memory instead of acquiring from HW\n");
|
||||
printf(" --mmapped-dma sets flag for improved EXMIMO UE performance\n");
|
||||
printf(" --external-clock tells hardware to use an external clock reference\n");
|
||||
printf(" --usim-test use XOR autentication algo in case of test usim mode\n");
|
||||
printf(" --single-thread-disable. Disables single-thread mode in lte-softmodem\n");
|
||||
printf(" -C Set the downlink frequency for all component carriers\n");
|
||||
@@ -652,7 +656,7 @@ void *l2l1_task(void *arg)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void get_options (int argc, char **argv)
|
||||
{
|
||||
@@ -689,6 +693,8 @@ static void get_options (int argc, char **argv)
|
||||
LONG_OPTION_PHYTEST,
|
||||
LONG_OPTION_USIMTEST,
|
||||
LONG_OPTION_MMAPPED_DMA,
|
||||
LONG_OPTION_EXTERNAL_CLOCK,
|
||||
LONG_OPTION_WAIT_FOR_SYNC,
|
||||
LONG_OPTION_SINGLE_THREAD_DISABLE,
|
||||
#if T_TRACER
|
||||
LONG_OPTION_T_PORT,
|
||||
@@ -716,6 +722,8 @@ static void get_options (int argc, char **argv)
|
||||
{"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST},
|
||||
{"usim-test", no_argument, NULL, LONG_OPTION_USIMTEST},
|
||||
{"mmapped-dma", no_argument, NULL, LONG_OPTION_MMAPPED_DMA},
|
||||
{"external-clock", no_argument, NULL, LONG_OPTION_EXTERNAL_CLOCK},
|
||||
{"wait-for-sync", no_argument, NULL, LONG_OPTION_WAIT_FOR_SYNC},
|
||||
{"single-thread-disable", no_argument, NULL, LONG_OPTION_SINGLE_THREAD_DISABLE},
|
||||
#if T_TRACER
|
||||
{"T_port", required_argument, 0, LONG_OPTION_T_PORT},
|
||||
@@ -824,7 +832,15 @@ static void get_options (int argc, char **argv)
|
||||
case LONG_OPTION_SINGLE_THREAD_DISABLE:
|
||||
single_thread_flag = 0;
|
||||
break;
|
||||
|
||||
|
||||
case LONG_OPTION_EXTERNAL_CLOCK:
|
||||
clock_source = external;
|
||||
break;
|
||||
|
||||
case LONG_OPTION_WAIT_FOR_SYNC:
|
||||
wait_for_sync = 1;
|
||||
break;
|
||||
|
||||
#if T_TRACER
|
||||
case LONG_OPTION_T_PORT: {
|
||||
extern int T_port;
|
||||
@@ -1335,6 +1351,7 @@ void init_openair0() {
|
||||
|
||||
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
|
||||
|
||||
openair0_cfg[card].clock_source = clock_source;
|
||||
|
||||
openair0_cfg[card].tx_num_channels=min(2,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx));
|
||||
openair0_cfg[card].rx_num_channels=min(2,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
|
||||
@@ -1618,14 +1635,11 @@ int main( int argc, char **argv )
|
||||
PHY_vars_eNB_g[0] = malloc(sizeof(PHY_VARS_eNB*));
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,abstraction_flag);
|
||||
PHY_vars_eNB_g[0][CC_id]->CC_id = CC_id;
|
||||
|
||||
PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,node_function[CC_id],abstraction_flag);
|
||||
PHY_vars_eNB_g[0][CC_id]->ue_dl_rb_alloc=0x1fff;
|
||||
PHY_vars_eNB_g[0][CC_id]->target_ue_dl_mcs=target_dl_mcs;
|
||||
PHY_vars_eNB_g[0][CC_id]->ue_ul_nb_rb=6;
|
||||
PHY_vars_eNB_g[0][CC_id]->target_ue_ul_mcs=target_ul_mcs;
|
||||
|
||||
// initialization for phy-test
|
||||
for (k=0;k<NUMBER_OF_UE_MAX;k++) {
|
||||
PHY_vars_eNB_g[0][CC_id]->transmission_mode[k] = transmission_mode;
|
||||
@@ -1637,41 +1651,43 @@ int main( int argc, char **argv )
|
||||
for (re=0; re<frame_parms[CC_id]->ofdm_symbol_size; re++)
|
||||
PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff/frame_parms[CC_id]->nb_antennas_tx;
|
||||
}
|
||||
|
||||
if (phy_test==1) PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0;
|
||||
else PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
|
||||
|
||||
|
||||
if (PHY_vars_eNB_g[0][CC_id]->mac_enabled == 0) { //set default parameters for testing mode
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
|
||||
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI;
|
||||
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI;
|
||||
|
||||
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = i;
|
||||
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3);
|
||||
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
|
||||
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
|
||||
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI;
|
||||
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI;
|
||||
|
||||
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = i;
|
||||
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3);
|
||||
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
compute_prach_seq(&PHY_vars_eNB_g[0][CC_id]->frame_parms.prach_config_common,
|
||||
PHY_vars_eNB_g[0][CC_id]->frame_parms.frame_type,
|
||||
PHY_vars_eNB_g[0][CC_id]->X_u);
|
||||
|
||||
PHY_vars_eNB_g[0][CC_id]->frame_parms.frame_type,
|
||||
PHY_vars_eNB_g[0][CC_id]->X_u);
|
||||
|
||||
|
||||
PHY_vars_eNB_g[0][CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0];
|
||||
|
||||
if (frame_parms[CC_id]->frame_type==FDD) {
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 0;
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 0;
|
||||
}
|
||||
else {
|
||||
if (frame_parms[CC_id]->N_RB_DL == 100)
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624;
|
||||
else if (frame_parms[CC_id]->N_RB_DL == 50)
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624/2;
|
||||
else if (frame_parms[CC_id]->N_RB_DL == 25)
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624/4;
|
||||
if (frame_parms[CC_id]->N_RB_DL == 100)
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624;
|
||||
else if (frame_parms[CC_id]->N_RB_DL == 50)
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624/2;
|
||||
else if (frame_parms[CC_id]->N_RB_DL == 25)
|
||||
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624/4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
NB_eNB_INST=1;
|
||||
NB_INST=1;
|
||||
@@ -1851,9 +1867,9 @@ int main( int argc, char **argv )
|
||||
}
|
||||
}
|
||||
else {
|
||||
init_eNB(node_function,node_timing,1,eth_params,single_thread_flag);
|
||||
// Sleep to allow all threads to setup
|
||||
|
||||
printf("Initializing eNB threads\n");
|
||||
init_eNB(node_function,node_timing,1,eth_params,single_thread_flag,wait_for_sync);
|
||||
|
||||
number_of_cards = 1;
|
||||
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[*]
|
||||
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
|
||||
[*] Mon Aug 1 18:43:22 2016
|
||||
[*] Sun Jan 15 07:26:50 2017
|
||||
[*]
|
||||
[dumpfile] "/tmp/openair_dump_eNB.vcd"
|
||||
[dumpfile_mtime] "Mon Aug 1 18:41:49 2016"
|
||||
[dumpfile_size] 22622
|
||||
[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/rru_if4p5_usrp.gtkw"
|
||||
[timestart] 0
|
||||
[dumpfile_mtime] "Sun Jan 15 07:04:19 2017"
|
||||
[dumpfile_size] 18140627
|
||||
[savefile] "/home/uprru1/oai/openairinterface5g/targets/RT/USER/rru_if4p5_usrp.gtkw"
|
||||
[timestart] 29977510000
|
||||
[size] 1301 716
|
||||
[pos] 309 0
|
||||
*-19.793451 29983948856 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
*-21.793451 29983948856 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[sst_width] 284
|
||||
[signals_width] 262
|
||||
[sst_expanded] 1
|
||||
@@ -17,10 +17,12 @@
|
||||
@28
|
||||
functions.trx_read
|
||||
functions.trx_write
|
||||
@25
|
||||
variables.trx_write_flags[63:0]
|
||||
@28
|
||||
functions.trx_write_if
|
||||
functions.send_if4
|
||||
functions.trx_read_if
|
||||
@29
|
||||
functions.recv_if4
|
||||
@24
|
||||
variables.trx_ts[63:0]
|
||||
@@ -40,121 +42,8 @@ variables.subframe_number_RX1_eNB[63:0]
|
||||
variables.frame_number_TX1_eNB[63:0]
|
||||
variables.subframe_number_TX1_eNB[63:0]
|
||||
@28
|
||||
functions.phy_enb_sfgen
|
||||
functions.phy_eNB_ofdm_mod_l
|
||||
functions.phy_eNB_slot_fep
|
||||
functions.phy_enb_prach_rx
|
||||
@24
|
||||
variables.dci_info[63:0]
|
||||
variables.ue0_BO[63:0]
|
||||
@420
|
||||
variables.ue0_BSR[63:0]
|
||||
variables.ue0_timing_advance[63:0]
|
||||
@28
|
||||
functions.macxface_initiate_ra_proc
|
||||
functions.macxface_terminate_ra_proc
|
||||
functions.phy_enb_ulsch_msg3
|
||||
functions.macxface_SR_indication
|
||||
@420
|
||||
variables.ue0_SR_ENERGY[63:0]
|
||||
variables.ue0_SR_THRES[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding0
|
||||
@24
|
||||
variables.ue0_res0[63:0]
|
||||
@420
|
||||
variables.ue0_rssi0[63:0]
|
||||
variables.ue0_MCS0[63:0]
|
||||
variables.ue0_RB0[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND0[63:0]
|
||||
variables.ue0_SFN0[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding1
|
||||
@24
|
||||
variables.ue0_res1[63:0]
|
||||
@420
|
||||
variables.ue0_rssi1[63:0]
|
||||
variables.ue0_MCS1[63:0]
|
||||
variables.ue0_RB1[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND1[63:0]
|
||||
variables.ue0_SFN1[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding2
|
||||
@24
|
||||
variables.ue0_res2[63:0]
|
||||
@420
|
||||
variables.ue0_rssi2[63:0]
|
||||
variables.ue0_MCS2[63:0]
|
||||
variables.ue0_RB2[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND2[63:0]
|
||||
variables.ue0_SFN2[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding3
|
||||
@24
|
||||
variables.ue0_res3[63:0]
|
||||
@420
|
||||
variables.ue0_rssi3[63:0]
|
||||
variables.ue0_MCS3[63:0]
|
||||
variables.ue0_RB3[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND3[63:0]
|
||||
variables.ue0_SFN3[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding4
|
||||
@420
|
||||
variables.ue0_rssi4[63:0]
|
||||
@24
|
||||
variables.ue0_res4[63:0]
|
||||
@420
|
||||
variables.ue0_MCS4[63:0]
|
||||
variables.ue0_RB4[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND4[63:0]
|
||||
variables.ue0_SFN4[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding5
|
||||
@24
|
||||
variables.ue0_res5[63:0]
|
||||
@420
|
||||
variables.ue0_rssi5[63:0]
|
||||
variables.ue0_MCS5[63:0]
|
||||
variables.ue0_RB5[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND5[63:0]
|
||||
variables.ue0_SFN5[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding6
|
||||
@24
|
||||
variables.ue0_res6[63:0]
|
||||
@420
|
||||
variables.ue0_rssi6[63:0]
|
||||
variables.ue0_MCS6[63:0]
|
||||
variables.ue0_RB6[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND6[63:0]
|
||||
variables.ue0_SFN6[63:0]
|
||||
@28
|
||||
functions.phy_enb_ulsch_decoding7
|
||||
@24
|
||||
variables.ue0_res7[63:0]
|
||||
@420
|
||||
variables.ue0_rssi7[63:0]
|
||||
variables.ue0_MCS7[63:0]
|
||||
variables.ue0_RB7[63:0]
|
||||
@24
|
||||
variables.ue0_ROUND7[63:0]
|
||||
variables.ue0_SFN7[63:0]
|
||||
@28
|
||||
functions.phy_enb_prach_rx
|
||||
functions.phy_eNB_dlsch_encoding
|
||||
functions.phy_eNB_dlsch_modulation
|
||||
functions.phy_eNB_dlsch_scrambling
|
||||
functions.phy_enb_pdcch_tx
|
||||
functions.phy_enb_rs_tx
|
||||
functions.rrc_mac_config_req
|
||||
functions.rlc_data_req
|
||||
functions.udp_enb_task
|
||||
[pattern_trace] 1
|
||||
[pattern_trace] 0
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
uint8_t Nid_cell,
|
||||
eNB_func_t node_function,
|
||||
uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
@@ -54,6 +55,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6;
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,abstraction_flag);
|
||||
|
||||
LOG_I(PHY,"init eNB: Node Function %d\n",node_function);
|
||||
LOG_I(PHY,"init eNB: Nid_cell %d\n", frame_parms->Nid_cell);
|
||||
LOG_I(PHY,"init eNB: frame_type %d,tdd_config %d\n", frame_parms->frame_type,frame_parms->tdd_config);
|
||||
LOG_I(PHY,"init eNB: number of ue max %d number of enb max %d number of harq pid max %d\n",
|
||||
@@ -61,27 +63,32 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
LOG_I(PHY,"init eNB: N_RB_DL %d\n", frame_parms->N_RB_DL);
|
||||
LOG_I(PHY,"init eNB: prach_config_index %d\n", frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex);
|
||||
|
||||
if (node_function >= NGFI_RRU_IF5)
|
||||
// For RRU, don't allocate DLSCH/ULSCH Transport channel buffers
|
||||
return (PHY_vars_eNB);
|
||||
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||
for (j=0; j<2; j++) {
|
||||
PHY_vars_eNB->dlsch[i][j] = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL,abstraction_flag,frame_parms);
|
||||
|
||||
if (!PHY_vars_eNB->dlsch[i][j]) {
|
||||
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
|
||||
exit(-1);
|
||||
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
|
||||
exit(-1);
|
||||
} else {
|
||||
LOG_D(PHY,"dlsch[%d][%d] => %p\n",i,j,PHY_vars_eNB->dlsch[i][j]);
|
||||
PHY_vars_eNB->dlsch[i][j]->rnti=0;
|
||||
LOG_D(PHY,"dlsch[%d][%d] => %p\n",i,j,PHY_vars_eNB->dlsch[i][j]);
|
||||
PHY_vars_eNB->dlsch[i][j]->rnti=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n");
|
||||
PHY_vars_eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,frame_parms->N_RB_UL, abstraction_flag);
|
||||
|
||||
|
||||
if (!PHY_vars_eNB->ulsch[1+i]) {
|
||||
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
// this is the transmission mode for the signalling channels
|
||||
// this will be overwritten with the real transmission mode by the RRC once the UE is connected
|
||||
PHY_vars_eNB->transmission_mode[i] = frame_parms->nb_antenna_ports_eNB==1 ? 1 : 2;
|
||||
@@ -91,7 +98,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
gettimeofday(&ts, NULL);
|
||||
PHY_vars_eNB->ulsch[1+i]->reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
|
||||
int j;
|
||||
|
||||
|
||||
for (j=0; j<10; j++) {
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->loc_rss_list[j]);
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->loc_rssi_list[j]);
|
||||
@@ -99,7 +106,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->loc_timing_advance_list[j]);
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->loc_timing_update_list[j]);
|
||||
}
|
||||
|
||||
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->tot_loc_rss_list);
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->tot_loc_rssi_list);
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->tot_loc_subcarrier_rss_list);
|
||||
@@ -107,37 +114,36 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
initialize(&PHY_vars_eNB->ulsch[1+i]->tot_loc_timing_update_list);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// ULSCH for RA
|
||||
PHY_vars_eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag);
|
||||
|
||||
|
||||
if (!PHY_vars_eNB->ulsch[0]) {
|
||||
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
PHY_vars_eNB->dlsch_SI = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, abstraction_flag, frame_parms);
|
||||
LOG_D(PHY,"eNB %d : SI %p\n",eNB_id,PHY_vars_eNB->dlsch_SI);
|
||||
PHY_vars_eNB->dlsch_ra = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, abstraction_flag, frame_parms);
|
||||
LOG_D(PHY,"eNB %d : RA %p\n",eNB_id,PHY_vars_eNB->dlsch_ra);
|
||||
PHY_vars_eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, 0, frame_parms);
|
||||
LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_MCH);
|
||||
|
||||
|
||||
|
||||
|
||||
PHY_vars_eNB->rx_total_gain_dB=130;
|
||||
|
||||
|
||||
for(i=0; i<NUMBER_OF_UE_MAX; i++)
|
||||
PHY_vars_eNB->mu_mimo_mode[i].dl_pow_off = 2;
|
||||
|
||||
|
||||
PHY_vars_eNB->check_for_total_transmissions = 0;
|
||||
|
||||
|
||||
PHY_vars_eNB->check_for_MUMIMO_transmissions = 0;
|
||||
|
||||
|
||||
PHY_vars_eNB->FULL_MUMIMO_transmissions = 0;
|
||||
|
||||
|
||||
PHY_vars_eNB->check_for_SUMIMO_transmissions = 0;
|
||||
|
||||
PHY_vars_eNB->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
|
||||
PHY_vars_eNB->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
|
||||
return (PHY_vars_eNB);
|
||||
}
|
||||
@@ -271,7 +277,7 @@ void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs],
|
||||
PHY_vars_eNB_g[eNB_id] = (PHY_VARS_eNB**) malloc(MAX_NUM_CCs*sizeof(PHY_VARS_eNB*));
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_eNB_g[eNB_id][CC_id] = init_lte_eNB(frame_parms[CC_id],eNB_id,Nid_cell,abstraction_flag);
|
||||
PHY_vars_eNB_g[eNB_id][CC_id] = init_lte_eNB(frame_parms[CC_id],eNB_id,Nid_cell,eNodeB_3GPP,abstraction_flag);
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->Mod_id=eNB_id;
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->CC_id=CC_id;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
uint8_t Nid_cell,
|
||||
eNB_func_t node_function,
|
||||
uint8_t abstraction_flag);
|
||||
|
||||
PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
Reference in New Issue
Block a user