Commit cfd45a1d authored by Sandeep Kumar's avatar Sandeep Kumar

small fixes and mid save

parent 5ae509b2
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
* \warning * \warning
*/ */
#include <stdint.h>
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/TOOLS/ALAW/alaw_lut.h" #include "PHY/TOOLS/ALAW/alaw_lut.h"
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
* \warning * \warning
*/ */
#include <stdint.h>
#include "PHY/defs.h" #include "PHY/defs.h"
/// Macro for IF4 packet type /// Macro for IF4 packet type
...@@ -57,7 +56,7 @@ struct IF4_header { ...@@ -57,7 +56,7 @@ struct IF4_header {
/// Frame Status /// Frame Status
uint32_t frame_status; uint32_t frame_status;
}; } __attribute__ ((__packed__));
typedef struct IF4_header IF4_header_t; typedef struct IF4_header IF4_header_t;
#define sizeof_IF4_header_t 12 #define sizeof_IF4_header_t 12
......
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
#include <stdint.h> 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 PHY/LTE_TRANSPORT/if5_mobipass_tools.c
* \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 "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/LTE_TRANSPORT/if5_mobipass_tools.h" #include "PHY/LTE_TRANSPORT/if5_mobipass_tools.h"
...@@ -7,36 +44,35 @@ ...@@ -7,36 +44,35 @@
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
uint8_t send_IF5(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint8_t init_seq) { void send_IF5(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint8_t *seqno) {
uint8_t seqno=init_seq; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
void *txp[2]; void *txp[fp->nb_antennas_tx];
void *tx_buffer=NULL; void *tx_buffer=NULL;
__m128i *data_block=NULL,*main_data_block=NULL; __m128i *data_block=NULL, *data_block_head=NULL;
__m128i *txp128; __m128i *txp128;
__m128i t0, t1; __m128i t0, t1;
uint16_t packet_id=0, i; uint16_t packet_id=0, i;
uint16_t db_fulllength = 640; uint16_t db_fulllength=640;
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));
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES); IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
data_block = (__m128i *)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + 4); data_block_head = (__m128i *)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + 4);
main_data_block = data_block;
header->flags = 0; header->flags = 0;
header->fifo_status = 0; header->fifo_status = 0;
header->seqno = *seqno;
header->ack = 0; header->ack = 0;
header->seqno = seqno; header->word0 = 0;
header->rsvd = 0;
txp[0] = (void*)&eNB->common_vars.txdata[0][0][proc->subframe_tx*eNB->frame_parms.samples_per_tti]; txp[0] = (void*)&eNB->common_vars.txdata[0][0][proc->subframe_tx*eNB->frame_parms.samples_per_tti];
txp128 = (__m128i *) txp[0]; txp128 = (__m128i *) txp[0];
for (packet_id=0; packet_id<(7680*2)/640; packet_id++) { for (packet_id=0; packet_id<(fp->samples_per_tti*2)/db_fulllength; packet_id++) {
header->time_stamp = proc->timestamp_tx + packet_id*640; header->time_stamp = proc->timestamp_tx + packet_id * db_fulllength;
data_block = main_data_block; data_block = data_block_head;
for (i=0; i<db_fulllength>>3; i+=2) { for (i=0; i<db_fulllength>>3; i+=2) {
t0 = _mm_srli_epi16(*txp128++, 4); t0 = _mm_srli_epi16(*txp128++, 4);
...@@ -58,8 +94,7 @@ uint8_t send_IF5(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint8_t init_seq) { ...@@ -58,8 +94,7 @@ uint8_t send_IF5(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint8_t init_seq) {
header->seqno += 1; header->seqno += 1;
} }
seqno = header->seqno; *seqno = header->seqno;
free(tx_buffer); free(tx_buffer);
return(seqno); return;
} }
/*******************************************************************************
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 PHY/LTE_TRANSPORT/if5_mobipass_tools.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 <stdint.h> #include <stdint.h>
#include "PHY/defs.h" #include "PHY/defs.h"
#define IF5_MOBIPASS 0x0050 #define IF5_MOBIPASS 0xbffe
struct IF5_mobipass_header { struct IF5_mobipass_header {
/// Type ///
uint16_t flags; uint16_t flags;
/// Sub-Type ///
uint16_t fifo_status; uint16_t fifo_status;
/// Reserved ///
uint8_t seqno; uint8_t seqno;
///
uint8_t ack; uint8_t ack;
///
uint32_t rsvd; uint32_t word0;
/// Frame Status ///
uint32_t time_stamp; uint32_t time_stamp;
} __attribute__ ((__packed__)); } __attribute__ ((__packed__));
typedef struct IF5_mobipass_header IF5_mobipass_header_t; typedef struct IF5_mobipass_header IF5_mobipass_header_t;
#define sizeof_IF5_mobipass_header_t 14 #define sizeof_IF5_mobipass_header_t 14
uint8_t send_IF5(PHY_VARS_eNB*, eNB_rxtx_proc_t*, uint8_t); void send_IF5(PHY_VARS_eNB*, eNB_rxtx_proc_t*, uint8_t*);
...@@ -2524,6 +2524,10 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2524,6 +2524,10 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
uint16_t packet_type; uint16_t packet_type;
uint32_t symbol_number=0; uint32_t symbol_number=0;
uint32_t symbol_mask, symbol_mask_full; uint32_t symbol_mask, symbol_mask_full;
struct timespec time_req, time_rem;
time_req.tv_sec = 0;
time_req.tv_nsec = 900000;
if (subframe==9) { if (subframe==9) {
subframe=0; subframe=0;
...@@ -2583,7 +2587,16 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2583,7 +2587,16 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
} else if(eNB->node_function == eNodeB_3GPP_BBU) { // acquisition from IF } else if(eNB->node_function == eNodeB_3GPP_BBU) { // acquisition from IF
/// **** trx_read_func from IF device **** /// /// **** trx_read_func from IF device **** ///
nanosleep(&time_req, &time_rem);
proc->timestamp_rx += fp->samples_per_tti;
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, proc->frame_rx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, proc->subframe_rx );
} }
......
...@@ -124,11 +124,11 @@ int eth_socket_init_raw(openair0_device *device) { ...@@ -124,11 +124,11 @@ int eth_socket_init_raw(openair0_device *device) {
/* Construct the Ethernet header */ /* Construct the Ethernet header */
ether_aton_r(local_mac, (struct ether_addr *)(&(eth->eh.ether_shost))); ether_aton_r(local_mac, (struct ether_addr *)(&(eth->eh.ether_shost)));
ether_aton_r(remote_mac, (struct ether_addr *)(&(eth->eh.ether_dhost))); ether_aton_r(remote_mac, (struct ether_addr *)(&(eth->eh.ether_dhost)));
// if (((*) device->priv)->flags == ETH_RAW_IF5_MOBIPASS) { if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
eth->eh.ether_type = htons(0xbffe); eth->eh.ether_type = htons(0xbffe);
// } else { } else {
// eth->eh.ether_type = htons((short)device->openair0_cfg->my_port); 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]); 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; return 0;
......
...@@ -302,6 +302,8 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -302,6 +302,8 @@ static void* eNB_thread_rxtx( void* param ) {
uint16_t packet_type; uint16_t packet_type;
uint32_t symbol_number=0; uint32_t symbol_number=0;
uint8_t seqno=0;
if (opp_enabled == 1) { if (opp_enabled == 1) {
snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf", "eNB"); snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf", "eNB");
tx_time_file = fopen(tx_time_name,"w"); tx_time_file = fopen(tx_time_name,"w");
...@@ -548,8 +550,8 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -548,8 +550,8 @@ static void* eNB_thread_rxtx( void* param ) {
} else if (PHY_vars_eNB_g[0][proc->CC_id]->node_function == eNodeB_3GPP_BBU) { } else if (PHY_vars_eNB_g[0][proc->CC_id]->node_function == eNodeB_3GPP_BBU) {
/// **** trx_write_func to IF device **** /// /// **** trx_write_func to IF device **** ///
// send_IF5(PHY_vars_eNB_g[0][proc->CC_id], proc, 0); send_IF5(PHY_vars_eNB_g[0][proc->CC_id], proc, &seqno);
} else { } else {
/// **** send_IF4 of txdataF to RRU **** /// /// **** send_IF4 of txdataF to RRU **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
...@@ -626,10 +628,8 @@ static void* eNB_thread_rx_common( void* param ) { ...@@ -626,10 +628,8 @@ static void* eNB_thread_rx_common( void* param ) {
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;
uint8_t seqno=0;
FILE *rx_time_file = NULL; FILE *rx_time_file = NULL;
char rx_time_name[101]; char rx_time_name[101];
int i;
struct timespec wait; struct timespec wait;
wait.tv_sec=0; wait.tv_sec=0;
...@@ -764,14 +764,6 @@ static void* eNB_thread_rx_common( void* param ) { ...@@ -764,14 +764,6 @@ static void* eNB_thread_rx_common( void* param ) {
if (eNB->rfdevice.trx_start_func(&eNB->rfdevice) != 0 ) if (eNB->rfdevice.trx_start_func(&eNB->rfdevice) != 0 )
LOG_E(HW,"Could not start the RF device\n"); LOG_E(HW,"Could not start the RF device\n");
} }
// proc->proc_rxtx[0].timestamp_tx = 0;
// seqno = send_IF5(eNB, &proc->proc_rxtx[0], 0);
// for (i=0; i<1000;i++) {
// seqno = send_IF5(eNB, &proc->proc_rxtx[0], seqno);
// proc->proc_rxtx[0].timestamp_tx += 7680*2;
// }
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
while (!oai_exit) { while (!oai_exit) {
......
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