Commit dce51915 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

update to make harmony work with Mobipass[Ercom]

parent 73920f3f
This diff is collapsed.
...@@ -759,6 +759,10 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ...@@ -759,6 +759,10 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
#endif #endif
LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
// initialize harq_pid and round // initialize harq_pid and round
if (eNB_UE_stats == NULL)
return;
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti, mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,
frameP,subframeP, frameP,subframeP,
&ue_sched_ctl->harq_pid[CC_id], &ue_sched_ctl->harq_pid[CC_id],
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/*! \file ethernet_lib.c /*! \file ethernet_lib.c
* \brief API to stream I/Q samples over standard ethernet * \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 * \date 2015
* \version 0.2 * \version 0.2
* \company Eurecom * \company Eurecom
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "common_lib.h" #include "common_lib.h"
#include "ethernet_lib.h" #include "ethernet_lib.h"
#define DEBUG 0 //#define DEBUG 0
//struct sockaddr_ll dest_addr[MAX_INST]; //struct sockaddr_ll dest_addr[MAX_INST];
//struct sockaddr_ll local_addr[MAX_INST]; //struct sockaddr_ll local_addr[MAX_INST];
...@@ -93,7 +93,11 @@ int eth_socket_init_raw(openair0_device *device) { ...@@ -93,7 +93,11 @@ int eth_socket_init_raw(openair0_device *device) {
eth->local_addr_ll.sll_family = AF_PACKET; eth->local_addr_ll.sll_family = AF_PACKET;
eth->local_addr_ll.sll_ifindex = eth->if_index.ifr_ifindex; eth->local_addr_ll.sll_ifindex = eth->if_index.ifr_ifindex;
/* hear traffic from specific protocol*/ /* hear traffic from specific protocol*/
eth->local_addr_ll.sll_protocol = htons((short)device->openair0_cfg->my_port); 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_halen = ETH_ALEN;
eth->local_addr_ll.sll_pkttype = PACKET_OTHERHOST; eth->local_addr_ll.sll_pkttype = PACKET_OTHERHOST;
eth->addr_len = sizeof(struct sockaddr_ll); eth->addr_len = sizeof(struct sockaddr_ll);
...@@ -350,6 +354,78 @@ int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestam ...@@ -350,6 +354,78 @@ 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 eth_set_dev_conf_raw(openair0_device *device) {
......
...@@ -87,6 +87,8 @@ int trx_eth_start(openair0_device *device) { ...@@ -87,6 +87,8 @@ int trx_eth_start(openair0_device *device) {
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) { } else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
printf("Setting ETHERNET to RAW_IF5_MODE\n"); printf("Setting ETHERNET to RAW_IF5_MODE\n");
if (eth_socket_init_raw(device)!=0) return -1; if (eth_socket_init_raw(device)!=0) return -1;
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
} else { } else {
printf("Setting ETHERNET to UDP_IF5_MODE\n"); printf("Setting ETHERNET to UDP_IF5_MODE\n");
if (eth_socket_init_udp(device)!=0) return -1; if (eth_socket_init_udp(device)!=0) return -1;
...@@ -363,7 +365,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth ...@@ -363,7 +365,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
device->trx_read_func = trx_eth_read_udp_IF4p5; device->trx_read_func = trx_eth_read_udp_IF4p5;
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) { } else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
device->trx_write_func = trx_eth_write_raw_IF4p5; device->trx_write_func = trx_eth_write_raw_IF4p5;
device->trx_read_func = trx_eth_read_raw_IF4p5; device->trx_read_func = trx_eth_read_raw_IF5_mobipass;
} else { } else {
//device->trx_write_func = trx_eth_write_udp_IF4p5; //device->trx_write_func = trx_eth_write_udp_IF4p5;
//device->trx_read_func = trx_eth_read_udp_IF4p5; //device->trx_read_func = trx_eth_read_udp_IF4p5;
......
...@@ -230,6 +230,7 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi ...@@ -230,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_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_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_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_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 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); int eth_get_dev_conf_raw(openair0_device *device);
......
...@@ -71,3 +71,4 @@ ...@@ -71,3 +71,4 @@
// Mobipass packet sizes // Mobipass packet sizes
#define RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES 1280 #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 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
...@@ -17,7 +17,7 @@ eNBs = ...@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "93"; mobile_network_code = "92";
////////// Physical parameters: ////////// Physical parameters:
...@@ -129,7 +129,7 @@ eNBs = ...@@ -129,7 +129,7 @@ eNBs =
prach_root = 0; prach_root = 0;
prach_config_index = 0; prach_config_index = 0;
prach_high_speed = "DISABLE"; prach_high_speed = "DISABLE";
prach_zero_correlation = 1; prach_zero_correlation = 3;
prach_freq_offset = 2; prach_freq_offset = 2;
pucch_delta_shift = 1; pucch_delta_shift = 1;
pucch_nRB_CQI = 1; pucch_nRB_CQI = 1;
...@@ -265,7 +265,7 @@ eNBs = ...@@ -265,7 +265,7 @@ eNBs =
rrh_gw_active = "yes"; rrh_gw_active = "yes";
tr_preference = "raw_if5_mobipass"; tr_preference = "raw_if5_mobipass";
rf_preference = "usrp_b200"; rf_preference = "usrp_b200";
iq_txshift = 4; iq_txshift = 0;
tx_sample_advance = 80; tx_sample_advance = 80;
tx_scheduling_advance = 9; tx_scheduling_advance = 9;
} }
......
...@@ -279,6 +279,7 @@ static inline void wait_sync(char *thread_name) { ...@@ -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) 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; unsigned int aa,slot_offset;
//int dummy_tx_b[7680*4] __attribute__((aligned(32))); //int dummy_tx_b[7680*4] __attribute__((aligned(32)));
int i, tx_offset; int i, tx_offset;
...@@ -370,9 +371,9 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) ...@@ -370,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])[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 S-subframe switch to RX in second subframe
if (subframe_select(&phy_vars_eNB->frame_parms,subframe) == SF_S) { if (subframe_select(&phy_vars_eNB->frame_parms,subframe) == SF_S) {
...@@ -662,26 +663,37 @@ void fh_if5_asynch_UL(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -662,26 +663,37 @@ void fh_if5_asynch_UL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; 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) { int offset_mobipass = 40120;
proc->first_rx = 0; 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; *subframe = proc->subframe_rx;
*frame = proc->frame_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 { else {
if (proc->subframe_rx != *subframe) { if (proc->subframe_rx != *subframe) {
LOG_E(PHY,"fh_if5_asynch_UL: subframe_rx %d is not what we expect %d\n",proc->subframe_rx,*subframe); proc->first_rx++;
exit_fun("Exiting"); 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) { if (proc->frame_rx != *frame) {
LOG_E(PHY,"fh_if5_asynch_UL: subframe_rx %d is not what we expect %d\n",proc->frame_rx,*frame); proc->first_rx++;
exit_fun("Exiting"); 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 } // eNodeB_3GPP_BBU
// asynchronous UL with IF4p5 (RCC,RAU,eNodeB_BBU) // asynchronous UL with IF4p5 (RCC,RAU,eNodeB_BBU)
...@@ -1218,11 +1230,16 @@ void wakeup_slaves(eNB_proc_t *proc) { ...@@ -1218,11 +1230,16 @@ void wakeup_slaves(eNB_proc_t *proc) {
exit_fun( "error locking mutex_rxtx" ); exit_fun( "error locking mutex_rxtx" );
break; 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; int cnt_slave = ++slave_proc->instance_cnt_FH;
slave_proc->frame_rx = proc->frame_rx; slave_proc->frame_rx = proc->frame_rx;
slave_proc->subframe_rx = proc->subframe_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; slave_proc->timestamp_tx = proc->timestamp_tx;
pthread_mutex_unlock( &slave_proc->mutex_FH ); pthread_mutex_unlock( &slave_proc->mutex_FH );
...@@ -1483,6 +1500,7 @@ static void* eNB_thread_single( void* param ) { ...@@ -1483,6 +1500,7 @@ static void* eNB_thread_single( void* param ) {
eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0]; eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0];
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id]; PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
eNB->CC_id = proc->CC_id;
void *rxp[2],*rxp2[2]; void *rxp[2],*rxp2[2];
...@@ -1610,7 +1628,7 @@ static void* eNB_thread_single( void* param ) { ...@@ -1610,7 +1628,7 @@ static void* eNB_thread_single( void* param ) {
} }
if (eNB->CC_id==1) if (eNB->CC_id==1)
LOG_I(PHY,"eNB thread single %p (proc %p, CC_id %d), frame %d (%p), subframe %d (%p)\n", 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); pthread_self(), proc, eNB->CC_id, frame,&frame,subframe,&subframe);
// synchronization on FH interface, acquire signals/data and block // synchronization on FH interface, acquire signals/data and block
...@@ -1751,7 +1769,7 @@ void init_eNB_proc(int inst) { ...@@ -1751,7 +1769,7 @@ void init_eNB_proc(int inst) {
} }
//for multiple CCs: setup master and slaves //for multiple CCs: setup master and slaves
/* /*
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
eNB = PHY_vars_eNB_g[inst][CC_id]; eNB = PHY_vars_eNB_g[inst][CC_id];
...@@ -1764,8 +1782,8 @@ void init_eNB_proc(int inst) { ...@@ -1764,8 +1782,8 @@ void init_eNB_proc(int inst) {
if (i >= CC_id) eNB->proc.slave_proc[i] = &(PHY_vars_eNB_g[inst][i+1]->proc); if (i >= CC_id) eNB->proc.slave_proc[i] = &(PHY_vars_eNB_g[inst][i+1]->proc);
} }
} }
}*/ }
*/
/* setup PHY proc TX sync mechanism */ /* setup PHY proc TX sync mechanism */
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL); pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
...@@ -2144,7 +2162,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst ...@@ -2144,7 +2162,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"); printf("Exiting, cannot initialize eNodeB Buffers\n");
exit(-1); exit(-1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment