changes to allow if4 specific eth transport modes
This commit is contained in:
@@ -2242,6 +2242,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
|||||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
||||||
} else if (strcmp(tr_preference, "raw") == 0) {
|
} else if (strcmp(tr_preference, "raw") == 0) {
|
||||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
||||||
|
} else if (strcmp(tr_preference, "udpif4") == 0) {
|
||||||
|
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udpif4 = 1;
|
||||||
|
} else if (strcmp(tr_preference, "rawif4") == 0) {
|
||||||
|
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].rawif4 = 1;
|
||||||
} else {//if (strcmp(preference, "no") == 0)
|
} else {//if (strcmp(preference, "no") == 0)
|
||||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
||||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ typedef struct rrh_gw_config_s {
|
|||||||
char *remote_address;
|
char *remote_address;
|
||||||
uint16_t local_port;
|
uint16_t local_port;
|
||||||
uint16_t remote_port;
|
uint16_t remote_port;
|
||||||
|
uint8_t udpif4;
|
||||||
|
uint8_t rawif4;
|
||||||
int tx_scheduling_advance;
|
int tx_scheduling_advance;
|
||||||
int tx_sample_advance;
|
int tx_sample_advance;
|
||||||
int iq_txshift;
|
int iq_txshift;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
|
|
||||||
#include "common_lib.h"
|
#include "common_lib.h"
|
||||||
#include "ethernet_lib.h"
|
#include "ethernet_lib.h"
|
||||||
|
#include "if_defs.h"
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
#include "common_lib.h"
|
#include "common_lib.h"
|
||||||
#include "ethernet_lib.h"
|
#include "ethernet_lib.h"
|
||||||
|
#include "if_defs.h"
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
struct sockaddr_in dest_addr[MAX_INST];
|
struct sockaddr_in dest_addr[MAX_INST];
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
#include "common_lib.h"
|
#include "common_lib.h"
|
||||||
#include "ethernet_lib.h"
|
#include "ethernet_lib.h"
|
||||||
|
#include "if_defs.h"
|
||||||
|
|
||||||
int num_devices_eth = 0;
|
int num_devices_eth = 0;
|
||||||
struct sockaddr_in dest_addr[MAX_INST];
|
struct sockaddr_in dest_addr[MAX_INST];
|
||||||
@@ -336,7 +336,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_freq_func = trx_eth_set_freq;
|
||||||
device->trx_set_gains_func = trx_eth_set_gains;
|
device->trx_set_gains_func = trx_eth_set_gains;
|
||||||
|
|
||||||
/// handle if4 eth read and write functions
|
|
||||||
if (eth->flags == ETH_RAW_MODE) {
|
if (eth->flags == ETH_RAW_MODE) {
|
||||||
device->trx_write_func = trx_eth_write_raw;
|
device->trx_write_func = trx_eth_write_raw;
|
||||||
device->trx_read_func = trx_eth_read_raw;
|
device->trx_read_func = trx_eth_read_raw;
|
||||||
|
|||||||
@@ -52,25 +52,12 @@
|
|||||||
#define MAX_INST 4
|
#define MAX_INST 4
|
||||||
#define DEFAULT_IF "lo"
|
#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 TX_FLAG 1
|
||||||
#define RX_FLAG 0
|
#define RX_FLAG 0
|
||||||
|
|
||||||
#define MAX_PACKET_SEQ_NUM(spp,spf) (spf/spp)
|
#include "if_defs.h"
|
||||||
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
|
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
|
||||||
#define APP_HEADER_SIZE_BYTES (sizeof(int32_t) + sizeof(openair0_timestamp))
|
#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 */
|
/*!\brief opaque ethernet data structure */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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 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) (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))
|
||||||
@@ -65,6 +65,7 @@
|
|||||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
//#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/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
|
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||||
|
|
||||||
@@ -1016,7 +1017,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)->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_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)->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)->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_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;
|
(eth_params+j)->tx_scheduling_advance = enb_properties->properties[i]->rrh_gw_config[j].tx_scheduling_advance;
|
||||||
|
|||||||
Reference in New Issue
Block a user