Clang format UE, eNB and lib (#850)

* Clang-formated UE, eNB and lib.
* Fixed compiling errors from clang-format.
* Fix linking issues introduced by clang-format
* Fix poor formating in initializing arrays of arrays.
* Fix mistake in conflict resolution on rm_turbo.c
* Re-apply clang format to gtpc_ies.h
master
Pedro Alvarez 5 years ago committed by Andre Puschmann
parent 2ed2e35aa7
commit c5979f59eb

@ -23,17 +23,18 @@
char CHECK_FUNCTION_EXISTS(); char CHECK_FUNCTION_EXISTS();
#ifdef __CLASSIC_C__ #ifdef __CLASSIC_C__
int main(){ int main()
{
int ac; int ac;
char* av[]; char* av[];
#else #else
int main(int ac, char*av[]){ int main(int ac, char* av[])
{
#endif #endif
float ac2 = sqrtf(rand()); float ac2 = sqrtf(rand());
CHECK_FUNCTION_EXISTS(); CHECK_FUNCTION_EXISTS();
if(ac2 * ac > 1000) if (ac2 * ac > 1000) {
{
return *av[0]; return *av[0];
} }
return 0; return 0;

@ -19,22 +19,21 @@
* *
*/ */
#include <math.h>
#include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <math.h>
#include <sys/time.h> #include <sys/time.h>
#include <signal.h> #include <unistd.h>
#include <unistd.h> #include <unistd.h>
#include "srslte/srslte.h" #include "srslte/srslte.h"
#include "srslte/phy/rf/rf_utils.h"
#include "srslte/common/crash_handler.h" #include "srslte/common/crash_handler.h"
#include "srslte/phy/rf/rf_utils.h"
#ifndef DISABLE_RF #ifndef DISABLE_RF
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"
@ -47,7 +46,6 @@
#define MAX_EARFCN 1000 #define MAX_EARFCN 1000
int band = -1; int band = -1;
int earfcn_start = -1, earfcn_end = -1; int earfcn_start = -1, earfcn_end = -1;
@ -68,7 +66,8 @@ struct cells results[1024];
float rf_gain = 70.0; float rf_gain = 70.0;
char* rf_args = ""; char* rf_args = "";
void usage(char *prog) { void usage(char* prog)
{
printf("Usage: %s [agsendtvb] -b band\n", prog); printf("Usage: %s [agsendtvb] -b band\n", prog);
printf("\t-a RF args [Default %s]\n", rf_args); printf("\t-a RF args [Default %s]\n", rf_args);
printf("\t-g RF gain [Default %.2f dB]\n", rf_gain); printf("\t-g RF gain [Default %.2f dB]\n", rf_gain);
@ -78,7 +77,8 @@ void usage(char *prog) {
printf("\t-v [set srslte_verbose to debug, default none]\n"); printf("\t-v [set srslte_verbose to debug, default none]\n");
} }
void parse_args(int argc, char **argv) { void parse_args(int argc, char** argv)
{
int opt; int opt;
while ((opt = getopt(argc, argv, "agsendvb")) != -1) { while ((opt = getopt(argc, argv, "agsendvb")) != -1) {
switch (opt) { switch (opt) {
@ -135,7 +135,8 @@ float srslte_rf_set_rx_gain_wrapper(void* h, float f)
return srslte_rf_set_rx_gain((srslte_rf_t*)h, f); return srslte_rf_set_rx_gain((srslte_rf_t*)h, f);
} }
int main(int argc, char **argv) { int main(int argc, char** argv)
{
int n; int n;
srslte_rf_t rf; srslte_rf_t rf;
srslte_ue_cellsearch_t cs; srslte_ue_cellsearch_t cs;
@ -265,5 +266,3 @@ int main(int argc, char **argv) {
srslte_rf_close(&rf); srslte_rf_close(&rf);
exit(0); exit(0);
} }

@ -19,26 +19,25 @@
* *
*/ */
#include "srslte/common/crash_handler.h"
#include "srslte/common/gen_mch_tables.h"
#include "srslte/srslte.h"
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <sys/select.h> #include <sys/select.h>
#include <pthread.h> #include <unistd.h>
#include <semaphore.h>
#include <signal.h>
#include "srslte/common/crash_handler.h"
#include "srslte/common/gen_mch_tables.h"
#include "srslte/srslte.h"
#define UE_CRNTI 0x1234 #define UE_CRNTI 0x1234
#define M_CRNTI 0xFFFD #define M_CRNTI 0xFFFD
#ifndef DISABLE_RF #ifndef DISABLE_RF
#include "srslte/phy/rf/rf.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
#include "srslte/phy/rf/rf.h"
srslte_rf_t rf; srslte_rf_t rf;
#else #else
#pragma message "Compiling pdsch_ue with no RF support" #pragma message "Compiling pdsch_ue with no RF support"
@ -101,7 +100,6 @@ int rvidx[SRSLTE_MAX_CODEWORDS] = {0, 0};
cf_t *sf_buffer[SRSLTE_MAX_PORTS] = {NULL}, *output_buffer[SRSLTE_MAX_PORTS] = {NULL}; cf_t *sf_buffer[SRSLTE_MAX_PORTS] = {NULL}, *output_buffer[SRSLTE_MAX_PORTS] = {NULL};
int sf_n_re, sf_n_samples; int sf_n_re, sf_n_samples;
pthread_t net_thread; pthread_t net_thread;
@ -111,19 +109,18 @@ bool net_packet_ready = false;
srslte_netsource_t net_source; srslte_netsource_t net_source;
srslte_netsink_t net_sink; srslte_netsink_t net_sink;
int prbset_num = 1, last_prbset_num = 1; int prbset_num = 1, last_prbset_num = 1;
int prbset_orig = 0; int prbset_orig = 0;
//#define DATA_BUFF_SZ 1024*128 //#define DATA_BUFF_SZ 1024*128
// uint8_t data[8*DATA_BUFF_SZ], data2[DATA_BUFF_SZ]; // uint8_t data[8*DATA_BUFF_SZ], data2[DATA_BUFF_SZ];
// uint8_t data_tmp[DATA_BUFF_SZ]; // uint8_t data_tmp[DATA_BUFF_SZ];
#define DATA_BUFF_SZ 1024 * 1024 #define DATA_BUFF_SZ 1024 * 1024
uint8_t *data_mbms, *data[2], data2[DATA_BUFF_SZ]; uint8_t *data_mbms, *data[2], data2[DATA_BUFF_SZ];
uint8_t data_tmp[DATA_BUFF_SZ]; uint8_t data_tmp[DATA_BUFF_SZ];
void usage(char *prog) { void usage(char* prog)
{
printf("Usage: %s [Iagmfoncvpuxb]\n", prog); printf("Usage: %s [Iagmfoncvpuxb]\n", prog);
#ifndef DISABLE_RF #ifndef DISABLE_RF
printf("\t-I RF device [Default %s]\n", rf_dev); printf("\t-I RF device [Default %s]\n", rf_dev);
@ -143,7 +140,9 @@ void usage(char *prog) {
printf("\t-x Transmission mode [1-4] [Default %d]\n", transmission_mode + 1); printf("\t-x Transmission mode [1-4] [Default %d]\n", transmission_mode + 1);
printf("\t-b Precoding Matrix Index (multiplex mode only)* [Default %d]\n", multiplex_pmi); printf("\t-b Precoding Matrix Index (multiplex mode only)* [Default %d]\n", multiplex_pmi);
printf("\t-w Number of codewords/layers (multiplex mode only)* [Default %d]\n", multiplex_nof_layers); printf("\t-w Number of codewords/layers (multiplex mode only)* [Default %d]\n", multiplex_nof_layers);
printf("\t-u listen TCP/UDP port for input data (if mbsfn is active then the stream is over mbsfn only) (-1 is random) [Default %d]\n", net_port); printf("\t-u listen TCP/UDP port for input data (if mbsfn is active then the stream is over mbsfn only) (-1 is "
"random) [Default %d]\n",
net_port);
printf("\t-v [set srslte_verbose to debug, default none]\n"); printf("\t-v [set srslte_verbose to debug, default none]\n");
printf("\t-s output file SNR [Default %f]\n", output_file_snr); printf("\t-s output file SNR [Default %f]\n", output_file_snr);
printf("\t-q Enable/Disable 256QAM modulation (default %s)\n", enable_256qam ? "enabled" : "disabled"); printf("\t-q Enable/Disable 256QAM modulation (default %s)\n", enable_256qam ? "enabled" : "disabled");
@ -151,7 +150,8 @@ void usage(char *prog) {
printf("\t*: See 3GPP 36.212 Table 5.3.3.1.5-4 for more information\n"); printf("\t*: See 3GPP 36.212 Table 5.3.3.1.5-4 for more information\n");
} }
void parse_args(int argc, char **argv) { void parse_args(int argc, char** argv)
{
int opt; int opt;
while ((opt = getopt(argc, argv, "IadglfmoncpqvutxbwMsB")) != -1) { while ((opt = getopt(argc, argv, "IadglfmoncpqvutxbwMsB")) != -1) {
@ -226,7 +226,8 @@ void parse_args(int argc, char **argv) {
#endif #endif
} }
void base_init() { void base_init()
{
int i; int i;
/* Configure cell and PDSCH in function of the transmission mode */ /* Configure cell and PDSCH in function of the transmission mode */
@ -255,7 +256,6 @@ void base_init() {
} }
data_mbms = srslte_vec_malloc(sizeof(uint8_t) * SOFTBUFFER_SIZE); data_mbms = srslte_vec_malloc(sizeof(uint8_t) * SOFTBUFFER_SIZE);
/* init memory */ /* init memory */
for (i = 0; i < SRSLTE_MAX_PORTS; i++) { for (i = 0; i < SRSLTE_MAX_PORTS; i++) {
sf_buffer[i] = srslte_vec_malloc(sizeof(cf_t) * sf_n_re); sf_buffer[i] = srslte_vec_malloc(sizeof(cf_t) * sf_n_re);
@ -274,7 +274,6 @@ void base_init() {
bzero(output_buffer[i], sizeof(cf_t) * sf_n_samples); bzero(output_buffer[i], sizeof(cf_t) * sf_n_samples);
} }
/* open file or USRP */ /* open file or USRP */
if (output_file_name) { if (output_file_name) {
if (strcmp(output_file_name, "NULL")) { if (strcmp(output_file_name, "NULL")) {
@ -342,9 +341,6 @@ void base_init() {
exit(-1); exit(-1);
} }
if (srslte_regs_init(&regs, cell)) { if (srslte_regs_init(&regs, cell)) {
ERROR("Error initiating regs\n"); ERROR("Error initiating regs\n");
exit(-1); exit(-1);
@ -378,7 +374,6 @@ void base_init() {
srslte_pdsch_set_rnti(&pdsch, UE_CRNTI); srslte_pdsch_set_rnti(&pdsch, UE_CRNTI);
if (mbsfn_area_id > -1) { if (mbsfn_area_id > -1) {
if (srslte_pmch_init(&pmch, cell.nof_prb, 1)) { if (srslte_pmch_init(&pmch, cell.nof_prb, 1)) {
ERROR("Error creating PMCH object\n"); ERROR("Error creating PMCH object\n");
@ -400,8 +395,8 @@ void base_init() {
} }
} }
void base_free()
void base_free() { {
int i; int i;
for (i = 0; i < SRSLTE_MAX_CODEWORDS; i++) { for (i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
srslte_softbuffer_tx_free(softbuffers[i]); srslte_softbuffer_tx_free(softbuffers[i]);
@ -452,7 +447,6 @@ void base_free() {
} }
} }
bool go_exit = false; bool go_exit = false;
void sig_int_handler(int signo) void sig_int_handler(int signo)
{ {
@ -462,20 +456,17 @@ void sig_int_handler(int signo)
} }
} }
unsigned int reverse(register unsigned int x)
unsigned int
reverse(register unsigned int x)
{ {
x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1));
x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2));
x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4));
x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8));
return ((x >> 16) | (x << 16)); return ((x >> 16) | (x << 16));
} }
uint32_t prbset_to_bitmask() { uint32_t prbset_to_bitmask()
{
uint32_t mask = 0; uint32_t mask = 0;
int nb = (int)ceilf((float)cell.nof_prb / srslte_ra_type0_P(cell.nof_prb)); int nb = (int)ceilf((float)cell.nof_prb / srslte_ra_type0_P(cell.nof_prb));
for (int i = 0; i < nb; i++) { for (int i = 0; i < nb; i++) {
@ -486,7 +477,8 @@ uint32_t prbset_to_bitmask() {
return reverse(mask) >> (32 - nb); return reverse(mask) >> (32 - nb);
} }
int update_radl() { int update_radl()
{
ZERO_OBJECT(dci_dl); ZERO_OBJECT(dci_dl);
@ -552,7 +544,8 @@ int update_radl() {
} }
/* Read new MCS from stdin */ /* Read new MCS from stdin */
int update_control() { int update_control()
{
char input[128]; char input[128];
fd_set set; fd_set set;
@ -648,9 +641,9 @@ int update_control() {
} }
} }
/** Function run in a separate thread to receive UDP data */ /** Function run in a separate thread to receive UDP data */
void *net_thread_fnc(void *arg) { void* net_thread_fnc(void* arg)
{
int n; int n;
int rpm = 0, wpm = 0; int rpm = 0, wpm = 0;
@ -671,8 +664,7 @@ void *net_thread_fnc(void *arg) {
sem_wait(&net_sem); sem_wait(&net_sem);
if (mbsfn_area_id > -1) { if (mbsfn_area_id > -1) {
memcpy(data_mbms, &data2[wpm], nbytes); memcpy(data_mbms, &data2[wpm], nbytes);
} } else {
else{
memcpy(data[0], &data2[wpm], nbytes / (size_t)2); memcpy(data[0], &data2[wpm], nbytes / (size_t)2);
memcpy(data[1], &data2[wpm], nbytes / (size_t)2); memcpy(data[1], &data2[wpm], nbytes / (size_t)2);
} }
@ -695,8 +687,8 @@ void *net_thread_fnc(void *arg) {
return NULL; return NULL;
} }
int main(int argc, char** argv)
int main(int argc, char **argv) { {
int nf = 0, sf_idx = 0, N_id_2 = 0; int nf = 0, sf_idx = 0, N_id_2 = 0;
cf_t pss_signal[SRSLTE_PSS_LEN]; cf_t pss_signal[SRSLTE_PSS_LEN];
float sss_signal0[SRSLTE_SSS_LEN]; // for subframe 0 float sss_signal0[SRSLTE_SSS_LEN]; // for subframe 0
@ -758,7 +750,6 @@ int main(int argc, char **argv) {
ERROR("Error initializing MBSFNR signal\n"); ERROR("Error initializing MBSFNR signal\n");
exit(-1); exit(-1);
} }
} }
if (srslte_refsignal_cs_set_cell(&csr_refs, cell)) { if (srslte_refsignal_cs_set_cell(&csr_refs, cell)) {
@ -766,15 +757,12 @@ int main(int argc, char **argv) {
exit(-1); exit(-1);
} }
for (i = 0; i < SRSLTE_MAX_PORTS; i++) { for (i = 0; i < SRSLTE_MAX_PORTS; i++) {
sf_symbols[i] = sf_buffer[i % cell.nof_ports]; sf_symbols[i] = sf_buffer[i % cell.nof_ports];
} }
#ifndef DISABLE_RF #ifndef DISABLE_RF
sigset_t sigset; sigset_t sigset;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); sigaddset(&sigset, SIGINT);
@ -829,7 +817,6 @@ int main(int argc, char **argv) {
srslte_softbuffer_tx_reset(softbuffers[i]); srslte_softbuffer_tx_reset(softbuffers[i]);
} }
#ifndef DISABLE_RF #ifndef DISABLE_RF
bool start_of_burst = true; bool start_of_burst = true;
#endif #endif
@ -847,11 +834,9 @@ int main(int argc, char **argv) {
/* Set Antenna port resource elements to zero */ /* Set Antenna port resource elements to zero */
bzero(sf_symbols[0], sizeof(cf_t) * sf_n_re); bzero(sf_symbols[0], sizeof(cf_t) * sf_n_re);
if (sf_idx == 0 || sf_idx == 5) { if (sf_idx == 0 || sf_idx == 5) {
srslte_pss_put_slot(pss_signal, sf_symbols[0], cell.nof_prb, SRSLTE_CP_NORM); srslte_pss_put_slot(pss_signal, sf_symbols[0], cell.nof_prb, SRSLTE_CP_NORM);
srslte_sss_put_slot(sf_idx ? sss_signal5 : sss_signal0, sf_symbols[0], cell.nof_prb, srslte_sss_put_slot(sf_idx ? sss_signal5 : sss_signal0, sf_symbols[0], cell.nof_prb, SRSLTE_CP_NORM);
SRSLTE_CP_NORM);
} }
/* Copy zeros, SSS, PSS into the rest of antenna ports */ /* Copy zeros, SSS, PSS into the rest of antenna ports */
@ -993,7 +978,6 @@ int main(int argc, char **argv) {
srslte_ofdm_tx_sf(&ifft_mbsfn); srslte_ofdm_tx_sf(&ifft_mbsfn);
} }
/* send to file or usrp */ /* send to file or usrp */
if (output_file_name) { if (output_file_name) {
if (!null_file_sink) { if (!null_file_sink) {
@ -1011,7 +995,8 @@ int main(int argc, char **argv) {
#ifndef DISABLE_RF #ifndef DISABLE_RF
float norm_factor = (float)cell.nof_prb / 15 / sqrtf(pdsch_cfg.grant.nof_prb); float norm_factor = (float)cell.nof_prb / 15 / sqrtf(pdsch_cfg.grant.nof_prb);
for (i = 0; i < cell.nof_ports; i++) { for (i = 0; i < cell.nof_ports; i++) {
srslte_vec_sc_prod_cfc(output_buffer[i], rf_amp * norm_factor, output_buffer[i], SRSLTE_SF_LEN_PRB(cell.nof_prb)); srslte_vec_sc_prod_cfc(
output_buffer[i], rf_amp * norm_factor, output_buffer[i], SRSLTE_SF_LEN_PRB(cell.nof_prb));
} }
srslte_rf_send_multi(&rf, (void**)output_buffer, sf_n_samples, true, start_of_burst, false); srslte_rf_send_multi(&rf, (void**)output_buffer, sf_n_samples, true, start_of_burst, false);
start_of_burst = false; start_of_burst = false;
@ -1027,5 +1012,3 @@ int main(int argc, char **argv) {
printf("Done\n"); printf("Done\n");
exit(0); exit(0);
} }

@ -19,21 +19,20 @@
* *
*/ */
#include <assert.h>
#include <math.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <math.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <assert.h>
#include <signal.h>
#include <pthread.h>
#include <semaphore.h>
#include "srslte/common/gen_mch_tables.h"
#include "srslte/common/crash_handler.h" #include "srslte/common/crash_handler.h"
#include "srslte/common/gen_mch_tables.h"
#include "srslte/phy/io/filesink.h" #include "srslte/phy/io/filesink.h"
#include "srslte/srslte.h" #include "srslte/srslte.h"
@ -152,7 +151,8 @@ void args_default(prog_args_t* args)
args->mbsfn_sf_mask = 32; args->mbsfn_sf_mask = 32;
} }
void usage(prog_args_t *args, char *prog) { void usage(prog_args_t* args, char* prog)
{
printf("Usage: %s [adgpPoOcildFRDnruMNvTG] -f rx_frequency (in Hz) | -i input_file\n", prog); printf("Usage: %s [adgpPoOcildFRDnruMNvTG] -f rx_frequency (in Hz) | -i input_file\n", prog);
#ifndef DISABLE_RF #ifndef DISABLE_RF
printf("\t-I RF dev [Default %s]\n", args->rf_dev); printf("\t-I RF dev [Default %s]\n", args->rf_dev);
@ -198,7 +198,8 @@ void usage(prog_args_t *args, char *prog) {
printf("\t-v [set srslte_verbose to debug, default none]\n"); printf("\t-v [set srslte_verbose to debug, default none]\n");
} }
void parse_args(prog_args_t *args, int argc, char **argv) { void parse_args(prog_args_t* args, int argc, char** argv)
{
int opt; int opt;
args_default(args); args_default(args);
@ -336,7 +337,6 @@ void sig_int_handler(int signo)
cf_t* sf_buffer[SRSLTE_MAX_PORTS] = {NULL}; cf_t* sf_buffer[SRSLTE_MAX_PORTS] = {NULL};
#ifndef DISABLE_RF #ifndef DISABLE_RF
int srslte_rf_recv_wrapper(void* h, cf_t* data_[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t) int srslte_rf_recv_wrapper(void* h, cf_t* data_[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t)
@ -379,10 +379,13 @@ srslte_netsink_t net_sink, net_sink_signal;
#define PRINT_LINE(_fmt, ...) \ #define PRINT_LINE(_fmt, ...) \
printf("\033[K" _fmt "\n", ##__VA_ARGS__); \ printf("\033[K" _fmt "\n", ##__VA_ARGS__); \
this_nof_lines++ this_nof_lines++
#define PRINT_LINE_RESET_CURSOR() printf("\033[%dA", this_nof_lines); prev_nof_lines = this_nof_lines #define PRINT_LINE_RESET_CURSOR() \
printf("\033[%dA", this_nof_lines); \
prev_nof_lines = this_nof_lines
#define PRINT_LINE_ADVANCE_CURSOR() printf("\033[%dB", prev_nof_lines + 1) #define PRINT_LINE_ADVANCE_CURSOR() printf("\033[%dB", prev_nof_lines + 1)
int main(int argc, char **argv) { int main(int argc, char** argv)
{
int ret; int ret;
#ifndef DISABLE_RF #ifndef DISABLE_RF
@ -919,7 +922,6 @@ int main(int argc, char **argv) {
PRINT_LINE("Press enter maximum printing debug log of 1 subframe."); PRINT_LINE("Press enter maximum printing debug log of 1 subframe.");
PRINT_LINE(""); PRINT_LINE("");
PRINT_LINE_RESET_CURSOR(); PRINT_LINE_RESET_CURSOR();
} }
break; break;
} }
@ -1005,7 +1007,8 @@ float tmp_plot[110 * 15 * 2048];
float tmp_plot2[110 * 15 * 2048]; float tmp_plot2[110 * 15 * 2048];
float tmp_plot3[110 * 15 * 2048]; float tmp_plot3[110 * 15 * 2048];
void *plot_thread_run(void *arg) { void* plot_thread_run(void* arg)
{
int i; int i;
uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp); uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp);

@ -22,8 +22,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h>
#include "srslte/srslte.h" #include "srslte/srslte.h"
@ -36,7 +36,8 @@ int out_N_id_2 = 0, force_N_id_2=-1;
#define CFO_AUTO -9999.0 #define CFO_AUTO -9999.0
float force_cfo = CFO_AUTO; float force_cfo = CFO_AUTO;
void usage(char *prog) { void usage(char* prog)
{
printf("Usage: %s [olntsNfcv] -i input_file\n", prog); printf("Usage: %s [olntsNfcv] -i input_file\n", prog);
printf("\t-o output_file [Default %s]\n", output_file_name); printf("\t-o output_file [Default %s]\n", output_file_name);
printf("\t-l frame_length [Default %d]\n", frame_length); printf("\t-l frame_length [Default %d]\n", frame_length);
@ -49,7 +50,8 @@ void usage(char *prog) {
printf("\t-v srslte_verbose\n"); printf("\t-v srslte_verbose\n");
} }
void parse_args(int argc, char **argv) { void parse_args(int argc, char** argv)
{
int opt; int opt;
while ((opt = getopt(argc, argv, "ionltsNfcv")) != -1) { while ((opt = getopt(argc, argv, "ionltsNfcv")) != -1) {
switch (opt) { switch (opt) {
@ -94,7 +96,8 @@ void parse_args(int argc, char **argv) {
} }
} }
int main(int argc, char **argv) { int main(int argc, char** argv)
{
srslte_filesource_t fsrc; srslte_filesource_t fsrc;
srslte_filesink_t fsink; srslte_filesink_t fsink;
srslte_pss_t pss[3]; // One for each N_id_2 srslte_pss_t pss[3]; // One for each N_id_2
@ -120,7 +123,8 @@ int main(int argc, char **argv) {
parse_args(argc, argv); parse_args(argc, argv);
gettimeofday(&tdata[1], NULL); gettimeofday(&tdata[1], NULL);
printf("Initializing...");fflush(stdout); printf("Initializing...");
fflush(stdout);
if (srslte_filesource_init(&fsrc, input_file_name, SRSLTE_COMPLEX_FLOAT_BIN)) { if (srslte_filesource_init(&fsrc, input_file_name, SRSLTE_COMPLEX_FLOAT_BIN)) {
ERROR("Error opening file %s\n", input_file_name); ERROR("Error opening file %s\n", input_file_name);
@ -184,8 +188,7 @@ int main(int argc, char **argv) {
/* read all file or nof_frames */ /* read all file or nof_frames */
frame_cnt = 0; frame_cnt = 0;
while (frame_length == srslte_filesource_read(&fsrc, input, frame_length) while (frame_length == srslte_filesource_read(&fsrc, input, frame_length) && frame_cnt < nof_frames) {
&& frame_cnt < nof_frames) {
gettimeofday(&tdata[1], NULL); gettimeofday(&tdata[1], NULL);
if (force_cfo != CFO_AUTO) { if (force_cfo != CFO_AUTO) {
@ -215,8 +218,7 @@ int main(int argc, char **argv) {
sss_idx = peak_pos[N_id_2] - 2 * (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_LEN)); sss_idx = peak_pos[N_id_2] - 2 * (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_LEN));
if (sss_idx >= 0) { if (sss_idx >= 0) {
srslte_sss_m0m1_diff(&sss[N_id_2], &input[sss_idx], srslte_sss_m0m1_diff(&sss[N_id_2], &input[sss_idx], &m0, &m0_value, &m1, &m1_value);
&m0, &m0_value, &m1, &m1_value);
cfo[frame_cnt] = srslte_pss_cfo_compute(&pss[N_id_2], &input[peak_pos[N_id_2] - 128]); cfo[frame_cnt] = srslte_pss_cfo_compute(&pss[N_id_2], &input[peak_pos[N_id_2] - 128]);
printf("\t%d\t%d\t%d\t%d\t%.3f\t\t%3d\t%d\t%d\t%.3f\n", printf("\t%d\t%d\t%d\t%d\t%.3f\t\t%3d\t%d\t%d\t%.3f\n",
@ -245,7 +247,9 @@ int main(int argc, char **argv) {
avg_time /= frame_cnt; avg_time /= frame_cnt;
printf("\n"); printf("\n");
printf("Average exec time: %.3f ms / frame. %.3f Msamp/s (%.3f\%% CPU)\n", printf("Average exec time: %.3f ms / frame. %.3f Msamp/s (%.3f\%% CPU)\n",
avg_time / 1000, frame_length / avg_time, 100 * avg_time / 5000 * (9600 / (float) frame_length )); avg_time / 1000,
frame_length / avg_time,
100 * avg_time / 5000 * (9600 / (float)frame_length));
float cfo_mean = 0; float cfo_mean = 0;
for (i = 0; i < frame_cnt; i++) { for (i = 0; i < frame_cnt; i++) {

@ -19,20 +19,20 @@
* *
*/ */
#include <stdio.h> #include <math.h>
#include <signal.h> #include <signal.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <math.h>
#include <time.h> #include <time.h>
#include <unistd.h>
#include <stdbool.h> #include <stdbool.h>
#include "srslte/srslte.h"
#include "srslte/phy/rf/rf.h"
#include "srslte/phy/io/filesink.h" #include "srslte/phy/io/filesink.h"
#include "srslte/phy/rf/rf.h"
#include "srslte/srslte.h"
static bool keep_running = true; static bool keep_running = true;
char* output_file_name; char* output_file_name;
@ -41,11 +41,13 @@ float rf_gain=40.0, rf_freq=-1.0, rf_rate=0.96e6;
int nof_samples = -1; int nof_samples = -1;
int nof_rx_antennas = 1; int nof_rx_antennas = 1;
void int_handler(int dummy) { void int_handler(int dummy)
{
keep_running = false; keep_running = false;
} }
void usage(char *prog) { void usage(char* prog)
{
printf("Usage: %s [agrnv] -f rx_frequency_hz -o output_file\n", prog); printf("Usage: %s [agrnv] -f rx_frequency_hz -o output_file\n", prog);
printf("\t-a RF args [Default %s]\n", rf_args); printf("\t-a RF args [Default %s]\n", rf_args);
printf("\t-g RF Gain [Default %.2f dB]\n", rf_gain); printf("\t-g RF Gain [Default %.2f dB]\n", rf_gain);
@ -55,7 +57,8 @@ void usage(char *prog) {
printf("\t-v srslte_verbose\n"); printf("\t-v srslte_verbose\n");
} }
void parse_args(int argc, char **argv) { void parse_args(int argc, char** argv)
{
int opt; int opt;
while ((opt = getopt(argc, argv, "agrnvfoA")) != -1) { while ((opt = getopt(argc, argv, "agrnvfoA")) != -1) {
switch (opt) { switch (opt) {
@ -94,7 +97,8 @@ void parse_args(int argc, char **argv) {
} }
} }
int main(int argc, char **argv) { int main(int argc, char** argv)
{
cf_t* buffer[SRSLTE_MAX_PORTS]; cf_t* buffer[SRSLTE_MAX_PORTS];
int sample_count, n; int sample_count, n;
srslte_rf_t rf; srslte_rf_t rf;
@ -143,9 +147,7 @@ int main(int argc, char **argv) {
printf("Correctly RX rate: %.2f MHz\n", srate * 1e-6); printf("Correctly RX rate: %.2f MHz\n", srate * 1e-6);
srslte_rf_start_rx_stream(&rf, false); srslte_rf_start_rx_stream(&rf, false);
while ((sample_count < nof_samples || nof_samples == -1) && keep_running) {
while((sample_count < nof_samples || nof_samples == -1)
&& keep_running){
n = srslte_rf_recv_with_time_multi(&rf, (void**)buffer, buflen, true, NULL, NULL); n = srslte_rf_recv_with_time_multi(&rf, (void**)buffer, buflen, true, NULL, NULL);
if (n < 0) { if (n < 0) {
ERROR("Error receiving samples\n"); ERROR("Error receiving samples\n");

@ -19,19 +19,19 @@
* *
*/ */
#include <stdio.h> #include <math.h>
#include <signal.h> #include <signal.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <math.h>
#include <time.h> #include <time.h>
#include <unistd.h>
#include <stdbool.h> #include <stdbool.h>
#include "srslte/srslte.h"
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"
#include "srslte/srslte.h"
static bool keep_running = true; static bool keep_running = true;
char* output_file_name = NULL; char* output_file_name = NULL;
@ -42,11 +42,13 @@ int nof_subframes = -1;
int N_id_2 = -1; int N_id_2 = -1;
uint32_t nof_rx_antennas = 1; uint32_t nof_rx_antennas = 1;
void int_handler(int dummy) { void int_handler(int dummy)
{
keep_running = false; keep_running = false;
} }
void usage(char *prog) { void usage(char* prog)
{
printf("Usage: %s [agrnv] -l N_id_2 -f rx_frequency_hz -o output_file\n", prog); printf("Usage: %s [agrnv] -l N_id_2 -f rx_frequency_hz -o output_file\n", prog);
printf("\t-a RF args [Default %s]\n", rf_args); printf("\t-a RF args [Default %s]\n", rf_args);
printf("\t-g RF Gain [Default %.2f dB]\n", rf_gain); printf("\t-g RF Gain [Default %.2f dB]\n", rf_gain);
@ -56,7 +58,8 @@ void usage(char *prog) {
printf("\t-v verbose\n"); printf("\t-v verbose\n");
} }
void parse_args(int argc, char **argv) { void parse_args(int argc, char** argv)
{
int opt; int opt;
while ((opt = getopt(argc, argv, "agpnvfolA")) != -1) { while ((opt = getopt(argc, argv, "agpnvfolA")) != -1) {
switch (opt) { switch (opt) {
@ -108,7 +111,8 @@ int srslte_rf_recv_wrapper(void* h, cf_t* data_[SRSLTE_MAX_PORTS], uint32_t nsam
return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL); return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL);
} }
int main(int argc, char **argv) { int main(int argc, char** argv)
{
cf_t* buffer[SRSLTE_MAX_PORTS] = {NULL}; cf_t* buffer[SRSLTE_MAX_PORTS] = {NULL};
int n; int n;
srslte_rf_t rf; srslte_rf_t rf;
@ -158,7 +162,8 @@ int main(int argc, char **argv) {
cell.nof_prb = nof_prb; cell.nof_prb = nof_prb;
cell.nof_ports = 1; cell.nof_ports = 1;
if (srslte_ue_sync_init_multi(&ue_sync, cell.nof_prb, cell.id==1000, srslte_rf_recv_wrapper, nof_rx_antennas, (void*) &rf)) { if (srslte_ue_sync_init_multi(
&ue_sync, cell.nof_prb, cell.id == 1000, srslte_rf_recv_wrapper, nof_rx_antennas, (void*)&rf)) {
fprintf(stderr, "Error initiating ue_sync\n"); fprintf(stderr, "Error initiating ue_sync\n");
exit(-1); exit(-1);
} }
@ -170,9 +175,7 @@ int main(int argc, char **argv) {
uint32_t subframe_count = 0; uint32_t subframe_count = 0;
bool start_capture = false; bool start_capture = false;
bool stop_capture = false; bool stop_capture = false;
while((subframe_count < nof_subframes || nof_subframes == -1) while ((subframe_count < nof_subframes || nof_subframes == -1) && !stop_capture) {
&& !stop_capture)
{
n = srslte_ue_sync_zerocopy(&ue_sync, buffer); n = srslte_ue_sync_zerocopy(&ue_sync, buffer);
if (n < 0) { if (n < 0) {
ERROR("Error receiving samples\n"); ERROR("Error receiving samples\n");

@ -19,13 +19,13 @@
* *
*/ */
#include <complex.h>
#include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h>
#include <math.h>
#include <time.h> #include <time.h>
#include <complex.h> #include <unistd.h>
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"
#include "srslte/srslte.h" #include "srslte/srslte.h"
@ -40,7 +40,8 @@ char *rf_args="";
char* output_filename = NULL; char* output_filename = NULL;
char* input_filename = NULL; char* input_filename = NULL;
void usage(char *prog) { void usage(char* prog)
{
printf("Usage: %s -o [rx_signal_file]\n", prog); printf("Usage: %s -o [rx_signal_file]\n", prog);
printf("\t-a RF args [Default %s]\n", rf_args); printf("\t-a RF args [Default %s]\n", rf_args);
printf("\t-f RF TX/RX frequency [Default %.2f MHz]\n", rf_freq / 1e6); printf("\t-f RF TX/RX frequency [Default %.2f MHz]\n", rf_freq / 1e6);
@ -52,7 +53,8 @@ void usage(char *prog) {
printf("\t-p Number of UL RB [Default %d]\n", nof_prb); printf("\t-p Number of UL RB [Default %d]\n", nof_prb);
} }
void parse_args(int argc, char **argv) { void parse_args(int argc, char** argv)
{
int opt; int opt;
while ((opt = getopt(argc, argv, "ioafgGptT")) != -1) { while ((opt = getopt(argc, argv, "ioafgGptT")) != -1) {
switch (opt) { switch (opt) {
@ -103,7 +105,8 @@ void parse_args(int argc, char **argv) {
} }
} }
int main(int argc, char **argv) { int main(int argc, char** argv)
{
parse_args(argc, argv); parse_args(argc, argv);
uint32_t flen = srslte_sampling_freq_hz(nof_prb) / 1000; uint32_t flen = srslte_sampling_freq_hz(nof_prb) / 1000;
@ -141,7 +144,6 @@ int main(int argc, char **argv) {
srslte_rf_set_rx_srate(&rf, (double)srate); srslte_rf_set_rx_srate(&rf, (double)srate);
srslte_rf_set_tx_srate(&rf, (double)srate); srslte_rf_set_tx_srate(&rf, (double)srate);
printf("Subframe len: %d samples\n", flen); printf("Subframe len: %d samples\n", flen);
printf("Time advance: %f us\n", time_adv_sec * 1e6); printf("Time advance: %f us\n", time_adv_sec * 1e6);
printf("Set TX/RX rate: %.2f MHz\n", (float)srate / 1000000); printf("Set TX/RX rate: %.2f MHz\n", (float)srate / 1000000);
@ -166,7 +168,6 @@ int main(int argc, char **argv) {
srslte_rf_start_rx_stream(&rf, false); srslte_rf_start_rx_stream(&rf, false);
uint32_t nframe = 0; uint32_t nframe = 0;
while (nframe < nof_frames) { while (nframe < nof_frames) {
printf("Rx subframe %d\n", nframe); printf("Rx subframe %d\n", nframe);
srslte_rf_recv_with_time(&rf, &rx_buffer[flen * nframe], flen, true, &tstamp.full_secs, &tstamp.frac_secs); srslte_rf_recv_with_time(&rf, &rx_buffer[flen * nframe], flen, true, &tstamp.full_secs, &tstamp.frac_secs);
@ -176,7 +177,6 @@ int main(int argc, char **argv) {
srslte_rf_send_timed2(&rf, tx_buffer, flen + time_adv_samples, tstamp.full_secs, tstamp.frac_secs, true, true); srslte_rf_send_timed2(&rf, tx_buffer, flen + time_adv_samples, tstamp.full_secs, tstamp.frac_secs, true, true);
printf("Transmitting Signal\n"); printf("Transmitting Signal\n");
} }
} }
srslte_vec_save_file(output_filename, &rx_buffer[10 * flen], flen * sizeof(cf_t)); srslte_vec_save_file(output_filename, &rx_buffer[10 * flen], flen * sizeof(cf_t));

@ -19,20 +19,20 @@
* *
*/ */
#include <stdio.h> #include <math.h>
#include <signal.h> #include <signal.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <math.h>
#include <time.h> #include <time.h>
#include <unistd.h>
#include <zmq.h> #include <zmq.h>
#include <stdbool.h> #include <stdbool.h>
#include "srslte/srslte.h"
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"
#include "srslte/srslte.h"
static bool keep_running = true; static bool keep_running = true;
static uint32_t nof_rx_antennas = 1; static uint32_t nof_rx_antennas = 1;
@ -77,7 +77,8 @@ static int tx_zmq(void **buffer, uint32_t buffer_len)
return zmq_send(zmq_sock, buffer[0], buffer_len, 0); return zmq_send(zmq_sock, buffer[0], buffer_len, 0);
} }
int main(int argc, char **argv) { int main(int argc, char** argv)
{
void* buffer[max_rx_antennas]; void* buffer[max_rx_antennas];
int n = 0; int n = 0;
uint32_t buflen = 0; // in samples uint32_t buflen = 0; // in samples
@ -198,11 +199,13 @@ static void close_radio()
srslte_rf_close(&rf); srslte_rf_close(&rf);
} }
static void int_handler(int dummy) { static void int_handler(int dummy)
{
keep_running = false; keep_running = false;
} }
static void usage(char *prog) { static void usage(char* prog)
{
printf("Usage: %s [agrAzv] -f rx_frequency_hz\n", prog); printf("Usage: %s [agrAzv] -f rx_frequency_hz\n", prog);
printf("\t-a RF args [Default %s]\n", rf_args); printf("\t-a RF args [Default %s]\n", rf_args);
printf("\t-g RF Gain [Default %.2f dB]\n", rf_gain); printf("\t-g RF Gain [Default %.2f dB]\n", rf_gain);
@ -213,7 +216,8 @@ static void usage(char *prog) {
printf("\t-v srslte_verbose\n"); printf("\t-v srslte_verbose\n");
} }
static void parse_args(int argc, char **argv) { static void parse_args(int argc, char** argv)
{
int opt; int opt;
while ((opt = getopt(argc, argv, "agrfvmzA")) != -1) { while ((opt = getopt(argc, argv, "agrfvmzA")) != -1) {
switch (opt) { switch (opt) {
@ -256,4 +260,3 @@ static void parse_args(int argc, char **argv) {
exit(-1); exit(-1);
} }
} }

@ -21,9 +21,8 @@
#ifndef SRSLTE_GTPC_H #ifndef SRSLTE_GTPC_H
#define SRSLTE_GTPC_H #define SRSLTE_GTPC_H
#include <stdint.h>
#include "srslte/asn1/gtpc_msg.h" #include "srslte/asn1/gtpc_msg.h"
#include <stdint.h>
namespace srslte { namespace srslte {

@ -24,8 +24,7 @@
#include "srslte/phy/io/netsource.h" #include "srslte/phy/io/netsource.h"
namespace srslte namespace srslte {
{
/**************************************************************** /****************************************************************
* *
@ -33,8 +32,7 @@ namespace srslte
* Ref: TS 29.274 v10.14.0 Table 8.1-1 * Ref: TS 29.274 v10.14.0 Table 8.1-1
* *
****************************************************************/ ****************************************************************/
enum gtpc_ie_type enum gtpc_ie_type {
{
// const uint8_t GTPC_IE_TYPE_RESERVED = 0; // const uint8_t GTPC_IE_TYPE_RESERVED = 0;
GTPC_IE_TYPE_IMSI = 1, GTPC_IE_TYPE_IMSI = 1,
GTPC_IE_TYPE_CAUSE = 2, GTPC_IE_TYPE_CAUSE = 2,
@ -159,8 +157,7 @@ enum gtpc_ie_type
* Ref: 3GPP TS 29.274 v10.14.0 Figure 8.4-1 and Table 8.4-1 * Ref: 3GPP TS 29.274 v10.14.0 Figure 8.4-1 and Table 8.4-1
* *
***************************************************************************/ ***************************************************************************/
enum gtpc_cause_value enum gtpc_cause_value {
{
// Reserved // Reserved
GTPC_CAUSE_VALUE_LOCAL_DETACH = 2, GTPC_CAUSE_VALUE_LOCAL_DETACH = 2,
GTPC_CAUSE_VALUE_COMPLETE_DETACH = 3, GTPC_CAUSE_VALUE_COMPLETE_DETACH = 3,
@ -235,8 +232,7 @@ enum gtpc_cause_value
// 240-255 Spare. For future use in an initial/request message. // 240-255 Spare. For future use in an initial/request message.
}; };
struct gtpc_cause_ie struct gtpc_cause_ie {
{
enum gtpc_cause_value cause_value; enum gtpc_cause_value cause_value;
bool pce; bool pce;
bool bce; bool bce;
@ -274,8 +270,7 @@ struct gtpc_cause_ie
* Ref: 3GPP TS 29.274 v10.14.0 Table 8.7-1 * Ref: 3GPP TS 29.274 v10.14.0 Table 8.7-1
* *
***************************************************************************/ ***************************************************************************/
struct gtpc_ambr_ie struct gtpc_ambr_ie {
{
uint32_t apn_ambr_uplink; uint32_t apn_ambr_uplink;
uint32_t apn_ambr_downlink; uint32_t apn_ambr_downlink;
}; };
@ -311,15 +306,9 @@ struct gtpc_ambr_ie
* Ref: 3GPP TS 29.274 v10.14.0 Figure 8.14-1 * Ref: 3GPP TS 29.274 v10.14.0 Figure 8.14-1
* *
***************************************************************************/ ***************************************************************************/
enum gtpc_pdn_type enum gtpc_pdn_type { GTPC_PDN_TYPE_IPV4 = 1, GTPC_PDN_TYPE_IPV6 = 2, GTPC_PDN_TYPE_IPV4V6 = 3 };
{
GTPC_PDN_TYPE_IPV4 = 1,
GTPC_PDN_TYPE_IPV6 = 2,
GTPC_PDN_TYPE_IPV4V6 = 3
};
struct gtpc_pdn_address_allocation_ie struct gtpc_pdn_address_allocation_ie {
{
enum gtpc_pdn_type pdn_type; enum gtpc_pdn_type pdn_type;
bool ipv4_present; bool ipv4_present;
bool ipv6_present; bool ipv6_present;
@ -333,8 +322,7 @@ struct gtpc_pdn_address_allocation_ie
* Ref: 3GPP TS 29.274 v10.14.0 Figure 8.15-1 * Ref: 3GPP TS 29.274 v10.14.0 Figure 8.15-1
* *
***************************************************************************/ ***************************************************************************/
struct gtpc_bearer_qos_ie struct gtpc_bearer_qos_ie {
{
struct { struct {
uint8_t pvi : 1; uint8_t pvi : 1;
uint8_t spare : 1; uint8_t spare : 1;
@ -360,16 +348,7 @@ struct gtpc_bearer_qos_ie
* *
***************************************************************************/ ***************************************************************************/
enum gtpc_rat_type enum gtpc_rat_type { UTRAN = 1, GERAN, WLAN, GAN, HSPA_EVOLUTION, EUTRAN, Virtual };
{
UTRAN = 1,
GERAN,
WLAN,
GAN,
HSPA_EVOLUTION,
EUTRAN,
Virtual
};
// TODO // TODO
// TODO IEs between 8.17 and 8.22 missing // TODO IEs between 8.17 and 8.22 missing
@ -381,8 +360,7 @@ enum gtpc_rat_type
* Ref: 3GPP TS 29.274 v10.14.0 Figure 8.22-1 * Ref: 3GPP TS 29.274 v10.14.0 Figure 8.22-1
* *
***************************************************************************/ ***************************************************************************/
enum gtpc_interface_type enum gtpc_interface_type {
{
S1_U_ENODEB_GTP_U_INTERFACE, S1_U_ENODEB_GTP_U_INTERFACE,
S1_U_SGW_GTP_U_INTERFACE, S1_U_SGW_GTP_U_INTERFACE,
S12_RNC_GTP_U_INTERFACE, S12_RNC_GTP_U_INTERFACE,
@ -391,8 +369,10 @@ enum gtpc_interface_type
S5_S8_PGW_GTP_U_INTERFACE, S5_S8_PGW_GTP_U_INTERFACE,
S5_S8_SGW_GTP_C_INTERFACE, S5_S8_SGW_GTP_C_INTERFACE,
S5_S8_PGW_GTP_C_INTERFACE, S5_S8_PGW_GTP_C_INTERFACE,
S5_S8_SGW_PMIPV6_INTERFACE, //(the 32 bit GRE key is encoded in 32 bit TEID field and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6) S5_S8_SGW_PMIPV6_INTERFACE, //(the 32 bit GRE key is encoded in 32 bit TEID field and since alternate CoA is not used
S5_S8_PGW_PMIPV6_INTERFACE, //(the 32 bit GRE key is encoded in 32 bit TEID field and the control plane and user plane addresses are the same for PMIPv6) // the control plane and user plane addresses are the same for PMIPv6)
S5_S8_PGW_PMIPV6_INTERFACE, //(the 32 bit GRE key is encoded in 32 bit TEID field and the control plane and user plane
// addresses are the same for PMIPv6)
S11_MME_GTP_C_INTERFACE, S11_MME_GTP_C_INTERFACE,
S11_S4_SGW_GTP_C_INTERFACE, S11_S4_SGW_GTP_C_INTERFACE,
S10_MME_GTP_C_INTERFACE, S10_MME_GTP_C_INTERFACE,
@ -419,9 +399,7 @@ enum gtpc_interface_type
S2B_U_PGW_GTP_U_INTERFACE S2B_U_PGW_GTP_U_INTERFACE
}; };
typedef struct gtpc_f_teid_ie {
typedef struct gtpc_f_teid_ie
{
bool ipv4_present; bool ipv4_present;
bool ipv6_present; bool ipv6_present;
enum gtpc_interface_type interface_type; enum gtpc_interface_type interface_type;
@ -444,5 +422,5 @@ typedef struct gtpc_f_teid_ie
// As such, each GTP-C message will define it's bearer context structures // As such, each GTP-C message will define it's bearer context structures
// locally, according to the rules of TS 29.274 v10.14.0 Section 7. // locally, according to the rules of TS 29.274 v10.14.0 Section 7.
} //namespace } // namespace srslte
#endif // SRSLTE_GTPC_IES_H #endif // SRSLTE_GTPC_IES_H

@ -402,8 +402,7 @@ struct gtpc_delete_session_response {
* Ref: 3GPP TS 29.274 v10.14.0 Table 7.2.11.1-1 * Ref: 3GPP TS 29.274 v10.14.0 Table 7.2.11.1-1
* *
***************************************************************************/ ***************************************************************************/
struct gtpc_downlink_data_notification struct gtpc_downlink_data_notification {
{
bool cause_present; bool cause_present;
struct gtpc_cause_ie cause; struct gtpc_cause_ie cause;
bool eps_bearer_id_present; bool eps_bearer_id_present;
@ -421,8 +420,7 @@ struct gtpc_downlink_data_notification
* Ref: 3GPP TS 29.274 v10.14.0 Table 7.2.11.2-1 * Ref: 3GPP TS 29.274 v10.14.0 Table 7.2.11.2-1
* *
***************************************************************************/ ***************************************************************************/
struct gtpc_downlink_data_notification_acknowledge struct gtpc_downlink_data_notification_acknowledge {
{
struct gtpc_cause_ie cause; struct gtpc_cause_ie cause;
// Data Notification Delay // Data Notification Delay
// Recovery // Recovery
@ -435,8 +433,7 @@ struct gtpc_downlink_data_notification_acknowledge
* Ref: 3GPP TS 29.274 v10.14.0 Table 7.2.11.3-1 * Ref: 3GPP TS 29.274 v10.14.0 Table 7.2.11.3-1
* *
***************************************************************************/ ***************************************************************************/
struct gtpc_downlink_data_notification_failure_indication struct gtpc_downlink_data_notification_failure_indication {
{
struct gtpc_cause_ie cause; struct gtpc_cause_ie cause;
// Private extension // Private extension
}; };

@ -664,9 +664,11 @@ typedef struct {
} LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT; } LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT;
LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataconfigupdateitem( LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataconfigupdateitem(
LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdataconfigupdateitem( LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdataconfigupdateitem(
uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT* ie); uint8_t** ptr,
LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
* ProtocolIE ENB-MBMS-M2AP-ID INTEGER * ProtocolIE ENB-MBMS-M2AP-ID INTEGER
@ -761,9 +763,11 @@ typedef struct {
} LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT; } LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT;
LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsserviceassociatedlogicalm2connectionitem( LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsserviceassociatedlogicalm2connectionitem(
LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceassociatedlogicalm2connectionitem( LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceassociatedlogicalm2connectionitem(
uint8_t** ptr, LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT* ie); uint8_t** ptr,
LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
* ProtocolIE MBMS-Session-Id STATIC OCTET STRING * ProtocolIE MBMS-Session-Id STATIC OCTET STRING
@ -1001,9 +1005,11 @@ typedef struct {
} LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT; } LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT;
LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnareaitem( LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnareaitem(
LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnareaitem( LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnareaitem(
uint8_t** ptr, LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie); uint8_t** ptr,
LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
* ProtocolIE MCCHrelatedBCCH-ConfigPerMBSFNArea DYNAMIC SEQUENCE * ProtocolIE MCCHrelatedBCCH-ConfigPerMBSFNArea DYNAMIC SEQUENCE

@ -97,7 +97,8 @@ typedef enum {
LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS, LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS,
} LIBLTE_MME_DEVICE_PROPERTIES_ENUM; } LIBLTE_MME_DEVICE_PROPERTIES_ENUM;
static const char liblte_mme_device_properties_text[LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS][50] = { static const char liblte_mme_device_properties_text[LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS][50] = {
"Not configured for low priority", "Configured for low priority"}; "Not configured for low priority",
"Configured for low priority"};
// Structs // Structs
// Functions // Functions
LIBLTE_ERROR_ENUM LIBLTE_ERROR_ENUM
@ -194,8 +195,10 @@ typedef enum {
LIBLTE_MME_REVISION_LEVEL_RESERVED, LIBLTE_MME_REVISION_LEVEL_RESERVED,
LIBLTE_MME_REVISION_LEVEL_N_ITEMS, LIBLTE_MME_REVISION_LEVEL_N_ITEMS,
} LIBLTE_MME_REVISION_LEVEL_ENUM; } LIBLTE_MME_REVISION_LEVEL_ENUM;
static const char liblte_mme_revision_level_text[LIBLTE_MME_REVISION_LEVEL_N_ITEMS][20] = { static const char liblte_mme_revision_level_text[LIBLTE_MME_REVISION_LEVEL_N_ITEMS][20] = {"GSM Phase 1",
"GSM Phase 1", "GSM Phase 2", "R99", "RESERVED"}; "GSM Phase 2",
"R99",
"RESERVED"};
typedef enum { typedef enum {
LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_1 = 0, LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_1 = 0,
LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_2, LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_2,
@ -204,8 +207,11 @@ typedef enum {
LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_5, LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_5,
LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS, LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS,
} LIBLTE_MME_RF_POWER_CAPABILITY_ENUM; } LIBLTE_MME_RF_POWER_CAPABILITY_ENUM;
static const char liblte_mme_rf_power_capability_text[LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS][20] = { static const char liblte_mme_rf_power_capability_text[LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS][20] = {"Class 1",
"Class 1", "Class 2", "Class 3", "Class 4", "Class 5"}; "Class 2",
"Class 3",
"Class 4",
"Class 5"};
typedef enum { typedef enum {
LIBLTE_MME_SS_SCREEN_INDICATOR_0 = 0, LIBLTE_MME_SS_SCREEN_INDICATOR_0 = 0,
LIBLTE_MME_SS_SCREEN_INDICATOR_1, LIBLTE_MME_SS_SCREEN_INDICATOR_1,
@ -213,8 +219,8 @@ typedef enum {
LIBLTE_MME_SS_SCREEN_INDICATOR_3, LIBLTE_MME_SS_SCREEN_INDICATOR_3,
LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS, LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS,
} LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM; } LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM;
static const char liblte_mme_ss_screen_indicator_text[LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS][100] = { static const char liblte_mme_ss_screen_indicator_text[LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS][100] =
"Default Phase 1", "Ellipsis Notation Phase 2", "RESERVED", "RESERVED"}; {"Default Phase 1", "Ellipsis Notation Phase 2", "RESERVED", "RESERVED"};
// Structs // Structs
typedef struct { typedef struct {
LIBLTE_MME_REVISION_LEVEL_ENUM rev_lev; LIBLTE_MME_REVISION_LEVEL_ENUM rev_lev;
@ -300,8 +306,8 @@ typedef enum {
LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA7, LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA7,
LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS, LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS,
} LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM; } LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM;
static const char liblte_mme_type_of_integrity_algorithm_text[LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS][20] = { static const char liblte_mme_type_of_integrity_algorithm_text[LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS][20] =
"EIA0", "128-EIA1", "128-EIA2", "EIA3", "EIA4", "EIA5", "EIA6", "EIA7"}; {"EIA0", "128-EIA1", "128-EIA2", "EIA3", "EIA4", "EIA5", "EIA6", "EIA7"};
typedef enum { typedef enum {
LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA0 = 0, LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA0 = 0,
LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_128_EEA1, LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_128_EEA1,
@ -313,8 +319,8 @@ typedef enum {
LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA7, LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA7,
LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS, LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS,
} LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM; } LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM;
static const char liblte_mme_type_of_ciphering_algorithm_text[LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS][20] = { static const char liblte_mme_type_of_ciphering_algorithm_text[LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS][20] =
"EEA0", "128-EEA1", "128-EEA2", "EEA3", "EEA4", "EEA5", "EEA6", "EEA7"}; {"EEA0", "128-EEA1", "128-EEA2", "EEA3", "EEA4", "EEA5", "EEA6", "EEA7"};
typedef enum { typedef enum {
LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE = 0, LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE = 0,
LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_MAPPED, LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_MAPPED,
@ -418,8 +424,8 @@ typedef enum {
LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_RESERVED, LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_RESERVED,
LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS, LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS,
} LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM; } LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM;
static const char liblte_mme_additional_update_result_text[LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS][100] = { static const char liblte_mme_additional_update_result_text[LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS][100] =
"No Additional Information", "CS Fallback Not Preferred", "SMS Only", "RESERVED"}; {"No Additional Information", "CS Fallback Not Preferred", "SMS Only", "RESERVED"};
// Structs // Structs
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_result_ie(LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM result, LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_result_ie(LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM result,
@ -446,7 +452,8 @@ typedef enum {
LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS, LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS,
} LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM; } LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM;
static const char liblte_mme_additional_update_type_text[LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS][20] = { static const char liblte_mme_additional_update_type_text[LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS][20] = {
"No additional info", "SMS Only"}; "No additional info",
"SMS Only"};
// Structs // Structs
// Functions // Functions
LIBLTE_ERROR_ENUM LIBLTE_ERROR_ENUM
@ -575,8 +582,10 @@ typedef enum {
LIBLTE_MME_DAYLIGHT_SAVING_TIME_RESERVED, LIBLTE_MME_DAYLIGHT_SAVING_TIME_RESERVED,
LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS, LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS,
} LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM; } LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM;
static const char liblte_mme_daylight_saving_time_text[LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS][20] = { static const char liblte_mme_daylight_saving_time_text[LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS][20] = {"No Adjustment",
"No Adjustment", "+1 Hour", "+2 Hours", "RESERVED"}; "+1 Hour",
"+2 Hours",
"RESERVED"};
// Structs // Structs
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_daylight_saving_time_ie(LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM dst, uint8** ie_ptr); LIBLTE_ERROR_ENUM liblte_mme_pack_daylight_saving_time_ie(LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM dst, uint8** ie_ptr);
@ -781,8 +790,10 @@ typedef enum {
LIBLTE_MME_CS_LCS_RESERVED, LIBLTE_MME_CS_LCS_RESERVED,
LIBLTE_MME_CS_LCS_N_ITEMS, LIBLTE_MME_CS_LCS_N_ITEMS,
} LIBLTE_MME_CS_LCS_ENUM; } LIBLTE_MME_CS_LCS_ENUM;
static const char liblte_mme_cs_lcs_text[LIBLTE_MME_CS_LCS_N_ITEMS][100] = { static const char liblte_mme_cs_lcs_text[LIBLTE_MME_CS_LCS_N_ITEMS][100] = {"No Information Available",
"No Information Available", "Not Supported", "Supported", "RESERVED"}; "Not Supported",
"Supported",
"RESERVED"};
// Structs // Structs
typedef struct { typedef struct {
LIBLTE_MME_CS_LCS_ENUM cs_lcs; LIBLTE_MME_CS_LCS_ENUM cs_lcs;
@ -834,8 +845,8 @@ typedef enum {
LIBLTE_MME_EPS_UPDATE_TYPE_PERIODIC_UPDATING, LIBLTE_MME_EPS_UPDATE_TYPE_PERIODIC_UPDATING,
LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS, LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS,
} LIBLTE_MME_EPS_UPDATE_TYPE_ENUM; } LIBLTE_MME_EPS_UPDATE_TYPE_ENUM;
static const char liblte_mme_eps_update_type_text[LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS][100] = { static const char liblte_mme_eps_update_type_text[LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS][100] =
"TA Updating", "Combined TA/LA Updating", "Combined TA/LA Updating With IMSI Attach", "Periodic Updating"}; {"TA Updating", "Combined TA/LA Updating", "Combined TA/LA Updating With IMSI Attach", "Periodic Updating"};
// Structs // Structs
typedef struct { typedef struct {
LIBLTE_MME_EPS_UPDATE_TYPE_ENUM type; LIBLTE_MME_EPS_UPDATE_TYPE_ENUM type;
@ -1013,8 +1024,8 @@ typedef enum {
LIBLTE_MME_SS_SCREENING_INDICATOR_RESERVED_2, LIBLTE_MME_SS_SCREENING_INDICATOR_RESERVED_2,
LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS, LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS,
} LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM; } LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM;
static const char liblte_mme_ss_screening_indicator_text[LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS][20] = { static const char liblte_mme_ss_screening_indicator_text[LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS][20] =
"Phase 1", "Phase 2", "Reserved 1", "Reserved 2"}; {"Phase 1", "Phase 2", "Reserved 1", "Reserved 2"};
// Structs // Structs
typedef struct { typedef struct {
LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM ss_screening; LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM ss_screening;
@ -1306,9 +1317,10 @@ typedef enum {
LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_DIFFERENT_PLMNS, LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_DIFFERENT_PLMNS,
LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS, LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS,
} LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM; } LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM;
static const char static const char liblte_mme_tracking_area_identity_list_type_text[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS]
liblte_mme_tracking_area_identity_list_type_text[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS][100] = { [100] = {"One PLMN, Non-Consecutive TACs",
"One PLMN, Non-Consecutive TACs", "One PLMN, Consecutive TACs", "Different PLMNs"}; "One PLMN, Consecutive TACs",
"Different PLMNs"};
// Structs // Structs
typedef struct { typedef struct {
LIBLTE_MME_TRACKING_AREA_ID_STRUCT tai[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_MAX_SIZE]; LIBLTE_MME_TRACKING_AREA_ID_STRUCT tai[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_MAX_SIZE];
@ -1569,8 +1581,10 @@ typedef enum {
LIBLTE_MME_VOICE_DOMAIN_PREF_PS_PREFFERED, LIBLTE_MME_VOICE_DOMAIN_PREF_PS_PREFFERED,
LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS, LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS,
} LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM; } LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM;
static const char liblte_mme_voice_domain_pref_text[LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS][20] = { static const char liblte_mme_voice_domain_pref_text[LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS][20] = {"CS Only",
"CS Only", "PS Only", "CS Preffered", "PS Preffered"}; "PS Only",
"CS Preffered",
"PS Preffered"};
// Structs // Structs
typedef struct { typedef struct {
LIBLTE_MME_UE_USAGE_SETTING_ENUM ue_usage_setting; LIBLTE_MME_UE_USAGE_SETTING_ENUM ue_usage_setting;
@ -1578,9 +1592,11 @@ typedef struct {
} LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT; } LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie( LIBLTE_ERROR_ENUM liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie(
LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting, uint8** ie_ptr); LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting,
uint8** ie_ptr);
LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie( LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie(
uint8** ie_ptr, LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting); uint8** ie_ptr,
LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting);
/********************************************************************* /*********************************************************************
IE Name: GUTI Type IE Name: GUTI Type
@ -1779,13 +1795,18 @@ typedef enum {
LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS, LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS,
} LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM; } LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM;
static const char liblte_mme_esm_info_transfer_flag_text[LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS][20] = { static const char liblte_mme_esm_info_transfer_flag_text[LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS][20] = {
"Not Required", "Required"}; "Not Required",
"Required"};
// Structs // Structs
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_esm_info_transfer_flag_ie( LIBLTE_ERROR_ENUM
LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag, uint8 bit_offset, uint8** ie_ptr); liblte_mme_pack_esm_info_transfer_flag_ie(LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag,
LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie( uint8 bit_offset,
uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM* esm_info_transfer_flag); uint8** ie_ptr);
LIBLTE_ERROR_ENUM
liblte_mme_unpack_esm_info_transfer_flag_ie(uint8** ie_ptr,
uint8 bit_offset,
LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM* esm_info_transfer_flag);
/********************************************************************* /*********************************************************************
IE Name: Linked EPS Bearer Identity IE Name: Linked EPS Bearer Identity
@ -2229,8 +2250,8 @@ typedef enum {
LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_BIDIRECTIONAL, LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_BIDIRECTIONAL,
LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS, LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS,
} LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM; } LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM;
static const char liblte_mme_tft_packet_filter_direction_text[LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS][100] = { static const char liblte_mme_tft_packet_filter_direction_text[LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS][100] =
"Pre Rel-7 TFT Filter", "Downlink Only", "Uplink Only", "Bidirectional"}; {"Pre Rel-7 TFT Filter", "Downlink Only", "Uplink Only", "Bidirectional"};
// Structs // Structs
typedef struct { typedef struct {
LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM dir; LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM dir;
@ -2900,7 +2921,8 @@ LIBLTE_ERROR_ENUM
uint32 count, uint32 count,
LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT* guti_realloc_complete); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT* guti_realloc_complete);
/********************************************************************* /*********************************************************************
Message Name: Identity Request Message Name: Identity Request
@ -3150,7 +3172,8 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_complete_msg(
uint32 count, uint32 count,
LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT* ta_update_complete); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT* ta_update_complete);
/********************************************************************* /*********************************************************************
Message Name: Tracking Area Update Reject Message Name: Tracking Area Update Reject
@ -3239,7 +3262,8 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_downlink_generic_nas_transport_msg(
uint32 count, uint32 count,
LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* dl_generic_nas_transport); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* dl_generic_nas_transport);
/********************************************************************* /*********************************************************************
Message Name: Uplink Generic NAS Transport Message Name: Uplink Generic NAS Transport
@ -3265,7 +3289,8 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_generic_nas_transport_msg(
uint32 count, uint32 count,
LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* ul_generic_nas_transport); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* ul_generic_nas_transport);
/********************************************************************* /*********************************************************************
Message Name: Activate Dedicated EPS Bearer Context Accept Message Name: Activate Dedicated EPS Bearer Context Accept
@ -3489,9 +3514,11 @@ typedef struct {
} LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT; } LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_reject_msg( LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_reject_msg(
LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej, LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej,
LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej);
/********************************************************************* /*********************************************************************
Message Name: Bearer Resource Allocation Request Message Name: Bearer Resource Allocation Request
@ -3518,9 +3545,11 @@ typedef struct {
} LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT; } LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_request_msg( LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_request_msg(
LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req, LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req,
LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req);
/********************************************************************* /*********************************************************************
Message Name: Bearer Resource Modification Reject Message Name: Bearer Resource Modification Reject
@ -3544,9 +3573,11 @@ typedef struct {
} LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT; } LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_reject_msg( LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_reject_msg(
LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej, LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej,
LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej);
/********************************************************************* /*********************************************************************
Message Name: Bearer Resource Modification Request Message Name: Bearer Resource Modification Request
@ -3577,9 +3608,11 @@ typedef struct {
} LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT; } LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_request_msg( LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_request_msg(
LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req, LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req,
LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_request_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_request_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req);
/********************************************************************* /*********************************************************************
Message Name: Deactivate EPS Bearer Context Accept Message Name: Deactivate EPS Bearer Context Accept
@ -3744,7 +3777,8 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_accept_msg(
uint32 count, uint32 count,
LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* mod_eps_bearer_context_accept); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* mod_eps_bearer_context_accept);
/********************************************************************* /*********************************************************************
Message Name: Modify EPS Bearer Context Reject Message Name: Modify EPS Bearer Context Reject
@ -3766,9 +3800,11 @@ typedef struct {
} LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT; } LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_reject_msg( LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_reject_msg(
LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej, LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej,
LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej);
/********************************************************************* /*********************************************************************
Message Name: Modify EPS Bearer Context Request Message Name: Modify EPS Bearer Context Request
@ -3805,9 +3841,11 @@ typedef struct {
} LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; } LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_request_msg( LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_request_msg(
LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req, LIBLTE_BYTE_MSG_STRUCT* msg); LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req,
LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg( LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg(
LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req); LIBLTE_BYTE_MSG_STRUCT* msg,
LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req);
/********************************************************************* /*********************************************************************
Message Name: Notification Message Name: Notification

@ -1921,9 +1921,11 @@ typedef struct {
} LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT; } LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcernc_totargetrnc_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcernc_totargetrnc_transparentcontainer(
LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcernc_totargetrnc_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcernc_totargetrnc_transparentcontainer(
uint8_t** ptr, LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE SubscriberProfileIDforRFP INTEGER /* ProtocolIE SubscriberProfileIDforRFP INTEGER
@ -1969,9 +1971,11 @@ typedef struct {
} LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT; } LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_tosourcernc_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_tosourcernc_transparentcontainer(
LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_tosourcernc_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_tosourcernc_transparentcontainer(
uint8_t** ptr, LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE Threshold_RSRQ INTEGER /* ProtocolIE Threshold_RSRQ INTEGER
@ -2774,9 +2778,11 @@ typedef struct {
} LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT; } LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcebss_totargetbss_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcebss_totargetbss_transparentcontainer(
LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcebss_totargetbss_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcebss_totargetbss_transparentcontainer(
uint8_t** ptr, LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE SRVCCOperationPossible ENUMERATED /* ProtocolIE SRVCCOperationPossible ENUMERATED
@ -2890,9 +2896,11 @@ typedef struct {
} LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT; } LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell_enhancedgranularity( LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell_enhancedgranularity(
LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell_enhancedgranularity( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell_enhancedgranularity(
uint8_t** ptr, LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE E_UTRAN_Trace_ID STATIC OCTET STRING /* ProtocolIE E_UTRAN_Trace_ID STATIC OCTET STRING
@ -3444,9 +3452,11 @@ typedef struct {
} LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT; } LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer(
LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer(
uint8_t** ptr, LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE M1ThresholdEventA2 SEQUENCE /* ProtocolIE M1ThresholdEventA2 SEQUENCE
@ -3927,9 +3937,11 @@ typedef struct {
} LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT; } LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetbss_tosourcebss_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetbss_tosourcebss_transparentcontainer(
LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetbss_tosourcebss_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetbss_tosourcebss_transparentcontainer(
uint8_t** ptr, LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE TAIListForRestart DYNAMIC SEQUENCE OF /* ProtocolIE TAIListForRestart DYNAMIC SEQUENCE OF
@ -5080,9 +5092,11 @@ typedef struct {
} LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT; } LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer(
LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer(
uint8_t** ptr, LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE EmergencyAreaID_Broadcast DYNAMIC SEQUENCE OF /* ProtocolIE EmergencyAreaID_Broadcast DYNAMIC SEQUENCE OF
@ -5172,7 +5186,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_enb_statustransfer_transparentcontainer(LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie, liblte_s1ap_pack_enb_statustransfer_transparentcontainer(LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer(
uint8_t** ptr, LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE TraceActivation SEQUENCE /* ProtocolIE TraceActivation SEQUENCE
@ -5589,9 +5604,11 @@ typedef struct {
} LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT; } LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistres( LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistres(
LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistres( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistres(
uint8_t** ptr, LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Container List UE_associatedLogicalS1_ConnectionListResAck DYNAMIC SEQUENCE OF /* Protocol Container List UE_associatedLogicalS1_ConnectionListResAck DYNAMIC SEQUENCE OF
@ -5604,9 +5621,11 @@ typedef struct {
} LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT; } LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistresack( LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistresack(
LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistresack( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistresack(
uint8_t** ptr, LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* ProtocolIE PrivateMessage SEQUENCE /* ProtocolIE PrivateMessage SEQUENCE
@ -5854,7 +5873,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_allocationandretentionpriority_ext(LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* ie, liblte_s1ap_pack_allocationandretentionpriority_ext(LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message CancelledCellinEAI_Item_Ext STRUCT /* Protocol Message CancelledCellinEAI_Item_Ext STRUCT
@ -6005,7 +6025,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext(LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* ie, liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext(LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message EmergencyAreaID_Broadcast_Item_Ext STRUCT /* Protocol Message EmergencyAreaID_Broadcast_Item_Ext STRUCT
@ -6018,7 +6039,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_emergencyareaid_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* ie, liblte_s1ap_pack_emergencyareaid_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message EmergencyAreaID_Cancelled_Item_Ext STRUCT /* Protocol Message EmergencyAreaID_Cancelled_Item_Ext STRUCT
@ -6031,7 +6053,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_emergencyareaid_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* ie, liblte_s1ap_pack_emergencyareaid_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message CompletedCellinEAI_Item_Ext STRUCT /* Protocol Message CompletedCellinEAI_Item_Ext STRUCT
@ -6074,9 +6097,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT; } LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer_ext( LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer_ext(
LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message E_RABInformationListItem_Ext STRUCT /* Protocol Message E_RABInformationListItem_Ext STRUCT
@ -6435,9 +6460,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT; } LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer_ext( LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer_ext(
LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message M1ThresholdEventA2_Ext STRUCT /* Protocol Message M1ThresholdEventA2_Ext STRUCT
@ -6497,9 +6524,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT; } LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemext( LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemext(
LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message UESecurityCapabilities_Ext STRUCT /* Protocol Message UESecurityCapabilities_Ext STRUCT
@ -6546,9 +6575,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT; } LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer_ext( LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer_ext(
LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message E_RABInformationList STRUCT /* Protocol Message E_RABInformationList STRUCT
@ -6575,9 +6606,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT; } LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation_ext( LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation_ext(
LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation_ext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation_ext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message SONInformationReply_Ext STRUCT /* Protocol Message SONInformationReply_Ext STRUCT
@ -6607,9 +6640,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT; } LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_itemext( LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_itemext(
LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_itemext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_itemext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message E_RABItem STRUCT /* Protocol Message E_RABItem STRUCT
@ -6659,9 +6694,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT; } LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item( LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item(
LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message ImmediateMDT_Ext STRUCT /* Protocol Message ImmediateMDT_Ext STRUCT
@ -6963,7 +7000,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_e_rabtobemodifyitembearermodreqext(LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* ie, liblte_s1ap_pack_e_rabtobemodifyitembearermodreqext(LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifyitembearermodreqext( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifyitembearermodreqext(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message E_RABModifyItemBearerModResExt STRUCT /* Protocol Message E_RABModifyItemBearerModResExt STRUCT
@ -7342,9 +7380,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT; } LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem( LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(
LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message UE_associatedLogicalS1_ConnectionItemRes STRUCT /* Protocol Message UE_associatedLogicalS1_ConnectionItemRes STRUCT
@ -7355,9 +7395,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT; } LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemres( LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemres(
LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemres( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemres(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message ErrorIndication STRUCT /* Protocol Message ErrorIndication STRUCT
@ -7689,7 +7731,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_locationreportingfailureindication(LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* ie, liblte_s1ap_pack_locationreportingfailureindication(LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingfailureindication( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingfailureindication(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message LocationReport STRUCT /* Protocol Message LocationReport STRUCT
@ -7930,9 +7973,11 @@ typedef struct {
} LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT; } LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT;
LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknonueassociatedlppatransport( LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknonueassociatedlppatransport(
LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie, uint8_t** ptr); LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie,
uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknonueassociatedlppatransport( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknonueassociatedlppatransport(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message UplinkNonUEAssociatedLPPaTransport STRUCT /* Protocol Message UplinkNonUEAssociatedLPPaTransport STRUCT
@ -7947,7 +7992,8 @@ LIBLTE_ERROR_ENUM
liblte_s1ap_pack_uplinknonueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie, liblte_s1ap_pack_uplinknonueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie,
uint8_t** ptr); uint8_t** ptr);
LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknonueassociatedlppatransport( LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknonueassociatedlppatransport(
uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie); uint8_t** ptr,
LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie);
/******************************************************************************* /*******************************************************************************
/* Protocol Message ENBDirectInformationTransfer STRUCT /* Protocol Message ENBDirectInformationTransfer STRUCT

@ -26,28 +26,28 @@
* operations in both push and pop * operations in both push and pop
*****************************************************************************/ *****************************************************************************/
#ifndef SRSLTE_BLOCK_QUEUE_H #ifndef SRSLTE_BLOCK_QUEUE_H
#define SRSLTE_BLOCK_QUEUE_H #define SRSLTE_BLOCK_QUEUE_H
#include <queue>
#include <memory> #include <memory>
#include <utility>
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <queue>
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <stdio.h>
#include <strings.h> #include <strings.h>
#include <unistd.h>
#include <utility>
namespace srslte { namespace srslte {
template <typename myobj> template <typename myobj>
class block_queue { class block_queue
{
public: public:
// Callback functions for mutexed operations inside pop/push methods // Callback functions for mutexed operations inside pop/push methods
class call_mutexed_itf { class call_mutexed_itf
{
public: public:
virtual void popping(const myobj& obj) = 0; virtual void popping(const myobj& obj) = 0;
virtual void pushing(const myobj& obj) = 0; virtual void pushing(const myobj& obj) = 0;
@ -63,7 +63,8 @@ public:
enable = true; enable = true;
num_threads = 0; num_threads = 0;
} }
~block_queue() { ~block_queue()
{
// Unlock threads waiting at push or pop // Unlock threads waiting at push or pop
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
enable = false; enable = false;
@ -83,56 +84,48 @@ public:
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
pthread_mutex_destroy(&mutex); pthread_mutex_destroy(&mutex);
} }
void set_mutexed_itf(call_mutexed_itf *itf) { void set_mutexed_itf(call_mutexed_itf* itf) { mutexed_callback = itf; }
mutexed_callback = itf; void resize(int new_capacity) { capacity = new_capacity; }
}
void resize(int new_capacity) {
capacity = new_capacity;
}
void push(const myobj& value) { void push(const myobj& value) { push_(value, true); }
push_(value, true);
}
void push(myobj&& value) { push_(std::move(value), true); } void push(myobj&& value) { push_(std::move(value), true); }
bool try_push(const myobj& value) { bool try_push(const myobj& value) { return push_(value, false); }
return push_(value, false);
}
std::pair<bool, myobj> try_push(myobj&& value) { return push_(std::move(value), false); } std::pair<bool, myobj> try_push(myobj&& value) { return push_(std::move(value), false); }
bool try_pop(myobj *value) { bool try_pop(myobj* value) { return pop_(value, false); }
return pop_(value, false);
}
myobj wait_pop() { // blocking pop myobj wait_pop()
{ // blocking pop
myobj value = myobj(); myobj value = myobj();
pop_(&value, true); pop_(&value, true);
return value; return value;
} }
bool empty() { // queue is empty? bool empty()
{ // queue is empty?
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
bool ret = q.empty(); bool ret = q.empty();
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
return ret; return ret;
} }
void clear() { // remove all items void clear()
{ // remove all items
myobj* item = NULL; myobj* item = NULL;
while (try_pop(item)); while (try_pop(item))
;
} }
const myobj& front() const { return q.front(); } const myobj& front() const { return q.front(); }
size_t size() { size_t size() { return q.size(); }
return q.size();
}
private: private:
bool pop_(myobj* value, bool block)
bool pop_(myobj *value, bool block) { {
if (!enable) { if (!enable) {
return false; return false;
} }
@ -231,6 +224,6 @@ private:
uint32_t num_threads; uint32_t num_threads;
}; };
} } // namespace srslte
#endif // SRSLTE_BLOCK_QUEUE_H #endif // SRSLTE_BLOCK_QUEUE_H

@ -22,19 +22,19 @@
#ifndef SRSLTE_BUFFER_POOL_H #ifndef SRSLTE_BUFFER_POOL_H
#define SRSLTE_BUFFER_POOL_H #define SRSLTE_BUFFER_POOL_H
#include <algorithm>
#include <map>
#include <pthread.h> #include <pthread.h>
#include <vector>
#include <stack> #include <stack>
#include <map>
#include <string> #include <string>
#include <algorithm> #include <vector>
/******************************************************************************* /*******************************************************************************
INCLUDES INCLUDES
*******************************************************************************/ *******************************************************************************/
#include "srslte/common/log.h"
#include "srslte/common/common.h" #include "srslte/common/common.h"
#include "srslte/common/log.h"
namespace srslte { namespace srslte {
@ -48,9 +48,9 @@ namespace srslte {
*****************************************************************************/ *****************************************************************************/
template <class buffer_t> template <class buffer_t>
class buffer_pool{ class buffer_pool
{
public: public:
// non-static methods // non-static methods
buffer_pool(int capacity_ = -1) buffer_pool(int capacity_ = -1)
{ {
@ -67,7 +67,8 @@ public:
capacity = nof_buffers; capacity = nof_buffers;
} }
~buffer_pool() { ~buffer_pool()
{
// this destructor assumes all buffers have been properly deallocated // this destructor assumes all buffers have been properly deallocated
while (available.size()) { while (available.size()) {
delete available.top(); delete available.top();
@ -96,15 +97,12 @@ public:
#endif #endif
} }
uint32_t nof_available_pdus() { uint32_t nof_available_pdus() { return available.size(); }
return available.size();
}
bool is_almost_empty() { bool is_almost_empty() { return available.size() < capacity / 20; }
return available.size() < capacity/20;
}
buffer_t* allocate(const char *debug_name = NULL, bool blocking = false) { buffer_t* allocate(const char* debug_name = NULL, bool blocking = false)
{
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
buffer_t* b = NULL; buffer_t* b = NULL;
@ -134,8 +132,7 @@ public:
available.pop(); available.pop();
// do not print any warning // do not print any warning
} } else {
else {
printf("Error - buffer pool is empty\n"); printf("Error - buffer pool is empty\n");
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED #ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
@ -162,7 +159,6 @@ public:
return ret; return ret;
} }
private: private:
static const int POOL_SIZE = 4096; static const int POOL_SIZE = 4096;
std::stack<buffer_t*> available; std::stack<buffer_t*> available;
@ -172,29 +168,28 @@ private:
uint32_t capacity; uint32_t capacity;
}; };
class byte_buffer_pool
class byte_buffer_pool { {
public: public:
// Singleton static methods // Singleton static methods
static byte_buffer_pool* instance; static byte_buffer_pool* instance;
static byte_buffer_pool* get_instance(int capacity = -1); static byte_buffer_pool* get_instance(int capacity = -1);
static void cleanup(void); static void cleanup(void);
byte_buffer_pool(int capacity = -1) { byte_buffer_pool(int capacity = -1)
{
log = NULL; log = NULL;
pool = new buffer_pool<byte_buffer_t>(capacity); pool = new buffer_pool<byte_buffer_t>(capacity);
} }
byte_buffer_pool(const byte_buffer_pool& other) = delete; byte_buffer_pool(const byte_buffer_pool& other) = delete;
byte_buffer_pool& operator=(const byte_buffer_pool& other) = delete; byte_buffer_pool& operator=(const byte_buffer_pool& other) = delete;
~byte_buffer_pool() { ~byte_buffer_pool() { delete pool; }
delete pool; byte_buffer_t* allocate(const char* debug_name = NULL, bool blocking = false)
} {
byte_buffer_t* allocate(const char *debug_name = NULL, bool blocking = false) {
return pool->allocate(debug_name, blocking); return pool->allocate(debug_name, blocking);
} }
void set_log(srslte::log *log) { void set_log(srslte::log* log) { this->log = log; }
this->log = log; void deallocate(byte_buffer_t* b)
} {
void deallocate(byte_buffer_t *b) {
if (!b) { if (!b) {
return; return;
} }
@ -216,9 +211,8 @@ public:
} }
b = NULL; b = NULL;
} }
void print_all_buffers() { void print_all_buffers() { pool->print_all_buffers(); }
pool->print_all_buffers();
}
private: private:
srslte::log* log; srslte::log* log;
buffer_pool<byte_buffer_t>* pool; buffer_pool<byte_buffer_t>* pool;

@ -22,9 +22,9 @@
#ifndef SRSLTE_CONFIG_FILE_H #ifndef SRSLTE_CONFIG_FILE_H
#define SRSLTE_CONFIG_FILE_H #define SRSLTE_CONFIG_FILE_H
#include "common.h"
#include <fstream> #include <fstream>
#include <pwd.h> #include <pwd.h>
#include "common.h"
bool config_exists(std::string& filename, std::string default_name) bool config_exists(std::string& filename, std::string default_name)
{ {

@ -30,8 +30,8 @@
#ifndef SRSLTE_CRASH_HANDLER_H #ifndef SRSLTE_CRASH_HANDLER_H
#define SRSLTE_CRASH_HANDLER_H #define SRSLTE_CRASH_HANDLER_H
#include <stdio.h>
#include "srslte/config.h" #include "srslte/config.h"
#include <stdio.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

@ -26,15 +26,13 @@
* Common mch table generation - used in phch_common of UE and ENB for MBMS * Common mch table generation - used in phch_common of UE and ENB for MBMS
*****************************************************************************/ *****************************************************************************/
#include <pthread.h> #include <pthread.h>
#include <string.h>
#include <stdint.h> #include <stdint.h>
#include <string.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif // __cplusplus #endif // __cplusplus
void generate_frame_mch_table(uint8_t* table, uint8_t alloc); void generate_frame_mch_table(uint8_t* table, uint8_t alloc);
void generate_mch_table(uint8_t* table, uint32_t sf_alloc, uint8_t num_frames); void generate_mch_table(uint8_t* table, uint32_t sf_alloc, uint8_t num_frames);
void generate_mcch_table(uint8_t* table, uint32_t sf_alloc); void generate_mcch_table(uint8_t* table, uint32_t sf_alloc);
@ -43,5 +41,4 @@ void generate_mcch_table(uint8_t *table, uint32_t sf_alloc);
} }
#endif // __cplusplus #endif // __cplusplus
#endif // SECURITY_H #endif // SECURITY_H

@ -107,7 +107,9 @@ typedef enum {
LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS, LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS,
} LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM; } LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM;
static const char liblte_security_ciphering_algorithm_id_text[LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS][20] = { static const char liblte_security_ciphering_algorithm_id_text[LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS][20] = {
"EEA0", "128-EEA1", "128-EEA2"}; "EEA0",
"128-EEA1",
"128-EEA2"};
typedef enum { typedef enum {
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0 = 0, LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0 = 0,
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA1, LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA1,
@ -116,7 +118,9 @@ typedef enum {
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS, LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS,
} LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM; } LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM;
static const char liblte_security_integrity_algorithm_id_text[LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = { static const char liblte_security_integrity_algorithm_id_text[LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = {
"EIA0", "128-EIA1", "128-EIA2"}; "EIA0",
"128-EIA1",
"128-EIA2"};
// Structs // Structs
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8* k_asme, LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8* k_asme,
@ -175,12 +179,26 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8*
// Enums // Enums
// Structs // Structs
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_security_128_eia2( LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8* key,
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* mac); uint32 count,
LIBLTE_ERROR_ENUM liblte_security_128_eia2( uint8 bearer,
uint8* key, uint32 count, uint8 bearer, uint8 direction, LIBLTE_BIT_MSG_STRUCT* msg, uint8* mac); uint8 direction,
LIBLTE_ERROR_ENUM liblte_security_128_eia3( uint8* msg,
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* mac); uint32 msg_len,
uint8* mac);
LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8* key,
uint32 count,
uint8 bearer,
uint8 direction,
LIBLTE_BIT_MSG_STRUCT* msg,
uint8* mac);
LIBLTE_ERROR_ENUM liblte_security_128_eia3(uint8* key,
uint32 count,
uint8 bearer,
uint8 direction,
uint8* msg,
uint32 msg_len,
uint8* mac);
/********************************************************************* /*********************************************************************
Name: liblte_security_encryption_eea1 Name: liblte_security_encryption_eea1
@ -192,8 +210,13 @@ LIBLTE_ERROR_ENUM liblte_security_128_eia3(
Specification of the 3GPP Confidentiality and Specification of the 3GPP Confidentiality and
Integrity Algorithms UEA2 & UIA2 D1 v2.1 Integrity Algorithms UEA2 & UIA2 D1 v2.1
*********************************************************************/ *********************************************************************/
LIBLTE_ERROR_ENUM liblte_security_encryption_eea1( LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(uint8* key,
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out); uint32 count,
uint8 bearer,
uint8 direction,
uint8* msg,
uint32 msg_len,
uint8* out);
/********************************************************************* /*********************************************************************
Name: liblte_security_decryption_eea1 Name: liblte_security_decryption_eea1
@ -205,8 +228,13 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(
Specification of the 3GPP Confidentiality and Specification of the 3GPP Confidentiality and
Integrity Algorithms UEA2 & UIA2 D1 v2.1 Integrity Algorithms UEA2 & UIA2 D1 v2.1
*********************************************************************/ *********************************************************************/
LIBLTE_ERROR_ENUM liblte_security_decryption_eea1( LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(uint8* key,
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out); uint32 count,
uint8 bearer,
uint8 direction,
uint8* ct,
uint32 ct_len,
uint8* out);
/********************************************************************* /*********************************************************************
Name: liblte_security_encryption_eea2 Name: liblte_security_encryption_eea2
@ -215,8 +243,13 @@ LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(
Document Reference: 33.401 v13.1.0 Annex B.1.3 Document Reference: 33.401 v13.1.0 Annex B.1.3
*********************************************************************/ *********************************************************************/
LIBLTE_ERROR_ENUM liblte_security_encryption_eea2( LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(uint8* key,
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out); uint32 count,
uint8 bearer,
uint8 direction,
uint8* msg,
uint32 msg_len,
uint8* out);
/********************************************************************* /*********************************************************************
Name: liblte_security_decryption_eea2 Name: liblte_security_decryption_eea2
@ -225,14 +258,29 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(
Document Reference: 33.401 v13.1.0 Annex B.1.3 Document Reference: 33.401 v13.1.0 Annex B.1.3
*********************************************************************/ *********************************************************************/
LIBLTE_ERROR_ENUM liblte_security_decryption_eea2( LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(uint8* key,
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out); uint32 count,
uint8 bearer,
LIBLTE_ERROR_ENUM liblte_security_encryption_eea3( uint8 direction,
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out); uint8* ct,
uint32 ct_len,
LIBLTE_ERROR_ENUM liblte_security_decryption_eea3( uint8* out);
uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out);
LIBLTE_ERROR_ENUM liblte_security_encryption_eea3(uint8* key,
uint32 count,
uint8 bearer,
uint8 direction,
uint8* msg,
uint32 msg_len,
uint8* out);
LIBLTE_ERROR_ENUM liblte_security_decryption_eea3(uint8* key,
uint32 count,
uint8 bearer,
uint8 direction,
uint8* msg,
uint32 msg_len,
uint8* out);
/********************************************************************* /*********************************************************************
Name: liblte_security_milenage_f1 Name: liblte_security_milenage_f1

@ -33,10 +33,10 @@
#include <stdarg.h> #include <stdarg.h>
#include <string> #include <string>
#include "srslte/phy/common/timestamp.h"
#include "srslte/common/log.h" #include "srslte/common/log.h"
#include "srslte/common/logger.h" #include "srslte/common/logger.h"
#include "srslte/common/logger_stdout.h" #include "srslte/common/logger_stdout.h"
#include "srslte/phy/common/timestamp.h"
namespace srslte { namespace srslte {
@ -45,7 +45,6 @@ typedef std::string* str_ptr;
class log_filter : public srslte::log class log_filter : public srslte::log
{ {
public: public:
log_filter(); log_filter();
log_filter(std::string layer); log_filter(std::string layer);
log_filter(std::string layer, logger* logger_, bool tti = false); log_filter(std::string layer, logger* logger_, bool tti = false);
@ -68,15 +67,13 @@ public:
srslte::LOG_LEVEL_ENUM get_level(std::string l); srslte::LOG_LEVEL_ENUM get_level(std::string l);
class time_itf { class time_itf
{
public: public:
virtual srslte_timestamp_t get_time() = 0; virtual srslte_timestamp_t get_time() = 0;
}; };
typedef enum { typedef enum { TIME, EPOCH } time_format_t;
TIME,
EPOCH
} time_format_t;
void set_time_src(time_itf* source, time_format_t format); void set_time_src(time_itf* source, time_format_t format);

@ -30,11 +30,11 @@
#ifndef SRSLTE_LOGGER_FILE_H #ifndef SRSLTE_LOGGER_FILE_H
#define SRSLTE_LOGGER_FILE_H #define SRSLTE_LOGGER_FILE_H
#include <stdio.h>
#include <deque>
#include <string>
#include "srslte/common/logger.h" #include "srslte/common/logger.h"
#include "srslte/common/threads.h" #include "srslte/common/threads.h"
#include <deque>
#include <stdio.h>
#include <string>
namespace srslte { namespace srslte {

@ -27,9 +27,9 @@
#ifndef SRSLTE_LOGGER_STDOUT_H #ifndef SRSLTE_LOGGER_STDOUT_H
#define SRSLTE_LOGGER_STDOUT_H #define SRSLTE_LOGGER_STDOUT_H
#include "srslte/common/logger.h"
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include "srslte/common/logger.h"
namespace srslte { namespace srslte {

@ -22,8 +22,8 @@
#ifndef SRSLTE_MAC_PCAP_H #ifndef SRSLTE_MAC_PCAP_H
#define SRSLTE_MAC_PCAP_H #define SRSLTE_MAC_PCAP_H
#include <stdint.h>
#include "srslte/common/pcap.h" #include "srslte/common/pcap.h"
#include <stdint.h>
namespace srslte { namespace srslte {
@ -54,8 +54,14 @@ private:
bool enable_write; bool enable_write;
FILE* pcap_file; FILE* pcap_file;
uint32_t ue_id; uint32_t ue_id;
void pack_and_write(uint8_t* pdu, uint32_t pdu_len_bytes, uint32_t reTX, bool crc_ok, uint32_t tti, void pack_and_write(uint8_t* pdu,
uint16_t crnti_, uint8_t direction, uint8_t rnti_type); uint32_t pdu_len_bytes,
uint32_t reTX,
bool crc_ok,
uint32_t tti,
uint16_t crnti_,
uint8_t direction,
uint8_t rnti_type);
}; };
} // namespace srslte } // namespace srslte

@ -62,7 +62,8 @@ public:
start_periodic(report_period_secs_ * 1e6, -2); start_periodic(report_period_secs_ * 1e6, -2);
return true; return true;
} }
void stop() { void stop()
{
stop_thread(); stop_thread();
// stop all listeners // stop all listeners
for (uint32_t i = 0; i < listeners.size(); i++) { for (uint32_t i = 0; i < listeners.size(); i++) {
@ -72,9 +73,7 @@ public:
wait_thread_finish(); wait_thread_finish();
} }
void add_listener(metrics_listener<metrics_t> *listener) { void add_listener(metrics_listener<metrics_t>* listener) { listeners.push_back(listener); }
listeners.push_back(listener);
}
private: private:
void run_period() void run_period()

@ -29,11 +29,17 @@ namespace srslte {
class nas_pcap class nas_pcap
{ {
public: public:
nas_pcap() {enable_write=false; ue_id=0; pcap_file = NULL; } nas_pcap()
{
enable_write = false;
ue_id = 0;
pcap_file = NULL;
}
void enable(); void enable();
void open(const char* filename, uint32_t ue_id = 0); void open(const char* filename, uint32_t ue_id = 0);
void close(); void close();
void write_nas(uint8_t* pdu, uint32_t pdu_len_bytes); void write_nas(uint8_t* pdu, uint32_t pdu_len_bytes);
private: private:
bool enable_write; bool enable_write;
FILE* pcap_file; FILE* pcap_file;

@ -22,9 +22,9 @@
#ifndef SRSLTE_PCAP_H #ifndef SRSLTE_PCAP_H
#define SRSLTE_PCAP_H #define SRSLTE_PCAP_H
#include <arpa/inet.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <arpa/inet.h>
#include <sys/time.h> #include <sys/time.h>
#define MAC_LTE_DLT 147 #define MAC_LTE_DLT 147
@ -51,7 +51,6 @@ typedef struct pcaprec_hdr_s {
unsigned int orig_len; /* actual length of packet */ unsigned int orig_len; /* actual length of packet */
} pcaprec_hdr_t; } pcaprec_hdr_t;
/* radioType */ /* radioType */
#define FDD_RADIO 1 #define FDD_RADIO 1
#define TDD_RADIO 2 #define TDD_RADIO 2
@ -79,8 +78,6 @@ typedef struct pcaprec_hdr_s {
#define MAC_LTE_CRC_STATUS_TAG 0x07 #define MAC_LTE_CRC_STATUS_TAG 0x07
#define MAC_LTE_NB_MODE_TAG 0x0F #define MAC_LTE_NB_MODE_TAG 0x0F
/* Context information for every MAC PDU that will be logged */ /* Context information for every MAC PDU that will be logged */
typedef struct MAC_Context_Info_t { typedef struct MAC_Context_Info_t {
unsigned short radioType; unsigned short radioType;
@ -149,10 +146,7 @@ typedef struct {
#define AM_SN_LENGTH_16_BITS 16 #define AM_SN_LENGTH_16_BITS 16
/* Narrow band mode */ /* Narrow band mode */
typedef enum { typedef enum { rlc_no_nb_mode = 0, rlc_nb_mode = 1 } rlc_lte_nb_mode;
rlc_no_nb_mode = 0,
rlc_nb_mode = 1
} rlc_lte_nb_mode;
/* Context information for every RLC PDU that will be logged */ /* Context information for every RLC PDU that will be logged */
typedef struct { typedef struct {
@ -168,7 +162,6 @@ typedef struct {
rlc_lte_nb_mode nbMode; rlc_lte_nb_mode nbMode;
} RLC_Context_Info_t; } RLC_Context_Info_t;
// See Wireshark's packet-rlc-lte.h for details // See Wireshark's packet-rlc-lte.h for details
#define RLC_LTE_START_STRING "rlc-lte" #define RLC_LTE_START_STRING "rlc-lte"
#define RLC_LTE_SN_LENGTH_TAG 0x02 #define RLC_LTE_SN_LENGTH_TAG 0x02
@ -181,7 +174,6 @@ typedef struct {
#define RLC_LTE_NB_MODE_TAG 0x09 #define RLC_LTE_NB_MODE_TAG 0x09
#define RLC_LTE_PAYLOAD_TAG 0x01 #define RLC_LTE_PAYLOAD_TAG 0x01
/* Context information for every S1AP PDU that will be logged */ /* Context information for every S1AP PDU that will be logged */
typedef struct S1AP_Context_Info_s { typedef struct S1AP_Context_Info_s {
// No Context yet // No Context yet
@ -194,10 +186,10 @@ typedef struct S1AP_Context_Info_s {
/* Open the file and write file header */ /* Open the file and write file header */
inline FILE* LTE_PCAP_Open(uint32_t DLT, const char* fileName) inline FILE* LTE_PCAP_Open(uint32_t DLT, const char* fileName)
{ {
pcap_hdr_t file_header = pcap_hdr_t file_header = {
{
0xa1b2c3d4, /* magic number */ 0xa1b2c3d4, /* magic number */
2, 4, /* version number is 2.4 */ 2,
4, /* version number is 2.4 */
0, /* timezone */ 0, /* timezone */
0, /* sigfigs - apparently all tools do this */ 0, /* sigfigs - apparently all tools do this */
65535, /* snaplen - this should be long enough */ 65535, /* snaplen - this should be long enough */
@ -223,14 +215,12 @@ inline void LTE_PCAP_Close(FILE *fd)
fclose(fd); fclose(fd);
} }
/************************************************************************** /**************************************************************************
* API functions for writing MAC-LTE PCAP files * * API functions for writing MAC-LTE PCAP files *
**************************************************************************/ **************************************************************************/
/* Write an individual PDU (PCAP packet header + mac-context + mac-pdu) */ /* Write an individual PDU (PCAP packet header + mac-context + mac-pdu) */
inline int LTE_PCAP_MAC_WritePDU(FILE *fd, MAC_Context_Info_t *context, inline int LTE_PCAP_MAC_WritePDU(FILE* fd, MAC_Context_Info_t* context, const unsigned char* PDU, unsigned int length)
const unsigned char *PDU, unsigned int length)
{ {
pcaprec_hdr_t packet_header; pcaprec_hdr_t packet_header;
char context_header[256]; char context_header[256];
@ -280,7 +270,6 @@ inline int LTE_PCAP_MAC_WritePDU(FILE *fd, MAC_Context_Info_t *context,
/* Data tag immediately preceding PDU */ /* Data tag immediately preceding PDU */
context_header[offset++] = MAC_LTE_PAYLOAD_TAG; context_header[offset++] = MAC_LTE_PAYLOAD_TAG;
/****************************************************************/ /****************************************************************/
/* PCAP Header */ /* PCAP Header */
struct timeval t; struct timeval t;
@ -299,15 +288,12 @@ inline int LTE_PCAP_MAC_WritePDU(FILE *fd, MAC_Context_Info_t *context,
return 1; return 1;
} }
/************************************************************************** /**************************************************************************
* API functions for writing NAS-EPS PCAP files * * API functions for writing NAS-EPS PCAP files *
**************************************************************************/ **************************************************************************/
/* Write an individual PDU (PCAP packet header + nas-context + nas-pdu) */ /* Write an individual PDU (PCAP packet header + nas-context + nas-pdu) */
inline int LTE_PCAP_NAS_WritePDU(FILE *fd, NAS_Context_Info_t *context, inline int LTE_PCAP_NAS_WritePDU(FILE* fd, NAS_Context_Info_t* context, const unsigned char* PDU, unsigned int length)
const unsigned char *PDU, unsigned int length)
{ {
pcaprec_hdr_t packet_header; pcaprec_hdr_t packet_header;
@ -334,14 +320,12 @@ inline int LTE_PCAP_NAS_WritePDU(FILE *fd, NAS_Context_Info_t *context,
return 1; return 1;
} }
/************************************************************************** /**************************************************************************
* API functions for writing RLC-LTE PCAP files * * API functions for writing RLC-LTE PCAP files *
**************************************************************************/ **************************************************************************/
/* Write an individual RLC PDU (PCAP packet header + UDP header + rlc-context + rlc-pdu) */ /* Write an individual RLC PDU (PCAP packet header + UDP header + rlc-context + rlc-pdu) */
inline int LTE_PCAP_RLC_WritePDU(FILE *fd, RLC_Context_Info_t *context, inline int LTE_PCAP_RLC_WritePDU(FILE* fd, RLC_Context_Info_t* context, const unsigned char* PDU, unsigned int length)
const unsigned char *PDU, unsigned int length)
{ {
pcaprec_hdr_t packet_header; pcaprec_hdr_t packet_header;
char context_header[256]; char context_header[256];
@ -428,8 +412,7 @@ inline int LTE_PCAP_RLC_WritePDU(FILE *fd, RLC_Context_Info_t *context,
**************************************************************************/ **************************************************************************/
/* Write an individual PDU (PCAP packet header + s1ap-context + s1ap-pdu) */ /* Write an individual PDU (PCAP packet header + s1ap-context + s1ap-pdu) */
inline int LTE_PCAP_S1AP_WritePDU(FILE *fd, S1AP_Context_Info_t *context, inline int LTE_PCAP_S1AP_WritePDU(FILE* fd, S1AP_Context_Info_t* context, const unsigned char* PDU, unsigned int length)
const unsigned char *PDU, unsigned int length)
{ {
pcaprec_hdr_t packet_header; pcaprec_hdr_t packet_header;

@ -120,10 +120,7 @@ public:
uint8_t* get_current_sdu_ptr() { return &buffer_tx->msg[buffer_tx->N_bytes]; } uint8_t* get_current_sdu_ptr() { return &buffer_tx->msg[buffer_tx->N_bytes]; }
void add_sdu(uint32_t sdu_sz) void add_sdu(uint32_t sdu_sz) { buffer_tx->N_bytes += sdu_sz; }
{
buffer_tx->N_bytes += sdu_sz;
}
// Section 6.1.2 // Section 6.1.2
void parse_packet(uint8_t* ptr) void parse_packet(uint8_t* ptr)

@ -22,25 +22,20 @@
#ifndef SRSLTE_PDU_QUEUE_H #ifndef SRSLTE_PDU_QUEUE_H
#define SRSLTE_PDU_QUEUE_H #define SRSLTE_PDU_QUEUE_H
#include "srslte/common/log.h"
#include "srslte/common/block_queue.h" #include "srslte/common/block_queue.h"
#include "srslte/common/buffer_pool.h" #include "srslte/common/buffer_pool.h"
#include "srslte/common/timers.h" #include "srslte/common/log.h"
#include "srslte/common/pdu.h" #include "srslte/common/pdu.h"
#include "srslte/common/timers.h"
/* Logical Channel Demultiplexing and MAC CE dissassemble */ /* Logical Channel Demultiplexing and MAC CE dissassemble */
namespace srslte { namespace srslte {
class pdu_queue class pdu_queue
{ {
public: public:
typedef enum { typedef enum { DCH, BCH, MCH } channel_t;
DCH,
BCH,
MCH
} channel_t;
class process_callback class process_callback
{ {
public: public:
@ -80,6 +75,3 @@ private:
} // namespace srslte } // namespace srslte
#endif // SRSLTE_PDU_QUEUE_H #endif // SRSLTE_PDU_QUEUE_H

@ -22,15 +22,20 @@
#ifndef RLCPCAP_H #ifndef RLCPCAP_H
#define RLCPCAP_H #define RLCPCAP_H
#include <stdint.h>
#include "srslte/common/pcap.h" #include "srslte/common/pcap.h"
#include <stdint.h>
namespace srslte { namespace srslte {
class rlc_pcap class rlc_pcap
{ {
public: public:
rlc_pcap() {enable_write=false; ue_id=0; pcap_file = NULL; }; rlc_pcap()
{
enable_write = false;
ue_id = 0;
pcap_file = NULL;
};
void enable(bool en); void enable(bool en);
void open(const char* filename, uint32_t ue_id = 0); void open(const char* filename, uint32_t ue_id = 0);
void close(); void close();

@ -29,11 +29,16 @@ namespace srslte {
class s1ap_pcap class s1ap_pcap
{ {
public: public:
s1ap_pcap() {enable_write=false; pcap_file = NULL; } s1ap_pcap()
{
enable_write = false;
pcap_file = NULL;
}
void enable(); void enable();
void open(const char* filename); void open(const char* filename);
void close(); void close();
void write_s1ap(uint8_t* pdu, uint32_t pdu_len_bytes); void write_s1ap(uint8_t* pdu, uint32_t pdu_len_bytes);
private: private:
bool enable_write; bool enable_write;
FILE* pcap_file; FILE* pcap_file;

@ -26,7 +26,6 @@
* Common security header - wraps ciphering/integrity check algorithms. * Common security header - wraps ciphering/integrity check algorithms.
*****************************************************************************/ *****************************************************************************/
#include "srslte/common/common.h" #include "srslte/common/common.h"
namespace srslte { namespace srslte {
@ -38,8 +37,10 @@ typedef enum {
CIPHERING_ALGORITHM_ID_128_EEA3, CIPHERING_ALGORITHM_ID_128_EEA3,
CIPHERING_ALGORITHM_ID_N_ITEMS, CIPHERING_ALGORITHM_ID_N_ITEMS,
} CIPHERING_ALGORITHM_ID_ENUM; } CIPHERING_ALGORITHM_ID_ENUM;
static const char ciphering_algorithm_id_text[CIPHERING_ALGORITHM_ID_N_ITEMS][20] = { static const char ciphering_algorithm_id_text[CIPHERING_ALGORITHM_ID_N_ITEMS][20] = {"EEA0",
"EEA0", "128-EEA1", "128-EEA2", "128-EEA3"}; "128-EEA1",
"128-EEA2",
"128-EEA3"};
typedef enum { typedef enum {
INTEGRITY_ALGORITHM_ID_EIA0 = 0, INTEGRITY_ALGORITHM_ID_EIA0 = 0,
@ -48,8 +49,10 @@ typedef enum {
INTEGRITY_ALGORITHM_ID_128_EIA3, INTEGRITY_ALGORITHM_ID_128_EIA3,
INTEGRITY_ALGORITHM_ID_N_ITEMS, INTEGRITY_ALGORITHM_ID_N_ITEMS,
} INTEGRITY_ALGORITHM_ID_ENUM; } INTEGRITY_ALGORITHM_ID_ENUM;
static const char integrity_algorithm_id_text[INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = { static const char integrity_algorithm_id_text[INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = {"EIA0",
"EIA0", "128-EIA1", "128-EIA2", "128-EIA3"}; "128-EIA1",
"128-EIA2",
"128-EIA3"};
typedef enum { typedef enum {
SECURITY_DIRECTION_UPLINK = 0, SECURITY_DIRECTION_UPLINK = 0,
@ -69,18 +72,11 @@ uint8_t security_generate_k_asme( uint8_t *ck,
uint16_t mnc, uint16_t mnc,
uint8_t* k_asme); uint8_t* k_asme);
uint8_t security_generate_k_enb( uint8_t *k_asme, uint8_t security_generate_k_enb(uint8_t* k_asme, uint32_t nas_count, uint8_t* k_enb);
uint32_t nas_count,
uint8_t *k_enb);
uint8_t security_generate_k_enb_star( uint8_t *k_enb, uint8_t security_generate_k_enb_star(uint8_t* k_enb, uint32_t pci, uint32_t earfcn, uint8_t* k_enb_star);
uint32_t pci,
uint32_t earfcn,
uint8_t *k_enb_star);
uint8_t security_generate_nh( uint8_t *k_asme, uint8_t security_generate_nh(uint8_t* k_asme, uint8_t* sync, uint8_t* nh);
uint8_t *sync,
uint8_t *nh);
uint8_t security_generate_k_nas(uint8_t* k_asme, uint8_t security_generate_k_nas(uint8_t* k_asme,
CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, CIPHERING_ALGORITHM_ID_ENUM enc_alg_id,
@ -103,28 +99,58 @@ uint8_t security_generate_k_up( uint8_t *k_enb,
/****************************************************************************** /******************************************************************************
* Integrity Protection * Integrity Protection
*****************************************************************************/ *****************************************************************************/
uint8_t security_128_eia1( uint8_t security_128_eia1(uint8_t* key,
uint8_t* key, uint32_t count, uint32_t bearer, uint8_t direction, uint8_t* msg, uint32_t msg_len, uint8_t* mac); uint32_t count,
uint32_t bearer,
uint8_t security_128_eia2( uint8_t direction,
uint8_t* key, uint32_t count, uint32_t bearer, uint8_t direction, uint8_t* msg, uint32_t msg_len, uint8_t* mac); uint8_t* msg,
uint32_t msg_len,
uint8_t security_128_eia3( uint8_t* mac);
uint8_t* key, uint32_t count, uint32_t bearer, uint8_t direction, uint8_t* msg, uint32_t msg_len, uint8_t* mac);
uint8_t security_128_eia2(uint8_t* key,
uint32_t count,
uint32_t bearer,
uint8_t direction,
uint8_t* msg,
uint32_t msg_len,
uint8_t* mac);
uint8_t security_128_eia3(uint8_t* key,
uint32_t count,
uint32_t bearer,
uint8_t direction,
uint8_t* msg,
uint32_t msg_len,
uint8_t* mac);
uint8_t security_md5(const uint8_t* input, size_t len, uint8_t* output); uint8_t security_md5(const uint8_t* input, size_t len, uint8_t* output);
/****************************************************************************** /******************************************************************************
* Encryption / Decryption * Encryption / Decryption
*****************************************************************************/ *****************************************************************************/
uint8_t security_128_eea1( uint8_t security_128_eea1(uint8_t* key,
uint8_t* key, uint32_t count, uint8_t bearer, uint8_t direction, uint8_t* msg, uint32_t msg_len, uint8_t* msg_out); uint32_t count,
uint8_t bearer,
uint8_t security_128_eea2( uint8_t direction,
uint8_t* key, uint32_t count, uint8_t bearer, uint8_t direction, uint8_t* msg, uint32_t msg_len, uint8_t* msg_out); uint8_t* msg,
uint32_t msg_len,
uint8_t security_128_eea3( uint8_t* msg_out);
uint8_t* key, uint32_t count, uint8_t bearer, uint8_t direction, uint8_t* msg, uint32_t msg_len, uint8_t* msg_out);
uint8_t security_128_eea2(uint8_t* key,
uint32_t count,
uint8_t bearer,
uint8_t direction,
uint8_t* msg,
uint32_t msg_len,
uint8_t* msg_out);
uint8_t security_128_eea3(uint8_t* key,
uint32_t count,
uint8_t bearer,
uint8_t direction,
uint8_t* msg,
uint32_t msg_len,
uint8_t* msg_out);
/****************************************************************************** /******************************************************************************
* Authentication * Authentication
@ -138,10 +164,7 @@ uint8_t security_milenage_f1_star(uint8_t* k, uint8_t* op, uint8_t* rand, uint8_
uint8_t uint8_t
security_milenage_f2345(uint8_t* k, uint8_t* op, uint8_t* rand, uint8_t* res, uint8_t* ck, uint8_t* ik, uint8_t* ak); security_milenage_f2345(uint8_t* k, uint8_t* op, uint8_t* rand, uint8_t* res, uint8_t* ck, uint8_t* ik, uint8_t* ak);
uint8_t security_milenage_f5_star( uint8_t *k, uint8_t security_milenage_f5_star(uint8_t* k, uint8_t* op, uint8_t* rand, uint8_t* ak);
uint8_t *op,
uint8_t *rand,
uint8_t *ak);
} // namespace srslte } // namespace srslte
#endif // SRSLTE_SECURITY_H #endif // SRSLTE_SECURITY_H

@ -12,10 +12,10 @@
#ifndef SRSLTE_SNOW_3G_H #ifndef SRSLTE_SNOW_3G_H
#define SRSLTE_SNOW_3G_H #define SRSLTE_SNOW_3G_H
#include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h>
typedef unsigned char u8; typedef unsigned char u8;
typedef unsigned int u32; typedef unsigned int u32;
@ -54,8 +54,7 @@ void snow3g_generate_keystream(u32 n, u32 *z);
* defined in Section 3. * defined in Section 3.
*/ */
void snow3g_f8( u8 *key, u32 count, u32 bearer, u32 dir, \ void snow3g_f8(u8* key, u32 count, u32 bearer, u32 dir, u8* data, u32 length);
u8 *data, u32 length );
/* f9. /* f9.
* Input key: 128 bit Integrity Key. * Input key: 128 bit Integrity Key.
@ -68,7 +67,6 @@ void snow3g_f8( u8 *key, u32 count, u32 bearer, u32 dir, \
* Generates 32-bit MAC using UIA2 algorithm as defined in Section 4. * Generates 32-bit MAC using UIA2 algorithm as defined in Section 4.
*/ */
u8* snow3g_f9( u8* key, u32 count, u32 fresh, u32 dir, \ u8* snow3g_f9(u8* key, u32 count, u32 fresh, u32 dir, u8* data, u64 length);
u8 *data, u64 length);
#endif // SRSLTE_SNOW_3G_H #endif // SRSLTE_SNOW_3G_H

@ -46,7 +46,6 @@ namespace srslte {
class thread_pool class thread_pool
{ {
public: public:
class worker : public thread class worker : public thread
{ {
public: public:
@ -55,8 +54,10 @@ public:
virtual void stop(); virtual void stop();
uint32_t get_id(); uint32_t get_id();
void release(); void release();
protected: protected:
virtual void work_imp() = 0; virtual void work_imp() = 0;
private: private:
uint32_t my_id; uint32_t my_id;
thread_pool* my_parent; thread_pool* my_parent;
@ -66,7 +67,6 @@ public:
void finished(); void finished();
}; };
thread_pool(uint32_t nof_workers); thread_pool(uint32_t nof_workers);
void init_worker(uint32_t id, worker*, uint32_t prio = 0, uint32_t mask = 255); void init_worker(uint32_t id, worker*, uint32_t prio = 0, uint32_t mask = 255);
void stop(); void stop();
@ -78,17 +78,10 @@ public:
worker* get_worker(uint32_t id); worker* get_worker(uint32_t id);
uint32_t get_nof_workers(); uint32_t get_nof_workers();
private: private:
bool find_finished_worker(uint32_t tti, uint32_t* id); bool find_finished_worker(uint32_t tti, uint32_t* id);
typedef enum { typedef enum { IDLE, START_WORK, WORKER_READY, WORKING } worker_status;
IDLE,
START_WORK,
WORKER_READY,
WORKING
}worker_status;
std::vector<worker*> workers; std::vector<worker*> workers;
uint32_t nof_workers; uint32_t nof_workers;

@ -24,9 +24,9 @@
#include <pthread.h> #include <pthread.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include <sys/timerfd.h> #include <sys/timerfd.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h>
// Default priority for all threads below UHD threads // Default priority for all threads below UHD threads
#define DEFAULT_PRIORITY 60 #define DEFAULT_PRIORITY 60
@ -72,12 +72,8 @@ public:
name = name_; name = name_;
pthread_setname_np(pthread_self(), name.c_str()); pthread_setname_np(pthread_self(), name.c_str());
} }
void wait_thread_finish() { void wait_thread_finish() { pthread_join(_thread, NULL); }
pthread_join(_thread, NULL); void thread_cancel() { pthread_cancel(_thread); }
}
void thread_cancel() {
pthread_cancel(_thread);
}
static std::string get_name() static std::string get_name()
{ {
@ -108,23 +104,28 @@ class periodic_thread : public thread
{ {
public: public:
periodic_thread(const std::string name_) : thread(name_) {} periodic_thread(const std::string name_) : thread(name_) {}
void start_periodic(int period_us_, int priority = -1) { void start_periodic(int period_us_, int priority = -1)
{
run_enable = true; run_enable = true;
period_us = period_us_; period_us = period_us_;
start(priority); start(priority);
} }
void stop_thread() { void stop_thread()
{
run_enable = false; run_enable = false;
wait_thread_finish(); wait_thread_finish();
} }
protected: protected:
virtual void run_period() = 0; virtual void run_period() = 0;
private: private:
int wakeups_missed; int wakeups_missed;
int timer_fd; int timer_fd;
int period_us; int period_us;
bool run_enable; bool run_enable;
void run_thread() { void run_thread()
{
if (make_periodic()) { if (make_periodic()) {
return; return;
} }
@ -135,7 +136,8 @@ private:
} }
} }
} }
int make_periodic() { int make_periodic()
{
int ret = -1; int ret = -1;
unsigned int ns; unsigned int ns;
unsigned int sec; unsigned int sec;
@ -162,15 +164,15 @@ private:
} }
return ret; return ret;
} }
void wait_period() { void wait_period()
{
unsigned long long missed; unsigned long long missed;
int ret; int ret;
/* Wait for the next timer event. If we have missed any the /* Wait for the next timer event. If we have missed any the
number is written to "missed" */ number is written to "missed" */
ret = read(timer_fd, &missed, sizeof(missed)); ret = read(timer_fd, &missed, sizeof(missed));
if (ret == -1) if (ret == -1) {
{
perror("read timer"); perror("read timer");
return; return;
} }

@ -29,11 +29,11 @@
#ifndef SRSLTE_TIMEOUT_H #ifndef SRSLTE_TIMEOUT_H
#define SRSLTE_TIMEOUT_H #define SRSLTE_TIMEOUT_H
#include <stdint.h> #include "srslte/srslte.h"
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <stdint.h>
#include <sys/time.h> #include <sys/time.h>
#include "srslte/srslte.h" #include <unistd.h>
namespace srslte { namespace srslte {
@ -99,7 +99,8 @@ public:
return false; return false;
} }
} }
int32_t get_msec_to_expire() { int32_t get_msec_to_expire()
{
if (running) { if (running) {
gettimeofday(&start_time[2], NULL); gettimeofday(&start_time[2], NULL);
get_time_interval(start_time); get_time_interval(start_time);
@ -107,10 +108,7 @@ public:
} }
return 0; return 0;
} }
bool is_running() bool is_running() { return running; }
{
return running;
}
private: private:
struct timeval start_time[3]; struct timeval start_time[3];

@ -39,19 +39,21 @@ template<class elemType>
class trace class trace
{ {
public: public:
trace(uint32_t nof_elems_) : tti(nof_elems_), data(nof_elems_)
trace(uint32_t nof_elems_) : tti(nof_elems_), data(nof_elems_) { {
rpm = 0; rpm = 0;
nof_elems = nof_elems_; nof_elems = nof_elems_;
wrapped = false; wrapped = false;
}; };
void push_cur_time_us(uint32_t cur_tti) { void push_cur_time_us(uint32_t cur_tti)
{
struct timeval t; struct timeval t;
gettimeofday(&t, NULL); gettimeofday(&t, NULL);
elemType us = t.tv_sec * 1e6 + t.tv_usec; elemType us = t.tv_sec * 1e6 + t.tv_usec;
push(cur_tti, us); push(cur_tti, us);
} }
void push(uint32_t value_tti, elemType value) { void push(uint32_t value_tti, elemType value)
{
tti[rpm] = value_tti; tti[rpm] = value_tti;
data[rpm] = value; data[rpm] = value;
rpm++; rpm++;
@ -60,7 +62,8 @@ public:
wrapped = true; wrapped = true;
} }
} }
bool writeToBinary(std::string filename) { bool writeToBinary(std::string filename)
{
FILE* f = fopen(filename.c_str(), "w"); FILE* f = fopen(filename.c_str(), "w");
if (f != NULL) { if (f != NULL) {
uint32_t st = wrapped ? (rpm + 1) : 0; uint32_t st = wrapped ? (rpm + 1) : 0;
@ -85,11 +88,11 @@ private:
uint32_t nof_elems; uint32_t nof_elems;
bool wrapped; bool wrapped;
void writeToBinaryValue(FILE *f, uint32_t idx) { void writeToBinaryValue(FILE* f, uint32_t idx)
{
fwrite(&tti[idx], 1, sizeof(uint32_t), f); fwrite(&tti[idx], 1, sizeof(uint32_t), f);
fwrite(&data[idx], 1, sizeof(elemType), f); fwrite(&data[idx], 1, sizeof(elemType), f);
} }
}; };
} // namespace srslte } // namespace srslte

@ -51,9 +51,8 @@ class tti_sync
virtual void set_producer_cntr(uint32_t) = 0; virtual void set_producer_cntr(uint32_t) = 0;
uint32_t get_producer_cntr() { return producer_cntr; } uint32_t get_producer_cntr() { return producer_cntr; }
uint32_t get_consumer_cntr() { return consumer_cntr; } uint32_t get_consumer_cntr() { return consumer_cntr; }
void set_increment(uint32_t increment_) { void set_increment(uint32_t increment_) { increment = increment_; }
increment = increment_;
}
protected: protected:
void increase_producer() { producer_cntr = (producer_cntr + increment) % modulus; } void increase_producer() { producer_cntr = (producer_cntr + increment) % modulus; }
void increase_producer(uint32_t cnt) { producer_cntr = cnt % modulus; } void increase_producer(uint32_t cnt) { producer_cntr = cnt % modulus; }

@ -28,8 +28,8 @@
#ifndef SRSLTE_TTI_SYNC_CV_H #ifndef SRSLTE_TTI_SYNC_CV_H
#define SRSLTE_TTI_SYNC_CV_H #define SRSLTE_TTI_SYNC_CV_H
#include <pthread.h>
#include "srslte/common/tti_sync.h" #include "srslte/common/tti_sync.h"
#include <pthread.h>
namespace srslte { namespace srslte {

@ -46,7 +46,6 @@
#define SRSLTE_API SRSLTE_IMPORT #define SRSLTE_API SRSLTE_IMPORT
#endif #endif
// Useful macros for templates // Useful macros for templates
#define CONCAT(a, b) a##b #define CONCAT(a, b) a##b
#define CONCAT2(a, b) CONCAT(a, b) #define CONCAT2(a, b) CONCAT(a, b)

@ -31,19 +31,16 @@
#ifndef SRSLTE_AGC_H #ifndef SRSLTE_AGC_H
#define SRSLTE_AGC_H #define SRSLTE_AGC_H
#include <complex.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <complex.h>
#include "srslte/config.h" #include "srslte/config.h"
#define SRSLTE_AGC_DEFAULT_TARGET 0.3 #define SRSLTE_AGC_DEFAULT_TARGET 0.3
#define SRSLTE_AGC_DEFAULT_BW 0.7 #define SRSLTE_AGC_DEFAULT_BW 0.7
typedef enum SRSLTE_API { typedef enum SRSLTE_API { SRSLTE_AGC_MODE_ENERGY = 0, SRSLTE_AGC_MODE_PEAK_AMPLITUDE } srslte_agc_mode_t;
SRSLTE_AGC_MODE_ENERGY = 0,
SRSLTE_AGC_MODE_PEAK_AMPLITUDE
} srslte_agc_mode_t;
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
float bandwidth; float bandwidth;
@ -78,11 +75,9 @@ SRSLTE_API void srslte_agc_reset(srslte_agc_t *q);
SRSLTE_API void srslte_agc_set_gain_range(srslte_agc_t* q, float min_gain_db, float max_gain_db); SRSLTE_API void srslte_agc_set_gain_range(srslte_agc_t* q, float min_gain_db, float max_gain_db);
SRSLTE_API void srslte_agc_set_bandwidth(srslte_agc_t *q, SRSLTE_API void srslte_agc_set_bandwidth(srslte_agc_t* q, float bandwidth);
float bandwidth);
SRSLTE_API void srslte_agc_set_target(srslte_agc_t *q, SRSLTE_API void srslte_agc_set_target(srslte_agc_t* q, float target);
float target);
SRSLTE_API float srslte_agc_get_rssi(srslte_agc_t* q); SRSLTE_API float srslte_agc_get_rssi(srslte_agc_t* q);
@ -90,14 +85,10 @@ SRSLTE_API float srslte_agc_get_output_level(srslte_agc_t *q);
SRSLTE_API float srslte_agc_get_gain(srslte_agc_t* q); SRSLTE_API float srslte_agc_get_gain(srslte_agc_t* q);
SRSLTE_API void srslte_agc_set_gain(srslte_agc_t *q, SRSLTE_API void srslte_agc_set_gain(srslte_agc_t* q, float init_gain_value_db);
float init_gain_value_db);
SRSLTE_API void srslte_agc_lock(srslte_agc_t *q, SRSLTE_API void srslte_agc_lock(srslte_agc_t* q, bool enable);
bool enable);
SRSLTE_API void srslte_agc_process(srslte_agc_t *q, SRSLTE_API void srslte_agc_process(srslte_agc_t* q, cf_t* signal, uint32_t len);
cf_t *signal,
uint32_t len);
#endif // SRSLTE_AGC_H #endif // SRSLTE_AGC_H

@ -22,8 +22,8 @@
#ifndef SRSLTE_CHEST_COMMON_H #ifndef SRSLTE_CHEST_COMMON_H
#define SRSLTE_CHEST_COMMON_H #define SRSLTE_CHEST_COMMON_H
#include <stdint.h>
#include "srslte/config.h" #include "srslte/config.h"
#include <stdint.h>
#define SRSLTE_CHEST_MAX_SMOOTH_FIL_LEN 64 #define SRSLTE_CHEST_MAX_SMOOTH_FIL_LEN 64
@ -33,8 +33,12 @@ typedef enum SRSLTE_API {
SRSLTE_CHEST_FILTER_NONE SRSLTE_CHEST_FILTER_NONE
} srslte_chest_filter_t; } srslte_chest_filter_t;
SRSLTE_API void srslte_chest_average_pilots( SRSLTE_API void srslte_chest_average_pilots(cf_t* input,
cf_t* input, cf_t* output, float* filter, uint32_t nof_ref, uint32_t nof_symbols, uint32_t filter_len); cf_t* output,
float* filter,
uint32_t nof_ref,
uint32_t nof_symbols,
uint32_t filter_len);
SRSLTE_API uint32_t srslte_chest_set_smooth_filter3_coeff(float* smooth_filter, float w); SRSLTE_API uint32_t srslte_chest_set_smooth_filter3_coeff(float* smooth_filter, float w);

@ -41,9 +41,9 @@
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/ch_estimation/chest_common.h" #include "srslte/phy/ch_estimation/chest_common.h"
#include "srslte/phy/resampling/interp.h"
#include "srslte/phy/ch_estimation/refsignal_dl.h" #include "srslte/phy/ch_estimation/refsignal_dl.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
#include "srslte/phy/resampling/interp.h"
#include "srslte/phy/sync/pss.h" #include "srslte/phy/sync/pss.h"
typedef struct SRSLTE_API { typedef struct SRSLTE_API {

@ -79,9 +79,7 @@ typedef struct {
} srslte_chest_ul_t; } srslte_chest_ul_t;
SRSLTE_API int srslte_chest_ul_init(srslte_chest_ul_t* q, uint32_t max_prb);
SRSLTE_API int srslte_chest_ul_init(srslte_chest_ul_t *q,
uint32_t max_prb);
SRSLTE_API void srslte_chest_ul_free(srslte_chest_ul_t* q); SRSLTE_API void srslte_chest_ul_free(srslte_chest_ul_t* q);
@ -95,10 +93,16 @@ SRSLTE_API int srslte_chest_ul_set_cell(srslte_chest_ul_t* q, srslte_cell_t cell
SRSLTE_API void srslte_chest_ul_pregen(srslte_chest_ul_t* q, srslte_refsignal_dmrs_pusch_cfg_t* cfg); SRSLTE_API void srslte_chest_ul_pregen(srslte_chest_ul_t* q, srslte_refsignal_dmrs_pusch_cfg_t* cfg);
SRSLTE_API int srslte_chest_ul_estimate_pusch( SRSLTE_API int srslte_chest_ul_estimate_pusch(srslte_chest_ul_t* q,
srslte_chest_ul_t* q, srslte_ul_sf_cfg_t* sf, srslte_pusch_cfg_t* cfg, cf_t* input, srslte_chest_ul_res_t* res); srslte_ul_sf_cfg_t* sf,
srslte_pusch_cfg_t* cfg,
SRSLTE_API int srslte_chest_ul_estimate_pucch( cf_t* input,
srslte_chest_ul_t* q, srslte_ul_sf_cfg_t* sf, srslte_pucch_cfg_t* cfg, cf_t* input, srslte_chest_ul_res_t* res); srslte_chest_ul_res_t* res);
SRSLTE_API int srslte_chest_ul_estimate_pucch(srslte_chest_ul_t* q,
srslte_ul_sf_cfg_t* sf,
srslte_pucch_cfg_t* cfg,
cf_t* input,
srslte_chest_ul_res_t* res);
#endif // SRSLTE_CHEST_UL_H #endif // SRSLTE_CHEST_UL_H

@ -43,8 +43,6 @@
#define SRSLTE_REFSIGNAL_PILOT_IDX_MBSFN(i, l, cell) ((6 * cell.nof_prb * (l) + (i))) #define SRSLTE_REFSIGNAL_PILOT_IDX_MBSFN(i, l, cell) ((6 * cell.nof_prb * (l) + (i)))
/** Cell-Specific Reference Signal */ /** Cell-Specific Reference Signal */
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
srslte_cell_t cell; srslte_cell_t cell;
@ -53,26 +51,24 @@ typedef struct SRSLTE_API {
uint16_t mbsfn_area_id; uint16_t mbsfn_area_id;
} srslte_refsignal_t; } srslte_refsignal_t;
SRSLTE_API int srslte_refsignal_cs_init(srslte_refsignal_t* q, uint32_t max_prb);
SRSLTE_API int srslte_refsignal_cs_init(srslte_refsignal_t *q, SRSLTE_API int srslte_refsignal_cs_set_cell(srslte_refsignal_t* q, srslte_cell_t cell);
uint32_t max_prb);
SRSLTE_API int srslte_refsignal_cs_set_cell(srslte_refsignal_t * q,
srslte_cell_t cell);
SRSLTE_API void srslte_refsignal_free(srslte_refsignal_t* q); SRSLTE_API void srslte_refsignal_free(srslte_refsignal_t* q);
SRSLTE_API int SRSLTE_API int
srslte_refsignal_cs_put_sf(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id, cf_t* sf_symbols); srslte_refsignal_cs_put_sf(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id, cf_t* sf_symbols);
SRSLTE_API int srslte_refsignal_cs_get_sf( SRSLTE_API int srslte_refsignal_cs_get_sf(srslte_refsignal_t* q,
srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id, cf_t* sf_symbols, cf_t* pilots); srslte_dl_sf_cfg_t* sf,
uint32_t port_id,
cf_t* sf_symbols,
cf_t* pilots);
SRSLTE_API uint32_t srslte_refsignal_cs_fidx(srslte_cell_t cell, uint32_t l, uint32_t port_id, uint32_t m); SRSLTE_API uint32_t srslte_refsignal_cs_fidx(srslte_cell_t cell, uint32_t l, uint32_t port_id, uint32_t m);
SRSLTE_API uint32_t srslte_refsignal_cs_nsymbol(uint32_t l, SRSLTE_API uint32_t srslte_refsignal_cs_nsymbol(uint32_t l, srslte_cp_t cp, uint32_t port_id);
srslte_cp_t cp,
uint32_t port_id);
SRSLTE_API uint32_t srslte_refsignal_cs_v(uint32_t port_id, uint32_t ref_symbol_idx); SRSLTE_API uint32_t srslte_refsignal_cs_v(uint32_t port_id, uint32_t ref_symbol_idx);
@ -98,9 +94,6 @@ SRSLTE_API int srslte_refsignal_mbsfn_put_sf(srslte_cell_t cell,
cf_t* mbsfn_pilots, cf_t* mbsfn_pilots,
cf_t* sf_symbols); cf_t* sf_symbols);
SRSLTE_API int srslte_refsignal_mbsfn_gen_seq(srslte_refsignal_t * q, SRSLTE_API int srslte_refsignal_mbsfn_gen_seq(srslte_refsignal_t* q, srslte_cell_t cell, uint32_t N_mbsfn_id);
srslte_cell_t cell,
uint32_t N_mbsfn_id);
#endif // SRSLTE_REFSIGNAL_DL_H #endif // SRSLTE_REFSIGNAL_DL_H

@ -76,7 +76,8 @@ typedef struct SRSLTE_API {
float* tmp_arg; float* tmp_arg;
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB]; uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB];
uint32_t n_prs_pusch[SRSLTE_NOF_DELTA_SS][SRSLTE_NSLOTS_X_FRAME]; // We precompute n_prs needed for cyclic shift alpha at srslte_refsignal_dl_init() uint32_t n_prs_pusch[SRSLTE_NOF_DELTA_SS][SRSLTE_NSLOTS_X_FRAME]; // We precompute n_prs needed for cyclic shift alpha
// at srslte_refsignal_dl_init()
uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME]; uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME];
uint32_t u_pucch[SRSLTE_NSLOTS_X_FRAME]; uint32_t u_pucch[SRSLTE_NSLOTS_X_FRAME];
uint32_t v_pusch[SRSLTE_NSLOTS_X_FRAME][SRSLTE_NOF_DELTA_SS]; uint32_t v_pusch[SRSLTE_NSLOTS_X_FRAME][SRSLTE_NOF_DELTA_SS];
@ -90,11 +91,9 @@ typedef struct {
cf_t* r[SRSLTE_NOF_SF_X_FRAME]; cf_t* r[SRSLTE_NOF_SF_X_FRAME];
} srslte_refsignal_srs_pregen_t; } srslte_refsignal_srs_pregen_t;
SRSLTE_API int srslte_refsignal_ul_init(srslte_refsignal_ul_t *q, SRSLTE_API int srslte_refsignal_ul_init(srslte_refsignal_ul_t* q, uint32_t max_prb);
uint32_t max_prb);
SRSLTE_API int srslte_refsignal_ul_set_cell(srslte_refsignal_ul_t *q, SRSLTE_API int srslte_refsignal_ul_set_cell(srslte_refsignal_ul_t* q, srslte_cell_t cell);
srslte_cell_t cell);
SRSLTE_API void srslte_refsignal_ul_free(srslte_refsignal_ul_t* q); SRSLTE_API void srslte_refsignal_ul_free(srslte_refsignal_ul_t* q);
@ -166,8 +165,11 @@ SRSLTE_API int srslte_refsignal_srs_gen(srslte_refsignal_ul_t* q,
uint32_t sf_idx, uint32_t sf_idx,
cf_t* r_srs); cf_t* r_srs);
SRSLTE_API int srslte_refsignal_srs_put( SRSLTE_API int srslte_refsignal_srs_put(srslte_refsignal_ul_t* q,
srslte_refsignal_ul_t* q, srslte_refsignal_srs_cfg_t* cfg, uint32_t tti, cf_t* r_srs, cf_t* sf_symbols); srslte_refsignal_srs_cfg_t* cfg,
uint32_t tti,
cf_t* r_srs,
cf_t* sf_symbols);
SRSLTE_API void srslte_refsignal_srs_pusch_shortened(srslte_refsignal_ul_t* q, SRSLTE_API void srslte_refsignal_srs_pusch_shortened(srslte_refsignal_ul_t* q,
srslte_ul_sf_cfg_t* sf, srslte_ul_sf_cfg_t* sf,

@ -35,18 +35,10 @@
#ifndef SRSLTE_CH_AWGN_H #ifndef SRSLTE_CH_AWGN_H
#define SRSLTE_CH_AWGN_H #define SRSLTE_CH_AWGN_H
SRSLTE_API void srslte_ch_awgn_c(const cf_t* input, SRSLTE_API void srslte_ch_awgn_c(const cf_t* input, cf_t* output, float variance, uint32_t len);
cf_t* output,
float variance,
uint32_t len);
SRSLTE_API void srslte_ch_awgn_f(const float* x, SRSLTE_API void srslte_ch_awgn_f(const float* x, float* y, float variance, uint32_t len);
float* y,
float variance,
uint32_t len);
SRSLTE_API float srslte_ch_awgn_get_variance(float ebno_db,
float rate);
SRSLTE_API float srslte_ch_awgn_get_variance(float ebno_db, float rate);
#endif // SRSLTE_CH_AWGN_H #endif // SRSLTE_CH_AWGN_H

@ -53,8 +53,11 @@ SRSLTE_API void srslte_channel_delay_update_srate(srslte_channel_delay_t* q, uin
SRSLTE_API void srslte_channel_delay_free(srslte_channel_delay_t* q); SRSLTE_API void srslte_channel_delay_free(srslte_channel_delay_t* q);
SRSLTE_API void srslte_channel_delay_execute( SRSLTE_API void srslte_channel_delay_execute(srslte_channel_delay_t* q,
srslte_channel_delay_t* q, const cf_t* in, cf_t* out, uint32_t len, const srslte_timestamp_t* ts); const cf_t* in,
cf_t* out,
uint32_t len,
const srslte_timestamp_t* ts);
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -66,8 +66,11 @@ SRSLTE_API int srslte_channel_fading_init(srslte_channel_fading_t* q, double sra
SRSLTE_API void srslte_channel_fading_free(srslte_channel_fading_t* q); SRSLTE_API void srslte_channel_fading_free(srslte_channel_fading_t* q);
SRSLTE_API double srslte_channel_fading_execute( SRSLTE_API double srslte_channel_fading_execute(srslte_channel_fading_t* q,
srslte_channel_fading_t* q, const cf_t* in, cf_t* out, uint32_t nof_samples, double init_time); const cf_t* in,
cf_t* out,
uint32_t nof_samples,
double init_time);
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -35,8 +35,11 @@ extern "C" {
SRSLTE_API void srslte_channel_rlf_init(srslte_channel_rlf_t* q, uint32_t t_on_ms, uint32_t t_off_ms); SRSLTE_API void srslte_channel_rlf_init(srslte_channel_rlf_t* q, uint32_t t_on_ms, uint32_t t_off_ms);
SRSLTE_API void srslte_channel_rlf_execute( SRSLTE_API void srslte_channel_rlf_execute(srslte_channel_rlf_t* q,
srslte_channel_rlf_t* q, const cf_t* in, cf_t* out, uint32_t nsamples, const srslte_timestamp_t* ts); const cf_t* in,
cf_t* out,
uint32_t nsamples,
const srslte_timestamp_t* ts);
SRSLTE_API void srslte_channel_rlf_free(srslte_channel_rlf_t* q); SRSLTE_API void srslte_channel_rlf_free(srslte_channel_rlf_t* q);

@ -30,10 +30,10 @@
#ifndef SRSLTE_PHY_COMMON_H #ifndef SRSLTE_PHY_COMMON_H
#define SRSLTE_PHY_COMMON_H #define SRSLTE_PHY_COMMON_H
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <math.h> #include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "srslte/config.h" #include "srslte/config.h"
@ -106,7 +106,8 @@ typedef enum { SRSLTE_SF_NORM = 0, SRSLTE_SF_MBSFN } srslte_sf_t;
#define SRSLTE_CP_NSYMB(cp) (SRSLTE_CP_ISNORM(cp) ? SRSLTE_CP_NORM_NSYMB : SRSLTE_CP_EXT_NSYMB) #define SRSLTE_CP_NSYMB(cp) (SRSLTE_CP_ISNORM(cp) ? SRSLTE_CP_NORM_NSYMB : SRSLTE_CP_EXT_NSYMB)
#define SRSLTE_CP_LEN(symbol_sz, c) ((int)ceilf((((float)(c) * (symbol_sz)) / 2048.0f))) #define SRSLTE_CP_LEN(symbol_sz, c) ((int)ceilf((((float)(c) * (symbol_sz)) / 2048.0f)))
#define SRSLTE_CP_LEN_NORM(symbol, symbol_sz) (((symbol)==0)?SRSLTE_CP_LEN((symbol_sz),SRSLTE_CP_NORM_0_LEN):SRSLTE_CP_LEN((symbol_sz),SRSLTE_CP_NORM_LEN)) #define SRSLTE_CP_LEN_NORM(symbol, symbol_sz) \
(((symbol) == 0) ? SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_NORM_0_LEN) : SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_NORM_LEN))
#define SRSLTE_CP_LEN_EXT(symbol_sz) (SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_EXT_LEN)) #define SRSLTE_CP_LEN_EXT(symbol_sz) (SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_EXT_LEN))
#define SRSLTE_CP_SZ(symbol_sz, cp) \ #define SRSLTE_CP_SZ(symbol_sz, cp) \
@ -127,7 +128,9 @@ typedef enum { SRSLTE_SF_NORM = 0, SRSLTE_SF_MBSFN } srslte_sf_t;
#define SRSLTE_LTE_TS 1.0 / (15000.0 * 2048) #define SRSLTE_LTE_TS 1.0 / (15000.0 * 2048)
#define SRSLTE_SLOT_IDX_CPNORM(symbol_idx, symbol_sz) (symbol_idx==0?0:(symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_0_LEN) + \ #define SRSLTE_SLOT_IDX_CPNORM(symbol_idx, symbol_sz) \
(symbol_idx == 0 ? 0 \
: (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_0_LEN) + \
(symbol_idx - 1) * (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_LEN)))) (symbol_idx - 1) * (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_LEN))))
#define SRSLTE_SLOT_IDX_CPEXT(idx, symbol_sz) (idx * (symbol_sz + SRSLTE_CP(symbol_sz, SRSLTE_CP_EXT_LEN))) #define SRSLTE_SLOT_IDX_CPEXT(idx, symbol_sz) (idx * (symbol_sz + SRSLTE_CP(symbol_sz, SRSLTE_CP_EXT_LEN)))
@ -137,15 +140,16 @@ typedef enum { SRSLTE_SF_NORM = 0, SRSLTE_SF_MBSFN } srslte_sf_t;
#define SRSLTE_GUARD_RE(nof_prb) ((srslte_symbol_sz(nof_prb) - nof_prb * SRSLTE_NRE) / 2) #define SRSLTE_GUARD_RE(nof_prb) ((srslte_symbol_sz(nof_prb) - nof_prb * SRSLTE_NRE) / 2)
#define SRSLTE_SYMBOL_HAS_REF(l, cp, nof_ports) ((l == 1 && nof_ports == 4) \ #define SRSLTE_SYMBOL_HAS_REF(l, cp, nof_ports) ((l == 1 && nof_ports == 4) || l == 0 || l == SRSLTE_CP_NSYMB(cp) - 3)
|| l == 0 \
|| l == SRSLTE_CP_NSYMB(cp) - 3)
#define SRSLTE_NOF_CTRL_SYMBOLS(cell, cfi) (cfi + (cell.nof_prb < 10 ? 1 : 0)) #define SRSLTE_NOF_CTRL_SYMBOLS(cell, cfi) (cfi + (cell.nof_prb < 10 ? 1 : 0))
#define SRSLTE_SYMBOL_HAS_REF_MBSFN(l, s) ((l == 2 && s == 0) || (l == 0 && s == 1) || (l == 4 && s == 1)) #define SRSLTE_SYMBOL_HAS_REF_MBSFN(l, s) ((l == 2 && s == 0) || (l == 0 && s == 1) || (l == 4 && s == 1))
#define SRSLTE_NON_MBSFN_REGION_GUARD_LENGTH(non_mbsfn_region,symbol_sz) ((non_mbsfn_region == 1)?(SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz)):(2*SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz)- SRSLTE_CP_LEN_NORM(1, symbol_sz))) #define SRSLTE_NON_MBSFN_REGION_GUARD_LENGTH(non_mbsfn_region, symbol_sz) \
((non_mbsfn_region == 1) \
? (SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz)) \
: (2 * SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz) - SRSLTE_CP_LEN_NORM(1, symbol_sz)))
#define SRSLTE_FDD_NOF_HARQ (TX_DELAY + FDD_HARQ_DELAY_MS) #define SRSLTE_FDD_NOF_HARQ (TX_DELAY + FDD_HARQ_DELAY_MS)
#define SRSLTE_MAX_HARQ_PROC 15 #define SRSLTE_MAX_HARQ_PROC 15
@ -158,10 +162,7 @@ typedef enum { SRSLTE_SF_NORM = 0, SRSLTE_SF_MBSFN } srslte_sf_t;
#define ZERO_OBJECT(x) memset(&(x), 0x0, sizeof((x))) #define ZERO_OBJECT(x) memset(&(x), 0x0, sizeof((x)))
typedef enum SRSLTE_API { typedef enum SRSLTE_API { SRSLTE_PHICH_NORM = 0, SRSLTE_PHICH_EXT } srslte_phich_length_t;
SRSLTE_PHICH_NORM = 0,
SRSLTE_PHICH_EXT
} srslte_phich_length_t;
typedef enum SRSLTE_API { typedef enum SRSLTE_API {
SRSLTE_PHICH_R_1_6 = 0, SRSLTE_PHICH_R_1_6 = 0,
@ -330,9 +331,7 @@ typedef struct SRSLTE_API {
SRSLTE_API bool srslte_cell_isvalid(srslte_cell_t* cell); SRSLTE_API bool srslte_cell_isvalid(srslte_cell_t* cell);
SRSLTE_API void srslte_cell_fprint(FILE *stream, SRSLTE_API void srslte_cell_fprint(FILE* stream, srslte_cell_t* cell, uint32_t sfn);
srslte_cell_t *cell,
uint32_t sfn);
SRSLTE_API bool srslte_cellid_isvalid(uint32_t cell_id); SRSLTE_API bool srslte_cellid_isvalid(uint32_t cell_id);
@ -370,25 +369,17 @@ SRSLTE_API int srslte_sampling_freq_hz(uint32_t nof_prb);
SRSLTE_API void srslte_use_standard_symbol_size(bool enabled); SRSLTE_API void srslte_use_standard_symbol_size(bool enabled);
SRSLTE_API uint32_t srslte_re_x_prb(uint32_t ns, SRSLTE_API uint32_t srslte_re_x_prb(uint32_t ns, uint32_t symbol, uint32_t nof_ports, uint32_t nof_symbols);
uint32_t symbol,
uint32_t nof_ports,
uint32_t nof_symbols);
SRSLTE_API uint32_t srslte_voffset(uint32_t symbol_id, SRSLTE_API uint32_t srslte_voffset(uint32_t symbol_id, uint32_t cell_id, uint32_t nof_ports);
uint32_t cell_id,
uint32_t nof_ports);
SRSLTE_API int srslte_group_hopping_f_gh(uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME], SRSLTE_API int srslte_group_hopping_f_gh(uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME], uint32_t cell_id);
uint32_t cell_id);
SRSLTE_API uint32_t srslte_N_ta_new_rar(uint32_t ta); SRSLTE_API uint32_t srslte_N_ta_new_rar(uint32_t ta);
SRSLTE_API uint32_t srslte_N_ta_new(uint32_t N_ta_old, SRSLTE_API uint32_t srslte_N_ta_new(uint32_t N_ta_old, uint32_t ta);
uint32_t ta);
SRSLTE_API float srslte_coderate(uint32_t tbs, SRSLTE_API float srslte_coderate(uint32_t tbs, uint32_t nof_re);
uint32_t nof_re);
SRSLTE_API char* srslte_cp_string(srslte_cp_t cp); SRSLTE_API char* srslte_cp_string(srslte_cp_t cp);
@ -408,19 +399,13 @@ SRSLTE_API float srslte_band_fu(uint32_t ul_earfcn);
SRSLTE_API uint32_t srslte_band_ul_earfcn(uint32_t dl_earfcn); SRSLTE_API uint32_t srslte_band_ul_earfcn(uint32_t dl_earfcn);
SRSLTE_API int srslte_band_get_fd_band(uint32_t band, SRSLTE_API int
srslte_earfcn_t *earfcn, srslte_band_get_fd_band(uint32_t band, srslte_earfcn_t* earfcn, int earfcn_start, int earfcn_end, uint32_t max_elems);
int earfcn_start,
int earfcn_end,
uint32_t max_elems);
SRSLTE_API int srslte_band_get_fd_band_all(uint32_t band, SRSLTE_API int srslte_band_get_fd_band_all(uint32_t band, srslte_earfcn_t* earfcn, uint32_t max_nelems);
srslte_earfcn_t *earfcn,
uint32_t max_nelems);
SRSLTE_API int srslte_band_get_fd_region(enum band_geographical_area region, SRSLTE_API int
srslte_earfcn_t *earfcn, srslte_band_get_fd_region(enum band_geographical_area region, srslte_earfcn_t* earfcn, uint32_t max_elems);
uint32_t max_elems);
SRSLTE_API int srslte_str2mimotype(char* mimo_type_str, srslte_tx_scheme_t* type); SRSLTE_API int srslte_str2mimotype(char* mimo_type_str, srslte_tx_scheme_t* type);

@ -48,53 +48,27 @@ SRSLTE_API int srslte_sequence_init(srslte_sequence_t *q, uint32_t len);
SRSLTE_API void srslte_sequence_free(srslte_sequence_t* q); SRSLTE_API void srslte_sequence_free(srslte_sequence_t* q);
SRSLTE_API int srslte_sequence_LTE_pr(srslte_sequence_t *q, SRSLTE_API int srslte_sequence_LTE_pr(srslte_sequence_t* q, uint32_t len, uint32_t seed);
uint32_t len,
uint32_t seed);
SRSLTE_API int srslte_sequence_set_LTE_pr(srslte_sequence_t *q, SRSLTE_API int srslte_sequence_set_LTE_pr(srslte_sequence_t* q, uint32_t len, uint32_t seed);
uint32_t len,
uint32_t seed);
SRSLTE_API int srslte_sequence_pbch(srslte_sequence_t *seq, SRSLTE_API int srslte_sequence_pbch(srslte_sequence_t* seq, srslte_cp_t cp, uint32_t cell_id);
srslte_cp_t cp,
uint32_t cell_id);
SRSLTE_API int srslte_sequence_pcfich(srslte_sequence_t *seq, SRSLTE_API int srslte_sequence_pcfich(srslte_sequence_t* seq, uint32_t nslot, uint32_t cell_id);
uint32_t nslot,
uint32_t cell_id);
SRSLTE_API int srslte_sequence_phich(srslte_sequence_t *seq, SRSLTE_API int srslte_sequence_phich(srslte_sequence_t* seq, uint32_t nslot, uint32_t cell_id);
uint32_t nslot,
uint32_t cell_id);
SRSLTE_API int srslte_sequence_pdcch(srslte_sequence_t *seq, SRSLTE_API int srslte_sequence_pdcch(srslte_sequence_t* seq, uint32_t nslot, uint32_t cell_id, uint32_t len);
uint32_t nslot,
uint32_t cell_id,
uint32_t len);
SRSLTE_API int srslte_sequence_pdsch(srslte_sequence_t *seq, SRSLTE_API int
uint16_t rnti, srslte_sequence_pdsch(srslte_sequence_t* seq, uint16_t rnti, int q, uint32_t nslot, uint32_t cell_id, uint32_t len);
int q,
uint32_t nslot,
uint32_t cell_id,
uint32_t len);
SRSLTE_API int srslte_sequence_pusch(srslte_sequence_t *seq, SRSLTE_API int
uint16_t rnti, srslte_sequence_pusch(srslte_sequence_t* seq, uint16_t rnti, uint32_t nslot, uint32_t cell_id, uint32_t len);
uint32_t nslot,
uint32_t cell_id,
uint32_t len);
SRSLTE_API int srslte_sequence_pucch(srslte_sequence_t *seq, SRSLTE_API int srslte_sequence_pucch(srslte_sequence_t* seq, uint16_t rnti, uint32_t nslot, uint32_t cell_id);
uint16_t rnti,
uint32_t nslot,
uint32_t cell_id);
SRSLTE_API int srslte_sequence_pmch(srslte_sequence_t *seq, SRSLTE_API int srslte_sequence_pmch(srslte_sequence_t* seq, uint32_t nslot, uint32_t mbsfn_id, uint32_t len);
uint32_t nslot,
uint32_t mbsfn_id,
uint32_t len);
SRSLTE_API int srslte_sequence_npbch(srslte_sequence_t* seq, srslte_cp_t cp, uint32_t cell_id); SRSLTE_API int srslte_sequence_npbch(srslte_sequence_t* seq, srslte_cp_t cp, uint32_t cell_id);

@ -22,8 +22,8 @@
#ifndef SRSLTE_DFT_H #ifndef SRSLTE_DFT_H
#define SRSLTE_DFT_H #define SRSLTE_DFT_H
#include <stdbool.h>
#include "srslte/config.h" #include "srslte/config.h"
#include <stdbool.h>
/********************************************************************************************** /**********************************************************************************************
* File: dft.h * File: dft.h
@ -43,13 +43,9 @@
* Reference: * Reference:
*********************************************************************************************/ *********************************************************************************************/
typedef enum { typedef enum { SRSLTE_DFT_COMPLEX, SRSLTE_REAL } srslte_dft_mode_t;
SRSLTE_DFT_COMPLEX, SRSLTE_REAL
}srslte_dft_mode_t;
typedef enum { typedef enum { SRSLTE_DFT_FORWARD, SRSLTE_DFT_BACKWARD } srslte_dft_dir_t;
SRSLTE_DFT_FORWARD, SRSLTE_DFT_BACKWARD
}srslte_dft_dir_t;
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
int init_size; // DFT length used in the first initialization int init_size; // DFT length used in the first initialization
@ -71,14 +67,9 @@ SRSLTE_API void srslte_dft_load();
SRSLTE_API void srslte_dft_exit(); SRSLTE_API void srslte_dft_exit();
SRSLTE_API int srslte_dft_plan(srslte_dft_plan_t *plan, SRSLTE_API int srslte_dft_plan(srslte_dft_plan_t* plan, int dft_points, srslte_dft_dir_t dir, srslte_dft_mode_t type);
int dft_points,
srslte_dft_dir_t dir,
srslte_dft_mode_t type);
SRSLTE_API int srslte_dft_plan_c(srslte_dft_plan_t *plan, SRSLTE_API int srslte_dft_plan_c(srslte_dft_plan_t* plan, int dft_points, srslte_dft_dir_t dir);
int dft_points,
srslte_dft_dir_t dir);
SRSLTE_API int srslte_dft_plan_guru_c(srslte_dft_plan_t* plan, SRSLTE_API int srslte_dft_plan_guru_c(srslte_dft_plan_t* plan,
int dft_points, int dft_points,
@ -91,12 +82,9 @@ SRSLTE_API int srslte_dft_plan_guru_c(srslte_dft_plan_t *plan,
int idist, int idist,
int odist); int odist);
SRSLTE_API int srslte_dft_plan_r(srslte_dft_plan_t *plan, SRSLTE_API int srslte_dft_plan_r(srslte_dft_plan_t* plan, int dft_points, srslte_dft_dir_t dir);
int dft_points,
srslte_dft_dir_t dir);
SRSLTE_API int srslte_dft_replan(srslte_dft_plan_t *plan, SRSLTE_API int srslte_dft_replan(srslte_dft_plan_t* plan, const int new_dft_points);
const int new_dft_points);
SRSLTE_API int srslte_dft_replan_guru_c(srslte_dft_plan_t* plan, SRSLTE_API int srslte_dft_replan_guru_c(srslte_dft_plan_t* plan,
const int new_dft_points, const int new_dft_points,
@ -108,48 +96,32 @@ SRSLTE_API int srslte_dft_replan_guru_c(srslte_dft_plan_t *plan,
int idist, int idist,
int odist); int odist);
SRSLTE_API int srslte_dft_replan_c(srslte_dft_plan_t *plan, SRSLTE_API int srslte_dft_replan_c(srslte_dft_plan_t* plan, int new_dft_points);
int new_dft_points);
SRSLTE_API int srslte_dft_replan_r(srslte_dft_plan_t *plan,
int new_dft_points);
SRSLTE_API int srslte_dft_replan_r(srslte_dft_plan_t* plan, int new_dft_points);
SRSLTE_API void srslte_dft_plan_free(srslte_dft_plan_t* plan); SRSLTE_API void srslte_dft_plan_free(srslte_dft_plan_t* plan);
/* Set options */ /* Set options */
SRSLTE_API void srslte_dft_plan_set_mirror(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_plan_set_mirror(srslte_dft_plan_t* plan, bool val);
bool val);
SRSLTE_API void srslte_dft_plan_set_db(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_plan_set_db(srslte_dft_plan_t* plan, bool val);
bool val);
SRSLTE_API void srslte_dft_plan_set_norm(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_plan_set_norm(srslte_dft_plan_t* plan, bool val);
bool val);
SRSLTE_API void srslte_dft_plan_set_dc(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_plan_set_dc(srslte_dft_plan_t* plan, bool val);
bool val);
/* Compute DFT */ /* Compute DFT */
SRSLTE_API void srslte_dft_run(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_run(srslte_dft_plan_t* plan, const void* in, void* out);
const void *in,
void *out);
SRSLTE_API void srslte_dft_run_c_zerocopy(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_run_c_zerocopy(srslte_dft_plan_t* plan, const cf_t* in, cf_t* out);
const cf_t *in,
cf_t *out);
SRSLTE_API void srslte_dft_run_c(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_run_c(srslte_dft_plan_t* plan, const cf_t* in, cf_t* out);
const cf_t *in,
cf_t *out);
SRSLTE_API void srslte_dft_run_guru_c(srslte_dft_plan_t* plan); SRSLTE_API void srslte_dft_run_guru_c(srslte_dft_plan_t* plan);
SRSLTE_API void srslte_dft_run_r(srslte_dft_plan_t *plan, SRSLTE_API void srslte_dft_run_r(srslte_dft_plan_t* plan, const float* in, float* out);
const float *in,
float *out);
#endif // SRSLTE_DFT_H #endif // SRSLTE_DFT_H

@ -43,24 +43,17 @@ typedef struct SRSLTE_API {
} srslte_dft_precoding_t; } srslte_dft_precoding_t;
SRSLTE_API int srslte_dft_precoding_init(srslte_dft_precoding_t *q, SRSLTE_API int srslte_dft_precoding_init(srslte_dft_precoding_t* q, uint32_t max_prb, bool is_tx);
uint32_t max_prb,
bool is_tx);
SRSLTE_API int srslte_dft_precoding_init_tx(srslte_dft_precoding_t *q, SRSLTE_API int srslte_dft_precoding_init_tx(srslte_dft_precoding_t* q, uint32_t max_prb);
uint32_t max_prb);
SRSLTE_API int srslte_dft_precoding_init_rx(srslte_dft_precoding_t *q, SRSLTE_API int srslte_dft_precoding_init_rx(srslte_dft_precoding_t* q, uint32_t max_prb);
uint32_t max_prb);
SRSLTE_API void srslte_dft_precoding_free(srslte_dft_precoding_t* q); SRSLTE_API void srslte_dft_precoding_free(srslte_dft_precoding_t* q);
SRSLTE_API bool srslte_dft_precoding_valid_prb(uint32_t nof_prb); SRSLTE_API bool srslte_dft_precoding_valid_prb(uint32_t nof_prb);
SRSLTE_API int srslte_dft_precoding(srslte_dft_precoding_t *q, SRSLTE_API int
cf_t *input, srslte_dft_precoding(srslte_dft_precoding_t* q, cf_t* input, cf_t* output, uint32_t nof_prb, uint32_t nof_symbols);
cf_t *output,
uint32_t nof_prb,
uint32_t nof_symbols);
#endif // SRSLTE_DFT_PRECODING_H #endif // SRSLTE_DFT_PRECODING_H

@ -31,8 +31,8 @@
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6 * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6
*********************************************************************************************/ *********************************************************************************************/
#include <strings.h>
#include <stdlib.h> #include <stdlib.h>
#include <strings.h>
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
@ -59,7 +59,6 @@ typedef struct SRSLTE_API{
uint32_t nof_symbols_mbsfn; uint32_t nof_symbols_mbsfn;
uint8_t non_mbsfn_region; uint8_t non_mbsfn_region;
bool freq_shift; bool freq_shift;
float freq_shift_f; float freq_shift_f;
cf_t* shift_buffer; cf_t* shift_buffer;
@ -82,74 +81,44 @@ SRSLTE_API int srslte_ofdm_init_mbsfn_(srslte_ofdm_t *q,
srslte_dft_dir_t dir, srslte_dft_dir_t dir,
srslte_sf_t sf_type); srslte_sf_t sf_type);
SRSLTE_API int srslte_ofdm_rx_init_mbsfn(srslte_ofdm_t *q, SRSLTE_API int
srslte_cp_t cp_type, srslte_ofdm_rx_init_mbsfn(srslte_ofdm_t* q, srslte_cp_t cp_type, cf_t* in_buffer, cf_t* out_buffer, uint32_t max_prb);
cf_t *in_buffer,
cf_t *out_buffer,
uint32_t max_prb);
SRSLTE_API int srslte_ofdm_rx_init(srslte_ofdm_t *q, SRSLTE_API int
srslte_cp_t cp_type, srslte_ofdm_rx_init(srslte_ofdm_t* q, srslte_cp_t cp_type, cf_t* in_buffer, cf_t* out_buffer, uint32_t max_prb);
cf_t *in_buffer,
cf_t *out_buffer,
uint32_t max_prb);
SRSLTE_API int srslte_ofdm_tx_set_prb(srslte_ofdm_t *q, SRSLTE_API int srslte_ofdm_tx_set_prb(srslte_ofdm_t* q, srslte_cp_t cp, uint32_t nof_prb);
srslte_cp_t cp,
uint32_t nof_prb);
SRSLTE_API int srslte_ofdm_rx_set_prb(srslte_ofdm_t *q, SRSLTE_API int srslte_ofdm_rx_set_prb(srslte_ofdm_t* q, srslte_cp_t cp, uint32_t nof_prb);
srslte_cp_t cp,
uint32_t nof_prb);
SRSLTE_API void srslte_ofdm_rx_free(srslte_ofdm_t* q); SRSLTE_API void srslte_ofdm_rx_free(srslte_ofdm_t* q);
SRSLTE_API void srslte_ofdm_rx_slot(srslte_ofdm_t *q, SRSLTE_API void srslte_ofdm_rx_slot(srslte_ofdm_t* q, int slot_in_sf);
int slot_in_sf);
SRSLTE_API void srslte_ofdm_rx_slot_ng(srslte_ofdm_t *q, SRSLTE_API void srslte_ofdm_rx_slot_ng(srslte_ofdm_t* q, cf_t* input, cf_t* output);
cf_t *input,
cf_t *output);
SRSLTE_API void srslte_ofdm_rx_sf(srslte_ofdm_t* q); SRSLTE_API void srslte_ofdm_rx_sf(srslte_ofdm_t* q);
SRSLTE_API void srslte_ofdm_rx_sf_ng(srslte_ofdm_t *q, SRSLTE_API void srslte_ofdm_rx_sf_ng(srslte_ofdm_t* q, cf_t* input, cf_t* output);
cf_t *input,
cf_t *output);
SRSLTE_API int srslte_ofdm_tx_init(srslte_ofdm_t *q, SRSLTE_API int
srslte_cp_t cp_type, srslte_ofdm_tx_init(srslte_ofdm_t* q, srslte_cp_t cp_type, cf_t* in_buffer, cf_t* out_buffer, uint32_t nof_prb);
cf_t *in_buffer,
cf_t *out_buffer,
uint32_t nof_prb);
SRSLTE_API int srslte_ofdm_tx_init_mbsfn(srslte_ofdm_t *q,
srslte_cp_t cp,
cf_t *in_buffer,
cf_t *out_buffer,
uint32_t nof_prb);
SRSLTE_API int
srslte_ofdm_tx_init_mbsfn(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* out_buffer, uint32_t nof_prb);
SRSLTE_API void srslte_ofdm_tx_free(srslte_ofdm_t* q); SRSLTE_API void srslte_ofdm_tx_free(srslte_ofdm_t* q);
SRSLTE_API void srslte_ofdm_tx_slot(srslte_ofdm_t *q, SRSLTE_API void srslte_ofdm_tx_slot(srslte_ofdm_t* q, int slot_in_sf);
int slot_in_sf);
SRSLTE_API void srslte_ofdm_tx_slot_mbsfn(srslte_ofdm_t *q,
cf_t *input,
cf_t *output);
SRSLTE_API void srslte_ofdm_tx_slot_mbsfn(srslte_ofdm_t* q, cf_t* input, cf_t* output);
SRSLTE_API void srslte_ofdm_tx_sf(srslte_ofdm_t* q); SRSLTE_API void srslte_ofdm_tx_sf(srslte_ofdm_t* q);
SRSLTE_API int srslte_ofdm_set_freq_shift(srslte_ofdm_t *q, SRSLTE_API int srslte_ofdm_set_freq_shift(srslte_ofdm_t* q, float freq_shift);
float freq_shift);
SRSLTE_API void srslte_ofdm_set_normalize(srslte_ofdm_t *q,
bool normalize_enable);
SRSLTE_API void srslte_ofdm_set_non_mbsfn_region(srslte_ofdm_t *q, SRSLTE_API void srslte_ofdm_set_normalize(srslte_ofdm_t* q, bool normalize_enable);
uint8_t non_mbsfn_region);
SRSLTE_API void srslte_ofdm_set_non_mbsfn_region(srslte_ofdm_t* q, uint8_t non_mbsfn_region);
#endif // SRSLTE_OFDM_H #endif // SRSLTE_OFDM_H

@ -54,8 +54,8 @@
#include "srslte/phy/enb/enb_ul.h" #include "srslte/phy/enb/enb_ul.h"
#include "srslte/phy/ue/ue_dl.h" #include "srslte/phy/ue/ue_dl.h"
#include "srslte/phy/utils/vector.h"
#include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/debug.h"
#include "srslte/phy/utils/vector.h"
#include "srslte/config.h" #include "srslte/config.h"
@ -93,14 +93,11 @@ typedef struct {
} srslte_enb_dl_phich_t; } srslte_enb_dl_phich_t;
/* This function shall be called just after the initial synchronization */ /* This function shall be called just after the initial synchronization */
SRSLTE_API int srslte_enb_dl_init(srslte_enb_dl_t *q, SRSLTE_API int srslte_enb_dl_init(srslte_enb_dl_t* q, cf_t* out_buffer[SRSLTE_MAX_PORTS], uint32_t max_prb);
cf_t *out_buffer[SRSLTE_MAX_PORTS],
uint32_t max_prb);
SRSLTE_API void srslte_enb_dl_free(srslte_enb_dl_t* q); SRSLTE_API void srslte_enb_dl_free(srslte_enb_dl_t* q);
SRSLTE_API int srslte_enb_dl_set_cell(srslte_enb_dl_t *q, SRSLTE_API int srslte_enb_dl_set_cell(srslte_enb_dl_t* q, srslte_cell_t cell);
srslte_cell_t cell);
SRSLTE_API int srslte_enb_dl_add_rnti(srslte_enb_dl_t* q, uint16_t rnti); SRSLTE_API int srslte_enb_dl_add_rnti(srslte_enb_dl_t* q, uint16_t rnti);
@ -121,8 +118,11 @@ SRSLTE_API int srslte_enb_dl_put_pmch(srslte_enb_dl_t* q, srslte_pmch_cfg_t* pmc
SRSLTE_API void srslte_enb_dl_gen_signal(srslte_enb_dl_t* q); SRSLTE_API void srslte_enb_dl_gen_signal(srslte_enb_dl_t* q);
SRSLTE_API bool srslte_enb_dl_gen_cqi_periodic( SRSLTE_API bool srslte_enb_dl_gen_cqi_periodic(srslte_cell_t* cell,
srslte_cell_t* cell, srslte_dl_cfg_t* dl_cfg, uint32_t tti, uint32_t ri, srslte_cqi_cfg_t* cqi_cfg); srslte_dl_cfg_t* dl_cfg,
uint32_t tti,
uint32_t ri,
srslte_cqi_cfg_t* cqi_cfg);
SRSLTE_API bool SRSLTE_API bool
srslte_enb_dl_gen_cqi_aperiodic(srslte_cell_t* cell, srslte_dl_cfg_t* dl_cfg, uint32_t ri, srslte_cqi_cfg_t* cqi_cfg); srslte_enb_dl_gen_cqi_aperiodic(srslte_cell_t* cell, srslte_dl_cfg_t* dl_cfg, uint32_t ri, srslte_cqi_cfg_t* cqi_cfg);

@ -44,8 +44,8 @@
#include "srslte/phy/phch/pusch_cfg.h" #include "srslte/phy/phch/pusch_cfg.h"
#include "srslte/phy/phch/ra.h" #include "srslte/phy/phch/ra.h"
#include "srslte/phy/utils/vector.h"
#include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/debug.h"
#include "srslte/phy/utils/vector.h"
#include "srslte/config.h" #include "srslte/config.h"
@ -63,20 +63,16 @@ typedef struct SRSLTE_API {
} srslte_enb_ul_t; } srslte_enb_ul_t;
/* This function shall be called just after the initial synchronization */ /* This function shall be called just after the initial synchronization */
SRSLTE_API int srslte_enb_ul_init(srslte_enb_ul_t *q, SRSLTE_API int srslte_enb_ul_init(srslte_enb_ul_t* q, cf_t* in_buffer, uint32_t max_prb);
cf_t *in_buffer,
uint32_t max_prb);
SRSLTE_API void srslte_enb_ul_free(srslte_enb_ul_t* q); SRSLTE_API void srslte_enb_ul_free(srslte_enb_ul_t* q);
SRSLTE_API int SRSLTE_API int
srslte_enb_ul_set_cell(srslte_enb_ul_t* q, srslte_cell_t cell, srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg); srslte_enb_ul_set_cell(srslte_enb_ul_t* q, srslte_cell_t cell, srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg);
SRSLTE_API int srslte_enb_ul_add_rnti(srslte_enb_ul_t *q, SRSLTE_API int srslte_enb_ul_add_rnti(srslte_enb_ul_t* q, uint16_t rnti);
uint16_t rnti);
SRSLTE_API void srslte_enb_ul_rem_rnti(srslte_enb_ul_t *q, SRSLTE_API void srslte_enb_ul_rem_rnti(srslte_enb_ul_t* q, uint16_t rnti);
uint16_t rnti);
SRSLTE_API void srslte_enb_ul_fft(srslte_enb_ul_t* q); SRSLTE_API void srslte_enb_ul_fft(srslte_enb_ul_t* q);

@ -19,8 +19,8 @@
* *
*/ */
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include "srslte/config.h" #include "srslte/config.h"
@ -29,7 +29,6 @@
#define SRSLTE_NOF_TC_CB_SIZES 188 #define SRSLTE_NOF_TC_CB_SIZES 188
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
uint32_t F; uint32_t F;
uint32_t C; uint32_t C;
@ -42,8 +41,7 @@
uint32_t tbs; uint32_t tbs;
} srslte_cbsegm_t; } srslte_cbsegm_t;
SRSLTE_API int srslte_cbsegm(srslte_cbsegm_t *s, SRSLTE_API int srslte_cbsegm(srslte_cbsegm_t* s, uint32_t tbs);
uint32_t tbs);
SRSLTE_API int srslte_cbsegm_cbsize(uint32_t index); SRSLTE_API int srslte_cbsegm_cbsize(uint32_t index);

@ -32,8 +32,8 @@
#ifndef SRSLTE_CONVCODER_H #ifndef SRSLTE_CONVCODER_H
#define SRSLTE_CONVCODER_H #define SRSLTE_CONVCODER_H
#include <stdbool.h>
#include "srslte/config.h" #include "srslte/config.h"
#include <stdbool.h>
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
uint32_t R; uint32_t R;
@ -42,10 +42,6 @@ typedef struct SRSLTE_API {
bool tail_biting; bool tail_biting;
} srslte_convcoder_t; } srslte_convcoder_t;
SRSLTE_API int srslte_convcoder_encode(srslte_convcoder_t *q, SRSLTE_API int srslte_convcoder_encode(srslte_convcoder_t* q, uint8_t* input, uint8_t* output, uint32_t frame_length);
uint8_t *input,
uint8_t *output,
uint32_t frame_length);
#endif // SRSLTE_CONVCODER_H #endif // SRSLTE_CONVCODER_H

@ -45,22 +45,16 @@ typedef struct SRSLTE_API {
uint32_t srslte_crc_out; uint32_t srslte_crc_out;
} srslte_crc_t; } srslte_crc_t;
SRSLTE_API int srslte_crc_init(srslte_crc_t *h, SRSLTE_API int srslte_crc_init(srslte_crc_t* h, uint32_t srslte_crc_poly, int srslte_crc_order);
uint32_t srslte_crc_poly,
int srslte_crc_order);
SRSLTE_API int srslte_crc_set_init(srslte_crc_t *h, SRSLTE_API int srslte_crc_set_init(srslte_crc_t* h, uint64_t init_value);
uint64_t init_value);
SRSLTE_API uint32_t srslte_crc_attach(srslte_crc_t *h, SRSLTE_API uint32_t srslte_crc_attach(srslte_crc_t* h, uint8_t* data, int len);
uint8_t *data,
int len);
SRSLTE_API uint32_t srslte_crc_attach_byte(srslte_crc_t *h, SRSLTE_API uint32_t srslte_crc_attach_byte(srslte_crc_t* h, uint8_t* data, int len);
uint8_t *data,
int len);
static inline void srslte_crc_checksum_put_byte(srslte_crc_t *h, uint8_t byte) { static inline void srslte_crc_checksum_put_byte(srslte_crc_t* h, uint8_t byte)
{
// Polynom order 8, 16, 24 or 32 only. // Polynom order 8, 16, 24 or 32 only.
int ord = h->order - 8; int ord = h->order - 8;
@ -70,16 +64,13 @@ static inline void srslte_crc_checksum_put_byte(srslte_crc_t *h, uint8_t byte) {
h->crcinit = crc; h->crcinit = crc;
} }
static inline uint64_t srslte_crc_checksum_get(srslte_crc_t *h) { static inline uint64_t srslte_crc_checksum_get(srslte_crc_t* h)
{
return (h->crcinit & h->crcmask); return (h->crcinit & h->crcmask);
} }
SRSLTE_API uint32_t srslte_crc_checksum_byte(srslte_crc_t *h, SRSLTE_API uint32_t srslte_crc_checksum_byte(srslte_crc_t* h, uint8_t* data, int len);
uint8_t *data,
int len);
SRSLTE_API uint32_t srslte_crc_checksum(srslte_crc_t *h, SRSLTE_API uint32_t srslte_crc_checksum(srslte_crc_t* h, uint8_t* data, int len);
uint8_t *data,
int len);
#endif // SRSLTE_CRC_H #endif // SRSLTE_CRC_H

@ -40,22 +40,12 @@
#ifndef SRSLTE_TX_NULL #ifndef SRSLTE_TX_NULL
#define SRSLTE_TX_NULL 100 #define SRSLTE_TX_NULL 100
#endif #endif
SRSLTE_API int srslte_rm_conv_tx(uint8_t *input, SRSLTE_API int srslte_rm_conv_tx(uint8_t* input, uint32_t in_len, uint8_t* output, uint32_t out_len);
uint32_t in_len,
uint8_t *output,
uint32_t out_len);
SRSLTE_API int srslte_rm_conv_rx(float *input,
uint32_t in_len,
float *output,
uint32_t out_len);
SRSLTE_API int srslte_rm_conv_rx(float* input, uint32_t in_len, float* output, uint32_t out_len);
/************* FIX THIS. MOVE ALL PROCESSING TO INT16 AND HAVE ONLY 1 IMPLEMENTATION ******/ /************* FIX THIS. MOVE ALL PROCESSING TO INT16 AND HAVE ONLY 1 IMPLEMENTATION ******/
SRSLTE_API int srslte_rm_conv_rx_s(int16_t *input, SRSLTE_API int srslte_rm_conv_rx_s(int16_t* input, uint32_t in_len, int16_t* output, uint32_t out_len);
uint32_t in_len,
int16_t *output,
uint32_t out_len);
#endif // SRSLTE_RM_CONV_H #endif // SRSLTE_RM_CONV_H

@ -73,11 +73,8 @@ SRSLTE_API int srslte_rm_turbo_rx(float *w_buff,
uint32_t rv_idx, uint32_t rv_idx,
uint32_t nof_filler_bits); uint32_t nof_filler_bits);
SRSLTE_API int srslte_rm_turbo_rx_lut(int16_t *input, SRSLTE_API int
int16_t *output, srslte_rm_turbo_rx_lut(int16_t* input, int16_t* output, uint32_t in_len, uint32_t cb_idx, uint32_t rv_idx);
uint32_t in_len,
uint32_t cb_idx,
uint32_t rv_idx);
SRSLTE_API int srslte_rm_turbo_rx_lut_(int16_t* input, SRSLTE_API int srslte_rm_turbo_rx_lut_(int16_t* input,
int16_t* output, int16_t* output,
@ -86,10 +83,7 @@ SRSLTE_API int srslte_rm_turbo_rx_lut_(int16_t *input,
uint32_t rv_idx, uint32_t rv_idx,
bool enable_input_tdec); bool enable_input_tdec);
SRSLTE_API int srslte_rm_turbo_rx_lut_8bit(int8_t *input, SRSLTE_API int
int8_t *output, srslte_rm_turbo_rx_lut_8bit(int8_t* input, int8_t* output, uint32_t in_len, uint32_t cb_idx, uint32_t rv_idx);
uint32_t in_len,
uint32_t cb_idx,
uint32_t rv_idx);
#endif // SRSLTE_RM_TURBO_H #endif // SRSLTE_RM_TURBO_H

@ -49,32 +49,24 @@ typedef struct SRSLTE_API {
#define SOFTBUFFER_SIZE 18600 #define SOFTBUFFER_SIZE 18600
SRSLTE_API int srslte_softbuffer_rx_init(srslte_softbuffer_rx_t * q, SRSLTE_API int srslte_softbuffer_rx_init(srslte_softbuffer_rx_t* q, uint32_t nof_prb);
uint32_t nof_prb);
SRSLTE_API void srslte_softbuffer_rx_reset(srslte_softbuffer_rx_t* p); SRSLTE_API void srslte_softbuffer_rx_reset(srslte_softbuffer_rx_t* p);
SRSLTE_API void srslte_softbuffer_rx_reset_tbs(srslte_softbuffer_rx_t *q, SRSLTE_API void srslte_softbuffer_rx_reset_tbs(srslte_softbuffer_rx_t* q, uint32_t tbs);
uint32_t tbs);
SRSLTE_API void srslte_softbuffer_rx_reset_cb(srslte_softbuffer_rx_t *q, SRSLTE_API void srslte_softbuffer_rx_reset_cb(srslte_softbuffer_rx_t* q, uint32_t nof_cb);
uint32_t nof_cb);
SRSLTE_API void srslte_softbuffer_rx_free(srslte_softbuffer_rx_t* p); SRSLTE_API void srslte_softbuffer_rx_free(srslte_softbuffer_rx_t* p);
SRSLTE_API int srslte_softbuffer_tx_init(srslte_softbuffer_tx_t * q, SRSLTE_API int srslte_softbuffer_tx_init(srslte_softbuffer_tx_t* q, uint32_t nof_prb);
uint32_t nof_prb);
SRSLTE_API void srslte_softbuffer_tx_reset(srslte_softbuffer_tx_t* p); SRSLTE_API void srslte_softbuffer_tx_reset(srslte_softbuffer_tx_t* p);
SRSLTE_API void srslte_softbuffer_tx_reset_tbs(srslte_softbuffer_tx_t *q, SRSLTE_API void srslte_softbuffer_tx_reset_tbs(srslte_softbuffer_tx_t* q, uint32_t tbs);
uint32_t tbs);
SRSLTE_API void srslte_softbuffer_tx_reset_cb(srslte_softbuffer_tx_t *q, SRSLTE_API void srslte_softbuffer_tx_reset_cb(srslte_softbuffer_tx_t* q, uint32_t nof_cb);
uint32_t nof_cb);
SRSLTE_API void srslte_softbuffer_tx_free(srslte_softbuffer_tx_t* p); SRSLTE_API void srslte_softbuffer_tx_free(srslte_softbuffer_tx_t* p);
#endif // SRSLTE_SOFTBUFFER_H #endif // SRSLTE_SOFTBUFFER_H

@ -39,15 +39,11 @@ typedef struct SRSLTE_API {
uint32_t max_long_cb; uint32_t max_long_cb;
} srslte_tc_interl_t; } srslte_tc_interl_t;
SRSLTE_API int srslte_tc_interl_LTE_gen(srslte_tc_interl_t *h, SRSLTE_API int srslte_tc_interl_LTE_gen(srslte_tc_interl_t* h, uint32_t long_cb);
uint32_t long_cb);
SRSLTE_API int srslte_tc_interl_LTE_gen_interl(srslte_tc_interl_t *h, SRSLTE_API int srslte_tc_interl_LTE_gen_interl(srslte_tc_interl_t* h, uint32_t long_cb, uint32_t interl_win);
uint32_t long_cb,
uint32_t interl_win);
SRSLTE_API int srslte_tc_interl_init(srslte_tc_interl_t *h, SRSLTE_API int srslte_tc_interl_init(srslte_tc_interl_t* h, uint32_t max_long_cb);
uint32_t max_long_cb);
SRSLTE_API void srslte_tc_interl_free(srslte_tc_interl_t* h); SRSLTE_API void srslte_tc_interl_free(srslte_tc_interl_t* h);

@ -34,8 +34,8 @@
#define SRSLTE_TURBOCODER_H #define SRSLTE_TURBOCODER_H
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/fec/tc_interl.h"
#include "srslte/phy/fec/crc.h" #include "srslte/phy/fec/crc.h"
#include "srslte/phy/fec/tc_interl.h"
#define SRSLTE_TCOD_MAX_LEN_CB_BYTES (6144 / 8) #define SRSLTE_TCOD_MAX_LEN_CB_BYTES (6144 / 8)
@ -48,21 +48,16 @@ typedef struct SRSLTE_API {
uint8_t* temp; uint8_t* temp;
} srslte_tcod_t; } srslte_tcod_t;
/* This structure is used as an output for the LUT version of the encoder. /* This structure is used as an output for the LUT version of the encoder.
* The encoder produces parity bits only and rate matching will interleave them * The encoder produces parity bits only and rate matching will interleave them
* with the systematic bits * with the systematic bits
*/ */
SRSLTE_API int srslte_tcod_init(srslte_tcod_t *h, SRSLTE_API int srslte_tcod_init(srslte_tcod_t* h, uint32_t max_long_cb);
uint32_t max_long_cb);
SRSLTE_API void srslte_tcod_free(srslte_tcod_t* h); SRSLTE_API void srslte_tcod_free(srslte_tcod_t* h);
SRSLTE_API int srslte_tcod_encode(srslte_tcod_t *h, SRSLTE_API int srslte_tcod_encode(srslte_tcod_t* h, uint8_t* input, uint8_t* output, uint32_t long_cb);
uint8_t *input,
uint8_t *output,
uint32_t long_cb);
SRSLTE_API int srslte_tcod_encode_lut(srslte_tcod_t* h, SRSLTE_API int srslte_tcod_encode_lut(srslte_tcod_t* h,
srslte_crc_t* crc_tb, srslte_crc_t* crc_tb,
@ -75,4 +70,3 @@ SRSLTE_API int srslte_tcod_encode_lut(srslte_tcod_t *h,
SRSLTE_API void srslte_tcod_gentable(); SRSLTE_API void srslte_tcod_gentable();
#endif // SRSLTE_TURBOCODER_H #endif // SRSLTE_TURBOCODER_H

@ -35,8 +35,8 @@
#define SRSLTE_TURBODECODER_H #define SRSLTE_TURBODECODER_H
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/fec/tc_interl.h"
#include "srslte/phy/fec/cbsegm.h" #include "srslte/phy/fec/cbsegm.h"
#include "srslte/phy/fec/tc_interl.h"
#define SRSLTE_TCOD_RATE 3 #define SRSLTE_TCOD_RATE 3
#define SRSLTE_TCOD_TOTALTAIL 12 #define SRSLTE_TCOD_TOTALTAIL 12
@ -94,19 +94,15 @@ typedef struct SRSLTE_API {
int n_iter; int n_iter;
} srslte_tdec_t; } srslte_tdec_t;
SRSLTE_API int srslte_tdec_init(srslte_tdec_t * h, SRSLTE_API int srslte_tdec_init(srslte_tdec_t* h, uint32_t max_long_cb);
uint32_t max_long_cb);
SRSLTE_API int srslte_tdec_init_manual(srslte_tdec_t * h, SRSLTE_API int srslte_tdec_init_manual(srslte_tdec_t* h, uint32_t max_long_cb, srslte_tdec_impl_type_t dec_type);
uint32_t max_long_cb,
srslte_tdec_impl_type_t dec_type);
SRSLTE_API void srslte_tdec_free(srslte_tdec_t* h); SRSLTE_API void srslte_tdec_free(srslte_tdec_t* h);
SRSLTE_API void srslte_tdec_force_not_sb(srslte_tdec_t* h); SRSLTE_API void srslte_tdec_force_not_sb(srslte_tdec_t* h);
SRSLTE_API int srslte_tdec_new_cb(srslte_tdec_t * h, SRSLTE_API int srslte_tdec_new_cb(srslte_tdec_t* h, uint32_t long_cb);
uint32_t long_cb);
SRSLTE_API int srslte_tdec_get_nof_iterations(srslte_tdec_t* h); SRSLTE_API int srslte_tdec_get_nof_iterations(srslte_tdec_t* h);
@ -114,25 +110,14 @@ SRSLTE_API uint32_t srslte_tdec_autoimp_get_subblocks(uint32_t long_cb);
SRSLTE_API uint32_t srslte_tdec_autoimp_get_subblocks_8bit(uint32_t long_cb); SRSLTE_API uint32_t srslte_tdec_autoimp_get_subblocks_8bit(uint32_t long_cb);
SRSLTE_API void srslte_tdec_iteration(srslte_tdec_t * h, SRSLTE_API void srslte_tdec_iteration(srslte_tdec_t* h, int16_t* input, uint8_t* output);
int16_t* input,
uint8_t *output);
SRSLTE_API int srslte_tdec_run_all(srslte_tdec_t * h,
int16_t * input,
uint8_t *output,
uint32_t nof_iterations,
uint32_t long_cb);
SRSLTE_API void srslte_tdec_iteration_8bit(srslte_tdec_t * h, SRSLTE_API int
int8_t* input, srslte_tdec_run_all(srslte_tdec_t* h, int16_t* input, uint8_t* output, uint32_t nof_iterations, uint32_t long_cb);
uint8_t *output);
SRSLTE_API int srslte_tdec_run_all_8bit(srslte_tdec_t * h, SRSLTE_API void srslte_tdec_iteration_8bit(srslte_tdec_t* h, int8_t* input, uint8_t* output);
int8_t * input,
uint8_t *output,
uint32_t nof_iterations,
uint32_t long_cb);
SRSLTE_API int
srslte_tdec_run_all_8bit(srslte_tdec_t* h, int8_t* input, uint8_t* output, uint32_t nof_iterations, uint32_t long_cb);
#endif // SRSLTE_TURBODECODER_H #endif // SRSLTE_TURBODECODER_H

@ -35,8 +35,8 @@
#define SRSLTE_TURBODECODER_GEN_H #define SRSLTE_TURBODECODER_GEN_H
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/fec/tc_interl.h"
#include "srslte/phy/fec/cbsegm.h" #include "srslte/phy/fec/cbsegm.h"
#include "srslte/phy/fec/tc_interl.h"
#define SRSLTE_TCOD_RATE 3 #define SRSLTE_TCOD_RATE 3
#define SRSLTE_TCOD_TOTALTAIL 12 #define SRSLTE_TCOD_TOTALTAIL 12
@ -51,7 +51,12 @@ typedef struct SRSLTE_API {
int tdec_gen_init(void** h, uint32_t max_long_cb); int tdec_gen_init(void** h, uint32_t max_long_cb);
void tdec_gen_free(void* h); void tdec_gen_free(void* h);
void tdec_gen_dec(void* h, int16_t* input, int16_t* app, int16_t* parity, int16_t* output, uint32_t long_cb); void tdec_gen_dec(void* h, int16_t* input, int16_t* app, int16_t* parity, int16_t* output, uint32_t long_cb);
void tdec_gen_extract_input(int16_t *input, int16_t *syst, int16_t *parity0, int16_t *parity1, int16_t *app2, uint32_t long_cb); void tdec_gen_extract_input(int16_t* input,
int16_t* syst,
int16_t* parity0,
int16_t* parity1,
int16_t* app2,
uint32_t long_cb);
void tdec_gen_decision_byte(int16_t* app1, uint8_t* output, uint32_t long_cb); void tdec_gen_decision_byte(int16_t* app1, uint8_t* output, uint32_t long_cb);
#endif // SRSLTE_TURBODECODER_GEN_H #endif // SRSLTE_TURBODECODER_GEN_H

@ -51,7 +51,6 @@ typedef enum SRSLTE_API {
#endif #endif
#endif #endif
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
int (*tdec_init)(void** h, uint32_t max_long_cb); int (*tdec_init)(void** h, uint32_t max_long_cb);
void (*tdec_free)(void* h); void (*tdec_free)(void* h);

@ -50,10 +50,14 @@
#define debug_enabled_iter 0 #define debug_enabled_iter 0
#define debug_len 20 #define debug_len 20
#define debug_vec(a) if (debug_enabled_iter) {printf("%s it=%d: ", STRING(a), n_iter);PRINT(stdout, a, debug_len);} #define debug_vec(a) \
if (debug_enabled_iter) { \
printf("%s it=%d: ", STRING(a), n_iter); \
PRINT(stdout, a, debug_len); \
}
static void MAKE_CALL(extract_input_tail_sb)(llr_t *input, llr_t *syst, llr_t *app2, llr_t *parity0, llr_t *parity1, uint32_t long_cb) static void MAKE_CALL(
extract_input_tail_sb)(llr_t* input, llr_t* syst, llr_t* app2, llr_t* parity0, llr_t* parity1, uint32_t long_cb)
{ {
for (int i = long_cb; i < long_cb + 3; i++) { for (int i = long_cb; i < long_cb + 3; i++) {
syst[i] = input[3 * (long_cb + 32) + 2 * (i - long_cb)]; syst[i] = input[3 * (long_cb + 32) + 2 * (i - long_cb)];
@ -106,7 +110,6 @@ void MAKE_CALL(run_tdec_iteration)(srslte_tdec_t * h, llr_t * input)
// Run MAP DEC #1 // Run MAP DEC #1
decptr->tdec_dec(dechdlr, syst, n_iter ? app1 : NULL, parity0, ext1, long_cb); decptr->tdec_dec(dechdlr, syst, n_iter ? app1 : NULL, parity0, ext1, long_cb);
} }
// Interleave extrinsic output of DEC1 to form apriori info for decoder 2 // Interleave extrinsic output of DEC1 to form apriori info for decoder 2
if (n_iter % 2) { if (n_iter % 2) {
@ -122,7 +125,6 @@ void MAKE_CALL(run_tdec_iteration)(srslte_tdec_t * h, llr_t * input)
// Deinterleaved extrinsic bits become apriori info for decoder 1 // Deinterleaved extrinsic bits become apriori info for decoder 1
MAKE_VEC(srslte_vec_lut)(ext2, inter, app1, long_cb); MAKE_VEC(srslte_vec_lut)(ext2, inter, app1, long_cb);
} }
if (h->n_iter == 0) { if (h->n_iter == 0) {

@ -32,9 +32,13 @@ typedef struct SRSLTE_API {
int tdec_sse_init(void** h, uint32_t max_long_cb); int tdec_sse_init(void** h, uint32_t max_long_cb);
void tdec_sse_free(void* h); void tdec_sse_free(void* h);
void tdec_sse_dec(void *h, int16_t * input, int16_t *app, int16_t * parity, void tdec_sse_dec(void* h, int16_t* input, int16_t* app, int16_t* parity, int16_t* output, uint32_t long_cb);
int16_t *output, uint32_t long_cb); void tdec_sse_extract_input(int16_t* input,
void tdec_sse_extract_input(int16_t *input, int16_t *syst, int16_t *parity0, int16_t *parity1, int16_t *app2, uint32_t long_cb); int16_t* syst,
int16_t* parity0,
int16_t* parity1,
int16_t* app2,
uint32_t long_cb);
void tdec_sse_decision_byte(int16_t* app1, uint8_t* output, uint32_t long_cb); void tdec_sse_decision_byte(int16_t* app1, uint8_t* output, uint32_t long_cb);
#endif // SRSLTE_TURBODECODER_SSE_H #endif // SRSLTE_TURBODECODER_SSE_H

@ -80,8 +80,72 @@
#define simd_set1 _mm256_set1_epi16 #define simd_set1 _mm256_set1_epi16
#define simd_insert _mm256_insert_epi16 #define simd_insert _mm256_insert_epi16
#define simd_shuffle _mm256_shuffle_epi8 #define simd_shuffle _mm256_shuffle_epi8
#define move_right _mm256_set_epi8(31,30,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2) #define move_right \
#define move_left _mm256_set_epi8(29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,1,0) _mm256_set_epi8(31, \
30, \
31, \
30, \
29, \
28, \
27, \
26, \
25, \
24, \
23, \
22, \
21, \
20, \
19, \
18, \
17, \
16, \
15, \
14, \
13, \
12, \
11, \
10, \
9, \
8, \
7, \
6, \
5, \
4, \
3, \
2)
#define move_left \
_mm256_set_epi8(29, \
28, \
27, \
26, \
25, \
24, \
23, \
22, \
21, \
20, \
19, \
18, \
17, \
16, \
15, \
14, \
13, \
12, \
11, \
10, \
9, \
8, \
7, \
6, \
5, \
4, \
3, \
2, \
1, \
0, \
1, \
0)
#define normalize_period 2 #define normalize_period 2
#define win_overlap_len 40 #define win_overlap_len 40
@ -123,13 +187,13 @@
#define INF 0 #define INF 0
inline static simd_type_t simd_rb_shift_128(simd_type_t v, const int l) { inline static simd_type_t simd_rb_shift_128(simd_type_t v, const int l)
{
__m128i low = _mm_srai_epi16(_mm_slli_epi16(v, 8), l + 8); __m128i low = _mm_srai_epi16(_mm_slli_epi16(v, 8), l + 8);
__m128i hi = _mm_srai_epi16(v, l); __m128i hi = _mm_srai_epi16(v, l);
return _mm_blendv_epi8(hi, low, _mm_set1_epi32(0x00FF00FF)); return _mm_blendv_epi8(hi, low, _mm_set1_epi32(0x00FF00FF));
} }
#else #else
#ifdef WINIMP_IS_AVX8 #ifdef WINIMP_IS_AVX8
@ -154,8 +218,72 @@
#define simd_set1 _mm256_set1_epi8 #define simd_set1 _mm256_set1_epi8
#define simd_insert _mm256_insert_epi8 #define simd_insert _mm256_insert_epi8
#define simd_shuffle _mm256_shuffle_epi8 #define simd_shuffle _mm256_shuffle_epi8
#define move_right _mm256_set_epi8(31,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1) #define move_right \
#define move_left _mm256_set_epi8(30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,0) _mm256_set_epi8(31, \
31, \
30, \
29, \
28, \
27, \
26, \
25, \
24, \
23, \
22, \
21, \
20, \
19, \
18, \
17, \
16, \
15, \
14, \
13, \
12, \
11, \
10, \
9, \
8, \
7, \
6, \
5, \
4, \
3, \
2, \
1)
#define move_left \
_mm256_set_epi8(30, \
29, \
28, \
27, \
26, \
25, \
24, \
23, \
22, \
21, \
20, \
19, \
18, \
17, \
16, \
15, \
14, \
13, \
12, \
11, \
10, \
9, \
8, \
7, \
6, \
5, \
4, \
3, \
2, \
1, \
0, \
0)
#define simd_rb_shift simd_rb_shift_256 #define simd_rb_shift simd_rb_shift_256
#define INF 0 #define INF 0
@ -166,13 +294,13 @@
#define use_saturated_add #define use_saturated_add
#define divide_output 1 #define divide_output 1
inline static simd_type_t simd_rb_shift_256(simd_type_t v, const int l) { inline static simd_type_t simd_rb_shift_256(simd_type_t v, const int l)
{
__m256i low = _mm256_srai_epi16(_mm256_slli_epi16(v, 8), l + 8); __m256i low = _mm256_srai_epi16(_mm256_slli_epi16(v, 8), l + 8);
__m256i hi = _mm256_srai_epi16(v, l); __m256i hi = _mm256_srai_epi16(v, l);
return _mm256_blendv_epi8(hi, low, _mm256_set1_epi32(0x00FF00FF)); return _mm256_blendv_epi8(hi, low, _mm256_set1_epi32(0x00FF00FF));
} }
#else #else
#ifdef WINIMP_IS_NEON16 #ifdef WINIMP_IS_NEON16
#include <arm_neon.h> #include <arm_neon.h>
@ -182,16 +310,12 @@
#define llr_t int16_t #define llr_t int16_t
#define v_insert_s16(a, b, imm) ({ (vsetq_lane_s16((b), (a), (imm))); })
#define v_insert_s16(a, b, imm) \
({ \
(vsetq_lane_s16((b), (a), (imm))); \
})
#define int8x16_to_8x8x2(v) ((int8x8x2_t){{vget_low_s8(v), vget_high_s8(v)}}) // TODO #define int8x16_to_8x8x2(v) ((int8x8x2_t){{vget_low_s8(v), vget_high_s8(v)}}) // TODO
static inline int movemask_neon(uint8x16_t movemask_low_in) { static inline int movemask_neon(uint8x16_t movemask_low_in)
{
uint8x8_t mask_and = vdup_n_u8(0x80); uint8x8_t mask_and = vdup_n_u8(0x80);
int8_t __attribute__((aligned(16))) xr[8]; int8_t __attribute__((aligned(16))) xr[8];
@ -232,18 +356,33 @@ static inline int movemask_neon(uint8x16_t movemask_low_in) {
return (int16x8_t)(vcombine_s8(vqmovn_s16((a)), vqmovn_s16((b)))); return (int16x8_t)(vcombine_s8(vqmovn_s16((a)), vqmovn_s16((b))));
} }
inline static int16x8_t v_srai_s16(const int16x8_t a, const int count)
inline static int16x8_t v_srai_s16(const int16x8_t a, const int count) { {
int16x8_t b = vmovq_n_s16(-count); int16x8_t b = vmovq_n_s16(-count);
return vshlq_s16(a, b); return vshlq_s16(a, b);
} }
inline static uint8x16_t v_load_s8(int i15, int i14, int i13, int i12, int i11, int i10, int i9, int i8, int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) inline static uint8x16_t v_load_s8(int i15,
int i14,
int i13,
int i12,
int i11,
int i10,
int i9,
int i8,
int i7,
int i6,
int i5,
int i4,
int i3,
int i2,
int i1,
int i0)
{ {
uint8_t __attribute__((aligned(16))) data[16] = {i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15}; uint8_t __attribute__((aligned(16)))
data[16] = {i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15};
return vld1q_u8(data); return vld1q_u8(data);
} }
#define simd_type_t int16x8_t #define simd_type_t int16x8_t
#define simd_load(x) vld1q_s16((int16_t*)x) #define simd_load(x) vld1q_s16((int16_t*)x)
#define simd_store(x, y) vst1q_s16((int16_t*)x, y) #define simd_store(x, y) vst1q_s16((int16_t*)x, y)
@ -278,33 +417,45 @@ typedef struct SRSLTE_API {
llr_t* beta; llr_t* beta;
} MAKE_TYPE; } MAKE_TYPE;
#define long_sb (long_cb / nof_blocks) #define long_sb (long_cb / nof_blocks)
#define debug_enabled_win 0 #define debug_enabled_win 0
#if debug_enabled_win #if debug_enabled_win
#define debug_state(d) printf("k=%5d, in=%5d, pa=%3d, out=%5d, alpha=[", d*long_sb+k+1, MAKE_FUNC(get_simd)(x,d), MAKE_FUNC(get_simd)(y,d), MAKE_FUNC(get_simd)(out,d)); \ #define debug_state(d) \
for (int j=0;j<8;j++) printf("%5d, ", MAKE_FUNC(get_simd)(old[j],d)); \ printf("k=%5d, in=%5d, pa=%3d, out=%5d, alpha=[", \
d* long_sb + k + 1, \
MAKE_FUNC(get_simd)(x, d), \
MAKE_FUNC(get_simd)(y, d), \
MAKE_FUNC(get_simd)(out, d)); \
for (int j = 0; j < 8; j++) \
printf("%5d, ", MAKE_FUNC(get_simd)(old[j], d)); \
printf("], beta=["); \ printf("], beta=["); \
for (int j=0;j<8;j++) printf("%5d, ", MAKE_FUNC(get_simd)(beta_save[j], d));printf("\n"); for (int j = 0; j < 8; j++) \
printf("%5d, ", MAKE_FUNC(get_simd)(beta_save[j], d)); \
printf("\n");
#define debug_state_pre(d) printf("pre-window k=%5d, in=%5d, pa=%3d, alpha=[", (d+1)*long_sb-loop_len+k+1, MAKE_FUNC(get_simd)(x,d), MAKE_FUNC(get_simd)(y,d)); \ #define debug_state_pre(d) \
for (int j=0;j<8;j++) printf("%5d, ", MAKE_FUNC(get_simd)(old[j],d)); \ printf("pre-window k=%5d, in=%5d, pa=%3d, alpha=[", \
(d + 1) * long_sb - loop_len + k + 1, \
MAKE_FUNC(get_simd)(x, d), \
MAKE_FUNC(get_simd)(y, d)); \
for (int j = 0; j < 8; j++) \
printf("%5d, ", MAKE_FUNC(get_simd)(old[j], d)); \
printf("]\n"); printf("]\n");
#define debug_state_beta(d) printf("k=%5d, in=%5d, pa=%3d, beta=[", d*long_sb+k, MAKE_FUNC(get_simd)(x,d), MAKE_FUNC(get_simd)(y,d)); \ #define debug_state_beta(d) \
for (int j=0;j<8;j++) printf("%5d, ", MAKE_FUNC(get_simd)(old[j],d));\ printf("k=%5d, in=%5d, pa=%3d, beta=[", d* long_sb + k, MAKE_FUNC(get_simd)(x, d), MAKE_FUNC(get_simd)(y, d)); \
for (int j = 0; j < 8; j++) \
printf("%5d, ", MAKE_FUNC(get_simd)(old[j], d)); \
printf("\n"); printf("\n");
static llr_t MAKE_FUNC(get_simd)(simd_type_t x, uint32_t pos) { static llr_t MAKE_FUNC(get_simd)(simd_type_t x, uint32_t pos)
{
llr_t* s = (llr_t*)&x; llr_t* s = (llr_t*)&x;
return s[pos]; return s[pos];
} }
#else #else
#define debug_state(a) #define debug_state(a)
#define debug_state_pre(a) #define debug_state_pre(a)
@ -320,7 +471,8 @@ static void MAKE_FUNC(print_simd)(simd_type_t x) {
printf("]\n"); printf("]\n");
}*/ }*/
inline static llr_t MAKE_FUNC(sadd)(llr_t x, llr_t y) { inline static llr_t MAKE_FUNC(sadd)(llr_t x, llr_t y)
{
#ifndef use_saturated_add #ifndef use_saturated_add
return x + y; return x + y;
#else #else
@ -329,7 +481,8 @@ inline static llr_t MAKE_FUNC(sadd)(llr_t x, llr_t y) {
#endif #endif
} }
inline static void MAKE_FUNC(normalize)(uint32_t k, simd_type_t old[8]) { inline static void MAKE_FUNC(normalize)(uint32_t k, simd_type_t old[8])
{
if ((k % normalize_period) == 0 && k != 0) { if ((k % normalize_period) == 0 && k != 0) {
#ifdef normalize_max #ifdef normalize_max
simd_type_t m = simd_max(old[0], old[1]); simd_type_t m = simd_max(old[0], old[1]);
@ -383,7 +536,11 @@ static void MAKE_FUNC(beta_trellis)(llr_t *input, llr_t *parity, uint32_t long_c
new[7] = old[3]; new[7] = old[3];
#if debug_enabled_win #if debug_enabled_win
printf("trellis: k=%d, in=%d, pa=%d, beta: ", k, x, y); for (int i=0;i<8;i++) {printf("%d,", old[i]);} printf("\n"); printf("trellis: k=%d, in=%d, pa=%d, beta: ", k, x, y);
for (int i = 0; i < 8; i++) {
printf("%d,", old[i]);
}
printf("\n");
#endif #endif
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
@ -714,7 +871,8 @@ void MAKE_FUNC(dec)(void *hh, llr_t *input, llr_t *app, llr_t *parity, llr_t *ou
#endif #endif
} }
#define INSERT8_INPUT(reg, st, off) reg = simd_insert(reg, input[3*(i+(st+0)*long_sb)+off], st+0);\ #define INSERT8_INPUT(reg, st, off) \
reg = simd_insert(reg, input[3 * (i + (st + 0) * long_sb) + off], st + 0); \
reg = simd_insert(reg, input[3 * (i + (st + 1) * long_sb) + off], st + 1); \ reg = simd_insert(reg, input[3 * (i + (st + 1) * long_sb) + off], st + 1); \
reg = simd_insert(reg, input[3 * (i + (st + 2) * long_sb) + off], st + 2); \ reg = simd_insert(reg, input[3 * (i + (st + 2) * long_sb) + off], st + 2); \
reg = simd_insert(reg, input[3 * (i + (st + 3) * long_sb) + off], st + 3); \ reg = simd_insert(reg, input[3 * (i + (st + 3) * long_sb) + off], st + 3); \
@ -723,8 +881,8 @@ void MAKE_FUNC(dec)(void *hh, llr_t *input, llr_t *app, llr_t *parity, llr_t *ou
reg = simd_insert(reg, input[3 * (i + (st + 6) * long_sb) + off], st + 6); \ reg = simd_insert(reg, input[3 * (i + (st + 6) * long_sb) + off], st + 6); \
reg = simd_insert(reg, input[3 * (i + (st + 7) * long_sb) + off], st + 7); reg = simd_insert(reg, input[3 * (i + (st + 7) * long_sb) + off], st + 7);
void MAKE_FUNC(
void MAKE_FUNC(extract_input)(llr_t *input, llr_t *systematic, llr_t *app2, llr_t *parity_0, llr_t *parity_1, uint32_t long_cb) extract_input)(llr_t* input, llr_t* systematic, llr_t* app2, llr_t* parity_0, llr_t* parity_1, uint32_t long_cb)
{ {
simd_type_t* systPtr = (simd_type_t*)systematic; simd_type_t* systPtr = (simd_type_t*)systematic;
simd_type_t* parity0Ptr = (simd_type_t*)parity_0; simd_type_t* parity0Ptr = (simd_type_t*)parity_0;
@ -770,27 +928,27 @@ void MAKE_FUNC(extract_input)(llr_t *input, llr_t *systematic, llr_t *app2, llr_
#define deinter(x, win) ((x % (long_cb / win)) * (win) + x / (long_cb / win)) #define deinter(x, win) ((x % (long_cb / win)) * (win) + x / (long_cb / win))
#define reset_cnt(a,b) if(!((a+1)%b)) { \ #define reset_cnt(a, b) \
if (!((a + 1) % b)) { \
k += b * nof_blocks; \ k += b * nof_blocks; \
if (k >= long_cb) { \ if (k >= long_cb) { \
k -= (long_cb - 1); \ k -= (long_cb - 1); \
} \ } \
} }
#ifdef WINIMP_IS_NEON16 #ifdef WINIMP_IS_NEON16
#define insert_bit(a,b) ap = v_insert_s16(ap, app1[k+(a%b)*nof_blocks], 7-a); \ #define insert_bit(a, b) \
ap = v_insert_s16(ap, app1[k + (a % b) * nof_blocks], 7 - a); \
reset_cnt(a, b); reset_cnt(a, b);
#else #else
#define insert_bit(a,b) ap = _mm_insert_epi16(ap, app1[k+(a%b)*nof_blocks], 7-a); \ #define insert_bit(a, b) \
ap = _mm_insert_epi16(ap, app1[k + (a % b) * nof_blocks], 7 - a); \
reset_cnt(a, b); reset_cnt(a, b);
#endif #endif
#ifndef WINIMP_IS_NEON16 #ifndef WINIMP_IS_NEON16
#define decide_for(b) for (uint32_t i = 0; i < long_cb/8; i++) { \ #define decide_for(b) \
for (uint32_t i = 0; i < long_cb / 8; i++) { \
insert_bit(0, b); \ insert_bit(0, b); \
insert_bit(1, b); \ insert_bit(1, b); \
insert_bit(2, b); \ insert_bit(2, b); \
@ -802,7 +960,8 @@ void MAKE_FUNC(extract_input)(llr_t *input, llr_t *systematic, llr_t *app2, llr_
output[i] = (uint8_t)_mm_movemask_epi8(_mm_cmpgt_epi8(_mm_packs_epi16(ap, zeros), zeros)); \ output[i] = (uint8_t)_mm_movemask_epi8(_mm_cmpgt_epi8(_mm_packs_epi16(ap, zeros), zeros)); \
} }
#else #else
#define decide_for(b) for (uint32_t i = 0; i < long_cb/8; i++) { \ #define decide_for(b) \
for (uint32_t i = 0; i < long_cb / 8; i++) { \
insert_bit(0, b); \ insert_bit(0, b); \
insert_bit(1, b); \ insert_bit(1, b); \
insert_bit(2, b); \ insert_bit(2, b); \
@ -837,7 +996,6 @@ void MAKE_FUNC(decision_byte)(llr_t *app1, uint8_t *output, uint32_t long_cb)
} }
} }
#undef WINIMP #undef WINIMP
#undef nof_blocks #undef nof_blocks
#undef llr_t #undef llr_t

@ -31,17 +31,10 @@
#ifndef SRSLTE_VITERBI_H #ifndef SRSLTE_VITERBI_H
#define SRSLTE_VITERBI_H #define SRSLTE_VITERBI_H
#include <stdbool.h>
#include "srslte/config.h" #include "srslte/config.h"
#include <stdbool.h>
typedef enum { SRSLTE_VITERBI_27 = 0, SRSLTE_VITERBI_29, SRSLTE_VITERBI_37, SRSLTE_VITERBI_39 } srslte_viterbi_type_t;
typedef enum {
SRSLTE_VITERBI_27 = 0,
SRSLTE_VITERBI_29,
SRSLTE_VITERBI_37,
SRSLTE_VITERBI_39
}srslte_viterbi_type_t;
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
void* ptr; void* ptr;
@ -67,32 +60,19 @@ SRSLTE_API int srslte_viterbi_init(srslte_viterbi_t *q,
uint32_t max_frame_length, uint32_t max_frame_length,
bool tail_bitting); bool tail_bitting);
SRSLTE_API void srslte_viterbi_set_gain_quant(srslte_viterbi_t *q, SRSLTE_API void srslte_viterbi_set_gain_quant(srslte_viterbi_t* q, float gain_quant);
float gain_quant);
SRSLTE_API void srslte_viterbi_set_gain_quant_s(srslte_viterbi_t *q, SRSLTE_API void srslte_viterbi_set_gain_quant_s(srslte_viterbi_t* q, int16_t gain_quant);
int16_t gain_quant);
SRSLTE_API void srslte_viterbi_free(srslte_viterbi_t* q); SRSLTE_API void srslte_viterbi_free(srslte_viterbi_t* q);
SRSLTE_API int srslte_viterbi_decode_f(srslte_viterbi_t *q, SRSLTE_API int srslte_viterbi_decode_f(srslte_viterbi_t* q, float* symbols, uint8_t* data, uint32_t frame_length);
float *symbols,
uint8_t *data,
uint32_t frame_length);
SRSLTE_API int srslte_viterbi_decode_s(srslte_viterbi_t *q, SRSLTE_API int srslte_viterbi_decode_s(srslte_viterbi_t* q, int16_t* symbols, uint8_t* data, uint32_t frame_length);
int16_t *symbols,
uint8_t *data,
uint32_t frame_length);
SRSLTE_API int srslte_viterbi_decode_us(srslte_viterbi_t* q, uint16_t* symbols, uint8_t* data, uint32_t frame_length); SRSLTE_API int srslte_viterbi_decode_us(srslte_viterbi_t* q, uint16_t* symbols, uint8_t* data, uint32_t frame_length);
SRSLTE_API int srslte_viterbi_decode_uc(srslte_viterbi_t *q, SRSLTE_API int srslte_viterbi_decode_uc(srslte_viterbi_t* q, uint8_t* symbols, uint8_t* data, uint32_t frame_length);
uint8_t *symbols,
uint8_t *data,
uint32_t frame_length);
SRSLTE_API int srslte_viterbi_init_sse(srslte_viterbi_t* q, SRSLTE_API int srslte_viterbi_init_sse(srslte_viterbi_t* q,
srslte_viterbi_type_t type, srslte_viterbi_type_t type,
@ -112,6 +92,4 @@ SRSLTE_API int srslte_viterbi_init_avx2(srslte_viterbi_t *q,
uint32_t max_frame_length, uint32_t max_frame_length,
bool tail_bitting); bool tail_bitting);
#endif // SRSLTE_VITERBI_H #endif // SRSLTE_VITERBI_H

@ -30,9 +30,8 @@
#ifndef SRSLTE_BINSOURCE_H #ifndef SRSLTE_BINSOURCE_H
#define SRSLTE_BINSOURCE_H #define SRSLTE_BINSOURCE_H
#include <stdint.h>
#include "srslte/config.h" #include "srslte/config.h"
#include <stdint.h>
/* Low-level API */ /* Low-level API */
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
@ -47,20 +46,14 @@ SRSLTE_API void srslte_binsource_init(srslte_binsource_t* q);
SRSLTE_API void srslte_binsource_free(srslte_binsource_t* q); SRSLTE_API void srslte_binsource_free(srslte_binsource_t* q);
SRSLTE_API void srslte_binsource_seed_set(srslte_binsource_t* q, SRSLTE_API void srslte_binsource_seed_set(srslte_binsource_t* q, uint32_t seed);
uint32_t seed);
SRSLTE_API void srslte_binsource_seed_time(srslte_binsource_t* q); SRSLTE_API void srslte_binsource_seed_time(srslte_binsource_t* q);
SRSLTE_API int srslte_binsource_cache_gen(srslte_binsource_t* q, SRSLTE_API int srslte_binsource_cache_gen(srslte_binsource_t* q, int nbits);
int nbits);
SRSLTE_API void srslte_binsource_cache_cpy(srslte_binsource_t* q, SRSLTE_API void srslte_binsource_cache_cpy(srslte_binsource_t* q, uint8_t* bits, int nbits);
uint8_t *bits,
int nbits);
SRSLTE_API int srslte_binsource_generate(srslte_binsource_t* q, SRSLTE_API int srslte_binsource_generate(srslte_binsource_t* q, uint8_t* bits, int nbits);
uint8_t *bits,
int nbits);
#endif // SRSLTE_BINSOURCE_H #endif // SRSLTE_BINSOURCE_H

@ -45,19 +45,12 @@ typedef struct SRSLTE_API {
srslte_datatype_t type; srslte_datatype_t type;
} srslte_filesink_t; } srslte_filesink_t;
SRSLTE_API int srslte_filesink_init(srslte_filesink_t *q, SRSLTE_API int srslte_filesink_init(srslte_filesink_t* q, char* filename, srslte_datatype_t type);
char *filename,
srslte_datatype_t type);
SRSLTE_API void srslte_filesink_free(srslte_filesink_t* q); SRSLTE_API void srslte_filesink_free(srslte_filesink_t* q);
SRSLTE_API int srslte_filesink_write(srslte_filesink_t *q, SRSLTE_API int srslte_filesink_write(srslte_filesink_t* q, void* buffer, int nsamples);
void *buffer,
int nsamples);
SRSLTE_API int srslte_filesink_write_multi(srslte_filesink_t *q, SRSLTE_API int srslte_filesink_write_multi(srslte_filesink_t* q, void** buffer, int nsamples, int nchannels);
void **buffer,
int nsamples,
int nchannels);
#endif // SRSLTE_FILESINK_H #endif // SRSLTE_FILESINK_H

@ -44,22 +44,14 @@ typedef struct SRSLTE_API {
srslte_datatype_t type; srslte_datatype_t type;
} srslte_filesource_t; } srslte_filesource_t;
SRSLTE_API int srslte_filesource_init(srslte_filesource_t *q, SRSLTE_API int srslte_filesource_init(srslte_filesource_t* q, char* filename, srslte_datatype_t type);
char *filename,
srslte_datatype_t type);
SRSLTE_API void srslte_filesource_free(srslte_filesource_t* q); SRSLTE_API void srslte_filesource_free(srslte_filesource_t* q);
SRSLTE_API void srslte_filesource_seek(srslte_filesource_t *q, SRSLTE_API void srslte_filesource_seek(srslte_filesource_t* q, int pos);
int pos);
SRSLTE_API int srslte_filesource_read(srslte_filesource_t *q, SRSLTE_API int srslte_filesource_read(srslte_filesource_t* q, void* buffer, int nsamples);
void *buffer,
int nsamples);
SRSLTE_API int srslte_filesource_read_multi(srslte_filesource_t *q, SRSLTE_API int srslte_filesource_read_multi(srslte_filesource_t* q, void** buffer, int nsamples, int nof_channels);
void **buffer,
int nsamples,
int nof_channels);
#endif // SRSLTE_FILESOURCE_H #endif // SRSLTE_FILESOURCE_H

@ -31,19 +31,16 @@
#ifndef SRSLTE_NETSINK_H #ifndef SRSLTE_NETSINK_H
#define SRSLTE_NETSINK_H #define SRSLTE_NETSINK_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h>
#include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <sys/socket.h>
#include "srslte/config.h" #include "srslte/config.h"
typedef enum { typedef enum { SRSLTE_NETSINK_UDP, SRSLTE_NETSINK_TCP } srslte_netsink_type_t;
SRSLTE_NETSINK_UDP,
SRSLTE_NETSINK_TCP
} srslte_netsink_type_t;
/* Low-level API */ /* Low-level API */
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
@ -53,16 +50,11 @@ typedef struct SRSLTE_API {
struct sockaddr_in servaddr; struct sockaddr_in servaddr;
} srslte_netsink_t; } srslte_netsink_t;
SRSLTE_API int srslte_netsink_init(srslte_netsink_t *q, SRSLTE_API int srslte_netsink_init(srslte_netsink_t* q, const char* address, uint16_t port, srslte_netsink_type_t type);
const char *address,
uint16_t port,
srslte_netsink_type_t type);
SRSLTE_API void srslte_netsink_free(srslte_netsink_t* q); SRSLTE_API void srslte_netsink_free(srslte_netsink_t* q);
SRSLTE_API int srslte_netsink_write(srslte_netsink_t *q, SRSLTE_API int srslte_netsink_write(srslte_netsink_t* q, void* buffer, int nof_bytes);
void *buffer,
int nof_bytes);
SRSLTE_API int srslte_netsink_set_nonblocking(srslte_netsink_t* q); SRSLTE_API int srslte_netsink_set_nonblocking(srslte_netsink_t* q);

@ -31,19 +31,16 @@
#ifndef SRSLTE_NETSOURCE_H #ifndef SRSLTE_NETSOURCE_H
#define SRSLTE_NETSOURCE_H #define SRSLTE_NETSOURCE_H
#include <stdbool.h>
#include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <stdio.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/socket.h>
#include "srslte/config.h" #include "srslte/config.h"
typedef enum { typedef enum { SRSLTE_NETSOURCE_UDP, SRSLTE_NETSOURCE_TCP } srslte_netsource_type_t;
SRSLTE_NETSOURCE_UDP,
SRSLTE_NETSOURCE_TCP
} srslte_netsource_type_t;
/* Low-level API */ /* Low-level API */
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
@ -54,22 +51,17 @@ typedef struct SRSLTE_API {
struct sockaddr_in cliaddr; struct sockaddr_in cliaddr;
} srslte_netsource_t; } srslte_netsource_t;
SRSLTE_API int srslte_netsource_init(srslte_netsource_t *q, SRSLTE_API int
const char *address, srslte_netsource_init(srslte_netsource_t* q, const char* address, uint16_t port, srslte_netsource_type_t type);
uint16_t port,
srslte_netsource_type_t type);
SRSLTE_API void srslte_netsource_free(srslte_netsource_t* q); SRSLTE_API void srslte_netsource_free(srslte_netsource_t* q);
SRSLTE_API int srslte_netsource_set_nonblocking(srslte_netsource_t* q); SRSLTE_API int srslte_netsource_set_nonblocking(srslte_netsource_t* q);
SRSLTE_API int srslte_netsource_read(srslte_netsource_t *q, SRSLTE_API int srslte_netsource_read(srslte_netsource_t* q, void* buffer, int nof_bytes);
void *buffer,
int nof_bytes);
SRSLTE_API int srslte_netsource_write(srslte_netsource_t* q, void* buffer, int nbytes); SRSLTE_API int srslte_netsource_write(srslte_netsource_t* q, void* buffer, int nbytes);
SRSLTE_API int srslte_netsource_set_timeout(srslte_netsource_t *q, SRSLTE_API int srslte_netsource_set_timeout(srslte_netsource_t* q, uint32_t microseconds);
uint32_t microseconds);
#endif // SRSLTE_NETSOURCE_H #endif // SRSLTE_NETSOURCE_H

@ -37,14 +37,9 @@
/* Generates the vector of layer-mapped symbols "x" based on the vector of data symbols "d" /* Generates the vector of layer-mapped symbols "x" based on the vector of data symbols "d"
*/ */
SRSLTE_API int srslte_layermap_single(cf_t *d, SRSLTE_API int srslte_layermap_single(cf_t* d, cf_t* x, int nof_symbols);
cf_t *x,
int nof_symbols);
SRSLTE_API int srslte_layermap_diversity(cf_t *d, SRSLTE_API int srslte_layermap_diversity(cf_t* d, cf_t* x[SRSLTE_MAX_LAYERS], int nof_layers, int nof_symbols);
cf_t *x[SRSLTE_MAX_LAYERS],
int nof_layers,
int nof_symbols);
SRSLTE_API int srslte_layermap_multiplex(cf_t* d[SRSLTE_MAX_CODEWORDS], SRSLTE_API int srslte_layermap_multiplex(cf_t* d[SRSLTE_MAX_CODEWORDS],
cf_t* x[SRSLTE_MAX_LAYERS], cf_t* x[SRSLTE_MAX_LAYERS],
@ -61,14 +56,9 @@ SRSLTE_API int srslte_layermap_type(cf_t* d[SRSLTE_MAX_CODEWORDS],
/* Generates the vector of data symbols "d" based on the vector of layer-mapped symbols "x" /* Generates the vector of data symbols "d" based on the vector of layer-mapped symbols "x"
*/ */
SRSLTE_API int srslte_layerdemap_single(cf_t *x, SRSLTE_API int srslte_layerdemap_single(cf_t* x, cf_t* d, int nof_symbols);
cf_t *d,
int nof_symbols);
SRSLTE_API int srslte_layerdemap_diversity(cf_t *x[SRSLTE_MAX_LAYERS], SRSLTE_API int srslte_layerdemap_diversity(cf_t* x[SRSLTE_MAX_LAYERS], cf_t* d, int nof_layers, int nof_layer_symbols);
cf_t *d,
int nof_layers,
int nof_layer_symbols);
SRSLTE_API int srslte_layerdemap_multiplex(cf_t* x[SRSLTE_MAX_LAYERS], SRSLTE_API int srslte_layerdemap_multiplex(cf_t* x[SRSLTE_MAX_LAYERS],
cf_t* d[SRSLTE_MAX_CODEWORDS], cf_t* d[SRSLTE_MAX_CODEWORDS],

@ -39,13 +39,9 @@
* resources on each of the antenna ports. * resources on each of the antenna ports.
*/ */
/* Generates the vector "y" from the input vector "x" /* Generates the vector "y" from the input vector "x"
*/ */
SRSLTE_API int srslte_precoding_single(cf_t *x, SRSLTE_API int srslte_precoding_single(cf_t* x, cf_t* y, int nof_symbols, float scaling);
cf_t *y,
int nof_symbols,
float scaling);
SRSLTE_API int srslte_precoding_diversity(cf_t* x[SRSLTE_MAX_LAYERS], SRSLTE_API int srslte_precoding_diversity(cf_t* x[SRSLTE_MAX_LAYERS],
cf_t* y[SRSLTE_MAX_PORTS], cf_t* y[SRSLTE_MAX_PORTS],
@ -71,13 +67,8 @@ SRSLTE_API int srslte_precoding_type(cf_t* x[SRSLTE_MAX_LAYERS],
/* Estimates the vector "x" based on the received signal "y" and the channel estimates "h" /* Estimates the vector "x" based on the received signal "y" and the channel estimates "h"
*/ */
SRSLTE_API int srslte_predecoding_single(cf_t *y, SRSLTE_API int
cf_t *h, srslte_predecoding_single(cf_t* y, cf_t* h, cf_t* x, float* csi, int nof_symbols, float scaling, float noise_estimate);
cf_t *x,
float *csi,
int nof_symbols,
float scaling,
float noise_estimate);
SRSLTE_API int srslte_predecoding_single_multi(cf_t* y[SRSLTE_MAX_PORTS], SRSLTE_API int srslte_predecoding_single_multi(cf_t* y[SRSLTE_MAX_PORTS],
cf_t* h[SRSLTE_MAX_PORTS], cf_t* h[SRSLTE_MAX_PORTS],
@ -132,5 +123,4 @@ SRSLTE_API int srslte_precoding_cn(cf_t *h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
uint32_t nof_symbols, uint32_t nof_symbols,
float* cn); float* cn);
#endif // SRSLTE_PRECODING_H #endif // SRSLTE_PRECODING_H

@ -33,22 +33,19 @@
#include <stdint.h> #include <stdint.h>
#include "srslte/config.h"
#include "modem_table.h" #include "modem_table.h"
#include "srslte/config.h"
typedef _Complex float cf_t;
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
srslte_mod_t mod; /* In this implementation, mapping table is hard-coded */ srslte_mod_t mod; /* In this implementation, mapping table is hard-coded */
} srslte_demod_hard_t; } srslte_demod_hard_t;
SRSLTE_API void srslte_demod_hard_init(srslte_demod_hard_t* q); SRSLTE_API void srslte_demod_hard_init(srslte_demod_hard_t* q);
SRSLTE_API void srslte_demod_hard_table_set(srslte_demod_hard_t* q, SRSLTE_API void srslte_demod_hard_table_set(srslte_demod_hard_t* q, srslte_mod_t mod);
srslte_mod_t mod);
SRSLTE_API int srslte_demod_hard_demodulate(srslte_demod_hard_t* q, SRSLTE_API int srslte_demod_hard_demodulate(srslte_demod_hard_t* q, cf_t* symbols, uint8_t* bits, uint32_t nsymbols);
cf_t* symbols,
uint8_t *bits,
uint32_t nsymbols);
#endif // SRSLTE_DEMOD_HARD_H #endif // SRSLTE_DEMOD_HARD_H

@ -33,23 +33,13 @@
#include <stdint.h> #include <stdint.h>
#include "srslte/config.h"
#include "modem_table.h" #include "modem_table.h"
#include "srslte/config.h"
SRSLTE_API int srslte_demod_soft_demodulate(srslte_mod_t modulation, const cf_t* symbols, float* llr, int nsymbols);
SRSLTE_API int srslte_demod_soft_demodulate(srslte_mod_t modulation, SRSLTE_API int srslte_demod_soft_demodulate_s(srslte_mod_t modulation, const cf_t* symbols, short* llr, int nsymbols);
const cf_t* symbols,
float* llr,
int nsymbols);
SRSLTE_API int srslte_demod_soft_demodulate_s(srslte_mod_t modulation,
const cf_t* symbols,
short* llr,
int nsymbols);
SRSLTE_API int srslte_demod_soft_demodulate_b(srslte_mod_t modulation, SRSLTE_API int srslte_demod_soft_demodulate_b(srslte_mod_t modulation, const cf_t* symbols, int8_t* llr, int nsymbols);
const cf_t* symbols,
int8_t* llr,
int nsymbols);
#endif // SRSLTE_DEMOD_SOFT_H #endif // SRSLTE_DEMOD_SOFT_H

@ -33,17 +33,11 @@
#include <stdint.h> #include <stdint.h>
#include "srslte/config.h"
#include "modem_table.h" #include "modem_table.h"
#include "srslte/config.h"
SRSLTE_API int srslte_mod_modulate(srslte_modem_table_t* table, SRSLTE_API int srslte_mod_modulate(srslte_modem_table_t* table, uint8_t* bits, cf_t* symbols, uint32_t nbits);
uint8_t *bits,
cf_t* symbols,
uint32_t nbits);
SRSLTE_API int srslte_mod_modulate_bytes(srslte_modem_table_t* q, SRSLTE_API int srslte_mod_modulate_bytes(srslte_modem_table_t* q, uint8_t* bits, cf_t* symbols, uint32_t nbits);
uint8_t *bits,
cf_t* symbols,
uint32_t nbits);
#endif // SRSLTE_MOD_H #endif // SRSLTE_MOD_H

@ -34,8 +34,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include "srslte/phy/common/phy_common.h"
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/common/phy_common.h"
typedef struct { typedef struct {
cf_t symbol[8]; cf_t symbol[8];
@ -65,20 +65,15 @@ typedef struct SRSLTE_API {
qam256_packed_t* symbol_table_256qam; qam256_packed_t* symbol_table_256qam;
} srslte_modem_table_t; } srslte_modem_table_t;
SRSLTE_API void srslte_modem_table_init(srslte_modem_table_t* q); SRSLTE_API void srslte_modem_table_init(srslte_modem_table_t* q);
SRSLTE_API void srslte_modem_table_free(srslte_modem_table_t* q); SRSLTE_API void srslte_modem_table_free(srslte_modem_table_t* q);
SRSLTE_API void srslte_modem_table_reset(srslte_modem_table_t* q); SRSLTE_API void srslte_modem_table_reset(srslte_modem_table_t* q);
SRSLTE_API int srslte_modem_table_set(srslte_modem_table_t* q, SRSLTE_API int srslte_modem_table_set(srslte_modem_table_t* q, cf_t* table, uint32_t nsymbols, uint32_t nbits_x_symbol);
cf_t* table,
uint32_t nsymbols,
uint32_t nbits_x_symbol);
SRSLTE_API int srslte_modem_table_lte(srslte_modem_table_t* q, SRSLTE_API int srslte_modem_table_lte(srslte_modem_table_t* q, srslte_mod_t modulation);
srslte_mod_t modulation);
SRSLTE_API void srslte_modem_table_bytes(srslte_modem_table_t* q); SRSLTE_API void srslte_modem_table_bytes(srslte_modem_table_t* q);

@ -145,20 +145,17 @@ SRSLTE_API int srslte_cqi_size(srslte_cqi_cfg_t* cfg);
SRSLTE_API int srslte_cqi_value_pack(srslte_cqi_cfg_t* cfg, srslte_cqi_value_t* value, uint8_t* buff); SRSLTE_API int srslte_cqi_value_pack(srslte_cqi_cfg_t* cfg, srslte_cqi_value_t* value, uint8_t* buff);
SRSLTE_API int srslte_cqi_value_unpack(srslte_cqi_cfg_t* cfg, SRSLTE_API int
uint8_t buff[SRSLTE_CQI_MAX_BITS], srslte_cqi_value_unpack(srslte_cqi_cfg_t* cfg, uint8_t buff[SRSLTE_CQI_MAX_BITS], srslte_cqi_value_t* value);
srslte_cqi_value_t* value);
SRSLTE_API int srslte_cqi_value_tostring(srslte_cqi_cfg_t* cfg, SRSLTE_API int
srslte_cqi_value_t* value, srslte_cqi_value_tostring(srslte_cqi_cfg_t* cfg, srslte_cqi_value_t* value, char* buff, uint32_t buff_len);
char* buff,
uint32_t buff_len);
SRSLTE_API bool srslte_cqi_periodic_send(srslte_cqi_report_cfg_t* periodic_cfg,uint32_t tti, srslte_frame_type_t frame_type); SRSLTE_API bool
srslte_cqi_periodic_send(srslte_cqi_report_cfg_t* periodic_cfg, uint32_t tti, srslte_frame_type_t frame_type);
SRSLTE_API bool srslte_cqi_periodic_ri_send(srslte_cqi_report_cfg_t* periodic_cfg, SRSLTE_API bool
uint32_t tti, srslte_cqi_periodic_ri_send(srslte_cqi_report_cfg_t* periodic_cfg, uint32_t tti, srslte_frame_type_t frame_type);
srslte_frame_type_t frame_type);
SRSLTE_API int srslte_cqi_hl_get_no_subbands(int nof_prb); SRSLTE_API int srslte_cqi_hl_get_no_subbands(int nof_prb);

@ -205,7 +205,9 @@ SRSLTE_API int srslte_dci_msg_unpack_pusch(srslte_cell_t* cell,
SRSLTE_API int srslte_dci_msg_pack_pdsch(srslte_cell_t* cell, SRSLTE_API int srslte_dci_msg_pack_pdsch(srslte_cell_t* cell,
srslte_dl_sf_cfg_t* sf, srslte_dl_sf_cfg_t* sf,
srslte_dci_cfg_t* cfg, srslte_dci_dl_t* dci, srslte_dci_msg_t* msg); srslte_dci_cfg_t* cfg,
srslte_dci_dl_t* dci,
srslte_dci_msg_t* msg);
SRSLTE_API int srslte_dci_msg_unpack_pdsch(srslte_cell_t* cell, SRSLTE_API int srslte_dci_msg_unpack_pdsch(srslte_cell_t* cell,
srslte_dl_sf_cfg_t* sf, srslte_dl_sf_cfg_t* sf,
@ -218,17 +220,11 @@ SRSLTE_API uint32_t srslte_dci_format_sizeof(srslte_cell_t* cell,
srslte_dci_cfg_t* cfg, srslte_dci_cfg_t* cfg,
srslte_dci_format_t format); srslte_dci_format_t format);
SRSLTE_API void srslte_dci_dl_fprint(FILE* f, SRSLTE_API void srslte_dci_dl_fprint(FILE* f, srslte_dci_dl_t* dci, uint32_t nof_prb);
srslte_dci_dl_t* dci,
uint32_t nof_prb);
SRSLTE_API uint32_t srslte_dci_dl_info(srslte_dci_dl_t* dci_dl, SRSLTE_API uint32_t srslte_dci_dl_info(srslte_dci_dl_t* dci_dl, char* str, uint32_t str_len);
char* str,
uint32_t str_len);
SRSLTE_API uint32_t srslte_dci_ul_info(srslte_dci_ul_t* dci_ul, SRSLTE_API uint32_t srslte_dci_ul_info(srslte_dci_ul_t* dci_ul, char* info_str, uint32_t len);
char* info_str,
uint32_t len);
SRSLTE_API srslte_dci_format_t srslte_dci_format_from_string(char* str); SRSLTE_API srslte_dci_format_t srslte_dci_format_from_string(char* str);
@ -236,9 +232,7 @@ SRSLTE_API char* srslte_dci_format_string(srslte_dci_format_t format);
SRSLTE_API char* srslte_dci_format_string_short(srslte_dci_format_t format); SRSLTE_API char* srslte_dci_format_string_short(srslte_dci_format_t format);
SRSLTE_API int srslte_dci_location_set(srslte_dci_location_t* c, SRSLTE_API int srslte_dci_location_set(srslte_dci_location_t* c, uint32_t L, uint32_t nCCE);
uint32_t L,
uint32_t nCCE);
SRSLTE_API bool srslte_dci_location_isvalid(srslte_dci_location_t* c); SRSLTE_API bool srslte_dci_location_isvalid(srslte_dci_location_t* c);

@ -85,8 +85,7 @@ SRSLTE_API int srslte_pbch_init(srslte_pbch_t *q);
SRSLTE_API void srslte_pbch_free(srslte_pbch_t* q); SRSLTE_API void srslte_pbch_free(srslte_pbch_t* q);
SRSLTE_API int srslte_pbch_set_cell(srslte_pbch_t *q, SRSLTE_API int srslte_pbch_set_cell(srslte_pbch_t* q, srslte_cell_t cell);
srslte_cell_t cell);
SRSLTE_API int srslte_pbch_decode(srslte_pbch_t* q, SRSLTE_API int srslte_pbch_decode(srslte_pbch_t* q,
srslte_chest_dl_res_t* channel, srslte_chest_dl_res_t* channel,

@ -74,12 +74,9 @@ typedef struct SRSLTE_API {
} srslte_pcfich_t; } srslte_pcfich_t;
SRSLTE_API int srslte_pcfich_init(srslte_pcfich_t *q, SRSLTE_API int srslte_pcfich_init(srslte_pcfich_t* q, uint32_t nof_rx_antennas);
uint32_t nof_rx_antennas);
SRSLTE_API int srslte_pcfich_set_cell(srslte_pcfich_t *q, SRSLTE_API int srslte_pcfich_set_cell(srslte_pcfich_t* q, srslte_regs_t* regs, srslte_cell_t cell);
srslte_regs_t *regs,
srslte_cell_t cell);
SRSLTE_API void srslte_pcfich_free(srslte_pcfich_t* q); SRSLTE_API void srslte_pcfich_free(srslte_pcfich_t* q);

@ -45,10 +45,7 @@
#include "srslte/phy/phch/regs.h" #include "srslte/phy/phch/regs.h"
#include "srslte/phy/scrambling/scrambling.h" #include "srslte/phy/scrambling/scrambling.h"
typedef enum SRSLTE_API { typedef enum SRSLTE_API { SEARCH_UE, SEARCH_COMMON } srslte_pdcch_search_mode_t;
SEARCH_UE, SEARCH_COMMON
} srslte_pdcch_search_mode_t;
/* PDCCH object */ /* PDCCH object */
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
@ -78,23 +75,17 @@ typedef struct SRSLTE_API {
} srslte_pdcch_t; } srslte_pdcch_t;
SRSLTE_API int srslte_pdcch_init_ue(srslte_pdcch_t *q, SRSLTE_API int srslte_pdcch_init_ue(srslte_pdcch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
uint32_t max_prb,
uint32_t nof_rx_antennas);
SRSLTE_API int srslte_pdcch_init_enb(srslte_pdcch_t *q, SRSLTE_API int srslte_pdcch_init_enb(srslte_pdcch_t* q, uint32_t max_prb);
uint32_t max_prb);
SRSLTE_API int srslte_pdcch_set_cell(srslte_pdcch_t *q, SRSLTE_API int srslte_pdcch_set_cell(srslte_pdcch_t* q, srslte_regs_t* regs, srslte_cell_t cell);
srslte_regs_t *regs,
srslte_cell_t cell);
SRSLTE_API void srslte_pdcch_set_regs(srslte_pdcch_t* q, srslte_regs_t* regs); SRSLTE_API void srslte_pdcch_set_regs(srslte_pdcch_t* q, srslte_regs_t* regs);
SRSLTE_API void srslte_pdcch_free(srslte_pdcch_t* q); SRSLTE_API void srslte_pdcch_free(srslte_pdcch_t* q);
SRSLTE_API float srslte_pdcch_coderate(uint32_t nof_bits, SRSLTE_API float srslte_pdcch_coderate(uint32_t nof_bits, uint32_t l);
uint32_t l);
/* Encoding function */ /* Encoding function */
SRSLTE_API int srslte_pdcch_encode(srslte_pdcch_t* q, SRSLTE_API int srslte_pdcch_encode(srslte_pdcch_t* q,
@ -110,30 +101,17 @@ SRSLTE_API int srslte_pdcch_extract_llr(srslte_pdcch_t* q,
cf_t* sf_symbols[SRSLTE_MAX_PORTS]); cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
/* Decoding functions: Try to decode a DCI message after calling srslte_pdcch_extract_llr */ /* Decoding functions: Try to decode a DCI message after calling srslte_pdcch_extract_llr */
SRSLTE_API int srslte_pdcch_decode_msg(srslte_pdcch_t* q, SRSLTE_API int
srslte_dl_sf_cfg_t* sf, srslte_pdcch_decode_msg(srslte_pdcch_t* q, srslte_dl_sf_cfg_t* sf, srslte_dci_cfg_t* dci_cfg, srslte_dci_msg_t* msg);
srslte_dci_cfg_t* dci_cfg,
srslte_dci_msg_t* msg);
SRSLTE_API int srslte_pdcch_dci_decode(srslte_pdcch_t* q,
float* e,
uint8_t* data,
uint32_t E,
uint32_t nof_bits,
uint16_t* crc);
SRSLTE_API int srslte_pdcch_dci_encode(srslte_pdcch_t *q,
uint8_t *data,
uint8_t *e,
uint32_t nof_bits,
uint32_t E,
uint16_t rnti);
SRSLTE_API void srslte_pdcch_dci_encode_conv(srslte_pdcch_t *q, SRSLTE_API int
uint8_t *data, srslte_pdcch_dci_decode(srslte_pdcch_t* q, float* e, uint8_t* data, uint32_t E, uint32_t nof_bits, uint16_t* crc);
uint32_t nof_bits,
uint8_t *coded_data, SRSLTE_API int
uint16_t rnti); srslte_pdcch_dci_encode(srslte_pdcch_t* q, uint8_t* data, uint8_t* e, uint32_t nof_bits, uint32_t E, uint16_t rnti);
SRSLTE_API void
srslte_pdcch_dci_encode_conv(srslte_pdcch_t* q, uint8_t* data, uint32_t nof_bits, uint8_t* coded_data, uint16_t rnti);
/* Function for generation of UE-specific search space DCI locations */ /* Function for generation of UE-specific search space DCI locations */
SRSLTE_API uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t* q, SRSLTE_API uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t* q,

@ -91,12 +91,9 @@ typedef struct {
float avg_iterations_block; float avg_iterations_block;
} srslte_pdsch_res_t; } srslte_pdsch_res_t;
SRSLTE_API int srslte_pdsch_init_ue(srslte_pdsch_t *q, SRSLTE_API int srslte_pdsch_init_ue(srslte_pdsch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
uint32_t max_prb,
uint32_t nof_rx_antennas);
SRSLTE_API int srslte_pdsch_init_enb(srslte_pdsch_t *q, SRSLTE_API int srslte_pdsch_init_enb(srslte_pdsch_t* q, uint32_t max_prb);
uint32_t max_prb);
SRSLTE_API void srslte_pdsch_free(srslte_pdsch_t* q); SRSLTE_API void srslte_pdsch_free(srslte_pdsch_t* q);
@ -105,8 +102,7 @@ SRSLTE_API int srslte_pdsch_enable_coworker(srslte_pdsch_t* q);
SRSLTE_API int srslte_pdsch_set_cell(srslte_pdsch_t* q, srslte_cell_t cell); SRSLTE_API int srslte_pdsch_set_cell(srslte_pdsch_t* q, srslte_cell_t cell);
SRSLTE_API int srslte_pdsch_set_rnti(srslte_pdsch_t *q, SRSLTE_API int srslte_pdsch_set_rnti(srslte_pdsch_t* q, uint16_t rnti);
uint16_t rnti);
SRSLTE_API void srslte_pdsch_free_rnti(srslte_pdsch_t* q, uint16_t rnti); SRSLTE_API void srslte_pdsch_free_rnti(srslte_pdsch_t* q, uint16_t rnti);

@ -30,9 +30,9 @@
#ifndef SRSLTE_PDSCH_CFG_H #ifndef SRSLTE_PDSCH_CFG_H
#define SRSLTE_PDSCH_CFG_H #define SRSLTE_PDSCH_CFG_H
#include "srslte/phy/phch/ra.h"
#include "srslte/phy/fec/softbuffer.h"
#include "srslte/phy/fec/cbsegm.h" #include "srslte/phy/fec/cbsegm.h"
#include "srslte/phy/fec/softbuffer.h"
#include "srslte/phy/phch/ra.h"
typedef struct SRSLTE_API { typedef struct SRSLTE_API {

@ -99,9 +99,7 @@ SRSLTE_API int srslte_phich_init(srslte_phich_t* q, uint32_t nof_rx_antennas);
SRSLTE_API void srslte_phich_free(srslte_phich_t* q); SRSLTE_API void srslte_phich_free(srslte_phich_t* q);
SRSLTE_API int srslte_phich_set_cell(srslte_phich_t *q, SRSLTE_API int srslte_phich_set_cell(srslte_phich_t* q, srslte_regs_t* regs, srslte_cell_t cell);
srslte_regs_t *regs,
srslte_cell_t cell);
SRSLTE_API void srslte_phich_set_regs(srslte_phich_t* q, srslte_regs_t* regs); SRSLTE_API void srslte_phich_set_regs(srslte_phich_t* q, srslte_regs_t* regs);

@ -39,10 +39,10 @@
#include "srslte/phy/modem/mod.h" #include "srslte/phy/modem/mod.h"
#include "srslte/phy/phch/dci.h" #include "srslte/phy/phch/dci.h"
#include "srslte/phy/phch/pdsch.h" #include "srslte/phy/phch/pdsch.h"
#include "srslte/phy/phch/ra_dl.h"
#include "srslte/phy/phch/regs.h" #include "srslte/phy/phch/regs.h"
#include "srslte/phy/phch/sch.h" #include "srslte/phy/phch/sch.h"
#include "srslte/phy/scrambling/scrambling.h" #include "srslte/phy/scrambling/scrambling.h"
#include "srslte/phy/phch/ra_dl.h"
typedef struct { typedef struct {
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME]; srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
} srslte_pmch_seq_t; } srslte_pmch_seq_t;

@ -30,14 +30,13 @@
#ifndef SRSLTE_PRACH_H #ifndef SRSLTE_PRACH_H
#define SRSLTE_PRACH_H #define SRSLTE_PRACH_H
#include <stdint.h>
#include <stdlib.h>
#include <complex.h>
#include <stdbool.h>
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/dft/dft.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
#include "srslte/phy/dft/dft.h"
#include <complex.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define SRSLTE_PRACH_MAX_LEN (2 * 24576 + 21024) // Maximum Tcp + Tseq #define SRSLTE_PRACH_MAX_LEN (2 * 24576 + 21024) // Maximum Tcp + Tseq
@ -135,13 +134,10 @@ SRSLTE_API uint32_t srslte_prach_get_preamble_format(uint32_t config_idx);
SRSLTE_API srslte_prach_sfn_t srslte_prach_get_sfn(uint32_t config_idx); SRSLTE_API srslte_prach_sfn_t srslte_prach_get_sfn(uint32_t config_idx);
SRSLTE_API bool srslte_prach_tti_opportunity(srslte_prach_t *p, SRSLTE_API bool srslte_prach_tti_opportunity(srslte_prach_t* p, uint32_t current_tti, int allowed_subframe);
uint32_t current_tti,
int allowed_subframe);
SRSLTE_API bool srslte_prach_tti_opportunity_config_fdd(uint32_t config_idx, SRSLTE_API bool
uint32_t current_tti, srslte_prach_tti_opportunity_config_fdd(uint32_t config_idx, uint32_t current_tti, int allowed_subframe);
int allowed_subframe);
SRSLTE_API bool srslte_prach_tti_opportunity_config_tdd(uint32_t config_idx, SRSLTE_API bool srslte_prach_tti_opportunity_config_tdd(uint32_t config_idx,
uint32_t tdd_ul_dl_config, uint32_t tdd_ul_dl_config,

@ -138,15 +138,11 @@ SRSLTE_API char* srslte_pucch_format_text(srslte_pucch_format_t format);
SRSLTE_API char* srslte_pucch_format_text_short(srslte_pucch_format_t format); SRSLTE_API char* srslte_pucch_format_text_short(srslte_pucch_format_t format);
SRSLTE_API void srslte_pucch_tx_info(srslte_pucch_cfg_t* cfg, SRSLTE_API void
srslte_uci_value_t* uci_data, srslte_pucch_tx_info(srslte_pucch_cfg_t* cfg, srslte_uci_value_t* uci_data, char* str, uint32_t str_len);
char* str,
uint32_t str_len);
SRSLTE_API void srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, SRSLTE_API void
srslte_uci_value_t* uci_data, srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, srslte_uci_value_t* uci_data, char* str, uint32_t str_len);
char* str,
uint32_t str_len);
SRSLTE_API bool srslte_pucch_cfg_isvalid(srslte_pucch_cfg_t* cfg, uint32_t nof_prb); SRSLTE_API bool srslte_pucch_cfg_isvalid(srslte_pucch_cfg_t* cfg, uint32_t nof_prb);

@ -31,18 +31,18 @@
#define SRSLTE_PUSCH_H #define SRSLTE_PUSCH_H
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/ch_estimation/refsignal_ul.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
#include "srslte/phy/mimo/precoding.h" #include "srslte/phy/dft/dft_precoding.h"
#include "srslte/phy/mimo/layermap.h" #include "srslte/phy/mimo/layermap.h"
#include "srslte/phy/modem/mod.h" #include "srslte/phy/mimo/precoding.h"
#include "srslte/phy/modem/demod_soft.h" #include "srslte/phy/modem/demod_soft.h"
#include "srslte/phy/scrambling/scrambling.h" #include "srslte/phy/modem/mod.h"
#include "srslte/phy/phch/regs.h"
#include "srslte/phy/phch/dci.h" #include "srslte/phy/phch/dci.h"
#include "srslte/phy/phch/sch.h"
#include "srslte/phy/phch/pusch_cfg.h" #include "srslte/phy/phch/pusch_cfg.h"
#include "srslte/phy/dft/dft_precoding.h" #include "srslte/phy/phch/regs.h"
#include "srslte/phy/ch_estimation/refsignal_ul.h" #include "srslte/phy/phch/sch.h"
#include "srslte/phy/scrambling/scrambling.h"
typedef struct { typedef struct {
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME]; srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
@ -93,22 +93,18 @@ typedef struct SRSLTE_API {
float avg_iterations_block; float avg_iterations_block;
} srslte_pusch_res_t; } srslte_pusch_res_t;
SRSLTE_API int srslte_pusch_init_ue(srslte_pusch_t *q, SRSLTE_API int srslte_pusch_init_ue(srslte_pusch_t* q, uint32_t max_prb);
uint32_t max_prb);
SRSLTE_API int srslte_pusch_init_enb(srslte_pusch_t *q, SRSLTE_API int srslte_pusch_init_enb(srslte_pusch_t* q, uint32_t max_prb);
uint32_t max_prb);
SRSLTE_API void srslte_pusch_free(srslte_pusch_t* q); SRSLTE_API void srslte_pusch_free(srslte_pusch_t* q);
/* These functions modify the state of the object and may take some time */ /* These functions modify the state of the object and may take some time */
SRSLTE_API int srslte_pusch_set_cell(srslte_pusch_t *q, SRSLTE_API int srslte_pusch_set_cell(srslte_pusch_t* q, srslte_cell_t cell);
srslte_cell_t cell);
SRSLTE_API int srslte_pusch_set_rnti(srslte_pusch_t* q, uint16_t rnti); SRSLTE_API int srslte_pusch_set_rnti(srslte_pusch_t* q, uint16_t rnti);
SRSLTE_API void srslte_pusch_free_rnti(srslte_pusch_t *q, SRSLTE_API void srslte_pusch_free_rnti(srslte_pusch_t* q, uint16_t rnti);
uint16_t rnti);
/* These functions do not modify the state and run in real-time */ /* These functions do not modify the state and run in real-time */
SRSLTE_API int srslte_pusch_encode(srslte_pusch_t* q, SRSLTE_API int srslte_pusch_encode(srslte_pusch_t* q,

@ -30,8 +30,8 @@
#ifndef SRSLTE_RA_H #ifndef SRSLTE_RA_H
#define SRSLTE_RA_H #define SRSLTE_RA_H
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
@ -70,15 +70,9 @@ typedef struct SRSLTE_API {
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
uint32_t riv; // if L_crb==0, DCI message packer will take this value directly uint32_t riv; // if L_crb==0, DCI message packer will take this value directly
enum { enum { SRSLTE_RA_TYPE2_NPRB1A_2 = 0, SRSLTE_RA_TYPE2_NPRB1A_3 = 1 } n_prb1a;
SRSLTE_RA_TYPE2_NPRB1A_2 = 0, SRSLTE_RA_TYPE2_NPRB1A_3 = 1 enum { SRSLTE_RA_TYPE2_NG1 = 0, SRSLTE_RA_TYPE2_NG2 = 1 } n_gap;
} n_prb1a; enum { SRSLTE_RA_TYPE2_LOC = 0, SRSLTE_RA_TYPE2_DIST = 1 } mode;
enum {
SRSLTE_RA_TYPE2_NG1 = 0, SRSLTE_RA_TYPE2_NG2 = 1
} n_gap;
enum {
SRSLTE_RA_TYPE2_LOC = 0, SRSLTE_RA_TYPE2_DIST = 1
} mode;
} srslte_ra_type2_t; } srslte_ra_type2_t;
SRSLTE_API uint32_t srslte_ra_type0_P(uint32_t nof_prb); SRSLTE_API uint32_t srslte_ra_type0_P(uint32_t nof_prb);
@ -93,11 +87,8 @@ SRSLTE_API uint32_t srslte_ra_type1_N_rb(uint32_t nof_prb);
SRSLTE_API uint32_t srslte_ra_type2_to_riv(uint32_t L_crb, uint32_t RB_start, uint32_t nof_prb); SRSLTE_API uint32_t srslte_ra_type2_to_riv(uint32_t L_crb, uint32_t RB_start, uint32_t nof_prb);
SRSLTE_API void srslte_ra_type2_from_riv(uint32_t riv, SRSLTE_API void
uint32_t* L_crb, srslte_ra_type2_from_riv(uint32_t riv, uint32_t* L_crb, uint32_t* RB_start, uint32_t nof_prb, uint32_t nof_vrb);
uint32_t* RB_start,
uint32_t nof_prb,
uint32_t nof_vrb);
SRSLTE_API int srslte_ra_tbs_idx_from_mcs(uint32_t mcs, bool is_ul); SRSLTE_API int srslte_ra_tbs_idx_from_mcs(uint32_t mcs, bool is_ul);

@ -51,9 +51,8 @@ SRSLTE_API int srslte_ra_dl_dci_to_grant(srslte_cell_t* cell,
srslte_dci_dl_t* dci, srslte_dci_dl_t* dci,
srslte_pdsch_grant_t* grant); srslte_pdsch_grant_t* grant);
SRSLTE_API int srslte_ra_dl_grant_to_grant_prb_allocation(srslte_dci_dl_t* dci, SRSLTE_API int
srslte_pdsch_grant_t* grant, srslte_ra_dl_grant_to_grant_prb_allocation(srslte_dci_dl_t* dci, srslte_pdsch_grant_t* grant, uint32_t nof_prb);
uint32_t nof_prb);
/** Functions used by the eNodeB scheduler */ /** Functions used by the eNodeB scheduler */
SRSLTE_API uint32_t srslte_ra_dl_approx_nof_re(srslte_cell_t* cell, uint32_t nof_prb, uint32_t nof_ctrl_symbols); SRSLTE_API uint32_t srslte_ra_dl_approx_nof_re(srslte_cell_t* cell, uint32_t nof_prb, uint32_t nof_ctrl_symbols);

@ -30,9 +30,9 @@
#ifndef SRSLTE_REGS_H #ifndef SRSLTE_REGS_H
#define SRSLTE_REGS_H #define SRSLTE_REGS_H
#include <stdbool.h>
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
#include <stdbool.h>
#define REGS_PHICH_NSYM 12 #define REGS_PHICH_NSYM 12
#define REGS_PHICH_REGS_X_GROUP 3 #define REGS_PHICH_REGS_X_GROUP 3
@ -42,7 +42,6 @@
#define REGS_RE_X_REG 4 #define REGS_RE_X_REG 4
typedef struct SRSLTE_API { typedef struct SRSLTE_API {
uint32_t k[4]; uint32_t k[4];
uint32_t k0; uint32_t k0;
@ -74,50 +73,35 @@ typedef struct SRSLTE_API {
srslte_regs_reg_t* regs; srslte_regs_reg_t* regs;
} srslte_regs_t; } srslte_regs_t;
SRSLTE_API int srslte_regs_init(srslte_regs_t *h, SRSLTE_API int srslte_regs_init(srslte_regs_t* h, srslte_cell_t cell);
srslte_cell_t cell);
SRSLTE_API int srslte_regs_init_opts(srslte_regs_t* h, srslte_cell_t cell, uint32_t phich_mi, bool mbsfn_or_sf1_6_tdd); SRSLTE_API int srslte_regs_init_opts(srslte_regs_t* h, srslte_cell_t cell, uint32_t phich_mi, bool mbsfn_or_sf1_6_tdd);
SRSLTE_API void srslte_regs_free(srslte_regs_t* h); SRSLTE_API void srslte_regs_free(srslte_regs_t* h);
SRSLTE_API int srslte_regs_pdcch_nregs(srslte_regs_t *h, SRSLTE_API int srslte_regs_pdcch_nregs(srslte_regs_t* h, uint32_t cfi);
uint32_t cfi);
SRSLTE_API int srslte_regs_pdcch_ncce(srslte_regs_t *h, SRSLTE_API int srslte_regs_pdcch_ncce(srslte_regs_t* h, uint32_t cfi);
uint32_t cfi);
SRSLTE_API int srslte_regs_pcfich_put(srslte_regs_t *h, SRSLTE_API int srslte_regs_pcfich_put(srslte_regs_t* h, cf_t symbols[REGS_PCFICH_NSYM], cf_t* slot_symbols);
cf_t symbols[REGS_PCFICH_NSYM],
cf_t *slot_symbols);
SRSLTE_API int srslte_regs_pcfich_get(srslte_regs_t *h, SRSLTE_API int srslte_regs_pcfich_get(srslte_regs_t* h, cf_t* slot_symbols, cf_t symbols[REGS_PCFICH_NSYM]);
cf_t *slot_symbols,
cf_t symbols[REGS_PCFICH_NSYM]);
SRSLTE_API uint32_t srslte_regs_phich_nregs(srslte_regs_t* h); SRSLTE_API uint32_t srslte_regs_phich_nregs(srslte_regs_t* h);
SRSLTE_API int srslte_regs_phich_add(srslte_regs_t *h, SRSLTE_API int
cf_t symbols[REGS_PHICH_NSYM], srslte_regs_phich_add(srslte_regs_t* h, cf_t symbols[REGS_PHICH_NSYM], uint32_t ngroup, cf_t* slot_symbols);
uint32_t ngroup,
cf_t *slot_symbols);
SRSLTE_API int srslte_regs_phich_get(srslte_regs_t *h, SRSLTE_API int
cf_t *slot_symbols, srslte_regs_phich_get(srslte_regs_t* h, cf_t* slot_symbols, cf_t symbols[REGS_PHICH_NSYM], uint32_t ngroup);
cf_t symbols[REGS_PHICH_NSYM],
uint32_t ngroup);
SRSLTE_API uint32_t srslte_regs_phich_ngroups(srslte_regs_t* h); SRSLTE_API uint32_t srslte_regs_phich_ngroups(srslte_regs_t* h);
SRSLTE_API uint32_t srslte_regs_phich_ngroups_m1(srslte_regs_t* h); SRSLTE_API uint32_t srslte_regs_phich_ngroups_m1(srslte_regs_t* h);
SRSLTE_API int srslte_regs_phich_reset(srslte_regs_t *h, SRSLTE_API int srslte_regs_phich_reset(srslte_regs_t* h, cf_t* slot_symbols);
cf_t *slot_symbols);
SRSLTE_API int srslte_regs_pdcch_put(srslte_regs_t *h, SRSLTE_API int srslte_regs_pdcch_put(srslte_regs_t* h, uint32_t cfi, cf_t* d, cf_t* slot_symbols);
uint32_t cfi,
cf_t *d,
cf_t *slot_symbols);
SRSLTE_API int srslte_regs_pdcch_put_offset(srslte_regs_t* h, SRSLTE_API int srslte_regs_pdcch_put_offset(srslte_regs_t* h,
uint32_t cfi, uint32_t cfi,
@ -126,10 +110,7 @@ SRSLTE_API int srslte_regs_pdcch_put_offset(srslte_regs_t *h,
uint32_t start_reg, uint32_t start_reg,
uint32_t nof_regs); uint32_t nof_regs);
SRSLTE_API int srslte_regs_pdcch_get(srslte_regs_t *h, SRSLTE_API int srslte_regs_pdcch_get(srslte_regs_t* h, uint32_t cfi, cf_t* slot_symbols, cf_t* d);
uint32_t cfi,
cf_t *slot_symbols,
cf_t *d);
SRSLTE_API int srslte_regs_pdcch_get_offset(srslte_regs_t* h, SRSLTE_API int srslte_regs_pdcch_get_offset(srslte_regs_t* h,
uint32_t cfi, uint32_t cfi,
@ -139,5 +120,3 @@ SRSLTE_API int srslte_regs_pdcch_get_offset(srslte_regs_t *h,
uint32_t nof_regs); uint32_t nof_regs);
#endif // SRSLTE_REGS_H #endif // SRSLTE_REGS_H

@ -32,10 +32,10 @@
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_common.h"
#include "srslte/phy/fec/crc.h"
#include "srslte/phy/fec/rm_turbo.h" #include "srslte/phy/fec/rm_turbo.h"
#include "srslte/phy/fec/turbocoder.h" #include "srslte/phy/fec/turbocoder.h"
#include "srslte/phy/fec/turbodecoder.h" #include "srslte/phy/fec/turbodecoder.h"
#include "srslte/phy/fec/crc.h"
#include "srslte/phy/phch/pdsch_cfg.h" #include "srslte/phy/phch/pdsch_cfg.h"
#include "srslte/phy/phch/pusch_cfg.h" #include "srslte/phy/phch/pusch_cfg.h"
#include "srslte/phy/phch/uci.h" #include "srslte/phy/phch/uci.h"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save