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

update to make harmony work with Mobipass[Ercom]

parent 73920f3f
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
/*! \file PHY/LTE_TRANSPORT/if5_tools.c /*! \file PHY/LTE_TRANSPORT/if5_tools.c
* \brief * \brief
* \author S. Sandeep Kumar, Raymond Knopp * \author S. Sandeep Kumar, Raymond Knopp, Tien-Thinh Nguyen
* \date 2016 * \date 2016
* \version 0.1 * \version 0.1
* \company Eurecom * \company Eurecom
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr * \email: ee13b1025@iith.ac.in, knopp@eurecom.fr, tien-thinh.nguyen@eurecom.fr
* \note * \note
* \warning * \warning
*/ */
...@@ -34,13 +34,21 @@ ...@@ -34,13 +34,21 @@
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
//#define DEBUG_DL_MOBIPASS
//#define DEBUG_UL_MOBIPASS
#define SUBFRAME_SKIP_NUM_MOBIPASS 8
int dummy_cnt = 0;
int subframe_skip_extra = 0;
int start_flag = 1;
int offset_cnt = 1;
void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) { void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx]; int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
int32_t *tx_buffer=NULL; int32_t *tx_buffer=NULL;
int8_t dummy_buffer[fp->samples_per_tti*2];
uint16_t packet_id=0, i=0; uint16_t packet_id=0, i=0;
uint32_t spp_eth = (uint32_t) eNB->ifdevice.openair0_cfg->samples_per_packet; uint32_t spp_eth = (uint32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
...@@ -89,16 +97,17 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe ...@@ -89,16 +97,17 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
} }
} else if (packet_type == IF5_MOBIPASS) { } else if (packet_type == IF5_MOBIPASS) {
uint16_t db_fulllength=640; uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
__m128i *data_block=NULL, *data_block_head=NULL; __m128i *data_block=NULL, *data_block_head=NULL;
__m128i *txp128; __m128i *txp128;
__m128i t0, t1; __m128i t0, t1;
tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); // tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES); IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + 4); data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
header->flags = 0; header->flags = 0;
header->fifo_status = 0; header->fifo_status = 0;
...@@ -110,14 +119,14 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe ...@@ -110,14 +119,14 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
txp128 = (__m128i *) txp[0]; txp128 = (__m128i *) txp[0];
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) { for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
header->time_stamp = (uint32_t)(proc_timestamp + packet_id*db_fulllength); header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
data_block = data_block_head; data_block = data_block_head;
for (i=0; i<db_fulllength>>2; i+=2) { for (i=0; i<db_fulllength>>2; i+=2) {
t0 = _mm_srai_epi16(*txp128++, 4); t0 = _mm_srai_epi16(*txp128++, 4);
t1 = _mm_srai_epi16(*txp128++, 4); t1 = _mm_srai_epi16(*txp128++, 4);
// *data_block++ = _mm_packs_epi16(t0, t1);
*data_block++ = _mm_packs_epi16(t0, t1); _mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
} }
// Write the packet to the fronthaul // Write the packet to the fronthaul
...@@ -129,18 +138,38 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe ...@@ -129,18 +138,38 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
IF5_MOBIPASS)) < 0) { IF5_MOBIPASS)) < 0) {
perror("ETHERNET write for IF5_MOBIPASS\n"); perror("ETHERNET write for IF5_MOBIPASS\n");
} }
#ifdef DEBUG_DL_MOBIPASS
if ((subframe==0)&&(dummy_cnt == 100)) {
memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2);
}
#endif
header->seqno += 1; header->seqno += 1;
} }
*seqno = header->seqno; *seqno = header->seqno;
#ifdef DEBUG_DL_MOBIPASS
uint8_t txe;
txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti));
if (txe > 0){
LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe);
}
#endif
} else { } else {
AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type); AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type);
} }
free(tx_buffer); free(tx_buffer);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 );
#ifdef DEBUG_DL_MOBIPASS
if(subframe==0) {
if (dummy_cnt==100) {
write_output("txsigmb.m","txs",(void*)dummy_buffer, fp->samples_per_tti,1, 5);
exit(-1);
} else {
dummy_cnt++;
}
}
#endif
return; return;
} }
...@@ -151,6 +180,8 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram ...@@ -151,6 +180,8 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx]; int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
uint16_t packet_id=0, i=0; uint16_t packet_id=0, i=0;
int8_t dummy_buffer_rx[fp->samples_per_tti*2];
uint8_t rxe;
int32_t spp_eth = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_packet; int32_t spp_eth = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
int32_t spsf = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_frame/10; int32_t spsf = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_frame/10;
...@@ -202,6 +233,127 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram ...@@ -202,6 +233,127 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram
} else if (packet_type == IF5_MOBIPASS) { } else if (packet_type == IF5_MOBIPASS) {
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
openair0_timestamp timestamp_mobipass[fp->samples_per_tti/db_fulllength];
int lower_offset = 0;
int upper_offset = 70000;
int subframe_skip = 0;
int reset_flag = 0;
int32_t *rx_buffer=NULL;
__m128i *data_block=NULL, *data_block_head=NULL;
__m128i *rxp128;
__m128i r0, r1;
//rx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
rx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES);
data_block_head = (__m128i *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti];
rxp128 = (__m128i *) (rxp[0]);
eNB_proc_t *proc = &eNB->proc;
/*
// while(packet_id<fp->samples_per_tti/db_fulllength) {
data_block = data_block_head;
eNB->ifdevice.trx_read_func(&eNB->ifdevice,
&ts0,
(void**)&rx_buffer,
db_fulllength,
1
);
if ((header->seqno == 1)&&(first_packet==1)) {
first_packet = 0; //ignore the packets before synchnorization
packet_id = 0;
ts_offset = ntohl(ts0);
}
if (first_packet==0) {
packet_cnt++;
ts = ntohl(ts0);
packet_id = (ts-ts_offset)/db_fulllength;
packet_id = packet_id % (fp->samples_per_tti/db_fulllength);
printf("[IF5_tools]packet_id:%d\n", packet_id);
// if (ts_stored == 0) {
// ts_stored = 1;
*proc_timestamp = ntohl(ts - (packet_id*db_fulllength));
// }
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength];
rxp128 = (__m128i *) (rxp[0]);
for (i=0; i<db_fulllength>>2; i+=2) {
r0 = _mm_loadu_si128(data_block++);
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4);
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4);
}
}
// }//end while
*/
packet_id=0;
while(packet_id<fp->samples_per_tti/db_fulllength) {
data_block = data_block_head;
eNB->ifdevice.trx_read_func(&eNB->ifdevice,
&timestamp_mobipass[packet_id],
(void**)&rx_buffer,
db_fulllength,
1
);
#ifdef DEBUG_UL_MOBIPASS
if (((proc->timestamp_tx + lower_offset) > ntohl(timestamp_mobipass[packet_id])) || ((proc->timestamp_tx + upper_offset) < ntohl(timestamp_mobipass[packet_id]))) {
//ignore the packet
subframe_skip_extra = (subframe_skip_extra + 1)%67;
LOG_D("[Mobipass] ignored packet, id:[%d,%d], proc->timestamp_tx:%llu, proc->timestamp_rx:%llu, seqno:%d\n", packet_id,subframe_skip_extra, proc->timestamp_tx, ntohl(timestamp_mobipass[packet_id]), header->seqno);
}
#endif
//skip SUBFRAME_SKIP_NUM_MOBIPASS additional UL packets
if ((start_flag == 1) && (subframe_skip < SUBFRAME_SKIP_NUM_MOBIPASS)){
subframe_skip++;
offset_cnt = header->seqno;
} else {
if ((offset_cnt != header->seqno) && (start_flag == 0) && (proc->first_rx > 3)){
#ifdef DEBUG_UL_MOBIPASS
LOG_D(PHY,"[Mobipass] Reset sequence number, offset_cnt:%d, header->seqno:%d, packet_id:%d\n", offset_cnt, header->seqno, packet_id);
#endif
reset_flag=1;
}
if ((reset_flag == 1) && (proc->first_rx > 3 ) && (start_flag == 0) && (packet_id == 0)) {
packet_id = 1;
reset_flag = 0;
}
start_flag = 0;
//store rxdata and increase packet_id
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength];
rxp128 = (__m128i *) (rxp[0]);
for (i=0; i<db_fulllength>>2; i+=2) {
r0 = _mm_loadu_si128(data_block++);
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4);
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4);
}
packet_id++;
offset_cnt = (header->seqno+1)&255;
}
}//end while
*proc_timestamp = ntohl(timestamp_mobipass[0]);
#ifdef DEBUG_UL_MOBIPASS
LOG_I(PHY,"[Mobipass][Recv_MOBIPASS] timestamp: %llu\n ", *proc_timestamp);
if (eNB->CC_id>0) {
rxe = dB_fixed(signal_energy(rxp[0],fp->samples_per_tti));
if (rxe > 0){
LOG_I(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (*proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, rxe);
// write_output("rxsigmb.m","rxs",(void*)dummy_buffer_rx, fp->samples_per_tti,1, 5);
// exit(-1);
}
}
#endif
} else { } else {
AssertFatal(1==0, "recv_IF5 - Unknown packet_type %x", packet_type); AssertFatal(1==0, "recv_IF5 - Unknown packet_type %x", packet_type);
......
...@@ -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*/
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_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; int offset_mobipass = 40120;
proc->frame_rx = (proc->timestamp_rx/(10*fp->samples_per_tti))&1023; 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 != 0) { if (proc->first_rx == 1) {
proc->first_rx = 0; 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)
...@@ -1219,10 +1231,15 @@ void wakeup_slaves(eNB_proc_t *proc) { ...@@ -1219,10 +1231,15 @@ void wakeup_slaves(eNB_proc_t *proc) {
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
...@@ -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