added mobipass interface and tested sending dummy and starting stream, no reply yet

This commit is contained in:
Sandeep Kumar
2016-07-01 19:29:02 +02:00
parent b628856635
commit 55c194b07d
8 changed files with 50 additions and 7 deletions
@@ -53,6 +53,7 @@
#include "ethernet_lib.h"
#include "if_defs.h"
#include "openair1/PHY/LTE_TRANSPORT/if4_tools.h"
#include "openair1/PHY/LTE_TRANSPORT/if5_mobipass_tools.h"
#define DEBUG 0
@@ -123,8 +124,11 @@ int eth_socket_init_raw(openair0_device *device) {
/* Construct the Ethernet header */
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);
// if (((*) device->priv)->flags == ETH_RAW_IF5_MOBIPASS) {
eth->eh.ether_type = htons(0xbffe);
// } 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]);
return 0;
@@ -214,6 +218,8 @@ int trx_eth_write_raw_IF4(openair0_device *device, openair0_timestamp timestamp,
packet_size = RAW_IF4_PDLFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4_PULFFT) {
packet_size = RAW_IF4_PULFFT_SIZE_BYTES(nblocks);
} else if (flags == IF5_MOBIPASS) {
packet_size = RAW_IF5_MOBIPASS_SIZE_BYTES;
} else {
packet_size = RAW_IF4_PRACH_SIZE_BYTES;
}
@@ -88,6 +88,17 @@ int trx_eth_start(openair0_device *device) {
} else if (eth->flags == ETH_UDP_IF4_MODE) {
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
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_IF4(device)!=0) return -1;
//} else {
//if(eth_get_dev_conf_raw_IF4(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;
} else {
if (eth_socket_init_udp(device)!=0) return -1;
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
@@ -334,6 +345,8 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
eth->flags = ETH_RAW_IF4_MODE;
} else if (eth_params->transp_preference == 2) {
eth->flags = ETH_UDP_IF4_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;
@@ -361,6 +374,9 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
} else if (eth->flags == ETH_RAW_IF4_MODE) {
device->trx_write_func = trx_eth_write_raw_IF4;
device->trx_read_func = trx_eth_read_raw_IF4;
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
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;
@@ -46,6 +46,7 @@
#define ETH_RAW_MODE 1
#define ETH_UDP_IF4_MODE 2
#define ETH_RAW_IF4_MODE 3
#define ETH_RAW_IF5_MOBIPASS 4
// Time domain RRH packet sizes
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
@@ -61,3 +62,7 @@
#define RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4_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)