Merge branch 'enhancement-10-harmony' of https://gitlab.eurecom.fr/oai/openairinterface5g into enhancement-10-harmony
This commit is contained in:
@@ -51,6 +51,8 @@
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "ethernet_lib.h"
|
||||
#include "if_defs.h"
|
||||
#include "openair1/PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
@@ -58,7 +60,6 @@ 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 ether_header eh;
|
||||
|
||||
int eth_socket_init_raw(openair0_device *device) {
|
||||
|
||||
@@ -120,11 +121,11 @@ int eth_socket_init_raw(openair0_device *device) {
|
||||
}
|
||||
|
||||
/* Construct the Ethernet header */
|
||||
ether_aton_r(local_mac, (struct ether_addr *)(&(eh.ether_shost)));
|
||||
ether_aton_r(remote_mac, (struct ether_addr *)(&(eh.ether_dhost)));
|
||||
eh.ether_type = htons((short)device->openair0_cfg->my_port);
|
||||
ether_aton_r(local_mac, (struct ether_addr *)(&(eth->eh.ether_shost)));
|
||||
ether_aton_r(remote_mac, (struct ether_addr *)(&(eth->eh.ether_dhost)));
|
||||
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,eh.ether_shost[0],eh.ether_shost[1],eh.ether_shost[2],eh.ether_shost[3],eh.ether_shost[4],eh.ether_shost[5]);
|
||||
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]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -152,7 +153,7 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
|
||||
|
||||
bytes_sent = 0;
|
||||
memcpy(buff2,(void*)&eh,MAC_HEADER_SIZE_BYTES);
|
||||
memcpy(buff2,(void*)ð->eh,MAC_HEADER_SIZE_BYTES);
|
||||
*(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t))=1+(i<<1);
|
||||
*(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = timestamp;
|
||||
|
||||
@@ -214,12 +215,12 @@ int trx_eth_write_raw_IF4(openair0_device *device, openair0_timestamp timestamp,
|
||||
} else if (flags == IF4_PULFFT) {
|
||||
packet_size = RAW_IF4_PULFFT_SIZE_BYTES(nblocks);
|
||||
} else {
|
||||
packet_size = RAW_IF4_PRACH_SIZE_BYTES(nblocks);
|
||||
packet_size = RAW_IF4_PRACH_SIZE_BYTES;
|
||||
}
|
||||
|
||||
eth->tx_nsamps = nblocks;
|
||||
|
||||
memcpy(buff[0], (void*)&eh, MAC_HEADER_SIZE_BYTES);
|
||||
memcpy(buff[0], (void*)ð->eh, MAC_HEADER_SIZE_BYTES);
|
||||
|
||||
bytes_sent = send(eth->sockfd[Mod_id],
|
||||
buff[0],
|
||||
@@ -302,49 +303,66 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
|
||||
int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
|
||||
|
||||
int nblocks = nsamps;
|
||||
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;
|
||||
|
||||
/* buff[i] points to the position in rx buffer where the payload to be received will be placed
|
||||
buff2 points to the position in rx buffer where the packet header will be placed */
|
||||
void *buff2 = (void*)(buff[i]-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES);
|
||||
|
||||
/* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/
|
||||
struct ether_header temp = *(struct ether_header *)buff2;
|
||||
int32_t temp0 = *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES);
|
||||
openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
|
||||
|
||||
bytes_received=0;
|
||||
|
||||
while(bytes_received < RAW_PACKET_SIZE_BYTES(nsamps)) {
|
||||
bytes_received +=recv(eth->sockfd[Mod_id],
|
||||
buff2,
|
||||
RAW_PACKET_SIZE_BYTES(nsamps),
|
||||
rcvfrom_flag);
|
||||
|
||||
ssize_t packet_size = MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t;
|
||||
|
||||
void *test_buffer = (void*)malloc(packet_size);
|
||||
void *rx_buffer=NULL;
|
||||
IF4_dl_header_t *test_header = (IF4_dl_header_t*)(test_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
|
||||
bytes_received = recv(eth->sockfd[Mod_id],
|
||||
test_buffer,
|
||||
packet_size,
|
||||
0);
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
perror("ETHERNET READ: ");
|
||||
exit(-1);
|
||||
} else {
|
||||
/* store the timestamp value from packet's header */
|
||||
*timestamp = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
|
||||
eth->rx_actual_nsamps=bytes_received>>2;
|
||||
eth->rx_count++;
|
||||
}
|
||||
}
|
||||
|
||||
/* tx buffer values restored */
|
||||
*(struct ether_header *)buff2 = temp;
|
||||
*(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES) = temp0;
|
||||
*(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1;
|
||||
}
|
||||
|
||||
*timestamp = test_header->sub_type;
|
||||
|
||||
if (test_header->sub_type == IF4_PDLFFT) {
|
||||
buff[0] = (void*)malloc(RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) - MAC_HEADER_SIZE_BYTES);
|
||||
packet_size = RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) - packet_size;
|
||||
|
||||
} else if (test_header->sub_type == IF4_PULFFT) {
|
||||
buff[0] = (void*)malloc(RAW_IF4_PULFFT_SIZE_BYTES(nblocks) - MAC_HEADER_SIZE_BYTES);
|
||||
packet_size = RAW_IF4_PULFFT_SIZE_BYTES(nblocks) - packet_size;
|
||||
|
||||
} else {
|
||||
buff[0] = (void*)malloc(RAW_IF4_PRACH_SIZE_BYTES - MAC_HEADER_SIZE_BYTES);
|
||||
packet_size = RAW_IF4_PRACH_SIZE_BYTES - packet_size;
|
||||
}
|
||||
|
||||
return (bytes_received-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES)>>2;
|
||||
memcpy(buff[0], test_header, sizeof_IF4_dl_header_t);
|
||||
rx_buffer = (void*)(buff[0]+sizeof_IF4_dl_header_t);
|
||||
|
||||
bytes_received = 0;
|
||||
|
||||
while(bytes_received < packet_size) {
|
||||
bytes_received += recv(eth->sockfd[Mod_id],
|
||||
rx_buffer,
|
||||
packet_size-bytes_received,
|
||||
0);
|
||||
if (bytes_received ==-1) {
|
||||
eth->num_rx_errors++;
|
||||
perror("ETHERNET READ: ");
|
||||
exit(-1);
|
||||
} else {
|
||||
eth->rx_actual_nsamps = bytes_received>>1;
|
||||
eth->rx_count++;
|
||||
}
|
||||
}
|
||||
|
||||
eth->rx_nsamps = nsamps;
|
||||
|
||||
free(test_buffer);
|
||||
return (bytes_received-MAC_HEADER_SIZE_BYTES)>>1;
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +382,7 @@ int eth_set_dev_conf_raw(openair0_device *device) {
|
||||
msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t);
|
||||
|
||||
|
||||
memcpy(msg,(void*)&eh,MAC_HEADER_SIZE_BYTES);
|
||||
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],
|
||||
@@ -400,10 +418,10 @@ int eth_get_dev_conf_raw(openair0_device *device) {
|
||||
}
|
||||
|
||||
/* RRH stores the remote MAC address */
|
||||
memcpy(eh.ether_dhost,(msg+ETH_ALEN),ETH_ALEN);
|
||||
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,eh.ether_shost[0],eh.ether_shost[1],eh.ether_shost[2],eh.ether_shost[3],eh.ether_shost[4],eh.ether_shost[5],eh.ether_dhost[0],eh.ether_dhost[1],eh.ether_dhost[2],eh.ether_dhost[3],eh.ether_dhost[4],eh.ether_dhost[5]);
|
||||
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]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "ethernet_lib.h"
|
||||
#include "if_defs.h"
|
||||
|
||||
#define DEBUG 0
|
||||
struct sockaddr_in dest_addr[MAX_INST];
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "ethernet_lib.h"
|
||||
|
||||
#include "if_defs.h"
|
||||
|
||||
int num_devices_eth = 0;
|
||||
struct sockaddr_in dest_addr[MAX_INST];
|
||||
@@ -320,7 +320,8 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
|
||||
} else if (eth_params->transp_preference == 2) {
|
||||
eth->flags = ETH_UDP_IF4_MODE;
|
||||
} else {
|
||||
AssertFatal(0==4, "transport_init: Unknown transport preference %d", eth_params->transp_preference);
|
||||
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"));
|
||||
@@ -336,7 +337,6 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
|
||||
device->trx_set_freq_func = trx_eth_set_freq;
|
||||
device->trx_set_gains_func = trx_eth_set_gains;
|
||||
|
||||
/// handle if4 eth read and write functions
|
||||
if (eth->flags == ETH_RAW_MODE) {
|
||||
device->trx_write_func = trx_eth_write_raw;
|
||||
device->trx_read_func = trx_eth_read_raw;
|
||||
@@ -347,16 +347,16 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
|
||||
device->trx_write_func = trx_eth_write_raw_IF4;
|
||||
device->trx_read_func = trx_eth_read_raw_IF4;
|
||||
} else {
|
||||
device->trx_write_func = trx_eth_write_udp_IF4;
|
||||
device->trx_read_func = trx_eth_read_udp_IF4;
|
||||
//device->trx_write_func = trx_eth_write_udp_IF4;
|
||||
//device->trx_read_func = trx_eth_read_udp_IF4;
|
||||
}
|
||||
|
||||
eth->if_name[device->Mod_id] = eth_params->local_if_name;
|
||||
device->priv = eth;
|
||||
|
||||
/* device specific */
|
||||
openair0_cfg[0].txlaunch_wait = 0;//manage when TX processing is triggered
|
||||
openair0_cfg[0].txlaunch_wait_slotcount = 0; //manage when TX processing is triggered
|
||||
//openair0_cfg[0].txlaunch_wait = 0;//manage when TX processing is triggered
|
||||
//openair0_cfg[0].txlaunch_wait_slotcount = 0; //manage when TX processing is triggered
|
||||
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;
|
||||
|
||||
@@ -52,25 +52,11 @@
|
||||
#define MAX_INST 4
|
||||
#define DEFAULT_IF "lo"
|
||||
|
||||
#define ETH_RAW_MODE 1
|
||||
#define ETH_UDP_MODE 0
|
||||
#define ETH_RAW_IF4_MODE 3
|
||||
#define ETH_UDP_IF4_MODE 2
|
||||
|
||||
#define TX_FLAG 1
|
||||
#define RX_FLAG 0
|
||||
|
||||
#define MAX_PACKET_SEQ_NUM(spp,spf) (spf/spp)
|
||||
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
|
||||
#include "if_defs.h"
|
||||
#define APP_HEADER_SIZE_BYTES (sizeof(int32_t) + sizeof(openair0_timestamp))
|
||||
#define PAYLOAD_SIZE_BYTES(nsamps) (nsamps<<2)
|
||||
#define UDP_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps))
|
||||
#define RAW_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps))
|
||||
|
||||
#define DATA_BLOCK_SIZE_BYTES(scaled_nblocks) (2*scaled_nblocks)
|
||||
#define RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define RAW_IF4_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_ul_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define RAW_IF4_PRACH_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_prach_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
|
||||
/*!\brief opaque ethernet data structure */
|
||||
typedef struct {
|
||||
@@ -127,6 +113,8 @@ typedef struct {
|
||||
/*!\brief number of packets received */
|
||||
uint64_t rx_count;
|
||||
|
||||
struct ether_header eh;
|
||||
|
||||
} eth_state_t;
|
||||
|
||||
|
||||
@@ -234,8 +222,8 @@ int eth_set_dev_conf_udp(openair0_device *device);
|
||||
int eth_socket_init_raw(openair0_device *device);
|
||||
int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
|
||||
int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
|
||||
//int trx_eth_write_raw_IF4(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
|
||||
//int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
|
||||
int trx_eth_write_raw_IF4(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
|
||||
int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
|
||||
int eth_get_dev_conf_raw(openair0_device *device);
|
||||
int eth_set_dev_conf_raw(openair0_device *device);
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
|
||||
* \brief
|
||||
* \author S. Sandeep Kumar, Raymond Knopp
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include <netinet/ether.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// ETH transport preference modes
|
||||
#define ETH_UDP_MODE 0
|
||||
#define ETH_RAW_MODE 1
|
||||
#define ETH_UDP_IF4_MODE 2
|
||||
#define ETH_RAW_IF4_MODE 3
|
||||
|
||||
// Time domain RRH packet sizes
|
||||
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
|
||||
#define MAX_PACKET_SEQ_NUM(spp,spf) (spf/spp)
|
||||
#define PAYLOAD_SIZE_BYTES(nsamps) (nsamps<<2)
|
||||
#define UDP_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps))
|
||||
#define RAW_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps))
|
||||
|
||||
// Packet sizes for IF4 interface format
|
||||
#define DATA_BLOCK_SIZE_BYTES(scaled_nblocks) (sizeof(int16_t)*scaled_nblocks)
|
||||
#define PRACH_BLOCK_SIZE_BYTES (sizeof(int16_t)*839) // FIX hard coded prach size
|
||||
|
||||
#define RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define RAW_IF4_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_ul_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define RAW_IF4_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4_prach_header_t + PRACH_BLOCK_SIZE_BYTES)
|
||||
@@ -486,7 +486,7 @@ static void* eNB_thread_rxtx( void* param ) {
|
||||
/// **** recv_IF4 of txdataF from RCC **** ///
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
|
||||
//recv_IF4(eNB, proc, packet_type, symbol_number);
|
||||
//recv_IF4(eNB, frame, subframe, packet_type, symbol_number);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
|
||||
|
||||
}
|
||||
@@ -536,7 +536,7 @@ static void* eNB_thread_rxtx( void* param ) {
|
||||
/// **** send_IF4 of txdataF to RRU **** ///
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
|
||||
//send_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc, 0);
|
||||
send_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc->frame_tx, proc->subframe_tx, IF4_PDLFFT);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
|
||||
|
||||
}
|
||||
@@ -1275,7 +1275,7 @@ void print_opp_meas(void) {
|
||||
print_meas(&softmodem_stats_rx_sf,"[eNB][total_phy_proc_rx]",NULL,NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void init_eNB(eNB_func_t node_function) {
|
||||
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
#include <execinfo.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/sysinfo.h>
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
@@ -65,6 +68,7 @@
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include "../../ARCH/COMMON/common_lib.h"
|
||||
#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
@@ -401,8 +405,13 @@ void help (void) {
|
||||
printf(" -U Set the lte softmodem as a UE\n");
|
||||
printf(" -W Enable L2 wireshark messages on localhost \n");
|
||||
printf(" -V Enable VCD (generated file will be located atopenair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n");
|
||||
printf(" -x Set the transmission mode, valid options: 1 \n"RESET);
|
||||
|
||||
printf(" -x Set the transmission mode, valid options: 1 \n");
|
||||
#if T_TRACER
|
||||
printf(" --T_port [port] use given port\n");
|
||||
printf(" --T_nowait don't wait for tracer, start immediately\n");
|
||||
#endif
|
||||
printf(RESET);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void exit_fun(const char* s)
|
||||
@@ -669,6 +678,11 @@ static void get_options (int argc, char **argv)
|
||||
LONG_OPTION_RCC,
|
||||
LONG_OPTION_RRU,
|
||||
LONG_OPTION_ENB
|
||||
#if T_TRACER
|
||||
,
|
||||
LONG_OPTION_T_PORT,
|
||||
LONG_OPTION_T_NOWAIT,
|
||||
#endif
|
||||
};
|
||||
|
||||
static const struct option long_options[] = {
|
||||
@@ -690,6 +704,10 @@ static void get_options (int argc, char **argv)
|
||||
{"RCC", no_argument, NULL, LONG_OPTION_RCC},
|
||||
{"RRU", no_argument, NULL, LONG_OPTION_RRU},
|
||||
{"eNB", no_argument, NULL, LONG_OPTION_ENB},
|
||||
#if T_TRACER
|
||||
{"T_port", required_argument, 0, LONG_OPTION_T_PORT},
|
||||
{"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT},
|
||||
#endif
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
@@ -789,6 +807,21 @@ static void get_options (int argc, char **argv)
|
||||
node_function = eNodeB_3GPP;
|
||||
break;
|
||||
|
||||
#if T_TRACER
|
||||
case LONG_OPTION_T_PORT: {
|
||||
extern int T_port;
|
||||
if (optarg == NULL) abort(); /* should not happen */
|
||||
T_port = atoi(optarg);
|
||||
break;
|
||||
}
|
||||
|
||||
case LONG_OPTION_T_NOWAIT: {
|
||||
extern int T_wait;
|
||||
T_wait = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case 'A':
|
||||
timing_advance = atoi (optarg);
|
||||
break;
|
||||
@@ -1016,7 +1049,17 @@ static void get_options (int argc, char **argv)
|
||||
(eth_params+j)->my_port = enb_properties->properties[i]->rrh_gw_config[j].local_port;
|
||||
(eth_params+j)->remote_addr = enb_properties->properties[i]->rrh_gw_config[j].remote_address;
|
||||
(eth_params+j)->remote_port = enb_properties->properties[i]->rrh_gw_config[j].remote_port;
|
||||
(eth_params+j)->transp_preference = enb_properties->properties[i]->rrh_gw_config[j].raw;
|
||||
|
||||
if (enb_properties->properties[i]->rrh_gw_config[j].raw == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_MODE;
|
||||
} else if (enb_properties->properties[i]->rrh_gw_config[j].rawif4 == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_RAW_IF4_MODE;
|
||||
} else if (enb_properties->properties[i]->rrh_gw_config[j].udpif4 == 1) {
|
||||
(eth_params+j)->transp_preference = ETH_UDP_IF4_MODE;
|
||||
} else {
|
||||
(eth_params+j)->transp_preference = ETH_UDP_MODE;
|
||||
}
|
||||
|
||||
(eth_params+j)->iq_txshift = enb_properties->properties[i]->rrh_gw_config[j].iq_txshift;
|
||||
(eth_params+j)->tx_sample_advance = enb_properties->properties[i]->rrh_gw_config[j].tx_sample_advance;
|
||||
(eth_params+j)->tx_scheduling_advance = enb_properties->properties[i]->rrh_gw_config[j].tx_scheduling_advance;
|
||||
@@ -1124,6 +1167,11 @@ static void get_options (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
#if T_TRACER
|
||||
int T_wait = 1; /* by default we wait for the tracer */
|
||||
int T_port = 2021; /* default port to listen to to wait for the tracer */
|
||||
#endif
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
int i,aa,card=0;
|
||||
@@ -1187,6 +1235,10 @@ int main( int argc, char **argv )
|
||||
else
|
||||
openair0_cfg[0].configFilename = rf_config_file;
|
||||
|
||||
#if T_TRACER
|
||||
T_init(T_port, T_wait);
|
||||
#endif
|
||||
|
||||
// initialize the log (see log.h for details)
|
||||
set_glog(glog_level, glog_verbosity);
|
||||
|
||||
@@ -1900,8 +1952,12 @@ int main( int argc, char **argv )
|
||||
pthread_cond_destroy(&sync_cond);
|
||||
pthread_mutex_destroy(&sync_mutex);
|
||||
|
||||
// *** Handle per CC_id openair0
|
||||
// *** Handle per CC_id openair0
|
||||
openair0.trx_end_func(&openair0);
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_eNB_g[0][CC_id]->rfdevice.trx_end_func(&PHY_vars_eNB_g[0][CC_id]->rfdevice);
|
||||
PHY_vars_eNB_g[0][CC_id]->ifdevice.trx_end_func(&PHY_vars_eNB_g[0][CC_id]->ifdevice);
|
||||
}
|
||||
|
||||
if (ouput_vcd)
|
||||
VCD_SIGNAL_DUMPER_CLOSE();
|
||||
|
||||
@@ -113,6 +113,8 @@ char smbv_ip[16];
|
||||
# include "create_tasks.h"
|
||||
#endif
|
||||
|
||||
#include "T.h"
|
||||
|
||||
/*
|
||||
DCI0_5MHz_TDD0_t UL_alloc_pdu;
|
||||
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
|
||||
@@ -245,6 +247,10 @@ help (void)
|
||||
printf ("-Y Set the global log verbosity (none, low, medium, high, full) \n");
|
||||
printf ("-z Set the cooperation flag (0 for no cooperation, 1 for delay diversity and 2 for distributed alamouti\n");
|
||||
printf ("-Z Reserved\n");
|
||||
#if T_TRACER
|
||||
printf ("--T_port [port] use given port\n");
|
||||
printf ("--T_nowait don't wait for tracer, start immediately\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
pthread_t log_thread;
|
||||
@@ -739,7 +745,8 @@ l2l1_task (void *args_p)
|
||||
+ oai_emulation.info.nb_enb_local));
|
||||
eNB_inst++) {
|
||||
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
|
||||
if ((slot & 1) == 0)
|
||||
if ((slot & 1) == 0) {
|
||||
T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(slot/2));
|
||||
LOG_D(EMU,
|
||||
"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n",
|
||||
eNB_inst,
|
||||
@@ -750,6 +757,7 @@ l2l1_task (void *args_p)
|
||||
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.frame_type,
|
||||
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.tdd_config,
|
||||
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.Nid_cell);
|
||||
}
|
||||
|
||||
#ifdef OPENAIR2
|
||||
//Application: traffic gen
|
||||
@@ -1247,6 +1255,11 @@ l2l1_task (void *args_p)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if T_TRACER
|
||||
int T_wait = 1; /* by default we wait for the tracer */
|
||||
int T_port = 2021; /* default port to listen to to wait for the tracer */
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
@@ -1263,6 +1276,7 @@ main (int argc, char **argv)
|
||||
int node_id;
|
||||
int port,Process_Flag=0,wgt,Channel_Flag=0,temp;
|
||||
#endif
|
||||
|
||||
//default parameters
|
||||
oai_emulation.info.n_frames = MAX_FRAME_NUMBER; //1024; //10;
|
||||
oai_emulation.info.n_frames_flag = 0; //fixme
|
||||
@@ -1279,6 +1293,10 @@ main (int argc, char **argv)
|
||||
// get command-line options
|
||||
get_simulation_options (argc, argv); //Command-line options
|
||||
|
||||
#if T_TRACER
|
||||
T_init(T_port, T_wait);
|
||||
#endif
|
||||
|
||||
// Initialize VCD LOG module
|
||||
VCD_SIGNAL_DUMPER_INIT (oai_emulation.info.vcd_file);
|
||||
|
||||
|
||||
@@ -212,6 +212,11 @@ void get_simulation_options(int argc, char *argv[])
|
||||
|
||||
LONG_OPTION_PHYTEST,
|
||||
LONG_OPTION_XFORMS,
|
||||
|
||||
#if T_TRACER
|
||||
LONG_OPTION_T_PORT,
|
||||
LONG_OPTION_T_NOWAIT,
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct option long_options[] = {
|
||||
@@ -246,6 +251,11 @@ void get_simulation_options(int argc, char *argv[])
|
||||
{"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST},
|
||||
{"xforms", no_argument, 0, LONG_OPTION_XFORMS},
|
||||
|
||||
#if T_TRACER
|
||||
{"T_port", required_argument, 0, LONG_OPTION_T_PORT},
|
||||
{"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT},
|
||||
#endif
|
||||
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
@@ -413,6 +423,21 @@ void get_simulation_options(int argc, char *argv[])
|
||||
xforms=1;
|
||||
break;
|
||||
|
||||
#if T_TRACER
|
||||
case LONG_OPTION_T_PORT: {
|
||||
extern int T_port;
|
||||
if (optarg == NULL) abort(); /* should not happen */
|
||||
T_port = atoi(optarg);
|
||||
break;
|
||||
}
|
||||
|
||||
case LONG_OPTION_T_NOWAIT: {
|
||||
extern int T_wait;
|
||||
T_wait = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case 'a':
|
||||
abstraction_flag = 1;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user