Commit d5d1dd0e authored by Sandeep Kumar's avatar Sandeep Kumar

fixed packet struct types

parent f101c663
...@@ -38,40 +38,44 @@ ...@@ -38,40 +38,44 @@
* \warning * \warning
*/ */
#ifndef USER_MODE
#include "if4_tools.h"
#include <stdint.h>
#else
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#endif
// Define how data blocks are stored and transferred // Define how data blocks are stored and transferred
//void send_IF4(PHY_VARS_eNB *eNB, int subframe){
void send_IF4(PHY_VARS_eNB *eNB, int subframe){ //eNB_proc_t *proc = &eNB->proc;
eNB_proc_t *proc = &eNB->proc;
//int frame=proc->frame_tx; //int frame=proc->frame_tx;
//int subframe=proc->subframe_tx; //int subframe=proc->subframe_tx;
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; //LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
uint32_t i,j; //uint32_t i,j;
float *data_block = malloc(length*sizeof(long)); //float *data_block = malloc(length*sizeof(long));
// Generate IF4 packet (for now DL) with frame status information // Generate IF4 packet (for now DL) with frame status information
dl_packet = gen_IF4_dl_packet( /* ADD INFO and data_block pointer */ ); //dl_packet = gen_IF4_dl_packet( /* ADD INFO and data_block pointer */ );
for(i=0; i<fp->symbols_per_tti; i++) { //for(i=0; i<fp->symbols_per_tti; i++) {
// Do compression of the two parts and generate data blocks // Do compression of the two parts and generate data blocks
symbol = eNB->common_vars.txdataF[0][0 /*antenna number*/][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)] //symbol = eNB->common_vars.txdataF[0][0 /*antenna number*/][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)]
data_block[j] = Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j -1])<<16 + Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j]); //data_block[j] = Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j -1])<<16 + Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j]);
data_block[j+NrOfNonZeroValues] = Atan(subframe[i][j+1])<<16 + Atan(subframe[i][j+2]); //data_block[j+NrOfNonZeroValues] = Atan(subframe[i][j+1])<<16 + Atan(subframe[i][j+2]);
// Set data blocks and update subframe no./other information to generated packet // Set data blocks and update subframe no./other information to generated packet
// Write the packet(s) to the fronthaul // Write the packet(s) to the fronthaul
} //}
} //}
void recv_IF4( /* ADD INFO and data_block pointer */ ) { void recv_IF4( /* ADD INFO and data_block pointer */ ) {
...@@ -83,83 +87,83 @@ void recv_IF4( /* ADD INFO and data_block pointer */ ) { ...@@ -83,83 +87,83 @@ void recv_IF4( /* ADD INFO and data_block pointer */ ) {
} }
IF4_dl_packet gen_IF4_dl_packet( /* ADD INFO and data_block pointer */ ) { struct IF4_dl_packet gen_IF4_dl_packet( /* ADD INFO and data_block pointer */ ) {
IF4_dl_packet dl_packet; struct IF4_dl_packet dl_packet;
// Set destination and source address // Set destination and source address
// Set Type and Sub-Type // Set Type and Sub-Type
dl_packet.type = ; //08_0A ? dl_packet.type = 0x080A;
dl_packet.sub_type = 0x0020; dl_packet.sub_type = 0x0020;
// Leave reserved as it is // Leave reserved as it is
//dl_packet.rsvd = ; //dl_packet.rsvd = ;
// Set frame status // Set frame status
dl_packet.frame_status.ant_num = ; dl_packet.frame_status.ant_num = 0;
dl_packet.frame_status.ant_start = ; dl_packet.frame_status.ant_start = 0;
dl_packet.frame_status.rf_num = ; dl_packet.frame_status.rf_num = 0;
dl_packet.frame_status.sf_num = ; dl_packet.frame_status.sf_num = 0;
dl_packet.frame_status.sym_num = ; dl_packet.frame_status.sym_num = 0;
//dl_packet.frame_status.rsvd = ; //dl_packet.frame_status.rsvd = ;
// Set data blocks if sent // Set data blocks if sent
if (data_block != NULL) { //if (data_block != NULL) {
//
} else { //} else {
//
} //}
// Set frame check sequence // Set frame check sequence
dl_packet.fcs = ; dl_packet.fcs = 0;
return dl_packet; return dl_packet;
} }
IF4_ul_packet gen_IF4_ul_packet( /* ADD INFO and data_block pointer */ ) { struct IF4_ul_packet gen_IF4_ul_packet( /* ADD INFO and data_block pointer */ ) {
IF4_ul_packet ul_packet; struct IF4_ul_packet ul_packet;
// Set destination and source address // Set destination and source address
// Set Type and Sub-Type // Set Type and Sub-Type
ul_packet.type = ; //08_0A ? ul_packet.type = 0x080A;
ul_packet.sub_type = 0x0019; ul_packet.sub_type = 0x0019;
// Leave reserved as it is // Leave reserved as it is
//ul_packet.rsvd = ; //ul_packet.rsvd = ;
// Set frame status // Set frame status
ul_packet.frame_status.ant_num = ; ul_packet.frame_status.ant_num = 0;
ul_packet.frame_status.ant_start = ; ul_packet.frame_status.ant_start = 0;
ul_packet.frame_status.rf_num = ; ul_packet.frame_status.rf_num = 0;
ul_packet.frame_status.sf_num = ; ul_packet.frame_status.sf_num = 0;
ul_packet.frame_status.sym_num = ; ul_packet.frame_status.sym_num = 0;
//ul_packet.frame_status.rsvd = ; //ul_packet.frame_status.rsvd = ;
// Set antenna specific gain // Set antenna specific gain
ul_packet.gain0.exponent = ; ul_packet.gain0.exponent = 0;
//ul_packet.gain0.rsvd = ; //ul_packet.gain0.rsvd = ;
// Set data blocks if sent // Set data blocks if sent
if (data_block != NULL) { //if (data_block != NULL) {
//
} else { //} else {
//
} //}
// Set frame check sequence // Set frame check sequence
ul_packet.fcs = ; ul_packet.fcs = 0;
return ul_packet; return ul_packet;
} }
IF4_prach_packet gen_IF4_prach_packet( /* ADD INFO and data_block pointer */ ) { struct IF4_prach_packet gen_IF4_prach_packet( /* ADD INFO and data_block pointer */ ) {
IF4_prach_packet prach_packet; struct IF4_prach_packet prach_packet;
// Set destination and source address // Set destination and source address
// Set Type and Sub-Type // Set Type and Sub-Type
prach_packet.type = ; //08_0A ? prach_packet.type = 0x080A;
prach_packet.sub_type = 0x0021; prach_packet.sub_type = 0x0021;
// Leave reserved as it is // Leave reserved as it is
...@@ -167,20 +171,27 @@ IF4_prach_packet gen_IF4_prach_packet( /* ADD INFO and data_block pointer */ ) { ...@@ -167,20 +171,27 @@ IF4_prach_packet gen_IF4_prach_packet( /* ADD INFO and data_block pointer */ ) {
// Set LTE Prach configuration // Set LTE Prach configuration
//prach_packet.prach_conf.rsvd = ; //prach_packet.prach_conf.rsvd = ;
prach_packet.prach_conf.ant = ; prach_packet.prach_conf.ant = 0;
prach_packet.prach_conf.rf_num = ; prach_packet.prach_conf.rf_num = 0;
prach_packet.prach_conf.sf_num = ; prach_packet.prach_conf.sf_num = 0;
prach_packet.prach_conf.exponent = ; prach_packet.prach_conf.exponent = 0;
// Set data blocks if sent // Set data blocks if sent
if (data_block != NULL) { //if (data_block != NULL) {
//
} else { //} else {
//
} //}
// Set frame check sequence // Set frame check sequence
prach_packet.fcs = ; prach_packet.fcs = 0;
return prach_packet; return prach_packet;
} }
int main(){
uint32_t i=0;
return 0;
}
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
* \warning * \warning
*/ */
#include <stdint.h>
/// IF4 Frame Status (32 bits) /// IF4 Frame Status (32 bits)
struct IF4_frame_status { struct IF4_frame_status {
/// Antenna Numbers /// Antenna Numbers
...@@ -59,9 +57,9 @@ struct IF4_frame_status { ...@@ -59,9 +57,9 @@ struct IF4_frame_status {
/// IF4 Antenna Gain (16 bits) /// IF4 Antenna Gain (16 bits)
struct IF4_gain { struct IF4_gain {
/// Reserved /// Reserved
uint32_t rsvd:10; uint16_t rsvd:10;
/// FFT Exponent Output /// FFT Exponent Output
uint32_t exponent:6; uint16_t exponent:6;
}; };
/// IF4 LTE PRACH Configuration (32 bits) /// IF4 LTE PRACH Configuration (32 bits)
...@@ -90,13 +88,14 @@ struct IF4_dl_packet { ...@@ -90,13 +88,14 @@ struct IF4_dl_packet {
/// Reserved /// Reserved
uint32_t rsvd; uint32_t rsvd;
/// Frame Status /// Frame Status
IF4_frame_status frame_status; struct IF4_frame_status frame_status;
/// Data Blocks /// Data Blocks
/// Frame Check Sequence /// Frame Check Sequence
uint32_t fcs; uint32_t fcs;
}; };
struct IF4_ul_packet { struct IF4_ul_packet {
/// Destination Address /// Destination Address
...@@ -109,23 +108,23 @@ struct IF4_ul_packet { ...@@ -109,23 +108,23 @@ struct IF4_ul_packet {
/// Reserved /// Reserved
uint32_t rsvd; uint32_t rsvd;
/// Frame Status /// Frame Status
IF4_frame_status frame_status; struct IF4_frame_status frame_status;
/// Gain 0 /// Gain 0
IF4_gain gain0; struct IF4_gain gain0;
/// Gain 1 /// Gain 1
IF4_gain gain1; struct IF4_gain gain1;
/// Gain 2 /// Gain 2
IF4_gain gain2; struct IF4_gain gain2;
/// Gain 3 /// Gain 3
IF4_gain gain3; struct IF4_gain gain3;
/// Gain 4 /// Gain 4
IF4_gain gain4; struct IF4_gain gain4;
/// Gain 5 /// Gain 5
IF4_gain gain5; struct IF4_gain gain5;
/// Gain 6 /// Gain 6
IF4_gain gain6; struct IF4_gain gain6;
/// Gain 7 /// Gain 7
IF4_gain gain7; struct IF4_gain gain7;
/// Data Blocks /// Data Blocks
/// Frame Check Sequence /// Frame Check Sequence
...@@ -144,7 +143,7 @@ struct IF4_prach_packet { ...@@ -144,7 +143,7 @@ struct IF4_prach_packet {
/// Reserved /// Reserved
uint32_t rsvd; uint32_t rsvd;
/// LTE Prach Configuration /// LTE Prach Configuration
IF4_lte_prach_conf prach_conf; struct IF4_lte_prach_conf prach_conf;
/// Prach Data Block (one antenna) /// Prach Data Block (one antenna)
/// Frame Check Sequence /// Frame Check Sequence
...@@ -153,12 +152,12 @@ struct IF4_prach_packet { ...@@ -153,12 +152,12 @@ struct IF4_prach_packet {
// Needs to be checked // Needs to be checked
IF4_dl_packet gen_IF4_dl_packet(); struct IF4_dl_packet gen_IF4_dl_packet();
IF4_ul_packet gen_IF4_ul_packet(); struct IF4_ul_packet gen_IF4_ul_packet();
IF4_prach_packet gen_IF4_prach_packet(); struct IF4_prach_packet gen_IF4_prach_packet();
void send_IF4(PHY_VARS_eNB *eNB, int subframe); void send_IF4( /* ADD INFO */ );
void recv_IF4(PHY_VARS_eNB *eNB, int subframe); void recv_IF4( /* ADD INFO */ );
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