1 /******************************************************************************
3 * Copyright (c) 2019 Intel.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
22 #include "xran_pkt_up.h"
24 #include <rte_common.h>
36 #define NUM_OF_PRB_IN_FULL_BAND (66)
37 #define N_SC_PER_PRB 12
38 #define N_SYM_PER_SLOT 14
39 #define N_FULLBAND_SC (NUM_OF_PRB_IN_FULL_BAND*N_SC_PER_PRB)
40 #define MAX_ANT_CARRIER_SUPPORTED 16
41 // 0.125, just for testing
42 #define SLOTNUM_PER_SUBFRAME 8
43 #define SUBFRAMES_PER_SYSTEMFRAME 10
44 #define PDSCH_PAYLOAD_SIZE (N_FULLBAND_SC*4)
45 #define NUM_OF_SLOT_IN_TDD_LOOP (80)
46 #define IQ_PLAYBACK_BUFFER_BYTES (NUM_OF_SLOT_IN_TDD_LOOP*N_SYM_PER_SLOT*N_FULLBAND_SC*4L)
47 /* PRACH data samples are 32 bits wide, 16bits for I and 16bits for Q. Each packet contains 839 samples. The payload length is 3356 octets.*/
48 #define PRACH_PLAYBACK_BUFFER_BYTES (10*839*4L)
51 #define iAssert(p) if(!(p)){fprintf(stderr,\
52 "Assertion failed: %s, file %s, line %d, val %d\n",\
53 #p, __FILE__, __LINE__, p);exit(-1);}
58 struct send_symbol_cb_args
60 struct rb_map *samp_buf;
69 struct ecpri_seq_id seq;
72 extern uint8_t numCCPorts;
73 /* Number of antennas supported by front-end */
75 extern uint8_t num_eAxc;
76 /* Number of antennas supported by front-end */
77 extern int16_t *p_tx_play_buffer[MAX_ANT_CARRIER_SUPPORTED];
78 extern int32_t tx_play_buffer_size[MAX_ANT_CARRIER_SUPPORTED];
79 extern int32_t tx_play_buffer_position[MAX_ANT_CARRIER_SUPPORTED];
81 /* Number of antennas supported by front-end */
82 extern int16_t *p_rx_log_buffer[MAX_ANT_CARRIER_SUPPORTED];
83 extern int32_t rx_log_buffer_size[MAX_ANT_CARRIER_SUPPORTED];
84 extern int32_t rx_log_buffer_position[MAX_ANT_CARRIER_SUPPORTED];
86 extern int16_t *p_prach_log_buffer[MAX_ANT_CARRIER_SUPPORTED];
87 extern int32_t prach_log_buffer_size[MAX_ANT_CARRIER_SUPPORTED];
88 extern int32_t prach_log_buffer_position[MAX_ANT_CARRIER_SUPPORTED];
90 extern int16_t *p_tx_buffer[MAX_ANT_CARRIER_SUPPORTED];
91 extern int32_t tx_buffer_size[MAX_ANT_CARRIER_SUPPORTED];
93 extern int16_t *p_rx_buffer[MAX_ANT_CARRIER_SUPPORTED];
94 extern int32_t rx_buffer_size[MAX_ANT_CARRIER_SUPPORTED];
96 void sys_save_buf_to_file_txt(char *filename, char *bufname, unsigned char *pBuffer, unsigned int size, unsigned int buffers_num);
97 void sys_save_buf_to_file(char *filename, char *bufname, unsigned char *pBuffer, unsigned int size, unsigned int buffers_num);
98 int sys_load_file_to_buff(char *filename, char *bufname, unsigned char *pBuffer, unsigned int size, unsigned int buffers_num);