From fe830a5287083dd92c977138d1c20a118df4de70 Mon Sep 17 00:00:00 2001 From: ismagom Date: Tue, 28 Apr 2015 09:26:24 +0200 Subject: [PATCH 01/19] Softbuffer RX initialization with ratematching NULL. Moved softbuffer to fec --- srslte/include/srslte/{phch => fec}/softbuffer.h | 0 srslte/lib/{phch => fec}/src/softbuffer.c | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename srslte/include/srslte/{phch => fec}/softbuffer.h (100%) rename srslte/lib/{phch => fec}/src/softbuffer.c (100%) diff --git a/srslte/include/srslte/phch/softbuffer.h b/srslte/include/srslte/fec/softbuffer.h similarity index 100% rename from srslte/include/srslte/phch/softbuffer.h rename to srslte/include/srslte/fec/softbuffer.h diff --git a/srslte/lib/phch/src/softbuffer.c b/srslte/lib/fec/src/softbuffer.c similarity index 100% rename from srslte/lib/phch/src/softbuffer.c rename to srslte/lib/fec/src/softbuffer.c From e7cc7b330e0330918825a4bb6e973978797ad9d7 Mon Sep 17 00:00:00 2001 From: ismagom Date: Tue, 28 Apr 2015 09:28:33 +0200 Subject: [PATCH 02/19] Softbuffer RX initialization with ratematching NULL. Moved softbuffer to fec --- srslte/include/srslte/phch/pdsch_cfg.h | 2 +- srslte/include/srslte/phch/pusch_cfg.h | 2 +- srslte/include/srslte/srslte.h | 2 +- srslte/lib/fec/src/rm_turbo.c | 9 +-------- srslte/lib/fec/src/softbuffer.c | 10 ++++++---- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/srslte/include/srslte/phch/pdsch_cfg.h b/srslte/include/srslte/phch/pdsch_cfg.h index 488cfb66e..547bb0a80 100644 --- a/srslte/include/srslte/phch/pdsch_cfg.h +++ b/srslte/include/srslte/phch/pdsch_cfg.h @@ -37,7 +37,7 @@ #define PDSCHCFG_ #include "srslte/phch/ra.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/softbuffer.h" #include "srslte/fec/cbsegm.h" typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/phch/pusch_cfg.h b/srslte/include/srslte/phch/pusch_cfg.h index ad60cd335..bf8286e00 100644 --- a/srslte/include/srslte/phch/pusch_cfg.h +++ b/srslte/include/srslte/phch/pusch_cfg.h @@ -37,7 +37,7 @@ #define PUSCHCFG_ #include "srslte/phch/ra.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/softbuffer.h" #include "srslte/fec/cbsegm.h" typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/srslte.h b/srslte/include/srslte/srslte.h index e6d71e22e..162c4bcdf 100644 --- a/srslte/include/srslte/srslte.h +++ b/srslte/include/srslte/srslte.h @@ -88,7 +88,7 @@ #include "srslte/phch/cqi.h" #include "srslte/phch/dci.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/softbuffer.h" #include "srslte/phch/pbch.h" #include "srslte/phch/pcfich.h" #include "srslte/phch/pdcch.h" diff --git a/srslte/lib/fec/src/rm_turbo.c b/srslte/lib/fec/src/rm_turbo.c index 533fd383a..468753a2a 100644 --- a/srslte/lib/fec/src/rm_turbo.c +++ b/srslte/lib/fec/src/rm_turbo.c @@ -133,8 +133,7 @@ int srslte_rm_turbo_tx(uint8_t *w_buff, uint32_t w_buff_len, uint8_t *input, uin /* Undoes Turbo Code Rate Matching. * 3GPP TS 36.212 v10.1.0 section 5.1.4.1 * - * If rv_idx==0, the w_buff circular buffer is initialized. Every subsequent call - * with rv_idx!=0 will soft-combine the LLRs from input with w_buff + * Soft-combines the data available in w_buff */ int srslte_rm_turbo_rx(float *w_buff, uint32_t w_buff_len, float *input, uint32_t in_len, float *output, uint32_t out_len, uint32_t rv_idx, uint32_t nof_filler_bits) { @@ -164,12 +163,6 @@ int srslte_rm_turbo_rx(float *w_buff, uint32_t w_buff_len, float *input, uint32_ ndummy = 0; } - if (rv_idx == 0) { - for (i = 0; i < 3 * K_p; i++) { - w_buff[i] = SRSLTE_RX_NULL; - } - } - /* Undo bit collection. Account for dummy bits */ N_cb = 3 * K_p; // TODO: Soft buffer size limitation k0 = nrows diff --git a/srslte/lib/fec/src/softbuffer.c b/srslte/lib/fec/src/softbuffer.c index db6fc574f..7508cbcf4 100644 --- a/srslte/lib/fec/src/softbuffer.c +++ b/srslte/lib/fec/src/softbuffer.c @@ -37,7 +37,8 @@ #include "srslte/common/phy_common.h" #include "srslte/phch/ra.h" #include "srslte/fec/turbodecoder.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/rm_turbo.h" +#include "srslte/fec/softbuffer.h" #include "srslte/utils/vector.h" #include "srslte/utils/debug.h" @@ -92,11 +93,12 @@ void srslte_softbuffer_rx_free(srslte_softbuffer_rx_t *q) { } void srslte_softbuffer_rx_reset(srslte_softbuffer_rx_t *q) { - int i; if (q->buffer_f) { - for (i=0;imax_cb;i++) { + for (uint32_t i=0;imax_cb;i++) { if (q->buffer_f[i]) { - bzero(q->buffer_f[i], sizeof(float) * q->buff_size); + for (uint32_t j=0;jbuff_size;j++) { + q->buffer_f[i][j] = SRSLTE_RX_NULL; + } } } } From c57d8969bee0283de16c987dae6adb3209833853 Mon Sep 17 00:00:00 2001 From: ismagom Date: Fri, 8 May 2015 10:35:39 +0200 Subject: [PATCH 03/19] State before directory reorganization --- cuhd/lib/radio_uhd.cc | 2 +- srslte/include/srslte/agc/agc.h | 2 +- srslte/include/srslte/phch/dci.h | 12 +++- srslte/include/srslte/phch/pdcch.h | 2 +- srslte/include/srslte/ue_itf/dl_buffer.h | 29 +++----- srslte/include/srslte/ue_itf/dl_sched_grant.h | 1 + srslte/include/srslte/ue_itf/log.h | 5 ++ srslte/include/srslte/ue_itf/params_db.h | 7 +- srslte/include/srslte/ue_itf/phy.h | 6 +- srslte/include/srslte/ue_itf/phy_params.h | 3 +- srslte/include/srslte/ue_itf/prach.h | 3 + srslte/include/srslte/ue_itf/sched_grant.h | 48 ++++++++++++-- srslte/include/srslte/ue_itf/ul_buffer.h | 2 +- srslte/include/srslte/ue_itf/ul_sched_grant.h | 7 ++ srslte/lib/ch_estimation/src/chest_dl.c | 5 +- srslte/lib/phch/src/dci.c | 14 +++- srslte/lib/phch/src/pdcch.c | 10 +-- srslte/lib/phch/test/pdcch_file_test.c | 2 +- srslte/lib/ue_itf/src/dl_buffer.cc | 66 +++++++++++++------ srslte/lib/ue_itf/src/phy.cc | 32 +++++---- srslte/lib/ue_itf/src/prach.cc | 13 +++- srslte/lib/ue_itf/src/ul_buffer.cc | 15 +++++ srslte/lib/ue_itf/test/ue_itf_test_prach.cc | 4 +- srslte/lib/ue_itf/test/ue_itf_test_sib1.cc | 2 +- 24 files changed, 211 insertions(+), 81 deletions(-) diff --git a/cuhd/lib/radio_uhd.cc b/cuhd/lib/radio_uhd.cc index 74b67834b..7e25be61c 100644 --- a/cuhd/lib/radio_uhd.cc +++ b/cuhd/lib/radio_uhd.cc @@ -49,7 +49,7 @@ bool radio_uhd::init(char *args) bool radio_uhd::rx_at(void* buffer, uint32_t nof_samples, srslte_timestamp_t rx_time) { - fprintf(stderr, "Not implemented\n"); + fprintf(stderr, "UHD Receive at time not implemented\n"); return false; } diff --git a/srslte/include/srslte/agc/agc.h b/srslte/include/srslte/agc/agc.h index f891d7d31..5b150c93c 100644 --- a/srslte/include/srslte/agc/agc.h +++ b/srslte/include/srslte/agc/agc.h @@ -43,7 +43,7 @@ #include "srslte/config.h" -#define SRSLTE_AGC_DEFAULT_TARGET 1.0 +#define SRSLTE_AGC_DEFAULT_TARGET 0.7 #define SRSLTE_AGC_DEFAULT_BW (5e-2) typedef enum SRSLTE_API { diff --git a/srslte/include/srslte/phch/dci.h b/srslte/include/srslte/phch/dci.h index fb651e0a1..c23342144 100644 --- a/srslte/include/srslte/phch/dci.h +++ b/srslte/include/srslte/phch/dci.h @@ -44,7 +44,9 @@ #include "srslte/common/phy_common.h" #include "srslte/phch/ra.h" -#define DCI_MAX_BITS 57 +#define SRSLTE_DCI_MAX_BITS 57 + +#define SRSLTE_RAR_GRANT_LEN 20 typedef enum { SRSLTE_DCI_FORMAT0, @@ -77,13 +79,16 @@ typedef struct SRSLTE_API { } srslte_dci_location_t; typedef struct SRSLTE_API { - uint8_t data[DCI_MAX_BITS]; + uint8_t data[SRSLTE_DCI_MAX_BITS]; uint32_t nof_bits; } srslte_dci_msg_t; typedef struct SRSLTE_API { uint32_t rba; uint32_t trunc_mcs; + uint32_t tpc_pusch; + bool ul_delay; + bool cqi_request; bool hopping_flag; } srslte_dci_rar_grant_t; @@ -112,6 +117,9 @@ SRSLTE_API int srslte_dci_rar_to_ul_grant(srslte_dci_rar_grant_t *rar, srslte_ra_ul_dci_t *ul_dci, srslte_ra_ul_grant_t *grant); +SRSLTE_API void srslte_dci_rar_grant_unpack(srslte_dci_rar_grant_t *rar, + uint8_t grant[SRSLTE_RAR_GRANT_LEN]); + SRSLTE_API srslte_dci_format_t srslte_dci_format_from_string(char *str); SRSLTE_API char* srslte_dci_format_string(srslte_dci_format_t format); diff --git a/srslte/include/srslte/phch/pdcch.h b/srslte/include/srslte/phch/pdcch.h index 82fb9e0e0..2b77b804a 100644 --- a/srslte/include/srslte/phch/pdcch.h +++ b/srslte/include/srslte/phch/pdcch.h @@ -73,7 +73,7 @@ typedef struct SRSLTE_API { cf_t *x[SRSLTE_MAX_PORTS]; cf_t *d; uint8_t *e; - float rm_f[3 * (DCI_MAX_BITS + 16)]; + float rm_f[3 * (SRSLTE_DCI_MAX_BITS + 16)]; float *llr; /* tx & rx objects */ diff --git a/srslte/include/srslte/ue_itf/dl_buffer.h b/srslte/include/srslte/ue_itf/dl_buffer.h index addbb2437..70075f56f 100644 --- a/srslte/include/srslte/ue_itf/dl_buffer.h +++ b/srslte/include/srslte/ue_itf/dl_buffer.h @@ -42,33 +42,20 @@ namespace ue { */ class SRSLTE_API dl_buffer : public queue::element { public: - typedef enum { - PDCCH_UL_SEARCH_CRNTI = 0, - PDCCH_UL_SEARCH_RA_PROC, - PDCCH_UL_SEARCH_SPS, - PDCCH_UL_SEARCH_TEMPORAL, - PDCCH_UL_SEARCH_TPC_PUSCH, - PDCCH_UL_SEARCH_TPC_PUCCH - } pdcch_ul_search_t; - - typedef enum { - PDCCH_DL_SEARCH_CRNTI = 0, - PDCCH_DL_SEARCH_SIRNTI, - PDCCH_DL_SEARCH_PRNTI, - PDCCH_DL_SEARCH_RARNTI, - PDCCH_DL_SEARCH_TEMPORAL, - PDCCH_DL_SEARCH_SPS - } pdcch_dl_search_t; - + int buffer_id; bool init_cell(srslte_cell_t cell, phy_params *params_db); void free_cell(); bool recv_ue_sync(srslte_ue_sync_t *ue_sync, srslte_timestamp_t *rx_time); - bool get_ul_grant(pdcch_ul_search_t mode, ul_sched_grant *grant); - bool get_dl_grant(pdcch_dl_search_t mode, dl_sched_grant *grant); + bool get_ul_grant(ul_sched_grant *grant); + bool get_dl_grant(dl_sched_grant *grant); + void discard_pending_rar_grant(); + void set_rar_grant(srslte_dci_rar_grant_t *rar_grant); + void set_rar_grant(uint8_t grant[SRSLTE_RAR_GRANT_LEN]); bool decode_ack(ul_sched_grant *pusch_grant); bool decode_data(dl_sched_grant *pdsch_grant, uint8_t *payload); // returns true or false for CRC OK/NOK + bool decode_data(dl_sched_grant *grant, srslte_softbuffer_rx_t *softbuffer, uint8_t *payload); private: phy_params *params_db; @@ -79,6 +66,8 @@ namespace ue { uint32_t cfi; bool sf_symbols_and_ce_done; bool pdcch_llr_extracted; + bool pending_rar_grant; + srslte_dci_rar_grant_t rar_grant; }; } } diff --git a/srslte/include/srslte/ue_itf/dl_sched_grant.h b/srslte/include/srslte/ue_itf/dl_sched_grant.h index 2048f8d21..76eab82e4 100644 --- a/srslte/include/srslte/ue_itf/dl_sched_grant.h +++ b/srslte/include/srslte/ue_itf/dl_sched_grant.h @@ -39,6 +39,7 @@ namespace ue { class SRSLTE_API dl_sched_grant : public sched_grant { public: + dl_sched_grant(rnti_type_t type, uint16_t rnti) : sched_grant(type, rnti) {} dl_sched_grant(uint16_t rnti) : sched_grant(rnti) {} uint32_t get_rv() { diff --git a/srslte/include/srslte/ue_itf/log.h b/srslte/include/srslte/ue_itf/log.h index 0045ec3e3..e054574f9 100644 --- a/srslte/include/srslte/ue_itf/log.h +++ b/srslte/include/srslte/ue_itf/log.h @@ -39,6 +39,11 @@ #ifndef LOG_H #define LOG_H +#define Error(fmt, ...) log_h->error(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define Warning(fmt, ...) log_h->warning(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define Info(fmt, ...) log_h->info(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define Debug(fmt, ...) log_h->debug(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) + using namespace std; namespace srslte { diff --git a/srslte/include/srslte/ue_itf/params_db.h b/srslte/include/srslte/ue_itf/params_db.h index c7d898f2a..879a96cf6 100644 --- a/srslte/include/srslte/ue_itf/params_db.h +++ b/srslte/include/srslte/ue_itf/params_db.h @@ -24,6 +24,7 @@ * and at http://www.gnu.org/licenses/. * */ +#include #include "srslte/srslte.h" @@ -37,10 +38,12 @@ namespace ue { public: params_db(uint32_t nof_params_) { nof_params = nof_params_; - db = new int64_t[nof_params_]; + db = (int64_t*) calloc(sizeof(int64_t), nof_params); } ~params_db() { - delete db; + if (db) { + free(db); + } } void set_param(uint32_t param_idx, int64_t value) { if (param_idx < nof_params) { diff --git a/srslte/include/srslte/ue_itf/phy.h b/srslte/include/srslte/ue_itf/phy.h index 125431d0e..a822c1d71 100644 --- a/srslte/include/srslte/ue_itf/phy.h +++ b/srslte/include/srslte/ue_itf/phy.h @@ -63,6 +63,7 @@ public: started = false; is_sfn_synched = false; cell_is_set = false; + phy_state = IDLE; } bool init(radio *radio_handler, tti_sync *ttisync); void stop(); @@ -78,7 +79,10 @@ public: bool stop_rxtx(); // Indicate the PHY to send PRACH as soon as possible + bool init_prach(); bool send_prach(uint32_t preamble_idx); + bool send_prach(uint32_t preamble_idx, int allowed_subframe); + bool send_prach(uint32_t preamble_idx, int allowed_subframe, int target_power_dbm); // Returns TTI when PRACH was transmitted. -1 if not yet transmitted int get_prach_transmitted_tti(); @@ -90,7 +94,7 @@ public: void set_timeadv_rar(uint32_t ta_cmd); void set_timeadv(uint32_t ta_cmd); - // Generate Msg3 UL grant from RAR + // Convert Msg3 UL grant to ul_sched_grant void rar_ul_grant(srslte_dci_rar_grant_t *rar, ul_sched_grant *grant); // Get status diff --git a/srslte/include/srslte/ue_itf/phy_params.h b/srslte/include/srslte/ue_itf/phy_params.h index cc0c702db..44ca38710 100644 --- a/srslte/include/srslte/ue_itf/phy_params.h +++ b/srslte/include/srslte/ue_itf/phy_params.h @@ -53,6 +53,7 @@ namespace ue { CELLSEARCH_TIMEOUT_PSS_CORRELATION_THRESHOLD, // integer that will be divided by 10 PUSCH_BETA, + PUSCH_EN_64QAM, PUSCH_RS_GROUP_HOPPING_EN, PUSCH_RS_SEQUENCE_HOPPING_EN, PUSCH_RS_CYCLIC_SHIFT, @@ -61,7 +62,7 @@ namespace ue { PUSCH_HOPPING_N_SB, PUSCH_HOPPING_INTRA_SF, PUSCH_HOPPING_OFFSET, - + PUCCH_BETA, PUCCH_DELTA_SHIFT, PUCCH_CYCLIC_SHIFT, diff --git a/srslte/include/srslte/ue_itf/prach.h b/srslte/include/srslte/ue_itf/prach.h index 50e7227cb..a93c772ae 100644 --- a/srslte/include/srslte/ue_itf/prach.h +++ b/srslte/include/srslte/ue_itf/prach.h @@ -46,6 +46,8 @@ namespace ue { bool init_cell(srslte_cell_t cell, phy_params *params_db); void free_cell(); bool prepare_to_send(uint32_t preamble_idx); + bool prepare_to_send(uint32_t preamble_idx, int allowed_subframe); + bool prepare_to_send(uint32_t preamble_idx, int allowed_subframe, int target_power_dbm); bool is_ready_to_send(uint32_t current_tti); int get_transmitted_tti(); bool send(srslte::radio* radio_handler, float cfo, srslte_timestamp_t rx_time); @@ -53,6 +55,7 @@ namespace ue { static const uint32_t tx_advance_sf = 1; // Number of subframes to advance transmission phy_params *params_db = NULL; int preamble_idx; + int allowed_subframe; bool initiated = false; uint32_t len; cf_t *buffer[64]; diff --git a/srslte/include/srslte/ue_itf/sched_grant.h b/srslte/include/srslte/ue_itf/sched_grant.h index deaf5ba4b..2f411473b 100644 --- a/srslte/include/srslte/ue_itf/sched_grant.h +++ b/srslte/include/srslte/ue_itf/sched_grant.h @@ -37,12 +37,47 @@ namespace ue { /* Uplink/Downlink scheduling grant generated by a successfully decoded PDCCH */ class SRSLTE_API sched_grant { public: - sched_grant(uint16_t rnti_) { - rnti = rnti_; - } - uint16_t get_rnti() { - return rnti; - } + typedef enum { + RNTI_TYPE_NOTDEFINED = 0, + RNTI_TYPE_CRNTI, + RNTI_TYPE_RA, + RNTI_TYPE_SPS, + RNTI_TYPE_TEMP, + RNTI_TYPE_SIRNTI, + RNTI_TYPE_PRNTI, + RNTI_TYPE_TPC_PUSCH, + RNTI_TYPE_TPC_PUCCH + } rnti_type_t; + + sched_grant(uint16_t rnti_) { + rnti = rnti_; + rnti_type = RNTI_TYPE_NOTDEFINED; + } + sched_grant(rnti_type_t rnti_type_, uint16_t rnti_) { + rnti = rnti_; + rnti_type = rnti_type_; + } + uint16_t get_rnti() { + return rnti; + } + bool is_temp_rnti() { + return rnti_type == RNTI_TYPE_TEMP; + } + bool is_crnti() { + return rnti_type == RNTI_TYPE_CRNTI; + } + bool is_ra_rnti() { + return rnti_type == RNTI_TYPE_RA; + } + bool is_SPS_rnti() { + return rnti_type == RNTI_TYPE_SPS; + } + bool is_sys_rnti() { + return (rnti_type == RNTI_TYPE_SIRNTI || rnti_type == RNTI_TYPE_PRNTI); + } + bool is_tpc_rnti() { + return (rnti_type == RNTI_TYPE_TPC_PUSCH || rnti_type == RNTI_TYPE_TPC_PUCCH); + } virtual uint32_t get_rv() = 0; virtual void set_rv(uint32_t rv) = 0; virtual bool get_ndi() = 0; @@ -51,6 +86,7 @@ namespace ue { virtual uint32_t get_tbs() = 0; protected: uint16_t rnti; + rnti_type_t rnti_type; }; } diff --git a/srslte/include/srslte/ue_itf/ul_buffer.h b/srslte/include/srslte/ue_itf/ul_buffer.h index 1ad7ee3ce..2774b49a9 100644 --- a/srslte/include/srslte/ue_itf/ul_buffer.h +++ b/srslte/include/srslte/ue_itf/ul_buffer.h @@ -47,7 +47,6 @@ namespace ue { public: bool init_cell(srslte_cell_t cell, phy_params *params_db); void free_cell(); - void set_tti(uint32_t tti); void set_current_tx_nb(uint32_t current_tx_nb); bool generate_ack(bool ack, dl_sched_grant *last_dl_grant); bool generate_ack(bool ack[2]); @@ -56,6 +55,7 @@ namespace ue { bool uci_ready(); bool generate_data(); bool generate_data(ul_sched_grant *pusch_grant, uint8_t *payload); + bool generate_data(ul_sched_grant *pusch_grant, srslte_softbuffer_tx_t *softbuffer, uint8_t *payload); bool send(radio* radio_handler, float time_adv_sec, float cfo, srslte_timestamp_t rx_time); static const uint32_t tx_advance_sf = 1; // Number of subframes to advance transmission diff --git a/srslte/include/srslte/ue_itf/ul_sched_grant.h b/srslte/include/srslte/ue_itf/ul_sched_grant.h index 7fa907761..c80e87d32 100644 --- a/srslte/include/srslte/ue_itf/ul_sched_grant.h +++ b/srslte/include/srslte/ue_itf/ul_sched_grant.h @@ -39,6 +39,7 @@ namespace ue { class SRSLTE_API ul_sched_grant : public sched_grant { public: + ul_sched_grant(rnti_type_t type, uint16_t rnti) : sched_grant(type, rnti) {} ul_sched_grant(uint16_t rnti) : sched_grant(rnti) {} uint32_t get_rv() { @@ -77,7 +78,11 @@ namespace ue { uint32_t get_n_dmrs() { return ul_dci.n_dmrs; } + bool is_from_rar() { + return grant_is_from_rar; + } bool create_from_dci(srslte_dci_msg_t *msg, srslte_cell_t cell, uint32_t N_srs, uint32_t n_rb_ho) { + grant_is_from_rar = false; if (srslte_dci_msg_to_ul_grant(msg, cell, N_srs, n_rb_ho, &ul_dci, &grant)) { return false; } else { @@ -88,6 +93,7 @@ namespace ue { } } bool create_from_rar(srslte_dci_rar_grant_t *rar, srslte_cell_t cell, uint32_t N_srs, uint32_t n_rb_ho) { + grant_is_from_rar = true; if (srslte_dci_rar_to_ul_grant(rar, cell, N_srs, n_rb_ho, &ul_dci, &grant)) { return false; } else { @@ -109,6 +115,7 @@ namespace ue { srslte_ra_ul_dci_t ul_dci; uint32_t current_tx_nb; uint16_t rnti; + bool grant_is_from_rar; }; } diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/src/chest_dl.c index b61793753..ac0c07925 100644 --- a/srslte/lib/ch_estimation/src/chest_dl.c +++ b/srslte/lib/ch_estimation/src/chest_dl.c @@ -74,7 +74,7 @@ int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell) perror("malloc"); goto clean_exit; } - q->tmp_noise = srslte_vec_malloc(sizeof(cf_t) * SRSLTE_REFSIGNAL_MAX_NUM_SF(cell.nof_prb)); + q->tmp_noise = srslte_vec_malloc(sizeof(cf_t) * 2 * SRSLTE_REFSIGNAL_MAX_NUM_SF(cell.nof_prb)); if (!q->tmp_noise) { perror("malloc"); goto clean_exit; @@ -99,7 +99,8 @@ int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell) perror("malloc"); goto clean_exit; } - q->pilot_estimates_average[i] = srslte_vec_malloc(sizeof(cf_t) * SRSLTE_REFSIGNAL_NUM_SF(cell.nof_prb, i)); + // FIXME: There's an invalid read during rsrp estimation for this buffer + q->pilot_estimates_average[i] = srslte_vec_malloc(2 * sizeof(cf_t) * SRSLTE_REFSIGNAL_NUM_SF(cell.nof_prb, i)); if (!q->pilot_estimates_average[i]) { perror("malloc"); goto clean_exit; diff --git a/srslte/lib/phch/src/dci.c b/srslte/lib/phch/src/dci.c index 7bbbac856..2dd8f0bf6 100644 --- a/srslte/lib/phch/src/dci.c +++ b/srslte/lib/phch/src/dci.c @@ -78,7 +78,7 @@ int srslte_dci_msg_to_dl_grant(srslte_dci_msg_t *msg, uint16_t msg_rnti, crc_is_crnti = true; } if (srslte_dci_msg_unpack_pdsch(msg, dl_dci, cell.nof_prb, crc_is_crnti)) { - fprintf(stderr, "Can't unpack PDSCH message\n"); + fprintf(stderr, "Can't unpack DCI message\n"); return ret; } @@ -140,6 +140,18 @@ int srslte_dci_rar_to_ul_grant(srslte_dci_rar_grant_t *rar, srslte_cell_t cell, return SRSLTE_SUCCESS; } +/* Unpack RAR UL grant as defined in Section 6.2 of 36.213 */ +void srslte_dci_rar_grant_unpack(srslte_dci_rar_grant_t *rar, uint8_t grant[SRSLTE_RAR_GRANT_LEN]) +{ + uint8_t *grant_ptr = grant; + rar->hopping_flag = srslte_bit_unpack(&grant_ptr, 1)?true:false; + rar->rba = srslte_bit_unpack(&grant_ptr, 10); + rar->trunc_mcs = srslte_bit_unpack(&grant_ptr, 4); + rar->tpc_pusch = srslte_bit_unpack(&grant_ptr, 3); + rar->ul_delay = srslte_bit_unpack(&grant_ptr, 1)?true:false; + rar->cqi_request = srslte_bit_unpack(&grant_ptr, 1)?true:false; +} + /* Creates the UL PUSCH resource allocation grant from a DCI format 0 message */ int srslte_dci_msg_to_ul_grant(srslte_dci_msg_t *msg, srslte_cell_t cell, diff --git a/srslte/lib/phch/src/pdcch.c b/srslte/lib/phch/src/pdcch.c index 5ac649bc2..d693ad790 100644 --- a/srslte/lib/phch/src/pdcch.c +++ b/srslte/lib/phch/src/pdcch.c @@ -98,7 +98,7 @@ int srslte_pdcch_init(srslte_pdcch_t *q, srslte_regs_t *regs, srslte_cell_t cell } uint32_t poly[3] = { 0x6D, 0x4F, 0x57 }; - if (srslte_viterbi_init(&q->decoder, SRSLTE_VITERBI_37, poly, DCI_MAX_BITS + 16, true)) { + if (srslte_viterbi_init(&q->decoder, SRSLTE_VITERBI_37, poly, SRSLTE_DCI_MAX_BITS + 16, true)) { goto clean; } @@ -281,7 +281,7 @@ static int dci_decode(srslte_pdcch_t *q, float *e, uint8_t *data, uint32_t E, ui if (q != NULL && data != NULL && E <= q->max_bits && - nof_bits <= DCI_MAX_BITS) + nof_bits <= SRSLTE_DCI_MAX_BITS) { /* unrate matching */ @@ -441,12 +441,12 @@ static void crc_set_mask_rnti(uint8_t *crc, uint16_t rnti) { static int dci_encode(srslte_pdcch_t *q, uint8_t *data, uint8_t *e, uint32_t nof_bits, uint32_t E, uint16_t rnti) { srslte_convcoder_t encoder; - uint8_t tmp[3 * (DCI_MAX_BITS + 16)]; + uint8_t tmp[3 * (SRSLTE_DCI_MAX_BITS + 16)]; if (q != NULL && data != NULL && e != NULL && - nof_bits < DCI_MAX_BITS && + nof_bits < SRSLTE_DCI_MAX_BITS && E < q->max_bits) { @@ -506,7 +506,7 @@ int srslte_pdcch_encode(srslte_pdcch_t *q, srslte_dci_msg_t *msg, srslte_dci_loc ret = SRSLTE_ERROR; if (location.ncce + PDCCH_FORMAT_NOF_CCE(location.L) <= q->nof_cce && - msg->nof_bits < DCI_MAX_BITS) + msg->nof_bits < SRSLTE_DCI_MAX_BITS) { INFO("Encoding DCI: Nbits: %d, E: %d, nCCE: %d, L: %d, RNTI: 0x%x\n", msg->nof_bits, e_bits, location.ncce, location.L, rnti); diff --git a/srslte/lib/phch/test/pdcch_file_test.c b/srslte/lib/phch/test/pdcch_file_test.c index cae04d8c2..fdcb99507 100644 --- a/srslte/lib/phch/test/pdcch_file_test.c +++ b/srslte/lib/phch/test/pdcch_file_test.c @@ -266,7 +266,7 @@ int main(int argc, char **argv) { case SRSLTE_DCI_MSG_TYPE_PDSCH_SCHED: bzero(&ra_dl, sizeof(srslte_ra_dl_dci_t)); if (srslte_dci_msg_unpack_pdsch(&dci_msg, &ra_dl, cell.nof_prb, rnti != SRSLTE_SIRNTI)) { - fprintf(stderr, "Can't unpack PDSCH message\n"); + fprintf(stderr, "Can't unpack DCI message\n"); } else { srslte_ra_pdsch_fprint(stdout, &ra_dl, cell.nof_prb); if (ra_dl.alloc_type == SRSLTE_RA_ALLOC_TYPE2 && ra_dl.type2_alloc.mode == SRSLTE_RA_TYPE2_LOC diff --git a/srslte/lib/ue_itf/src/dl_buffer.cc b/srslte/lib/ue_itf/src/dl_buffer.cc index aed1d5dbf..392bb0aeb 100644 --- a/srslte/lib/ue_itf/src/dl_buffer.cc +++ b/srslte/lib/ue_itf/src/dl_buffer.cc @@ -45,6 +45,7 @@ bool dl_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_) cell = cell_; sf_symbols_and_ce_done = false; pdcch_llr_extracted = false; + pending_rar_grant = false; tti = 0; if (!srslte_ue_dl_init(&ue_dl, cell)) { signal_buffer = (cf_t*) srslte_vec_malloc(sizeof(cf_t) * SRSLTE_SF_LEN_PRB(cell.nof_prb)); @@ -81,33 +82,55 @@ bool dl_buffer::recv_ue_sync(srslte_ue_sync_t *ue_sync, srslte_timestamp_t *rx_t return ret; } -bool dl_buffer::get_ul_grant(pdcch_ul_search_t mode, ul_sched_grant *grant) +void dl_buffer::discard_pending_rar_grant() { + pending_rar_grant = false; +} + +bool dl_buffer::get_ul_grant(ul_sched_grant *grant) { if (signal_buffer) { - if (!sf_symbols_and_ce_done) { - if (srslte_ue_dl_decode_fft_estimate(&ue_dl, signal_buffer, tti%10, &cfi) < 0) { - return false; + printf("get_ul_grant tti=%d, is_temp_rnti=%d\n", tti, grant->is_temp_rnti()); + if (pending_rar_grant && grant->is_temp_rnti()) { + printf("Get pending RAR grant tti=%d\n", tti); + return grant->create_from_rar(&rar_grant, cell, 0, params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET)); + } else { + if (!sf_symbols_and_ce_done) { + if (srslte_ue_dl_decode_fft_estimate(&ue_dl, signal_buffer, tti%10, &cfi) < 0) { + return false; + } + sf_symbols_and_ce_done = true; } - sf_symbols_and_ce_done = true; - } - if (!pdcch_llr_extracted) { - if (srslte_pdcch_extract_llr(&ue_dl.pdcch, ue_dl.sf_symbols, ue_dl.ce, 0, tti%10, cfi)) { + if (!pdcch_llr_extracted) { + if (srslte_pdcch_extract_llr(&ue_dl.pdcch, ue_dl.sf_symbols, ue_dl.ce, 0, tti%10, cfi)) { + return false; + } + pdcch_llr_extracted = true; + } + + srslte_dci_msg_t dci_msg; + if (srslte_ue_dl_find_ul_dci(&ue_dl, &dci_msg, cfi, tti%10, grant->get_rnti()) != 1) { return false; } - pdcch_llr_extracted = true; - } - - srslte_dci_msg_t dci_msg; - if (srslte_ue_dl_find_ul_dci(&ue_dl, &dci_msg, cfi, tti%10, grant->get_rnti())) { - return false; - } - - return grant->create_from_dci(&dci_msg, cell, 0, params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET)); + + return grant->create_from_dci(&dci_msg, cell, 0, params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET)); + } } +} +void dl_buffer::set_rar_grant(uint8_t grant[SRSLTE_RAR_GRANT_LEN]) +{ + srslte_dci_rar_grant_t rar_grant; + } -bool dl_buffer::get_dl_grant(pdcch_dl_search_t mode, dl_sched_grant *grant) +void dl_buffer::set_rar_grant(srslte_dci_rar_grant_t* rar_grant_) +{ + printf("Set pending RAR grant tti=%d\n", tti); + pending_rar_grant = true; + memcpy(&rar_grant, rar_grant_, sizeof(srslte_dci_rar_grant_t)); +} + +bool dl_buffer::get_dl_grant(dl_sched_grant *grant) { if (signal_buffer && is_ready()) { INFO("DL Buffer TTI %d: Getting DL grant\n", tti); @@ -157,6 +180,11 @@ bool dl_buffer::decode_ack(ul_sched_grant *grant) } bool dl_buffer::decode_data(dl_sched_grant *grant, uint8_t *payload) +{ + return decode_data(grant, &ue_dl.softbuffer, payload); +} + +bool dl_buffer::decode_data(dl_sched_grant *grant, srslte_softbuffer_rx_t *softbuffer, uint8_t *payload) { if (signal_buffer && is_ready()) { INFO("DL Buffer TTI %d: Decoding PDSCH\n", tti); @@ -170,7 +198,7 @@ bool dl_buffer::decode_data(dl_sched_grant *grant, uint8_t *payload) grant->get_pdsch_cfg(tti%10, &ue_dl.pdsch_cfg); if (ue_dl.pdsch_cfg.grant.mcs.mod > 0 && ue_dl.pdsch_cfg.grant.mcs.tbs >= 0) { - int ret = srslte_pdsch_decode_rnti(&ue_dl.pdsch, &ue_dl.pdsch_cfg, &ue_dl.softbuffer, ue_dl.sf_symbols, + int ret = srslte_pdsch_decode_rnti(&ue_dl.pdsch, &ue_dl.pdsch_cfg, softbuffer, ue_dl.sf_symbols, ue_dl.ce, 0, grant->get_rnti(), payload); if (SRSLTE_VERBOSE_ISINFO()) { diff --git a/srslte/lib/ue_itf/src/phy.cc b/srslte/lib/ue_itf/src/phy.cc index 6865bb983..fbecc53f3 100644 --- a/srslte/lib/ue_itf/src/phy.cc +++ b/srslte/lib/ue_itf/src/phy.cc @@ -114,10 +114,16 @@ void phy::set_param(phy_params::phy_param_t param, int64_t value) { // FIXME: Add PRACH power control -bool phy::send_prach(uint32_t preamble_idx) +bool phy::send_prach(uint32_t preamble_idx) { + send_prach(preamble_idx, -1, 0); +} +bool phy::send_prach(uint32_t preamble_idx, int allowed_subframe) { + send_prach(preamble_idx, allowed_subframe, 0); +} +bool phy::send_prach(uint32_t preamble_idx, int allowed_subframe, int target_power_dbm) { if (phy_state == RXTX) { - return prach_buffer.prepare_to_send(preamble_idx); + return prach_buffer.prepare_to_send(preamble_idx, allowed_subframe, target_power_dbm); } return false; } @@ -209,16 +215,14 @@ bool phy::set_cell(srslte_cell_t cell_) { { srslte_ue_sync_set_cfo(&ue_sync, cellsearch_cfo); - if (prach_buffer.init_cell(cell, ¶ms_db)) { - for(uint32_t i=0;i<6;i++) { - ((ul_buffer*) ul_buffer_queue->get(i))->init_cell(cell, ¶ms_db); - ((dl_buffer*) dl_buffer_queue->get(i))->init_cell(cell, ¶ms_db); - ((dl_buffer*) dl_buffer_queue->get(i))->buffer_id = i; - ((ul_buffer*) ul_buffer_queue->get(i))->ready(); - ((dl_buffer*) dl_buffer_queue->get(i))->release(); - } - cell_is_set = true; - } + for(uint32_t i=0;i<6;i++) { + ((ul_buffer*) ul_buffer_queue->get(i))->init_cell(cell, ¶ms_db); + ((dl_buffer*) dl_buffer_queue->get(i))->init_cell(cell, ¶ms_db); + ((dl_buffer*) dl_buffer_queue->get(i))->buffer_id = i; + ((ul_buffer*) ul_buffer_queue->get(i))->ready(); + ((dl_buffer*) dl_buffer_queue->get(i))->release(); + } + cell_is_set = true; } else { fprintf(stderr, "Error setting cell: initiating ue_sync"); } @@ -231,6 +235,10 @@ bool phy::set_cell(srslte_cell_t cell_) { return cell_is_set; } +bool phy::init_prach() { + return prach_buffer.init_cell(cell, ¶ms_db); +} + ul_buffer* phy::get_ul_buffer(uint32_t tti) { return (ul_buffer*) ul_buffer_queue->get(tti); diff --git a/srslte/lib/ue_itf/src/prach.cc b/srslte/lib/ue_itf/src/prach.cc index 2bb573a7b..ecdb9ea8e 100644 --- a/srslte/lib/ue_itf/src/prach.cc +++ b/srslte/lib/ue_itf/src/prach.cc @@ -85,10 +85,17 @@ bool prach::init_cell(srslte_cell_t cell_, phy_params *params_db_) return initiated; } -bool prach::prepare_to_send(uint32_t preamble_idx_) +bool prach::prepare_to_send(uint32_t preamble_idx_) { + prepare_to_send(preamble_idx_, -1, 0); +} +bool prach::prepare_to_send(uint32_t preamble_idx_, int allowed_subframe_) { + prepare_to_send(preamble_idx_, allowed_subframe_, 0); +} +bool prach::prepare_to_send(uint32_t preamble_idx_, int allowed_subframe_, int target_power_dbm) { if (initiated && preamble_idx_ < 64) { preamble_idx = preamble_idx_; + allowed_subframe = allowed_subframe_; transmitted_tti = -1; INFO("PRACH Buffer: Prepare to send preamble %d\n", preamble_idx); return true; @@ -112,7 +119,9 @@ bool prach::is_ready_to_send(uint32_t current_tti_) { srslte_prach_sf_config_t sf_config; srslte_prach_sf_config(config_idx, &sf_config); for (int i=0;i= 3 && interval_ra <= 13) { // Get DL grant for RA-RNTI=2 - if (dl_buffer->get_dl_grant(srslte::ue::dl_buffer::PDCCH_DL_SEARCH_RARNTI, &rar_grant)) + if (dl_buffer->get_dl_grant(&rar_grant)) { // Decode packet if (dl_buffer->decode_data(&rar_grant, payload)) { @@ -366,7 +366,7 @@ void run_tti(uint32_t tti) { srslte::ue::dl_sched_grant conn_setup_grant(rar_msg.temp_c_rnti); bool connsetup_recv = false; // Get DL grant for tmp_rnti - if (dl_buffer->get_dl_grant(srslte::ue::dl_buffer::PDCCH_DL_SEARCH_TEMPORAL, &conn_setup_grant)) + if (dl_buffer->get_dl_grant(&conn_setup_grant)) { // Decode packet if (dl_buffer->decode_data(&conn_setup_grant, payload)) { diff --git a/srslte/lib/ue_itf/test/ue_itf_test_sib1.cc b/srslte/lib/ue_itf/test/ue_itf_test_sib1.cc index 69100d0fe..8e25ac6d6 100644 --- a/srslte/lib/ue_itf/test/ue_itf_test_sib1.cc +++ b/srslte/lib/ue_itf/test/ue_itf_test_sib1.cc @@ -101,7 +101,7 @@ void run_tti(uint32_t tti) { srslte::ue::dl_buffer *buffer = phy.get_dl_buffer(tti); // Get DL grant - if (buffer->get_dl_grant(srslte::ue::dl_buffer::PDCCH_DL_SEARCH_SIRNTI, &grant)) + if (buffer->get_dl_grant(&grant)) { total_dci++; // MAC sets RV From 132c919dcf6a4afc57bfe860117237a422f69d25 Mon Sep 17 00:00:00 2001 From: ismagom Date: Fri, 8 May 2015 12:33:33 +0200 Subject: [PATCH 04/19] Changed directory structure. Compilation working with w/o UHD and srsGUI --- CMakeLists.txt | 20 +- cmake/modules/FindUHD.cmake | 4 +- cuhd/CMakeLists.txt | 48 -- cuhd/include/srslte/cuhd/cuhd_utils.h | 30 -- cuhd/lib/cuhd_utils.c | 79 --- {common => srsapps}/CMakeLists.txt | 24 +- srsapps/common/CMakeLists.txt | 28 ++ .../common/include/srsapps/common/binsem.h | 45 ++ .../common/include/srsapps/common}/log.h | 0 .../include/srsapps/common/log_stdout.h | 77 +++ .../include/srsapps/common}/params_db.h | 2 +- srsapps/common/include/srsapps/common/qbuff.h | 66 +++ .../common/include/srsapps/common}/queue.h | 4 +- .../common/include/srsapps/common/timers.h | 102 ++++ .../common/include/srsapps/common}/tti_sync.h | 2 +- .../include/srsapps/common}/tti_sync_cv.h | 4 +- srsapps/common/src/log_stdout.cc | 129 +++++ srsapps/common/src/qbuff.cc | 185 +++++++ .../ue_itf => srsapps/common}/src/queue.cc | 2 +- .../common}/src/tti_sync_cv.cc | 2 +- {cuhd/lib => srsapps/radio}/CMakeLists.txt | 23 +- .../radio/include/srsapps/radio}/radio_uhd.h | 0 {cuhd/lib => srsapps/radio/src}/radio_uhd.cc | 4 +- srsapps/ue/CMakeLists.txt | 27 + srsapps/ue/mac/CMakeLists.txt | 29 ++ srsapps/ue/mac/include/srsapps/ue/mac/demux.h | 53 ++ .../ue/mac/include/srsapps/ue/mac/dl_harq.h | 74 +++ .../ue/mac/include/srsapps/ue/mac/dl_sps.h | 31 ++ srsapps/ue/mac/include/srsapps/ue/mac/mac.h | 116 +++++ .../ue/mac/include/srsapps/ue/mac/mac_io.h | 84 ++++ .../mac/include/srsapps/ue/mac/mac_params.h | 67 +++ .../ue/mac/include/srsapps/ue/mac/mac_pdu.h | 137 ++++++ srsapps/ue/mac/include/srsapps/ue/mac/mux.h | 71 +++ srsapps/ue/mac/include/srsapps/ue/mac/proc.h | 34 ++ .../ue/mac/include/srsapps/ue/mac/proc_bsr.h | 30 ++ .../ue/mac/include/srsapps/ue/mac/proc_phr.h | 29 ++ .../ue/mac/include/srsapps/ue/mac/proc_ra.h | 133 +++++ .../ue/mac/include/srsapps/ue/mac/proc_sr.h | 30 ++ .../ue/mac/include/srsapps/ue/mac/ul_harq.h | 85 ++++ .../ue/mac/include/srsapps/ue/mac/ul_sps.h | 31 ++ srsapps/ue/mac/src/demux.cc | 150 ++++++ srsapps/ue/mac/src/dl_harq.cc | 194 ++++++++ srsapps/ue/mac/src/dl_sps.cc | 21 + srsapps/ue/mac/src/mac.cc | 460 ++++++++++++++++++ srsapps/ue/mac/src/mac_pdu.cc | 187 +++++++ srsapps/ue/mac/src/mux.cc | 271 +++++++++++ srsapps/ue/mac/src/proc_ra.cc | 442 +++++++++++++++++ srsapps/ue/mac/src/ul_harq.cc | 241 +++++++++ srsapps/ue/mac/test/CMakeLists.txt | 0 srsapps/ue/mac/test/mac_test.cc | 283 +++++++++++ srsapps/ue/phy/CMakeLists.txt | 32 ++ .../phy/include/srsapps/ue/phy}/dl_buffer.h | 8 +- .../include/srsapps/ue/phy}/dl_sched_grant.h | 2 +- .../ue/phy/include/srsapps/ue/phy}/phy.h | 14 +- .../phy/include/srsapps/ue/phy}/phy_params.h | 2 +- .../ue/phy/include/srsapps/ue/phy}/prach.h | 4 +- .../phy/include/srsapps/ue/phy}/sched_grant.h | 2 +- .../phy/include/srsapps/ue/phy}/ul_buffer.h | 8 +- .../include/srsapps/ue/phy}/ul_sched_grant.h | 2 +- .../ue/phy}/src/dl_buffer.cc | 8 +- .../lib/ue_itf => srsapps/ue/phy}/src/phy.cc | 8 +- .../ue_itf => srsapps/ue/phy}/src/prach.cc | 6 +- .../ue/phy}/src/ul_buffer.cc | 8 +- .../ue/phy}/test/CMakeLists.txt | 9 +- .../ue/phy}/test/ue_itf_test_prach.cc | 6 +- .../ue/phy}/test/ue_itf_test_sib1.cc | 6 +- srslte/CMakeLists.txt | 1 - srslte/examples/CMakeLists.txt | 57 +-- srslte/examples/cell_measurement.c | 2 +- srslte/examples/cell_search.c | 2 +- srslte/examples/pdsch_enodeb.c | 2 + srslte/examples/pdsch_ue.c | 11 +- srslte/examples/prach_ue.c | 2 +- .../tutorial_examples/CMakeLists.txt | 19 +- srslte/{ => examples}/tutorial_examples/pss.c | 0 .../tutorial_examples/simple_tx.c | 0 .../{ => examples}/tutorial_examples/ue_rx.c | 0 {common => srslte}/include/srslte/config.h | 0 {cuhd => srslte}/include/srslte/cuhd/cuhd.h | 1 - .../srslte/cuhd}/cuhd_utils.h | 37 +- srslte/lib/CMakeLists.txt | 49 +- .../lib/cuhd/src}/cuhd_handler.hpp | 0 .../lib => srslte/lib/cuhd/src}/cuhd_imp.cpp | 0 .../{examples => lib/cuhd/src}/cuhd_utils.c | 50 +- srslte/lib/fec/test/rm_turbo_test.c | 5 +- srslte/lib/sync/test/CMakeLists.txt | 14 +- 86 files changed, 4195 insertions(+), 372 deletions(-) delete mode 100644 cuhd/CMakeLists.txt delete mode 100644 cuhd/include/srslte/cuhd/cuhd_utils.h delete mode 100644 cuhd/lib/cuhd_utils.c rename {common => srsapps}/CMakeLists.txt (50%) create mode 100644 srsapps/common/CMakeLists.txt create mode 100644 srsapps/common/include/srsapps/common/binsem.h rename {srslte/include/srslte/ue_itf => srsapps/common/include/srsapps/common}/log.h (100%) create mode 100644 srsapps/common/include/srsapps/common/log_stdout.h rename {srslte/include/srslte/ue_itf => srsapps/common/include/srsapps/common}/params_db.h (98%) create mode 100644 srsapps/common/include/srsapps/common/qbuff.h rename {srslte/include/srslte/ue_itf => srsapps/common/include/srsapps/common}/queue.h (97%) create mode 100644 srsapps/common/include/srsapps/common/timers.h rename {srslte/include/srslte/ue_itf => srsapps/common/include/srsapps/common}/tti_sync.h (98%) rename {srslte/include/srslte/ue_itf => srsapps/common/include/srsapps/common}/tti_sync_cv.h (95%) create mode 100644 srsapps/common/src/log_stdout.cc create mode 100644 srsapps/common/src/qbuff.cc rename {srslte/lib/ue_itf => srsapps/common}/src/queue.cc (98%) rename {srslte/lib/ue_itf => srsapps/common}/src/tti_sync_cv.cc (97%) rename {cuhd/lib => srsapps/radio}/CMakeLists.txt (65%) rename {cuhd/include/srslte/cuhd => srsapps/radio/include/srsapps/radio}/radio_uhd.h (100%) rename {cuhd/lib => srsapps/radio/src}/radio_uhd.cc (96%) create mode 100644 srsapps/ue/CMakeLists.txt create mode 100644 srsapps/ue/mac/CMakeLists.txt create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/demux.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/mac.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/mux.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/proc.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h create mode 100644 srsapps/ue/mac/src/demux.cc create mode 100644 srsapps/ue/mac/src/dl_harq.cc create mode 100644 srsapps/ue/mac/src/dl_sps.cc create mode 100644 srsapps/ue/mac/src/mac.cc create mode 100644 srsapps/ue/mac/src/mac_pdu.cc create mode 100644 srsapps/ue/mac/src/mux.cc create mode 100644 srsapps/ue/mac/src/proc_ra.cc create mode 100644 srsapps/ue/mac/src/ul_harq.cc create mode 100644 srsapps/ue/mac/test/CMakeLists.txt create mode 100644 srsapps/ue/mac/test/mac_test.cc create mode 100644 srsapps/ue/phy/CMakeLists.txt rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/dl_buffer.h (93%) rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/dl_sched_grant.h (98%) rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/phy.h (94%) rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/phy_params.h (98%) rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/prach.h (96%) rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/sched_grant.h (98%) rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/ul_buffer.h (93%) rename {srslte/include/srslte/ue_itf => srsapps/ue/phy/include/srsapps/ue/phy}/ul_sched_grant.h (98%) rename {srslte/lib/ue_itf => srsapps/ue/phy}/src/dl_buffer.cc (97%) rename {srslte/lib/ue_itf => srsapps/ue/phy}/src/phy.cc (98%) rename {srslte/lib/ue_itf => srsapps/ue/phy}/src/prach.cc (98%) rename {srslte/lib/ue_itf => srsapps/ue/phy}/src/ul_buffer.cc (98%) rename {srslte/lib/ue_itf => srsapps/ue/phy}/test/CMakeLists.txt (81%) rename {srslte/lib/ue_itf => srsapps/ue/phy}/test/ue_itf_test_prach.cc (99%) rename {srslte/lib/ue_itf => srsapps/ue/phy}/test/ue_itf_test_sib1.cc (97%) rename srslte/{ => examples}/tutorial_examples/CMakeLists.txt (71%) rename srslte/{ => examples}/tutorial_examples/pss.c (100%) rename srslte/{ => examples}/tutorial_examples/simple_tx.c (100%) rename srslte/{ => examples}/tutorial_examples/ue_rx.c (100%) rename {common => srslte}/include/srslte/config.h (100%) rename {cuhd => srslte}/include/srslte/cuhd/cuhd.h (99%) rename srslte/{examples => include/srslte/cuhd}/cuhd_utils.h (58%) rename {cuhd/lib => srslte/lib/cuhd/src}/cuhd_handler.hpp (100%) rename {cuhd/lib => srslte/lib/cuhd/src}/cuhd_imp.cpp (100%) rename srslte/{examples => lib/cuhd/src}/cuhd_utils.c (85%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87d5a8d10..5bb92e8dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,19 +134,6 @@ MACRO(LIBLTE_SET_PIC) ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) ENDMACRO(LIBLTE_SET_PIC) -######################################################################## -# A macro for passing lists between different directories -# through an internal cache variable. -######################################################################## -MACRO (APPEND_INTERNAL_LIST LIST_NAME VALUE) - # If the list in not in the cache, create it. - IF (${LIST_NAME}) - SET (${LIST_NAME} "${${LIST_NAME}};${VALUE}" CACHE INTERNAL "Internal variable") - ELSE (${LIST_NAME}) - SET (${LIST_NAME} "${VALUE}" CACHE INTERNAL "Internal variable") - ENDIF (${LIST_NAME}) -ENDMACRO (APPEND_INTERNAL_LIST) - ######################################################################## # Print summary ######################################################################## @@ -156,15 +143,12 @@ MESSAGE(STATUS "Building for version: ${VERSION}") ######################################################################## # Add general includes and dependencies ######################################################################## -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/common/include) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/srslte/include/) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/cuhd/include) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/mex/include) ######################################################################## # Add the subdirectories ######################################################################## -ADD_SUBDIRECTORY(common) -ADD_SUBDIRECTORY(cuhd) ADD_SUBDIRECTORY(srslte) -add_subdirectory(mex) +ADD_SUBDIRECTORY(mex) +ADD_SUBDIRECTORY(srsapps) diff --git a/cmake/modules/FindUHD.cmake b/cmake/modules/FindUHD.cmake index 4f989718f..52e37d3fb 100644 --- a/cmake/modules/FindUHD.cmake +++ b/cmake/modules/FindUHD.cmake @@ -16,8 +16,8 @@ FIND_LIBRARY( HINTS $ENV{UHD_DIR}/lib PATHS /usr/local/lib /usr/lib - /usr/local/lib64 - /usr/local/lib32 + /usr/local/lib64 + /usr/local/lib32 ) INCLUDE(FindPackageHandleStandardArgs) diff --git a/cuhd/CMakeLists.txt b/cuhd/CMakeLists.txt deleted file mode 100644 index c0ab96c17..000000000 --- a/cuhd/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright 2012-2013 The srsLTE Developers. See the -# COPYRIGHT file at the top-level directory of this distribution. -# -# This file is part of the srsLTE library. -# -# srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation, either version 3 of -# the License, or (at your option) any later version. -# -# srsLTE is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# A copy of the GNU Lesser General Public License can be found in -# the LICENSE file in the top-level directory of this distribution -# and at http://www.gnu.org/licenses/. -# - -######################################################################## -# Install headers -######################################################################## -INSTALL(DIRECTORY include/ - DESTINATION "${INCLUDE_DIR}" - FILES_MATCHING PATTERN "*.h" - PATTERN ".svn" EXCLUDE -) - -######################################################################## -# Add headers to cmake project (useful for IDEs) -######################################################################## -SET(HEADERS_ALL "") -FILE(GLOB headers *) -FOREACH (_header ${headers}) - IF(IS_DIRECTORY ${_header}) - FILE(GLOB_RECURSE tmp "${_header}/*.h") - LIST(APPEND HEADERS_ALL ${tmp}) - ENDIF(IS_DIRECTORY ${_header}) -ENDFOREACH() -ADD_CUSTOM_TARGET (add_cuhd_headers SOURCES ${HEADERS_ALL}) - -######################################################################## -# Add the subdirectories -######################################################################## -ADD_SUBDIRECTORY(lib) - diff --git a/cuhd/include/srslte/cuhd/cuhd_utils.h b/cuhd/include/srslte/cuhd/cuhd_utils.h deleted file mode 100644 index 7f6654c97..000000000 --- a/cuhd/include/srslte/cuhd/cuhd_utils.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2014 The srsLTE Developers. See the - * COPYRIGHT file at the top-level directory of this distribution. - * - * \section LICENSE - * - * This file is part of the srsLTE library. - * - * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsLTE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * A copy of the GNU Lesser General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - -#include "srslte/config.h" - -SRSLTE_API int cuhd_rssi_scan(void *uhd, float *freqs, float *rssi, int nof_bands, double fs, int nsamp); diff --git a/cuhd/lib/cuhd_utils.c b/cuhd/lib/cuhd_utils.c deleted file mode 100644 index 95d68686a..000000000 --- a/cuhd/lib/cuhd_utils.c +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2014 The srsLTE Developers. See the - * COPYRIGHT file at the top-level directory of this distribution. - * - * \section LICENSE - * - * This file is part of the srsLTE library. - * - * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsLTE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * A copy of the GNU Lesser General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - -#include -#include -#include -#include - - -#include "srslte/cuhd/cuhd.h" -#include "srslte/utils/vector.h" -#include "srslte/utils/debug.h" - -int cuhd_rssi_scan(void *uhd, float *freqs, float *rssi, int nof_bands, double fs, int nsamp) { - int i, j; - int ret = -1; - _Complex float *buffer; - double f; - - buffer = calloc(nsamp, sizeof(_Complex float)); - if (!buffer) { - goto free_and_exit; - } - - cuhd_set_rx_gain(uhd, 20.0); - cuhd_set_rx_srate(uhd, fs); - - for (i=0;i + +#ifndef BINSEM_H +#define BINSEM_H + +/** Implementation of a binary semaphore using POSIX condition variable and mutex + */ + +namespace srslte { + + class binsem + { + public: + binsem() { + pthread_mutex_init(&mutex, NULL); + pthread_cond_init(&cv, NULL); + state = true; + } + ~binsem() { + pthread_mutex_destroy(&mutex); + pthread_cond_destroy(&cv); + } + void take() { + pthread_mutex_lock(&mutex); + while(!state) { + pthread_cond_wait(&cv, &mutex); + } + state = false; + pthread_mutex_unlock(&mutex); + } + void give() { + pthread_mutex_lock(&mutex); + pthread_cond_signal(&cv); + state = true; + pthread_mutex_unlock(&mutex); + } + private: + pthread_cond_t cv; + pthread_mutex_t mutex; + bool state; + }; +} + +#endif diff --git a/srslte/include/srslte/ue_itf/log.h b/srsapps/common/include/srsapps/common/log.h similarity index 100% rename from srslte/include/srslte/ue_itf/log.h rename to srsapps/common/include/srsapps/common/log.h diff --git a/srsapps/common/include/srsapps/common/log_stdout.h b/srsapps/common/include/srsapps/common/log_stdout.h new file mode 100644 index 000000000..cb2135493 --- /dev/null +++ b/srsapps/common/include/srsapps/common/log_stdout.h @@ -0,0 +1,77 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2014 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * A copy of the GNU Lesser General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include +#include +#include + +#include "srsapps/common/log.h" + +/****************************************************************************** + * File: log_stout.h + * + * Description: Logging service through standard output. Inherits log interface + * + * Reference: + *****************************************************************************/ + +#ifndef LOGSTDOUT_H +#define LOGSTDOUT_H + +using namespace std; + +namespace srslte { + +class log_stdout : public log +{ +public: + + log_stdout(string service_name_) : log(service_name_) { } + + void error(uint32_t tti, string message, ...); + void warning(uint32_t tti, string message, ...); + void info(uint32_t tti, string message, ...); + void debug(uint32_t tti, string message, ...); + + // Same with line and file info + void error(uint32_t tti, string file, int line, string message, ...); + void warning(uint32_t tti, string file, int line, string message, ...); + void info(uint32_t tti, string file, int line, string message, ...); + void debug(uint32_t tti, string file, int line, string message, ...); + +private: + typedef enum { + ERROR=0, WARNING, INFO, DEBUG, NOF_LEVELS + } level_t; + void printlog(level_t level, uint32_t tti, string file, int line, string message, va_list args); + void printlog(level_t level, uint32_t tti, string message, va_list args); +}; + +} + +#endif + diff --git a/srslte/include/srslte/ue_itf/params_db.h b/srsapps/common/include/srsapps/common/params_db.h similarity index 98% rename from srslte/include/srslte/ue_itf/params_db.h rename to srsapps/common/include/srsapps/common/params_db.h index 879a96cf6..cf48d9e98 100644 --- a/srslte/include/srslte/ue_itf/params_db.h +++ b/srsapps/common/include/srsapps/common/params_db.h @@ -26,7 +26,7 @@ */ #include -#include "srslte/srslte.h" +#include "srslte/config.h" #ifndef PARAMS_H #define PARAMS_H diff --git a/srsapps/common/include/srsapps/common/qbuff.h b/srsapps/common/include/srsapps/common/qbuff.h new file mode 100644 index 000000000..fb885b525 --- /dev/null +++ b/srsapps/common/include/srsapps/common/qbuff.h @@ -0,0 +1,66 @@ + +#include +#include "srslte/config.h" + +#ifndef QBUFF_H +#define QBUFF_H + +/** Implementation of a lock-free single-producer single-consumer queue buffer + * Communication can be pointer-based or stream based. + * Only 1 thread can read and only 1 thread can write. + * + * Writer: + * - Call request, returns a pointer. + * - Writes to memory, up to max_msg_size bytes + * - Call to push() passing message size + * or + * - use send() + * + * Reader: + * - Call to pop, receive pointer and message size + * - Read memory contents + * - Call to release() to release the message buffer + * or + * - use recv() + */ + +namespace srslte { + + class SRSLTE_API qbuff + { + public: + qbuff(); + ~qbuff(); + bool init(uint32_t nof_messages, uint32_t max_msg_size); + void* request(); + bool push(uint32_t len); + void* pop(uint32_t *len, uint32_t idx); + void* pop(uint32_t *len); + void* pop(); + void release(); + bool isempty(); + bool isfull(); + void flush(); + bool send(void *buffer, uint32_t msg_size); + int recv(void* buffer, uint32_t buffer_size); + void move_to(qbuff *dst); + uint32_t pending_data(); + private: + typedef struct { + bool valid; + uint32_t len; + void *ptr; + } pkt_t; + + uint32_t nof_messages; + uint32_t max_msg_size; + uint32_t rp, wp; + + pkt_t *packets; + uint8_t *buffer; + + }; + +} + +#endif diff --git a/srslte/include/srslte/ue_itf/queue.h b/srsapps/common/include/srsapps/common/queue.h similarity index 97% rename from srslte/include/srslte/ue_itf/queue.h rename to srsapps/common/include/srsapps/common/queue.h index b34eebc05..666171d1b 100644 --- a/srslte/include/srslte/ue_itf/queue.h +++ b/srsapps/common/include/srsapps/common/queue.h @@ -34,13 +34,15 @@ * Reference: *****************************************************************************/ +#include "srslte/config.h" + #ifndef QUEUE_H #define QUEUE_H namespace srslte { namespace ue { -class queue +class SRSLTE_API queue { public: diff --git a/srsapps/common/include/srsapps/common/timers.h b/srsapps/common/include/srsapps/common/timers.h new file mode 100644 index 000000000..cbb28e8f0 --- /dev/null +++ b/srsapps/common/include/srsapps/common/timers.h @@ -0,0 +1,102 @@ + +#include +#include "srslte/config.h" + +#ifndef TIMERS_H +#define TIMERS_H + +namespace srslte { + +class SRSLTE_API timer_callback +{ + public: + virtual void timer_expired(uint32_t timer_id) = 0; +}; + +class SRSLTE_API timers +{ +public: + class SRSLTE_API timer + { + public: + timer() { counter = 0; timeout = 0; running = false; }; + void set(timer_callback *callback_, uint32_t timeout_) { + callback = callback_; + timeout = timeout_; + } + bool is_running() { + return counter < timeout; + } + bool is_expired() { + return counter == timeout; + } + void reset() { + counter = 0; + } + void step() { + if (running) { + counter++; + if (is_expired()) { + callback->timer_expired(id); + } + } + } + void stop() { + running = false; + } + void run() { + running = true; + } + uint32_t id; + private: + timer_callback *callback; + uint32_t timeout; + uint32_t counter; + bool running; + }; + + timers(uint32_t nof_timers_) { + nof_timers = nof_timers_; + timer_list = new timer[nof_timers]; + for (uint32_t i=0;istep(); + } + } + void stop_all() { + for (int i=0;istop(); + } + } + void run_all() { + for (int i=0;irun(); + } + } + void reset_all() { + for (int i=0;ireset(); + } + } + timer *get(uint32_t i) { + if (i < nof_timers) { + return &timer_list[i]; + } else { + return NULL; + } + } +private: + uint32_t nof_timers; + timer *timer_list; +}; +} + +#endif \ No newline at end of file diff --git a/srslte/include/srslte/ue_itf/tti_sync.h b/srsapps/common/include/srsapps/common/tti_sync.h similarity index 98% rename from srslte/include/srslte/ue_itf/tti_sync.h rename to srsapps/common/include/srsapps/common/tti_sync.h index a27b105a4..5d9035df2 100644 --- a/srslte/include/srslte/ue_itf/tti_sync.h +++ b/srsapps/common/include/srsapps/common/tti_sync.h @@ -26,7 +26,7 @@ */ #include -#include "srslte/srslte.h" +#include "srslte/config.h" #ifndef TTISYNC_H #define TTISYNC_H diff --git a/srslte/include/srslte/ue_itf/tti_sync_cv.h b/srsapps/common/include/srsapps/common/tti_sync_cv.h similarity index 95% rename from srslte/include/srslte/ue_itf/tti_sync_cv.h rename to srsapps/common/include/srsapps/common/tti_sync_cv.h index 8e09420c1..37cd8319a 100644 --- a/srslte/include/srslte/ue_itf/tti_sync_cv.h +++ b/srsapps/common/include/srsapps/common/tti_sync_cv.h @@ -26,8 +26,8 @@ */ #include -#include "srslte/ue_itf/tti_sync.h" -#include "srslte/srslte.h" +#include "srsapps/common/tti_sync.h" +#include "srslte/config.h" #ifndef TTISYNC_CV_H #define TTISYNC_CV_H diff --git a/srsapps/common/src/log_stdout.cc b/srsapps/common/src/log_stdout.cc new file mode 100644 index 000000000..e928c04c1 --- /dev/null +++ b/srsapps/common/src/log_stdout.cc @@ -0,0 +1,129 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2014 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * A copy of the GNU Lesser General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include +#include +#include +#include + +#include "srsapps/common/log_stdout.h" + + +using namespace std; + +namespace srslte { + +const char* level_str[4] = {"[ERROR ", + "[WARN ", + "[INFO ", + "[DEBUG "}; + +void log_stdout::printlog(level_t type, uint32_t tti, string msg, va_list args) { + + printlog(type, tti, string(), -1, msg, args); +} + +void log_stdout::printlog(level_t type, uint32_t tti, string file, int line, string msg, va_list args) { + + printf("%s %s",level_str[type], get_service_name().c_str()); + if (file.length() > 0) { + printf("/%-14s", file.substr(file.find_last_of("/")+1,file.find_last_of(".")-1-file.find_last_of("/")).c_str()); + } + if (line >= 0) { + printf(" %5d]: ", tti); + } + vprintf(msg.c_str(), args); +} + +void log_stdout::error(uint32_t tti, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(ERROR, tti, msg, args); + va_end(args); +} + +void log_stdout::info(uint32_t tti, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(INFO, tti, msg, args); + va_end(args); +} + +void log_stdout::debug(uint32_t tti, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(DEBUG, tti, msg, args); + va_end(args); +} + +void log_stdout::warning(uint32_t tti, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(WARNING, tti, msg, args); + va_end(args); +} + + +void log_stdout::error(uint32_t tti, string file, int line, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(ERROR, tti, file, line, msg, args); + va_end(args); +} + +void log_stdout::info(uint32_t tti, string file, int line, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(INFO, tti, file, line, msg, args); + va_end(args); +} + +void log_stdout::debug(uint32_t tti, string file, int line, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(DEBUG, tti, file, line, msg, args); + va_end(args); +} + +void log_stdout::warning(uint32_t tti, string file, int line, string msg, ...) +{ + va_list args; + va_start(args, msg); + printlog(WARNING, tti, file, line, msg, args); + va_end(args); +} + +} + + \ No newline at end of file diff --git a/srsapps/common/src/qbuff.cc b/srsapps/common/src/qbuff.cc new file mode 100644 index 000000000..abdd811d2 --- /dev/null +++ b/srsapps/common/src/qbuff.cc @@ -0,0 +1,185 @@ +#include +#include +#include + + +#include "srsapps/common/qbuff.h" + +namespace srslte { + + +qbuff::qbuff() +{ + nof_messages=0; + max_msg_size=0; + wp = 0; + rp = 0; + buffer = NULL; + packets = NULL; +} + +qbuff::~qbuff() +{ + free(buffer); + free(packets); +} + +bool qbuff::init(uint32_t nof_messages_, uint32_t max_msg_size_) +{ + nof_messages = nof_messages_; + max_msg_size = max_msg_size_; + + buffer = (uint8_t*) calloc(nof_messages,max_msg_size); + packets = (pkt_t*) calloc(nof_messages,sizeof(pkt_t)); + if (buffer && packets) { + flush(); + return true; + } else { + return false; + } +} + +void qbuff::flush() +{ + wp = 0; + rp = 0; + for (int i=0;i= nof_messages)?(1-nof_messages):1; +} + +void* qbuff::pop() +{ + return pop(NULL); +} + +void* qbuff::pop(uint32_t* len) +{ + if (!isempty()) { + if (len) { + *len = packets[rp].len; + } + return packets[rp].ptr; + } else { + return NULL; + } +} + +void* qbuff::pop(uint32_t* len, uint32_t idx) +{ + if (idx == 0) { + return pop(len); + } else { + uint32_t rpp = rp; + uint32_t i = 0; + while(i= nof_messages)?(1-nof_messages):1; + i++; + } + if (packets[rpp].valid) { + if (len) { + *len = packets[rpp].len; + } + return packets[rpp].ptr; + } else { + return NULL; + } + } +} + +void qbuff::release() +{ + packets[rp].valid = false; + packets[rp].len = 0; + rp += (rp+1 >= nof_messages)?(1-nof_messages):1; +} + +bool qbuff::send(void* buffer, uint32_t msg_size) +{ + if (msg_size <= max_msg_size) { + void *ptr = request(); + if (ptr) { + memcpy(ptr, buffer, msg_size); + push(msg_size); + } else { + return false; + } + } else { + return false; + } +} + +uint32_t qbuff::pending_data() +{ + uint32_t total_len = 0; + for (int i=0;irequest(); + if (ptr_dst) { + memcpy(ptr_dst, ptr_src, len); + dst->push(len); + release(); + } + } +} + + + +int qbuff::recv(void* buffer, uint32_t buffer_size) +{ + uint32_t len; + void *ptr = pop(&len); + if (ptr) { + if (len <= buffer_size) { + memcpy(buffer, ptr, len); + release(); + return len; + } else { + return -1; + } + } else { + return 0; + } +} + + + +} \ No newline at end of file diff --git a/srslte/lib/ue_itf/src/queue.cc b/srsapps/common/src/queue.cc similarity index 98% rename from srslte/lib/ue_itf/src/queue.cc rename to srsapps/common/src/queue.cc index cc45a1b9c..2caf5ccae 100644 --- a/srslte/lib/ue_itf/src/queue.cc +++ b/srsapps/common/src/queue.cc @@ -27,7 +27,7 @@ #include #include -#include "srslte/ue_itf/queue.h" +#include "srsapps/common/queue.h" namespace srslte { namespace ue { diff --git a/srslte/lib/ue_itf/src/tti_sync_cv.cc b/srsapps/common/src/tti_sync_cv.cc similarity index 97% rename from srslte/lib/ue_itf/src/tti_sync_cv.cc rename to srsapps/common/src/tti_sync_cv.cc index 05a13a7fb..67dc41988 100644 --- a/srslte/lib/ue_itf/src/tti_sync_cv.cc +++ b/srsapps/common/src/tti_sync_cv.cc @@ -27,7 +27,7 @@ #include -#include "srslte/ue_itf/tti_sync_cv.h" +#include "srsapps/common/tti_sync_cv.h" namespace srslte { namespace ue { diff --git a/cuhd/lib/CMakeLists.txt b/srsapps/radio/CMakeLists.txt similarity index 65% rename from cuhd/lib/CMakeLists.txt rename to srsapps/radio/CMakeLists.txt index 1c7a8bcd2..f0ed75dc6 100644 --- a/cuhd/lib/CMakeLists.txt +++ b/srsapps/radio/CMakeLists.txt @@ -22,20 +22,11 @@ FIND_PACKAGE(UHD) IF(UHD_FOUND) - - ADD_LIBRARY(cuhd SHARED cuhd_imp.cpp cuhd_utils.c radio_uhd.cc) - INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) - LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) - TARGET_LINK_LIBRARIES(cuhd ${UHD_LIBRARIES}) - - LIBLTE_SET_PIC(cuhd) - APPEND_INTERNAL_LIST(OPTIONAL_LIBS cuhd) - INSTALL(TARGETS cuhd DESTINATION ${LIBRARY_DIR}) - - MESSAGE(STATUS " cuhd UHD C wrapper will be installed.") - -ELSE(UHD_FOUND) - - MESSAGE(STATUS " UHD driver not found. CUHD library is not generated") - + FILE(GLOB SOURCES "src/*.cc") + ADD_LIBRARY(srsapps_radio SHARED ${SOURCES}) + INSTALL(TARGETS srsapps_radio DESTINATION ${LIBRARY_DIR}) + LIBLTE_SET_PIC(srsapps_radio) ENDIF(UHD_FOUND) + +FILE(GLOB SOURCES "include/srsapps/radio/*.h") +ADD_CUSTOM_TARGET (add_srsapps_radio_headers SOURCES ${HEADERS_ALL}) diff --git a/cuhd/include/srslte/cuhd/radio_uhd.h b/srsapps/radio/include/srsapps/radio/radio_uhd.h similarity index 100% rename from cuhd/include/srslte/cuhd/radio_uhd.h rename to srsapps/radio/include/srsapps/radio/radio_uhd.h diff --git a/cuhd/lib/radio_uhd.cc b/srsapps/radio/src/radio_uhd.cc similarity index 96% rename from cuhd/lib/radio_uhd.cc rename to srsapps/radio/src/radio_uhd.cc index 7e25be61c..30de38298 100644 --- a/cuhd/lib/radio_uhd.cc +++ b/srsapps/radio/src/radio_uhd.cc @@ -27,7 +27,7 @@ #include "srslte/srslte.h" #include "srslte/common/radio.h" -#include "srslte/cuhd/radio_uhd.h" +#include "srsapps/radio/radio_uhd.h" namespace srslte { @@ -49,7 +49,7 @@ bool radio_uhd::init(char *args) bool radio_uhd::rx_at(void* buffer, uint32_t nof_samples, srslte_timestamp_t rx_time) { - fprintf(stderr, "UHD Receive at time not implemented\n"); + fprintf(stderr, "Not implemented\n"); return false; } diff --git a/srsapps/ue/CMakeLists.txt b/srsapps/ue/CMakeLists.txt new file mode 100644 index 000000000..f09fc8c6b --- /dev/null +++ b/srsapps/ue/CMakeLists.txt @@ -0,0 +1,27 @@ +# +# Copyright 2012-2013 The srsLTE Developers. See the +# COPYRIGHT file at the top-level directory of this distribution. +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# A copy of the GNU Lesser General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +INCLUDE_DIRECTORIES(phy/include/) +INCLUDE_DIRECTORIES(mac/include/) + +add_subdirectory(phy) +add_subdirectory(mac) + diff --git a/srsapps/ue/mac/CMakeLists.txt b/srsapps/ue/mac/CMakeLists.txt new file mode 100644 index 000000000..899a09459 --- /dev/null +++ b/srsapps/ue/mac/CMakeLists.txt @@ -0,0 +1,29 @@ +# +# Copyright 2012-2013 The srsLTE Developers. See the +# COPYRIGHT file at the top-level directory of this distribution. +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# A copy of the GNU Lesser General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +FILE(GLOB SOURCES "src/*.cc") +ADD_LIBRARY(srsapps_ue_mac SHARED ${SOURCES}) +INSTALL(TARGETS srsapps_ue_mac DESTINATION ${LIBRARY_DIR}) +LIBLTE_SET_PIC(srsapps_ue_mac) + +FILE(GLOB SOURCES "include/*.h") +ADD_CUSTOM_TARGET (add_srsapps_ue_mac_headers SOURCES ${HEADERS_ALL}) + diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h new file mode 100644 index 000000000..af386555f --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h @@ -0,0 +1,53 @@ + +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/log.h" +#include "srsapps/ue/mac/mac_io.h" +#include "srsapps/common/timers.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/ue/mac/mac_pdu.h" + +#ifndef DEMUX_H +#define DEMUX_H + +/* Logical Channel Demultiplexing and MAC CE dissassemble */ + +namespace srslte { +namespace ue { + +class demux +{ +public: + demux(); + void init(phy* phy_h_, log* log_h_, mac_io* mac_io_h_, timers* timers_db_); + + void push_pdu(uint32_t tti, uint8_t *mac_pdu, uint32_t nof_bits); + void push_pdu_bcch(uint32_t tti, uint8_t *mac_pdu, uint32_t nof_bits); + void push_pdu_temp_crnti(uint32_t tti, uint8_t *mac_pdu, uint32_t nof_bits); + bool is_temp_crnti_pending(); + void demultiplex_pending_pdu(uint32_t tti); + + uint64_t get_contention_resolution_id(); + +private: + mac_pdu mac_msg; + mac_pdu pending_mac_msg; + + void process_pdu(mac_pdu *pdu); + bool process_ce(mac_pdu::mac_subh *subheader); + + uint64_t contention_resolution_id; + bool pending_temp_rnti; + + phy *phy_h; + log *log_h; + mac_io *mac_io_h; + timers *timers_db; + uint32_t tti; +}; +} +} + +#endif + + + diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h new file mode 100644 index 000000000..f1aab3755 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h @@ -0,0 +1,74 @@ + + +#include "srsapps/common/log.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/common/timers.h" +#include "srsapps/ue/mac/demux.h" + +#ifndef DLHARQ_H +#define DLHARQ_H + +/* Downlink HARQ entity as defined in 5.3.2 of 36.321 */ + +namespace srslte { +namespace ue { + +typedef _Complex float cf_t; + +class dl_harq_entity +{ +public: + + const static uint32_t NOF_HARQ_PROC = 8; + const static uint32_t HARQ_BCCH_PID = NOF_HARQ_PROC; + + dl_harq_entity(); + ~dl_harq_entity(); + bool init(srslte_cell_t cell, uint32_t max_payload_len, srslte::log *log_h_, timers *timers_, demux *demux_unit); + bool is_sps(uint32_t pid); + void set_harq_info(uint32_t tti, uint32_t pid, dl_sched_grant *grant); + void receive_data(uint32_t tti, uint32_t pid, dl_buffer *dl_buffer, phy *phy_h); + void reset(); + bool is_ack_pending_resolution(); + void send_pending_ack_contention_resolution(); +private: + + + class dl_harq_process { + public: + dl_harq_process(); + bool init(srslte_cell_t cell, uint32_t max_payload_len, dl_harq_entity *parent); + void set_harq_info(uint32_t tti, dl_sched_grant *grant); + void receive_data(uint32_t tti, dl_buffer *dl_buffer, phy *phy_h); + void reset(); + // Called after the contention resolution is terminated to send pending ACKs, if any + void send_pending_ack_contention_resolution(); + uint32_t pid; + private: + + dl_harq_entity *harq_entity; + uint8_t *payload; + uint32_t max_payload_len; + dl_sched_grant cur_grant; + dl_sched_grant pending_ack_grant; + ul_buffer *pending_ul_buffer; + bool is_first_tx; + bool is_first_decoded; + bool pending_ack; + srslte::log *log_h; + + srslte_softbuffer_rx_t softbuffer; + }; + + + dl_harq_process *proc; + timers *timers_db; + demux *demux_unit; + srslte::log *log_h; + int pending_ack_pid; +}; + +} +} +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h b/srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h new file mode 100644 index 000000000..4bbfeb0d4 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h @@ -0,0 +1,31 @@ + + +#include "srsapps/common/log.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/common/timers.h" + +#ifndef DLSPS_H +#define DLSPS_H + +/* Downlink Semi-Persistent schedulign (Section 5.10.1) */ + +namespace srslte { +namespace ue { + +typedef _Complex float cf_t; + +class dl_sps +{ +public: + + void clear(); + void reset(uint32_t tti, dl_sched_grant *grant); + dl_sched_grant *get_pending_grant(uint32_t tti); +private: + +}; + +} +} +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h new file mode 100644 index 000000000..6b77fdc29 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h @@ -0,0 +1,116 @@ + + +#include "srsapps/common/log.h" +#include "srsapps/common/tti_sync.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/ue/mac/dl_harq.h" +#include "srsapps/ue/mac/ul_harq.h" +#include "srsapps/ue/mac/dl_sps.h" +#include "srsapps/ue/mac/ul_sps.h" +#include "srsapps/common/timers.h" +#include "srsapps/ue/mac/mac_io.h" +#include "srsapps/ue/mac/proc_ra.h" +#include "srsapps/ue/mac/proc_sr.h" +#include "srsapps/ue/mac/proc_bsr.h" +#include "srsapps/ue/mac/proc_phr.h" +#include "srsapps/ue/mac/mux.h" +#include "srsapps/ue/mac/demux.h" + +#ifndef UEMAC_H +#define UEMAC_H + +namespace srslte { +namespace ue { + +typedef _Complex float cf_t; + +class mac : public timer_callback +{ +public: + mac() : timers_db((uint32_t) NOF_MAC_TIMERS) {} + bool init(phy *phy_h, tti_sync *ttisync, log *log_h); + void stop(); + int get_tti(); + void main_radio_loop(); // called after thread creation + + bool send_ccch_sdu(uint8_t *sdu_payload, uint32_t nbytes); + bool send_dtch0_sdu(uint8_t *sdu_payload, uint32_t nbytes); // SRB0 + bool send_dcch0_sdu(uint8_t *sdu_payload, uint32_t nbytes); // DRB0 + + int recv_bcch_sdu(uint8_t *sdu_payload, uint32_t buffer_len_nbytes); + int recv_ccch_sdu(uint8_t *sdu_payload, uint32_t buffer_len_nbytes); + int recv_dtch0_sdu(uint8_t *sdu_payload, uint32_t buffer_len_nbytes); // SRB0 + int recv_dcch0_sdu(uint8_t *sdu_payload, uint32_t buffer_len_nbytes); // DRB0 + + void set_dcch0_priority(uint32_t priority, int PBR_x_tti, uint32_t BSD); + void set_dtch0_priority(uint32_t priority, int PBR_x_tti, uint32_t BSD); + + void set_param(mac_params::mac_param_t param, int64_t value); + + void reconfiguration(); + void reset(); + + void timer_expired(uint32_t timer_id); + + enum { + HARQ_RTT = 0, + TIME_ALIGNMENT, + CONTENTION_TIMER, + NOF_MAC_TIMERS + } mac_timers_t; + +private: + // Interaction with PHY + tti_sync *ttisync; + phy *phy_h; + + log *log_h; + + /* Logical channel (lch) IO */ + mac_io mac_io_lch; + + + mac_params params_db; + pthread_t mac_thread; + static void* mac_thread_fnc(void*); + + int tti; + bool started = false; + bool is_synchronized; + bool is_first_temporal; + + /* Multiplexing/Demultiplexing Units */ + mux mux_unit; + demux demux_unit; + + /* DL/UL HARQ */ + dl_harq_entity dl_harq; + ul_harq_entity ul_harq; + + /* DL/UL Semi-Persistent Sched */ + dl_sps dl_sps_assig; + ul_sps ul_sps_assig; + uint32_t get_harq_sps_pid(uint32_t tti); + + /* MAC Uplink-related Procedures */ + ra_proc ra_procedure; + sr_proc sr_procedure; + bsr_proc bsr_procedure; + phr_proc phr_procedure; + + /* Other procedures */ + void process_dl_grants(uint32_t tti); + void process_ul_grants(uint32_t tti); + void receive_pch(uint32_t tti); + + /* Functions for MAC Timers */ + timers timers_db; + void setup_timers(); + void timeAlignmentTimerExpire(); + +}; + +} +} +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h new file mode 100644 index 000000000..b2e98f92f --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h @@ -0,0 +1,84 @@ +#include +#include "srsapps/common/qbuff.h" + +#ifndef MACIO_H +#define MACIO_H + +/* Manages all MAC buffers including: + * - communication with higher layers through logical channels + * - communication between logical channels buffers and Dissassembly/Assembly unit + * - communication between Dissassembly/Assembly unit and Msg3 buffer + * + * For logical channels, IN means higher layers to MAC. OUT means MAC to higher layers. + * + * See queue.h for instructions on how to manage buffers + */ + +namespace srslte { +namespace ue { + + class mac_io + { + public: + + // list of logical channels + // Keep this order to match LoCH id with RB + typedef enum { + // Downlink (UE MAC -> UE RRC) + MAC_LCH_CCCH_DL = 0, // SRB0 + MAC_LCH_DCCH0_DL, // SRB1 + MAC_LCH_DCCH1_DL, // SRB2 + MAC_LCH_DTCH0_DL, // DRB0 + MAC_LCH_DTCH1_DL, // DRB1 + MAC_LCH_DTCH2_DL, // DRB2 + MAC_LCH_BCCH_DL, // N/A + MAC_LCH_PCCH_DL, // N/A + + // Uplink (UE RLC -> UE MAC) + MAC_LCH_CCCH_UL, // SRB0 + MAC_LCH_DCCH0_UL, // SRB1 + MAC_LCH_DCCH1_UL, // SRB2 + MAC_LCH_DTCH0_UL, // DRB0 + MAC_LCH_DTCH1_UL, // DRB1 + MAC_LCH_DTCH2_UL, // DRB2 + + MAC_NOF_QUEUES + } mac_lch_t; + + const static int NOF_DL_LCH = MAC_LCH_PCCH_DL - MAC_LCH_CCCH_DL; + const static int NOF_UL_LCH = MAC_LCH_DTCH2_UL - MAC_LCH_CCCH_UL; + + const static int DEFAULT_MSG_SZ = 8*1024; // 8 Kbytes + const static int DEFAULT_NOF_MESSAGES = 8; + + + qbuff* get(mac_lch_t ch) { + return get((uint32_t) ch); + } + + qbuff* get(int32_t lchid) { + if (lchid < MAC_NOF_QUEUES) { + return &queues[lchid]; + } else { + return NULL; + } + } + + // Move packets between queues with only 1 memcpy + void move(mac_lch_t src, mac_lch_t dst) { + get(src)->move_to(get(dst)); + } + + mac_io() { + for (int i=0;i +#include "srsapps/common/log.h" + +#ifndef MACPDU_H +#define MACPDU_H + +/* MAC PDU Packing/Unpacking functions */ + +namespace srslte { +namespace ue { + +class mac_pdu +{ +public: + + class mac_subh + { + public: + + typedef enum { + C_RNTI = 0, + CON_RES_ID, + TA_CMD, + PHD, + SDU + } cetype; + + // Reading functions + bool is_sdu(); + cetype ce_type(); + + uint32_t get_sdu_lcid(); + uint32_t get_sdu_nbytes(); + uint8_t* get_sdu_ptr(); + + uint16_t get_c_rnti(); + uint64_t get_con_res_id(); + uint8_t get_ta_cmd(); + uint8_t get_phd(); + + // Writing functions + bool set_sdu(uint8_t *ptr, uint32_t nof_bytes); + bool set_c_rnti(uint16_t crnti); + bool set_con_res_id(uint64_t con_res_id); + bool set_ta_cmd(uint8_t ta_cmd); + bool set_phd(uint8_t phd); + + private: + static const int MAX_CE_PAYLOAD_LEN = 8; + uint32_t lcid; + uint32_t nof_bytes; + uint8_t* sdu_payload_ptr; + uint8_t ce_payload[MAX_CE_PAYLOAD_LEN]; + }; + + mac_pdu(uint32_t max_subheaders); + + void reset(); + void init(uint32_t pdu_len); + + bool read_next(); + bool write_next(); + mac_subh* get(); + + bool write_packet(uint8_t *ptr); + void parse_packet(uint8_t *ptr); + + + +protected: + mac_subh *subheaders; + uint32_t pdu_len; + uint32_t rem_len; + uint32_t rp, wp; + uint32_t nof_subheaders; + uint32_t max_subheaders; +}; + +class mac_rar_pdu +{ +public: + class mac_rar + { + + public: + + static const uint32_t RAR_GRANT_LEN = 20; + + // Reading functions + uint32_t get_rapid(); + uint32_t get_ta_cmd(); + uint16_t get_temp_crnti(); + void get_sched_grant(uint8_t grant[RAR_GRANT_LEN]); + + // Writing functoins + void set_rapid(uint32_t rapid); + void set_ta_cmd(uint32_t ta); + void set_temp_crnti(uint16_t temp_rnti); + void set_sched_grant(uint8_t grant[RAR_GRANT_LEN]); + private: + uint8_t grant[RAR_GRANT_LEN]; + uint32_t ta; + uint16_t temp_rnti; + }; + + mac_rar_pdu(uint32_t max_rars); + + void reset(); + void init(uint32_t pdu_len); + + bool read_next(); + bool write_next(); + mac_rar* get(); + + void set_backoff(uint8_t bi); + bool is_backoff(); + uint8_t get_backoff(); + + bool write_packet(uint8_t *ptr); + void parse_packet(uint8_t *ptr); + + +private: + mac_rar *rars; + uint32_t pdu_len; + uint32_t rem_len; + uint32_t rp, wp; + uint32_t nof_rars; + uint32_t max_rars; + +}; + +} +} + +#endif + diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h new file mode 100644 index 000000000..f976709aa --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h @@ -0,0 +1,71 @@ +#include + +#include "srsapps/common/log.h" +#include "srsapps/ue/mac/mac_io.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/ue/mac/mac_pdu.h" + +#ifndef MUX_H +#define MUX_H + +/* Logical Channel Multiplexing and Prioritization + Msg3 Buffer */ + +namespace srslte { +namespace ue { + +class mux +{ +public: + mux(); + void reset(); + void init(log *log_h, mac_io *mac_io_h); + + uint8_t* pdu_pop(uint32_t tti_, uint32_t pdu_sz); + bool pdu_move_to_msg3(uint32_t tti, uint32_t pdu_sz); + void pdu_release(); + + uint8_t* msg3_pop(uint32_t tti_, uint32_t pdu_sz); + void msg3_flush(); + void msg3_release(); + bool msg3_isempty(); + + void append_crnti_ce_next_tx(uint16_t crnti); + + void set_priority(uint32_t lch_id, uint32_t priority, int PBR_x_tti, uint32_t BSD); + +private: + bool assemble_pdu(uint32_t pdu_sz); + bool allocate_sdu(uint32_t lcid, mac_pdu *pdu, uint32_t *sdu_sz); + bool allocate_sdu(uint32_t lcid, mac_pdu *pdu); + + int64_t Bj[mac_io::NOF_UL_LCH]; + int PBR[mac_io::NOF_UL_LCH]; // -1 sets to infinity + uint32_t BSD[mac_io::NOF_UL_LCH]; + uint32_t priority[mac_io::NOF_UL_LCH]; + uint32_t priority_sorted[mac_io::NOF_UL_LCH]; + uint32_t lchid_sorted[mac_io::NOF_UL_LCH]; + uint32_t nof_tx_pkts[mac_io::NOF_UL_LCH]; + + // Mutex for priority setting from outside MAC + pthread_mutex_t mutex; + + log *log_h; + mac_io *mac_io_h; + uint32_t tti; + uint16_t pending_crnti_ce; + + /* Msg3 Buffer */ + static const uint32_t MSG3_BUFF_SZ = 128; + qbuff msg3_buff; + + /* PDU Buffer */ + static const uint32_t PDU_BUFF_SZ = 16*1024; + qbuff pdu_buff; + mac_pdu pdu_msg; + +}; +} +} + +#endif + diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc.h new file mode 100644 index 000000000..60189d57b --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc.h @@ -0,0 +1,34 @@ + +#include + +#ifndef PROC_H +#define PROC_H + +/* Interface for a MAC procedure */ + +namespace srslte { +namespace ue { + +class proc +{ +public: + proc() { + running = false; + } + void run() { + running = true; + } + void stop() { + running = false; + } + bool is_running() { + return running; + } + virtual void step(uint32_t tti) = 0; +private: + bool running; +}; +} +} + +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h new file mode 100644 index 000000000..bf96b7174 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h @@ -0,0 +1,30 @@ + +#include + +#include "srsapps/ue/mac/proc.h" + +#ifndef PROCBSR_H +#define PROCBSR_H + +/* Buffer status report procedure */ + +namespace srslte { +namespace ue { + +class bsr_proc : public proc +{ +public: + void step(uint32_t tti) { + if (is_running()) { + fprintf(stderr, "BSR procedure not implemented\n"); + } + } + void reset() { + + } + +}; +} +} + +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h new file mode 100644 index 000000000..e44fcf61c --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h @@ -0,0 +1,29 @@ + +#include + +#include "srsapps/ue/mac/proc.h" + +#ifndef PROCPHR_H +#define PROCPHR_H + +/* Power headroom report procedure */ + +namespace srslte { +namespace ue { + +class phr_proc : public proc +{ +public: + void step(uint32_t tti) { + if (is_running()) { + fprintf(stderr, "PHR procedure not implemented\n"); + } + } + void reset() { + + } +}; +} +} + +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h new file mode 100644 index 000000000..19c3c3025 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h @@ -0,0 +1,133 @@ + +#include + +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/log.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/common/qbuff.h" +#include "srsapps/ue/mac/proc.h" +#include "srsapps/common/timers.h" +#include "srsapps/ue/mac/mux.h" +#include "srsapps/ue/mac/demux.h" +#include "srsapps/ue/mac/mac_pdu.h" + +#ifndef PROCRA_H +#define PROCRA_H + +/* Random access procedure as specified in Section 5.1 of 36.321 */ + +namespace srslte { +namespace ue { + +class ra_proc : public proc,timer_callback +{ + public: + ra_proc() : rar_pdu(20) {}; + bool init(mac_params *params_db, phy *phy_h, log *log_h, timers *timers_db, + mux *mux_unit, demux *demux_unit); + void reset(); + void start_pdcch_order(); + void start_rlc_order(); + void start_mac_order(); + void step(uint32_t tti); + bool is_successful(); + bool is_contention_resolution(); + bool is_error(); + bool in_progress(); + void pdcch_to_crnti(bool is_ul_grant); + void timer_expired(uint32_t timer_id); +private: + + void process_timeadv_cmd(uint32_t tti, uint32_t ta_cmd); + void step_initialization(); + void step_resource_selection(); + void step_preamble_transmission(); + void step_response_reception(); + void step_response_error(); + void step_backoff_wait(); + void step_contention_resolution(); + void step_completition(); + + // Buffer to receive RAR PDU + static const uint32_t MAX_RAR_PDU_LEN = 2048; + uint8_t rar_pdu_buffer[MAX_RAR_PDU_LEN]; + mac_rar_pdu rar_pdu; + + // Random Access parameters provided by higher layers defined in 5.1.1 + // They are read from params_db during initialization init() + uint32_t configIndex; + uint32_t nof_preambles; + uint32_t nof_groupA_preambles; + uint32_t nof_groupB_preambles; + uint32_t messagePowerOffsetGroupB; + uint32_t messageSizeGroupA; + uint32_t Pcmax; + uint32_t deltaPreambleMsg3; + uint32_t responseWindowSize; + uint32_t powerRampingStep; + uint32_t preambleTransMax; + uint32_t iniReceivedTargetPower; + int delta_preamble_db; + uint32_t maxharq_msg3tx; + uint32_t contentionResolutionTimer; + uint32_t maskIndex; + int preambleIndex; + + // Internal variables + uint32_t tti; + uint32_t preambleTransmissionCounter; + uint32_t backoff_param_ms; + uint32_t sel_maskIndex; + uint32_t sel_preamble; + uint32_t backoff_interval_start; + uint32_t backoff_inteval; + int received_target_power_dbm; + uint32_t ra_rnti; + uint8_t payload[256]; // 56 bits is often enough + + enum { + IDLE = 0, + INITIALIZATION, // Section 5.1.1 + RESOURCE_SELECTION, // Section 5.1.2 + PREAMBLE_TRANSMISSION, // Section 5.1.3 + RESPONSE_RECEPTION, // Section 5.1.4 + RESPONSE_ERROR, + BACKOFF_WAIT, + CONTENTION_RESOLUTION, // Section 5.1.5 + COMPLETION, // Section 5.1.6 + RA_PROBLEM // Section 5.1.5 last part + } state; + + typedef enum {RA_GROUP_A, RA_GROUP_B} ra_group_t; + + ra_group_t last_msg3_group; + bool msg3_transmitted; + bool first_rar_received; + void read_params(); + + phy *phy_h; + log *log_h; + mac_params *params_db; + timers *timers_db; + mux *mux_unit; + demux *demux_unit; + + uint64_t received_contention_id; + uint64_t transmitted_contention_id; + uint16_t transmitted_crnti; + enum { + PDCCH_CRNTI_NOT_RECEIVED = 0, + PDCCH_CRNTI_UL_GRANT, + PDCCH_CRNTI_DL_GRANT + } pdcch_to_crnti_received; + + enum { + PDCCH_ORDER = 0, + RLC_ORDER, + MAC_ORDER + } start_mode; +}; +} +} + +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h new file mode 100644 index 000000000..bdc191786 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h @@ -0,0 +1,30 @@ + +#include + +#include "srsapps/ue/mac/proc.h" + +#ifndef PROCSR_H +#define PROCSR_H + +/* Scheduling Request procedure */ + +namespace srslte { +namespace ue { + +class sr_proc : public proc +{ +public: + void step(uint32_t tti) { + if (is_running()) { + fprintf(stderr, "SR procedure not implemented\n"); + } + } + void reset() { + + } + +}; +} +} + +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h new file mode 100644 index 000000000..616d04fc6 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h @@ -0,0 +1,85 @@ + + +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/log.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/ue/mac/mux.h" +#include "srsapps/common/timers.h" + +#ifndef ULHARQ_H +#define ULHARQ_H + +/* Uplink HARQ entity as defined in 5.4.2 of 36.321 */ + +namespace srslte { +namespace ue { + +typedef _Complex float cf_t; + +class ul_harq_entity +{ +public: + + const static uint32_t NOF_HARQ_PROC = 8; + static uint32_t pidof(uint32_t tti); + + ul_harq_entity(); + ~ul_harq_entity(); + + bool init(srslte_cell_t cell, uint32_t max_payload_len, log *log_h, timers* timers_, mux *mux_unit); + void set_maxHARQ_Tx(uint32_t maxHARQ_Tx, uint32_t maxHARQ_Msg3Tx); + + void reset(); + void reset_ndi(); + bool is_sps(uint32_t pid); + void run_tti(uint32_t tti, ul_sched_grant *grant, phy *phy_); + void run_tti(uint32_t tti, phy *phy_); + bool is_last_retx_msg3(); + +private: + + class ul_harq_process { + public: + ul_harq_process(); + bool init(srslte_cell_t cell, uint32_t max_payload_len, ul_harq_entity *parent); + void reset(); + void reset_ndi(); + void set_maxHARQ_Tx(uint32_t maxHARQ_Tx_, uint32_t maxHARQ_Msg3Tx_); + + void generate_retx(ul_buffer *ul); + void generate_retx(ul_sched_grant *ul_grant, ul_buffer *ul); + void generate_new_tx(uint8_t *payload, bool is_msg3, ul_sched_grant* grant, ul_buffer *ul); + + bool has_grant(); + ul_sched_grant *get_grant(); + void set_harq_feedback(bool ack); + bool get_ndi(); + + private: + uint32_t current_tx_nb; + uint32_t current_irv; + bool harq_feedback; + bool ndi; + srslte::log *log_h; + ul_harq_entity *harq_entity; + ul_sched_grant cur_grant; + uint8_t *payload; + uint32_t max_payload_len; + bool is_grant_configured; + srslte_softbuffer_tx_t softbuffer; + uint32_t maxHARQ_Tx, maxHARQ_Msg3Tx; + bool is_msg3; + + void generate_tx(ul_buffer* ul); + }; + + bool last_retx_is_msg3; + timers *timers_db; + mux *mux_unit; + ul_harq_process *proc; + srslte::log *log_h; +}; + +} +} +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h b/srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h new file mode 100644 index 000000000..944847a53 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h @@ -0,0 +1,31 @@ + + +#include "srsapps/common/log.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/common/timers.h" + +#ifndef ULSPS_H +#define ULSPS_H + +/* Uplink Semi-Persistent schedulign (Section 5.10.2) */ + +namespace srslte { +namespace ue { + +typedef _Complex float cf_t; + +class ul_sps +{ +public: + + void clear() {} + void reset(uint32_t tti, sched_grant *grant) {} + ul_sched_grant *get_pending_grant(uint32_t tti) { return NULL; } +private: + +}; + +} +} +#endif \ No newline at end of file diff --git a/srsapps/ue/mac/src/demux.cc b/srsapps/ue/mac/src/demux.cc new file mode 100644 index 000000000..dcacd440a --- /dev/null +++ b/srsapps/ue/mac/src/demux.cc @@ -0,0 +1,150 @@ + +#include "srsapps/ue/mac/mac.h" +#include "srsapps/ue/mac/demux.h" + +namespace srslte { + namespace ue { + +demux::demux() : mac_msg(20),pending_mac_msg(20) +{ + contention_resolution_id = 0; + pending_temp_rnti = false; +} + +void demux::init(phy* phy_h_, log* log_h_, mac_io* mac_io_h_, timers* timers_db_) +{ + phy_h = phy_h_; + log_h = log_h_; + mac_io_h = mac_io_h_; + timers_db = timers_db_; +} + + +bool demux::is_temp_crnti_pending() +{ + return pending_temp_rnti; +} + +uint64_t demux::get_contention_resolution_id() +{ + uint64_t x = contention_resolution_id; + contention_resolution_id = 0; + return x; +} + + +/* Demultiplexing of MAC PDU associated with SI-RNTI. The PDU passes through + * the MAC in transparent mode + */ +void demux::push_pdu_bcch(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) +{ + tti = tti_; + mac_io_h->get(mac_io::MAC_LCH_BCCH_DL)->send(mac_pdu, nof_bits); + Debug("Pushed BCCH MAC PDU in transparent mode\n"); +} + +/* Demultiplexing of MAC PDU associated with a Temporal C-RNTI. The PDU will + * remain in buffer until demultiplex_pending_pdu() is called. + * This features is provided to enable the Random Access Procedure to decide + * wether the PDU shall pass to upper layers or not, which depends on the + * Contention Resolution result + */ +void demux::push_pdu_temp_crnti(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) +{ + tti = tti_; + if (!pending_temp_rnti) { + // Unpack DLSCH MAC PDU + pending_mac_msg.init(nof_bits); + pending_mac_msg.parse_packet(mac_pdu); + + // Look for Contention Resolution UE ID + contention_resolution_id = 0; + while(pending_mac_msg.read_next()) { + if (pending_mac_msg.get()->ce_type() == mac_pdu::mac_subh::CON_RES_ID) { + contention_resolution_id = pending_mac_msg.get()->get_con_res_id(); + } + } + pending_temp_rnti = true; + Debug("Saved MAC PDU with Temporal C-RNTI in buffer\n"); + } else { + Warning("Error pushing PDU with Temporal C-RNTI: Another PDU is still in pending\n"); + } +} + +/* Demultiplexing of logical channels and dissassemble of MAC CE */ +void demux::push_pdu(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) +{ + tti = tti_; + // Unpack DLSCH MAC PDU + mac_msg.init(nof_bits); + mac_msg.parse_packet(mac_pdu); + process_pdu(&mac_msg); + Debug("Normal MAC PDU processed\n"); +} + +void demux::demultiplex_pending_pdu(uint32_t tti_) +{ + tti = tti_; + if (pending_temp_rnti) { + process_pdu(&pending_mac_msg); + Debug("Temporal C-RNTI MAC PDU processed\n"); + pending_temp_rnti = false; + pending_mac_msg.reset(); + } else { + Error("Error demultiplex pending PDU: No pending PDU\n"); + } +} + + + +void demux::process_pdu(mac_pdu *pdu) +{ + while(pdu->read_next()) { + if (pdu->get()->is_sdu()) { + // Route logical channel + if (pdu->get()->get_sdu_lcid() <= mac_io::MAC_LCH_DTCH2_DL) { + qbuff *dest_lch = mac_io_h->get(pdu->get()->get_sdu_lcid()); + if (dest_lch) { + dest_lch->send(pdu->get()->get_sdu_ptr(), pdu->get()->get_sdu_nbytes()*8); + Debug("Sent MAC SDU len=%d bytes to lchid=%d\n", + pdu->get()->get_sdu_nbytes(), pdu->get()->get_sdu_lcid()); + } else { + Error("Getting destination channel LCID=%d\n", pdu->get()->get_sdu_lcid()); + } + } else { + Warning("Received SDU for unsupported LCID=%d\n", pdu->get()->get_sdu_lcid()); + } + // Process MAC Control Element + } else { + if (!process_ce(pdu->get())) { + Warning("Received Subheader with invalid or unkonwn LCID\n"); + } + } + } +} + + +bool demux::process_ce(mac_pdu::mac_subh *subh) { + switch(subh->ce_type()) { + case mac_pdu::mac_subh::CON_RES_ID: + contention_resolution_id = subh->get_c_rnti(); + Debug("Saved Contention Resolution ID=%d\n", contention_resolution_id); + break; + case mac_pdu::mac_subh::TA_CMD: + phy_h->set_timeadv(subh->get_ta_cmd()); + + // Start or restart timeAlignmentTimer + timers_db->get(mac::TIME_ALIGNMENT)->reset(); + timers_db->get(mac::TIME_ALIGNMENT)->run(); + Debug("Set TimeAdvance Command %d\n", subh->get_ta_cmd()); + break; + default: + Error("MAC CE not supported\n"); + break; + } + return true; +} + + +} +} diff --git a/srsapps/ue/mac/src/dl_harq.cc b/srsapps/ue/mac/src/dl_harq.cc new file mode 100644 index 000000000..819e0d35e --- /dev/null +++ b/srsapps/ue/mac/src/dl_harq.cc @@ -0,0 +1,194 @@ +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/phy/dl_sched_grant.h" + +#include "srsapps/ue/mac/mac.h" +#include "srsapps/ue/mac/dl_harq.h" + +namespace srslte { + namespace ue { + + + /*********************************************************** + * + * HARQ ENTITY + * + *********************************************************/ + +dl_harq_entity::dl_harq_entity() +{ + proc = new dl_harq_process[NOF_HARQ_PROC+1]; // BCCH process is separate + for (uint32_t i=0;i= 0; +} + +void dl_harq_entity::send_pending_ack_contention_resolution() +{ + if (is_ack_pending_resolution()) { + proc[pending_ack_pid].send_pending_ack_contention_resolution(); + pending_ack_pid = -1; + } +} + + /*********************************************************** + * + * HARQ PROCESS + * + *********************************************************/ + +dl_harq_entity::dl_harq_process::dl_harq_process() : cur_grant(0),pending_ack_grant(0) { + is_first_tx = true; + is_first_decoded = true; + bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant)); + payload = NULL; + max_payload_len = 0; +} + +void dl_harq_entity::dl_harq_process::reset() { + is_first_tx = true; + is_first_decoded = true; + bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant)); + srslte_softbuffer_rx_reset(&softbuffer); +} + +void dl_harq_entity::dl_harq_process::send_pending_ack_contention_resolution() +{ + if (pending_ul_buffer) { + pending_ul_buffer->generate_ack(pending_ack, &pending_ack_grant); + } +} + +void dl_harq_entity::dl_harq_process::receive_data(uint32_t tti, srslte::ue::dl_buffer *dl_buffer, phy *phy_h) +{ + bool ack = false; + pending_ul_buffer = NULL; + + if (payload) { + if (cur_grant.get_tbs() <= max_payload_len) { + Info("Decoding PDSCH data TBS=%d, RV=%d\n", cur_grant.get_tbs(), cur_grant.get_rv()); + if (dl_buffer->decode_data(&cur_grant, &softbuffer, payload)) { + Info("Decoded OK\n"); + // RX OK + Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit\n", cur_grant.get_tbs()/8); + if (pid == HARQ_BCCH_PID) { + harq_entity->demux_unit->push_pdu_bcch(tti, payload, cur_grant.get_tbs()); + is_first_tx = true; + } else { + if (is_first_decoded) { + if (cur_grant.is_temp_rnti()) { + harq_entity->demux_unit->push_pdu_temp_crnti(tti, payload, cur_grant.get_tbs()); + } else { + harq_entity->demux_unit->push_pdu(tti, payload, cur_grant.get_tbs()); + } + is_first_decoded = false; + } + ack = true; + } + } else { + Warning("Decoded Error\n"); + // RX NOK + ack = false; + } + if (pid == HARQ_BCCH_PID || harq_entity->timers_db->get(mac::TIME_ALIGNMENT)->is_expired()) { + // Do not generate ACK + Debug("Not generating ACK\n"); + } else { + if (cur_grant.is_temp_rnti()) { + // Postpone ACK after contention resolution is resolved + pending_ack = ack; + pending_ul_buffer = phy_h->get_ul_buffer(tti+4); + harq_entity->pending_ack_pid = pid; + memcpy(&pending_ack_grant, &cur_grant, sizeof(dl_sched_grant)); + } else { + Debug("Generating ACK\n"); + // Generate ACK + srslte::ue::ul_buffer *ul_buffer = phy_h->get_ul_buffer(tti+4); + ul_buffer->generate_ack(ack, &cur_grant); + } + } + } else { + fprintf(stderr, "Error with DL grant. TBS (%d) exceeds payload buffer length (%d)\n", cur_grant.get_tbs(), max_payload_len); + } + } +} +// Implement 5.3.2.2 +void dl_harq_entity::dl_harq_process::set_harq_info(uint32_t tti, srslte::ue::dl_sched_grant* new_grant) { + bool is_new_transmission = false; + if (new_grant->get_ndi() && !cur_grant.get_ndi() || is_first_tx) { + is_new_transmission = true; + is_first_decoded = true; + is_first_tx = false; + Debug("Set HARQ Info for new transmission\n"); + } else { + is_new_transmission = false; + Debug("Set HARQ Info for retransmission\n"); + } + if (is_new_transmission || cur_grant.get_tbs() != new_grant->get_tbs()) { + Debug("Reset softbuffer RX\n"); + srslte_softbuffer_rx_reset(&softbuffer); + } + if (new_grant->get_tbs() <= max_payload_len) { + memcpy(&cur_grant, new_grant, sizeof(srslte::ue::dl_sched_grant)); + } else { + fprintf(stderr, "Error with DL grant. TBS (%d) exceeds payload buffer length (%d)\n", new_grant->get_tbs(), max_payload_len); + } +} +bool dl_harq_entity::dl_harq_process::init(srslte_cell_t cell, uint32_t max_payload_len_, dl_harq_entity *parent) { + max_payload_len = max_payload_len_; + if (srslte_softbuffer_rx_init(&softbuffer, cell)) { + fprintf(stderr, "Error initiating soft buffer\n"); + return false; + } else { + harq_entity = parent; + log_h = harq_entity->log_h; + payload = (uint8_t*) srslte_vec_malloc(sizeof(uint8_t) * max_payload_len); + return payload?true:false; + } +} + + +} +} \ No newline at end of file diff --git a/srsapps/ue/mac/src/dl_sps.cc b/srsapps/ue/mac/src/dl_sps.cc new file mode 100644 index 000000000..9073c37aa --- /dev/null +++ b/srsapps/ue/mac/src/dl_sps.cc @@ -0,0 +1,21 @@ +#include "srsapps/ue/mac/dl_sps.h" + +namespace srslte { + namespace ue { + + dl_sched_grant* dl_sps::get_pending_grant(uint32_t tti) + { + return NULL; + } + void dl_sps::reset(uint32_t tti, dl_sched_grant* grant) + { + + } + void dl_sps::clear() + { + + } + + + } +} \ No newline at end of file diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc new file mode 100644 index 000000000..2f9d0fb6f --- /dev/null +++ b/srsapps/ue/mac/src/mac.cc @@ -0,0 +1,460 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2014 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * A copy of the GNU Lesser General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include +#include +#include +#include + +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/log.h" +#include "srsapps/ue/mac/mac.h" +#include "srsapps/ue/mac/mac_params.h" + +namespace srslte { +namespace ue { + +bool mac::init(phy *phy_h_, tti_sync* ttisync_, log* log_h_) +{ + started = false; + ttisync = ttisync_; + phy_h = phy_h_; + log_h = log_h_; + tti = 0; + is_synchronized = false; + + mux_unit.init(log_h, &mac_io_lch); + demux_unit.init(phy_h, log_h, &mac_io_lch, &timers_db); + ra_procedure.init(¶ms_db, phy_h, log_h, &timers_db, &mux_unit, &demux_unit); + + reset(); + + if (!pthread_create(&mac_thread, NULL, mac_thread_fnc, this)) { + started = true; + } else { + perror("pthread_create"); + } + return started; +} + +void mac::stop() +{ + started = false; + + pthread_join(mac_thread, NULL); +} + +int mac::get_tti() +{ + if (is_synchronized) { + return (int) tti; + } else { + return -1; + } +} + +// Implement Section 5.8 +void mac::reconfiguration() +{ + +} + +// Implement Section 5.9 +void mac::reset() +{ + timers_db.stop_all(); + timeAlignmentTimerExpire(); + ul_harq.reset_ndi(); + + mux_unit.msg3_flush(); + mux_unit.reset(); + + ra_procedure.stop(); + ra_procedure.reset(); + sr_procedure.stop(); + sr_procedure.reset(); + bsr_procedure.stop(); + bsr_procedure.reset(); + phr_procedure.stop(); + phr_procedure.reset(); + + dl_harq.reset(); + params_db.set_param(mac_params::RNTI_TEMP, 0); +} + +void* mac::mac_thread_fnc(void *arg) { + srslte::ue::mac* mac = static_cast(arg); + mac->main_radio_loop(); + return NULL; +} + +void mac::main_radio_loop() { + setup_timers(); + while(1) { + if (!is_synchronized) { + srslte_cell_t cell; + uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN]; + + if (phy_h->decode_mib_best(&cell, bch_payload)) { + + // Print MIB + srslte_cell_fprint(stdout, &cell, phy_h->get_current_tti()/10); + + // Init HARQ for this cell + Info("Init UL/DL HARQ\n"); + ul_harq.init(cell, 8*1024, log_h, &timers_db, &mux_unit); + dl_harq.init(cell, 8*1024, log_h, &timers_db, &demux_unit); + + // Set the current PHY cell to the detected cell + Info("Setting up PHY for cell_id=%d\n", cell.id); + if (phy_h->set_cell(cell)) { + Info("Starting RX streaming\n"); + if (phy_h->start_rxtx()) { + tti = ttisync->wait(); + Info("Receiver synchronized\n"); + + // Send MIB to RRC + mac_io_lch.get(mac_io::MAC_LCH_BCCH_DL)->send(bch_payload, SRSLTE_BCH_PAYLOAD_LEN); + + is_synchronized = true; + } else { + Error("Starting PHY receiver\n"); + exit(-1); + } + } else { + Error("Setting PHY cell\n"); + exit(-1); + } + } else { + Warning("Cell not found\n"); + } + sleep(1); + } + if (is_synchronized) { + /* Warning: Here order of invocation of procedures is important!! */ + + tti = ttisync->wait(); + + // Step all procedures + ra_procedure.step(tti); + sr_procedure.step(tti); + bsr_procedure.step(tti); + phr_procedure.step(tti); + + // Receive PCH, if requested + receive_pch(tti); + + // Process DL grants always + process_dl_grants(tti); + + // Send pending HARQ ACK, if any, and contention resolution is resolved + if (dl_harq.is_ack_pending_resolution()) { + if (ra_procedure.is_successful()) { + Info("Sending pending ACK for contention resolution\n"); + dl_harq.send_pending_ack_contention_resolution(); + } + } + + // Process UL grants if RA procedure is done or in contention resolution + if (ra_procedure.is_successful() || ra_procedure.is_contention_resolution()) { + Info("Processing UL grants\n"); + process_ul_grants(tti); + } + timers_db.step_all(); + } + } +} + +void mac::setup_timers() +{ + if (params_db.get_param(mac_params::TIMER_TIMEALIGN) > 0) { + timers_db.get(TIME_ALIGNMENT)->set(this, params_db.get_param(mac_params::TIMER_TIMEALIGN)); + } +} +static sched_grant::rnti_type_t rnti_type(int rnti_param_id) { + switch(rnti_param_id) { + case mac_params::RNTI_C: + return sched_grant::RNTI_TYPE_CRNTI; + case mac_params::RNTI_TEMP: + return sched_grant::RNTI_TYPE_TEMP; + case mac_params::RNTI_SPS: + return sched_grant::RNTI_TYPE_SPS; + case mac_params::RNTI_RA: + return sched_grant::RNTI_TYPE_RA; + } +} + +uint32_t mac::get_harq_sps_pid(uint32_t tti) { + uint32_t nof_proc = ((uint32_t) params_db.get_param(mac_params::SPS_DL_NOF_PROC)); + return tti/params_db.get_param(mac_params::SPS_DL_SCHED_INTERVAL)%nof_proc; + +} + +void mac::timer_expired(uint32_t timer_id) +{ + switch(timer_id) { + case TIME_ALIGNMENT: + timeAlignmentTimerExpire(); + break; + default: + break; + } +} + +/* Function called on expiry of TimeAlignmentTimer */ +void mac::timeAlignmentTimerExpire() { + dl_harq.reset(); + ul_harq.reset(); + dl_sps_assig.clear(); + ul_sps_assig.clear(); +} + +// Receive PCH when requested as defined in Section 5.5 +void mac::receive_pch(uint32_t tti) { + if (params_db.get_param(mac_params::PCCH_RECEIVE)) { + dl_buffer *dl_buffer = phy_h->get_dl_buffer(tti); + dl_sched_grant pch_grant(sched_grant::RNTI_TYPE_PRNTI, SRSLTE_PRNTI); + if (dl_buffer->get_dl_grant(&pch_grant)) { + qbuff *pcch_buff = mac_io_lch.get(mac_io::MAC_LCH_PCCH_DL); + uint8_t *ptr = (uint8_t*) pcch_buff->request(); + if (ptr && pch_grant.get_tbs() <= mac_io_lch.DEFAULT_MSG_SZ) { + if (dl_buffer->decode_data(&pch_grant, ptr)) { + pcch_buff->release(); + } else { + Warning("Error decoding PCH\n"); + } + } else { + Error("Error getting pointer from PCCH buffer\n"); + } + } else { + Debug("No P-RNTI grant found while looking for PCH messages\n"); + } + } +} + +/* This function controls DL Grant Assignment as specified in Section 5.3.1 in 36.321 + * and issues commands to DL harq operation + */ +void mac::process_dl_grants(uint32_t tti) { + // Get DL buffer for this TTI + dl_buffer *dl_buffer = phy_h->get_dl_buffer(tti); + + // 5.3.1 DL Assignment reception + for (int i = mac_params::RNTI_C;i<=mac_params::RNTI_RA;i++) { + // Check C-RNTI, SPS-RNTI and Temporal RNTI + if (params_db.get_param(i) != 0) { + Info("Searching DL grants for RNTI: %d\n", params_db.get_param(i)); + dl_sched_grant ue_grant(rnti_type(i), params_db.get_param(i)); + if (dl_buffer->get_dl_grant(&ue_grant)) { + // If PDCCH for C-RNTI and RA procedure in Contention Resolution, notify it + if (ra_procedure.is_contention_resolution() && i == mac_params::RNTI_C) { + ra_procedure.pdcch_to_crnti(false); + } + if (i != mac_params::RNTI_SPS) { + uint32_t harq_pid = ue_grant.get_harq_process(); + if (i == mac_params::RNTI_TEMP) { + ue_grant.set_ndi(is_first_temporal); + is_first_temporal = false; + } + if (i == mac_params::RNTI_C && dl_harq.is_sps(harq_pid)) { + ue_grant.set_ndi(true); + } + dl_harq.set_harq_info(tti, harq_pid, &ue_grant); + dl_harq.receive_data(tti, harq_pid, dl_buffer, phy_h); + } else { + uint32_t harq_pid = get_harq_sps_pid(tti); + if (ue_grant.get_ndi()) { + ue_grant.set_ndi(false); + dl_harq.set_harq_info(tti, harq_pid, &ue_grant); + dl_harq.receive_data(tti, harq_pid, dl_buffer, phy_h); + } else { + if (ue_grant.is_sps_release()) { + dl_sps_assig.clear(); + if (timers_db.get(TIME_ALIGNMENT)->is_running()) { + //phy_h->send_sps_ack(); + Warning("PHY Send SPS ACK not implemented\n"); + } + } else { + dl_sps_assig.reset(tti, &ue_grant); + ue_grant.set_ndi(true); + dl_harq.set_harq_info(tti, harq_pid, &ue_grant); + } + } + } + } + } + } + /* Process configured DL assingments (SPS) */ + dl_sched_grant *sps_grant = dl_sps_assig.get_pending_grant(tti); + if (sps_grant != NULL) { + Info("Processing SPS grant\n"); + uint32_t harq_pid = get_harq_sps_pid(tti); + sps_grant->set_ndi(true); + dl_harq.set_harq_info(tti, harq_pid, sps_grant); + dl_harq.receive_data(tti, harq_pid, dl_buffer, phy_h); + } + + /* Process SI-RNTI */ + uint32_t si_window_start = params_db.get_param(mac_params::BCCH_SI_WINDOW_ST); + uint32_t si_window_length = params_db.get_param(mac_params::BCCH_SI_WINDOW_LEN); + + if (tti >= si_window_start && tti < (si_window_start + si_window_length)) { + // Exclude subf 5 and sfn%2==0 unless it's a SIB1 message (window_length=1) (This is defined in 36.331 Sec 5.2.3) + if (!(phy_h->tti_to_subf(si_window_length) != 1 && + phy_h->tti_to_subf(si_window_start) == 5 && (phy_h->tti_to_SFN(tti)%2) == 0)) + { + Info("Searching for DL grant for SI-RNTI window_st=%d, window_len=%d\n", si_window_start, si_window_length); + dl_sched_grant si_grant(sched_grant::RNTI_TYPE_SIRNTI, SRSLTE_SIRNTI); + if (dl_buffer->get_dl_grant(&si_grant)) { + uint32_t k; + if (phy_h->tti_to_subf(si_window_start) == 5) { // This is SIB1, k is different + k = (phy_h->tti_to_SFN(tti)/2)%4; + } else { + k = phy_h->tti_to_subf(tti)%4; + } + si_grant.set_rv(((uint32_t) ceilf((float)1.5*k))%4); + Info("DL grant found, sending to HARQ with RV: %d\n", si_grant.get_rv()); + dl_harq.set_harq_info(tti, dl_harq_entity::HARQ_BCCH_PID, &si_grant); + dl_harq.receive_data(tti, dl_harq_entity::HARQ_BCCH_PID, dl_buffer, phy_h); + params_db.set_param(mac_params::BCCH_SI_WINDOW_ST, 0); + params_db.set_param(mac_params::BCCH_SI_WINDOW_LEN, 0); + } else { + Warning("DL grant not found\n"); + } + } + + } +} + +/* UL Grant reception and processin as defined in Section 5.4.1 in 36.321 */ +void mac::process_ul_grants(uint32_t tti) { + // Get DL buffer for this TTI to look for DCI grants + dl_buffer *dl_buffer = phy_h->get_dl_buffer(tti); + + //if (timers_db.get(TIME_ALIGNMENT)->is_running()) { + if (1) { + for (int i = mac_params::RNTI_C;i<=mac_params::RNTI_TEMP;i++) { + // Check C-RNTI, SPS-RNTI and Temporal C-RNTI + if (params_db.get_param(i) != 0) { + ul_sched_grant ul_grant(rnti_type(i), params_db.get_param(i)); + if (dl_buffer->get_ul_grant(&ul_grant)) { + if (ra_procedure.is_contention_resolution() && i == mac_params::RNTI_C) { + ra_procedure.pdcch_to_crnti(true); + } + if (i == mac_params::RNTI_C || i == mac_params::RNTI_TEMP || ra_procedure.is_running()) { + if (i == mac_params::RNTI_C && ul_harq.is_sps(tti)) + ul_grant.set_ndi(true); + ul_harq.run_tti(tti, &ul_grant, phy_h); + if (i == mac_params::RNTI_TEMP) { + // Discard already processed RAR grant + dl_buffer->discard_pending_rar_grant(); + } + return; + } + else if (i == mac_params::RNTI_SPS) { + if (ul_grant.get_ndi()) { + ul_grant.set_ndi(false); + ul_harq.run_tti(tti, &ul_grant, phy_h); + } else { + if (ul_grant.is_sps_release()) { + ul_sps_assig.clear(); + } else { + ul_sps_assig.reset(tti, &ul_grant); + ul_grant.set_ndi(true); + ul_harq.run_tti(tti, &ul_grant, phy_h); + return; + } + } + } + } + } + } + /* Process configured UL assingments (SPS) */ + ul_sched_grant *sps_grant = ul_sps_assig.get_pending_grant(tti); + if (sps_grant != NULL) { + sps_grant->set_ndi(true); + ul_harq.run_tti(tti, sps_grant, phy_h); + return; + } + } + ul_harq.run_tti(tti, phy_h); +} + + +int mac::recv_bcch_sdu(uint8_t* sdu_payload, uint32_t buffer_len_nbytes) +{ + return mac_io_lch.get(mac_io::MAC_LCH_BCCH_DL)->recv(sdu_payload, buffer_len_nbytes); +} + +int mac::recv_ccch_sdu(uint8_t* sdu_payload, uint32_t buffer_len_nbytes) +{ + return mac_io_lch.get(mac_io::MAC_LCH_CCCH_DL)->recv(sdu_payload, buffer_len_nbytes); +} + +int mac::recv_dtch0_sdu(uint8_t* sdu_payload, uint32_t buffer_len_nbytes) +{ + return mac_io_lch.get(mac_io::MAC_LCH_DTCH0_DL)->recv(sdu_payload, buffer_len_nbytes); +} + +int mac::recv_dcch0_sdu(uint8_t* sdu_payload, uint32_t buffer_len_nbytes) +{ + return mac_io_lch.get(mac_io::MAC_LCH_DTCH0_DL)->recv(sdu_payload, buffer_len_nbytes); +} + + +bool mac::send_ccch_sdu(uint8_t* sdu_payload, uint32_t nbytes) +{ + return mac_io_lch.get(mac_io::MAC_LCH_CCCH_UL)->send(sdu_payload, nbytes); +} + +bool mac::send_dtch0_sdu(uint8_t* sdu_payload, uint32_t nbytes) +{ + return mac_io_lch.get(mac_io::MAC_LCH_DTCH0_UL)->send(sdu_payload, nbytes); +} + +bool mac::send_dcch0_sdu(uint8_t* sdu_payload, uint32_t nbytes) +{ + return mac_io_lch.get(mac_io::MAC_LCH_DCCH0_UL)->send(sdu_payload, nbytes); +} + +void mac::set_param(mac_params::mac_param_t param, int64_t value) +{ + params_db.set_param((uint32_t) param, value); +} + +void mac::set_dcch0_priority(uint32_t priority, int PBR_x_tti, uint32_t BSD) +{ + mux_unit.set_priority(mac_io::MAC_LCH_DCCH0_UL - mac_io::MAC_LCH_CCCH_UL, priority, PBR_x_tti, BSD); +} +void mac::set_dtch0_priority(uint32_t priority, int PBR_x_tti, uint32_t BSD) +{ + mux_unit.set_priority(mac_io::MAC_LCH_DTCH0_UL - mac_io::MAC_LCH_CCCH_UL, priority, PBR_x_tti, BSD); +} + + +} +} diff --git a/srsapps/ue/mac/src/mac_pdu.cc b/srsapps/ue/mac/src/mac_pdu.cc new file mode 100644 index 000000000..3cfe629da --- /dev/null +++ b/srsapps/ue/mac/src/mac_pdu.cc @@ -0,0 +1,187 @@ +#include "srsapps/ue/mac/mac_pdu.h" + +namespace srslte { + namespace ue { +mac_pdu::mac_subh* mac_pdu::get() +{ + +} +void mac_pdu::init(uint32_t pdu_len) +{ + +} +mac_pdu::mac_pdu(uint32_t max_subheaders) +{ + +} +mac_pdu::mac_subh::cetype mac_pdu::mac_subh::ce_type() +{ + +} +uint16_t mac_pdu::mac_subh::get_c_rnti() +{ + +} +uint64_t mac_pdu::mac_subh::get_con_res_id() +{ + +} +uint8_t mac_pdu::mac_subh::get_phd() +{ + +} +uint32_t mac_pdu::mac_subh::get_sdu_lcid() +{ + +} +uint32_t mac_pdu::mac_subh::get_sdu_nbytes() +{ + +} +uint8_t* mac_pdu::mac_subh::get_sdu_ptr() +{ + +} +uint8_t mac_pdu::mac_subh::get_ta_cmd() +{ + +} +bool mac_pdu::mac_subh::is_sdu() +{ + +} +bool mac_pdu::mac_subh::set_c_rnti(uint16_t crnti) +{ + +} +bool mac_pdu::mac_subh::set_con_res_id(uint64_t con_res_id) +{ + +} +bool mac_pdu::mac_subh::set_phd(uint8_t phd) +{ + +} +bool mac_pdu::mac_subh::set_sdu(uint8_t* ptr, uint32_t nof_bytes) +{ + +} +bool mac_pdu::mac_subh::set_ta_cmd(uint8_t ta_cmd) +{ + +} +void mac_pdu::parse_packet(uint8_t* ptr) +{ + +} +bool mac_pdu::read_next() +{ + +} +void mac_pdu::reset() +{ + +} +bool mac_pdu::write_next() +{ + +} +bool mac_pdu::write_packet(uint8_t* ptr) +{ + +} + + + +mac_rar_pdu::mac_rar* mac_rar_pdu::get() +{ + +} +uint8_t mac_rar_pdu::get_backoff() +{ + +} +void mac_rar_pdu::init(uint32_t pdu_len) +{ + +} +bool mac_rar_pdu::is_backoff() +{ + +} +uint32_t mac_rar_pdu::mac_rar::get_rapid() +{ + +} +void mac_rar_pdu::mac_rar::get_sched_grant(uint8_t grant[]) +{ + +} +uint32_t mac_rar_pdu::mac_rar::get_ta_cmd() +{ + +} +uint16_t mac_rar_pdu::mac_rar::get_temp_crnti() +{ + +} +void mac_rar_pdu::mac_rar::set_rapid(uint32_t rapid) +{ + +} +void mac_rar_pdu::mac_rar::set_sched_grant(uint8_t grant[]) +{ + +} +void mac_rar_pdu::mac_rar::set_ta_cmd(uint32_t ta) +{ + +} +void mac_rar_pdu::mac_rar::set_temp_crnti(uint16_t temp_rnti) +{ + +} +mac_rar_pdu::mac_rar_pdu(uint32_t max_rars) +{ + +} +void mac_rar_pdu::parse_packet(uint8_t* ptr) +{ + +} +bool mac_rar_pdu::read_next() +{ + +} +void mac_rar_pdu::reset() +{ + +} +void mac_rar_pdu::set_backoff(uint8_t bi) +{ + +} +bool mac_rar_pdu::write_next() +{ + +} +bool mac_rar_pdu::write_packet(uint8_t* ptr) +{ + +} + + + + + } +} + +#ifdef kk +bool demux::lcid_is_lch(uint32_t lcid) { + if (lcid <= LIBLTE_MAC_DLSCH_DCCH_LCID_END) { + return true; + } else { + return false; + } +} +#endif diff --git a/srsapps/ue/mac/src/mux.cc b/srsapps/ue/mac/src/mux.cc new file mode 100644 index 000000000..1fb98c3af --- /dev/null +++ b/srsapps/ue/mac/src/mux.cc @@ -0,0 +1,271 @@ + +#include "srsapps/ue/mac/mux.h" +#include "srsapps/ue/mac/mac.h" + +namespace srslte { +namespace ue { + +#define IO_IDX(lch) (lch + mac_io::MAC_LCH_CCCH_UL) +#define UL_IDX(lch) (lch - mac_io::MAC_LCH_CCCH_UL) + +mux::mux() : pdu_msg(20) +{ + msg3_buff.init(1, MSG3_BUFF_SZ); + pdu_buff.init(1, PDU_BUFF_SZ); + bzero(nof_tx_pkts, sizeof(uint32_t) * mac_io::NOF_UL_LCH); + pthread_mutex_init(&mutex, NULL); + + for (int i=0;i priority_sorted[new_index] && new_index < mac_io::NOF_UL_LCH) { + new_index++; + } + int old_index = 0; + while(lch_id != lchid_sorted[old_index] && new_index < mac_io::NOF_UL_LCH) { + old_index++; + } + if (new_index == mac_io::NOF_UL_LCH) { + Error("Can't find LchID=%d in sorted list\n", lch_id); + return; + } + // Replace goes in one direction or the other + int add=new_index>old_index?1:-1; + for (int i=old_index;i!=new_index;i+=add) { + priority_sorted[i] = priority_sorted[i+add]; + lchid_sorted[i] = lchid_sorted[i+add]; + } + priority_sorted[new_index] = set_priority; + lchid_sorted[new_index] = lch_id; + } + pthread_mutex_unlock(&mutex); +} + +void mux::pdu_release() +{ + pdu_buff.release(); +} + +bool mux::pdu_move_to_msg3(uint32_t tti_, uint32_t pdu_sz) +{ + tti = tti_; + if (pdu_buff.isempty()) { + if (assemble_pdu(pdu_sz)) { + if (pdu_buff.pending_data() < MSG3_BUFF_SZ) { + pdu_buff.move_to(&msg3_buff); + return true; + } else { + pdu_buff.release(); + Error("Assembled PDU size exceeds Msg3 buffer size\n"); + return false; + } + } else { + Error("Assembling PDU\n"); + return false; + } + } else { + Error("Generating PDU: PDU pending in buffer for transmission\n"); + return false; + } +} + +// Multiplexing and logical channel priorization as defined in Section 5.4.3 +uint8_t* mux::pdu_pop(uint32_t tti_, uint32_t pdu_sz) +{ + tti = tti_; + if (pdu_buff.isempty()) { + if (assemble_pdu(pdu_sz)) { + return (uint8_t*) pdu_buff.pop(); + } else { + return NULL; + } + } else { + Error("Generating PDU: PDU pending in buffer for transmission\n"); + return NULL; + } +} + +void mux::append_crnti_ce_next_tx(uint16_t crnti) { + pending_crnti_ce = crnti; +} + +bool mux::assemble_pdu(uint32_t pdu_sz) { + + uint8_t *buff = (uint8_t*) pdu_buff.request(); + if (!buff) { + Error("Assembling PDU: Buffer is not available\n"); + return false; + } + + // Make sure pdu_sz is byte-aligned + pdu_sz = 8*(pdu_sz/8); + + // Acquire mutex. Cannot change priorities, PBR or BSD after assemble finishes + pthread_mutex_lock(&mutex); + + // Update Bj + for (int i=0;i=mac_io::NOF_UL_LCH;i++) { + // Add PRB unless it's infinity + if (PBR[i] >= 0) { + Bj[i] += PBR[i]; + } + if (Bj[i] >= BSD[i]) { + Bj[i] = BSD[i]; + } + } + +// Logical Channel Procedure + + uint32_t sdu_sz = 0; + + pdu_msg.init(pdu_sz); + + // MAC control element for C-RNTI or data from UL-CCCH + if (!allocate_sdu(UL_IDX(mac_io::MAC_LCH_CCCH_UL), &pdu_msg)) { + if (pending_crnti_ce) { + if (pdu_msg.write_next()) { + if (!pdu_msg.get()->set_c_rnti(pending_crnti_ce)) { + Warning("Pending C-RNTI CE could not be inserted in MAC PDU\n"); + } + } + } + } + pending_crnti_ce = 0; + + // MAC control element for BSR, with exception of BSR included for padding; + // TODO + // MAC control element for PHR + // TODO + + // data from any Logical Channel, except data from UL-CCCH; + // first only those with positive Bj + for (int i=0;i 0 || PBR[i] < 0) && res) { + res = allocate_sdu(lchid_sorted[i], &pdu_msg, &sdu_sz); + if (res && PBR[i] >= 0) { + Bj[i] -= sdu_sz; + } + } + } + + // If resources remain, allocate regardless of their Bj value + for (int i=0;i 0) { + mac_io_h->get(IO_IDX(i))->release(); + nof_tx_pkts[i]--; + } + } + + /* Generate MAC PDU and save to buffer */ + if (pdu_msg.write_packet(buff)) { + pdu_buff.push(pdu_sz); + } else { + Error("Writing PDU message to packet\n"); + return false; + } + return true; +} + + +bool mux::allocate_sdu(uint32_t lcid, mac_pdu *pdu) +{ + return allocate_sdu(lcid, pdu, NULL); +} + +bool mux::allocate_sdu(uint32_t lcid, mac_pdu *pdu, uint32_t *sdu_sz) +{ + + // Get n-th pending SDU pointer and length + uint32_t buff_len; + uint8_t *buff_ptr = (uint8_t*) mac_io_h->get(lcid)->pop(&buff_len, nof_tx_pkts[lcid]); + + if (buff_ptr) { // there is pending SDU to allocate + if (pdu->write_next()) { // there is space for a new subheader + if (pdu->get()->set_sdu(buff_ptr, buff_len)) { // new SDU could be added + // Increase number of pop'ed packets from queue + nof_tx_pkts[lcid]++; + return true; + } + } + } + return false; +} + + + +void mux::msg3_flush() +{ + msg3_buff.flush(); +} + +bool mux::msg3_isempty() +{ + return msg3_buff.isempty(); +} + +/* Returns a pointer to the Msg3 buffer */ +uint8_t* mux::msg3_pop(uint32_t tti, uint32_t TB_size) +{ + uint32_t len; + uint8_t *msg3 = (uint8_t*) msg3_buff.pop(&len); + if (len < TB_size) { + // Pad with zeros without exceeding maximum buffer size + if (TB_size <= MSG3_BUFF_SZ) { + bzero(&msg3[len], (TB_size-len)*sizeof(uint8_t)); + } else { + Error("Requested TB size from Msg3 buffer exceeds buffer size (%d>%d)\n", TB_size, MSG3_BUFF_SZ); + return NULL; + } + } + return msg3; +} + +void mux::msg3_release() +{ + msg3_buff.release(); +} + + + +} +} diff --git a/srsapps/ue/mac/src/proc_ra.cc b/srsapps/ue/mac/src/proc_ra.cc new file mode 100644 index 000000000..e8d01de36 --- /dev/null +++ b/srsapps/ue/mac/src/proc_ra.cc @@ -0,0 +1,442 @@ + +#include +#include + +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/ue/mac/mac_io.h" +#include "srsapps/ue/mac/proc_ra.h" +#include "srsapps/ue/mac/mac.h" +#include "srsapps/ue/mac/mux.h" + +/* Random access procedure as specified in Section 5.1 of 36.321 */ + +namespace srslte { +namespace ue { + +// Table 7.2-1. Backoff Parameter values +uint32_t backoff_table[16] = {0, 10, 20, 30, 40, 60, 80, 120, 160, 240, 320, 480, 960, 960, 960, 960}; + +// Table 7.6-1: DELTA_PREAMBLE values. +int delta_preamble_db_table[5] = {0, 0, -3, -3, 8}; + +bool ra_proc::init(mac_params* params_db_, phy* phy_h_, srslte::log* log_h_, srslte::timers* timers_db_, + mux* mux_unit_, demux* demux_unit_) +{ + phy_h = phy_h_; + log_h = log_h_; + params_db = params_db_; + timers_db = timers_db_; + mux_unit = mux_unit_; + demux_unit= demux_unit_; + reset(); +} + +void ra_proc::reset() { + state = IDLE; +} + +void ra_proc::read_params() { + + // Read initialization parameters + configIndex = params_db->get_param(mac_params::RA_CONFIGINDEX); + preambleIndex = params_db->get_param(mac_params::RA_PREAMBLEINDEX); + maskIndex = params_db->get_param(mac_params::RA_MASKINDEX); + nof_preambles = params_db->get_param(mac_params::RA_NOFPREAMBLES); + if (!nof_preambles || nof_preambles > 64) { + nof_preambles = 64; + } + nof_groupA_preambles = params_db->get_param(mac_params::RA_NOFGROUPAPREAMBLES); + if (!nof_groupA_preambles) { + nof_groupA_preambles = nof_preambles; + } + if (nof_groupA_preambles > nof_preambles) { + nof_groupA_preambles = nof_preambles; + } + nof_groupB_preambles = nof_preambles - nof_groupA_preambles; + if (nof_groupB_preambles) { + messagePowerOffsetGroupB = params_db->get_param(mac_params::RA_MESSAGEPOWEROFFSETB); + messageSizeGroupA = params_db->get_param(mac_params::RA_MESSAGESIZEA); + Pcmax = params_db->get_param(mac_params::RA_PCMAX); + deltaPreambleMsg3 = params_db->get_param(mac_params::RA_DELTAPREAMBLEMSG3); + } + responseWindowSize = params_db->get_param(mac_params::RA_RESPONSEWINDOW); + powerRampingStep = params_db->get_param(mac_params::RA_POWERRAMPINGSTEP); + preambleTransMax = params_db->get_param(mac_params::RA_PREAMBLETRANSMAX); + iniReceivedTargetPower = params_db->get_param(mac_params::RA_INITRECEIVEDPOWER); + maxharq_msg3tx = params_db->get_param(mac_params::RA_MAXTXMSG3); + contentionResolutionTimer = params_db->get_param(mac_params::RA_CONTENTIONTIMER); + + delta_preamble_db = delta_preamble_db_table[configIndex]; + + if (contentionResolutionTimer > 0) { + timers_db->get(mac::CONTENTION_TIMER)->set(this, contentionResolutionTimer); + } + +} + +bool ra_proc::in_progress() +{ + return (state > IDLE && state != COMPLETION); +} + +bool ra_proc::is_successful() { + return state == COMPLETION; +} + +bool ra_proc::is_contention_resolution() { + return state == CONTENTION_RESOLUTION; +} + +bool ra_proc::is_error() { + return state == RA_PROBLEM; +} + +uint32_t interval(uint32_t x1, uint32_t x2) { + if (x1 > x2) { + return x1-x2; + } else { + return 10240-x2+x1; + } +} + +const char* state_str[10] = {"Idle", + "RA Initializat.: ", + "RA ResSelection: ", + "RA PreambleTx : ", + "RA PreambleRx : ", + "RA ResponseErr : ", + "RA BackoffWait : ", + "RA ContentResol: ", + "RA Completed : ", + "RA Problem : "}; + +#define rError(fmt, ...) Error("%s" fmt, state_str[state], ##__VA_ARGS__) +#define rInfo(fmt, ...) Info("%s" fmt, state_str[state], ##__VA_ARGS__) +#define rDebug(fmt, ...) Debug("%s" fmt, state_str[state], ##__VA_ARGS__) + + +// Process Timing Advance Command as defined in Section 5.2 +void ra_proc::process_timeadv_cmd(uint32_t tti, uint32_t ta) { + if (preambleIndex > 0) { + // Preamble not selected by UE MAC + phy_h->set_timeadv_rar(ta); + timers_db->get(mac::TIME_ALIGNMENT)->reset(); + timers_db->get(mac::TIME_ALIGNMENT)->run(); + Info("Applying RAR TA CMD %d\n", ta); + } else { + // Preamble selected by UE MAC + if (!timers_db->get(mac::TIME_ALIGNMENT)->is_running()) { + phy_h->set_timeadv_rar(ta); + timers_db->get(mac::TIME_ALIGNMENT)->run(); + Info("Applying RAR TA CMD %d\n", ta); + } else { + // Ignore TA CMD + Warning("Ignoring RAR TA CMD because timeAlignmentTimer still running\n"); + } + } +} + +void ra_proc::step_initialization() { + read_params(); + pdcch_to_crnti_received = PDCCH_CRNTI_NOT_RECEIVED; + received_contention_id = 0; + transmitted_contention_id = 0; + preambleTransmissionCounter = 1; + first_rar_received = true; + mux_unit->msg3_flush(); + backoff_param_ms = 0; + phy_h->init_prach(); + state = RESOURCE_SELECTION; + rInfo("Done\n"); + +} + +void ra_proc::step_resource_selection() { + ra_group_t sel_group; + if (preambleIndex > 0) { + // Preamble is chosen by Higher layers (ie Network) + sel_maskIndex = maskIndex; + sel_preamble = (uint32_t) preambleIndex%nof_preambles; + } else { + // Preamble is chosen by MAC UE + if (!msg3_transmitted) { + if (nof_groupB_preambles > 0) { // Check also messageSizeGroupA and pathloss (Pcmax,deltaPreamble and powerOffset) + sel_group = RA_GROUP_B; + } else { + sel_group = RA_GROUP_A; + } + last_msg3_group = sel_group; + } else { + sel_group = last_msg3_group; + } + if (sel_group == RA_GROUP_A) { + sel_preamble = rand()%(nof_groupA_preambles-1); + } else { + sel_preamble = nof_groupA_preambles + rand()%(nof_groupB_preambles-1); + } + sel_maskIndex = 0; + } + rInfo("Selected preambleIndex=%d maskIndex=%d nof_GroupApreambles=%d\n", sel_preamble, sel_maskIndex,nof_groupA_preambles); + state = PREAMBLE_TRANSMISSION; +} + +void ra_proc::step_preamble_transmission() { + received_target_power_dbm = iniReceivedTargetPower + + delta_preamble_db + + (preambleTransmissionCounter-1)*powerRampingStep; + + phy_h->send_prach(sel_preamble, sel_maskIndex - 1, received_target_power_dbm); + rInfo("Selected received_target_power_dbm=%d dBm\n", received_target_power_dbm); + state = RESPONSE_RECEPTION; +} + +void ra_proc::step_response_reception() { + int ra_tti = phy_h->get_prach_transmitted_tti(); + if (ra_tti > 0) { + + ra_rnti = 1+ra_tti%10; // f_id=0 for FDD + dl_sched_grant rar_grant(ra_rnti); + uint32_t interval_ra = interval(tti, ra_tti); + + // Try to decode RAR only within the RA response window + if (interval_ra >= 3 && interval_ra <= 3+responseWindowSize) { + + // Get DL grant for RA-RNTI + dl_buffer *dl_buffer = phy_h->get_dl_buffer(tti); + if (dl_buffer->get_dl_grant(&rar_grant)) + { + rInfo("DL grant found RA-RNTI=%d\n", ra_rnti); + + if (rar_grant.get_tbs() > MAX_RAR_PDU_LEN) { + rError("RAR PDU exceeds local RAR PDU buffer (%d>%d)\n", rar_grant.get_tbs(), MAX_RAR_PDU_LEN); + state = RESPONSE_ERROR; + return; + } + + // Decode packet + if (dl_buffer->decode_data(&rar_grant, rar_pdu_buffer)) { + rar_pdu.init(rar_grant.get_tbs()); + + // Set Backoff parameter + if (rar_pdu.is_backoff()) { + backoff_param_ms = backoff_table[rar_pdu.get_backoff()%16]; + } else { + backoff_param_ms = 0; + } + + while(rar_pdu.read_next()) { + if (rar_pdu.get()->get_rapid() == sel_preamble) { + rInfo("Received RAPID=%d\n", sel_preamble); + + process_timeadv_cmd(tti, rar_pdu.get()->get_ta_cmd()); + + // FIXME: Indicate received target power + //phy_h->set_target_power_rar(iniReceivedTargetPower, (preambleTransmissionCounter-1)*powerRampingStep); + + // Indicate grant to PHY layer. RAR grants have 6 sf delay (4 is the default delay) + uint8_t grant[mac_rar_pdu::mac_rar::RAR_GRANT_LEN]; + rar_pdu.get()->get_sched_grant(grant); + phy_h->get_dl_buffer(tti+2)->set_rar_grant(grant); + + if (preambleIndex > 0) { + // Preamble selected by Network + state = COMPLETION; + } else { + // Preamble selected by UE MAC + params_db->set_param(mac_params::RNTI_TEMP, rar_pdu.get()->get_temp_crnti()); + if (first_rar_received) { + first_rar_received = false; + + // Save transmitted C-RNTI (if any) + transmitted_crnti = params_db->get_param(mac_params::RNTI_C); + + // Save transmitted UE contention id, as defined by higher layers + transmitted_contention_id = params_db->get_param(mac_params::CONTENTION_ID); + params_db->set_param(mac_params::CONTENTION_ID, 0); + + // If we have a C-RNTI, tell Mux unit to append C-RNTI CE if no CCCH SDU transmission + if (transmitted_crnti) { + mux_unit->append_crnti_ce_next_tx(transmitted_crnti); + } + + // Get TransportBlock size for the grant + ul_sched_grant msg3_grant(rar_pdu.get()->get_temp_crnti()); + phy_h->get_dl_buffer(tti+2)->get_ul_grant(&msg3_grant); + + // Move MAC PDU from Multiplexing and assembly unit to Msg3 + mux_unit->pdu_move_to_msg3(tti, msg3_grant.get_tbs()); // 56 is the minimum grant provided + + state = CONTENTION_RESOLUTION; + + // Start contention resolution timer + timers_db->get(mac::CONTENTION_TIMER)->reset(); + timers_db->get(mac::CONTENTION_TIMER)->run(); + } + } + } + } + } + } + } + if (interval_ra > 3+responseWindowSize && interval_ra < 10000) { + rInfo("Timeout while trying to receive RAR\n"); + state = RESPONSE_ERROR; + } + } +} + +void ra_proc::step_response_error() { + mux_unit->msg3_flush(); + + preambleTransmissionCounter++; + if (preambleTransmissionCounter == preambleTransMax + 1) { + rError("Maximum number of transmissions reached (%d)\n", preambleTransMax); + state = RA_PROBLEM; + } else { + backoff_interval_start = tti; + if (backoff_param_ms) { + backoff_inteval = rand()%backoff_param_ms; + } else { + backoff_inteval = 0; + } + if (backoff_inteval) { + rInfo("Backoff wait interval %d\n", backoff_inteval); + state = BACKOFF_WAIT; + } else { + rInfo("Transmitting inmediatly\n"); + state = RESOURCE_SELECTION; + } + } +} + +void ra_proc::step_backoff_wait() { + if (interval(tti, backoff_interval_start) >= backoff_inteval) { + state = RESOURCE_SELECTION; + } +} + +void ra_proc::step_contention_resolution() { + // If Msg3 has been sent + if (mux_unit->msg3_isempty()) { + msg3_transmitted = true; + if (pdcch_to_crnti_received != PDCCH_CRNTI_NOT_RECEIVED) + { + // Random Access initiated by MAC itself or PDCCH order (transmission of MAC C-RNTI CE) + if (start_mode == MAC_ORDER && pdcch_to_crnti_received == PDCCH_CRNTI_UL_GRANT || + start_mode == PDCCH_ORDER) + { + timers_db->get(mac::CONTENTION_TIMER)->stop(); + params_db->set_param(mac_params::RNTI_TEMP, 0); + state = COMPLETION; + } + pdcch_to_crnti_received = PDCCH_CRNTI_NOT_RECEIVED; + + } else if (demux_unit->is_temp_crnti_pending()) + { + // Random Access initiated by RRC by the transmission of CCCH SDU + received_contention_id = demux_unit->get_contention_resolution_id(); + if (received_contention_id) { + // MAC PDU successfully decoded and contains MAC CE contention Id + if (transmitted_contention_id == received_contention_id) { + + // UE Contention Resolution ID included in MAC CE matches the CCCH SDU transmitted in Msg3 + timers_db->get(mac::CONTENTION_TIMER)->stop(); + params_db->set_param(mac_params::RNTI_C, params_db->get_param(mac_params::RNTI_TEMP)); + + // finish the disassembly and demultiplexing of the MAC PDU + demux_unit->demultiplex_pending_pdu(tti); + state = COMPLETION; + } else { + // Discard MAC PDU + state = RESPONSE_ERROR; + } + params_db->set_param(mac_params::RNTI_TEMP, 0); + } + } + } +} + +void ra_proc::step_completition() { + params_db->set_param(mac_params::RA_PREAMBLEINDEX, 0); + params_db->set_param(mac_params::RA_MASKINDEX, 0); + mux_unit->msg3_flush(); + msg3_transmitted = false; +} + +void ra_proc::step(uint32_t tti_) +{ + tti = tti_; + if (is_running()) { + switch(state) { + case IDLE: + break; + case INITIALIZATION: + step_initialization(); + break; + case RESOURCE_SELECTION: + step_resource_selection(); + break; + case PREAMBLE_TRANSMISSION: + step_preamble_transmission(); + break; + case RESPONSE_RECEPTION: + step_response_reception(); + break; + case RESPONSE_ERROR: + step_response_error(); + break; + case BACKOFF_WAIT: + step_backoff_wait(); + break; + case CONTENTION_RESOLUTION: + step_contention_resolution(); + break; + case COMPLETION: + step_completition(); + break; + } + } +} + +void ra_proc::start_mac_order() +{ + if (state == IDLE || state == COMPLETION || state == RA_PROBLEM) { + start_mode = MAC_ORDER; + state = INITIALIZATION; + } +} + +void ra_proc::start_pdcch_order() +{ + if (state == IDLE || state == COMPLETION || state == RA_PROBLEM) { + start_mode = PDCCH_ORDER; + state = INITIALIZATION; + } +} + +void ra_proc::start_rlc_order() +{ + if (state == IDLE || state == COMPLETION || state == RA_PROBLEM) { + start_mode = RLC_ORDER; + state = INITIALIZATION; + } +} + +// Contention Resolution Timer is expired (Section 5.1.5) +void ra_proc::timer_expired(uint32_t timer_id) +{ + params_db->set_param(mac_params::RNTI_TEMP, 0); + state = RESPONSE_ERROR; +} + +void ra_proc::pdcch_to_crnti(bool is_uplink_grant) { + if (is_uplink_grant) { + pdcch_to_crnti_received = PDCCH_CRNTI_UL_GRANT; + } else { + pdcch_to_crnti_received = PDCCH_CRNTI_DL_GRANT; + } +} + +} +} + diff --git a/srsapps/ue/mac/src/ul_harq.cc b/srsapps/ue/mac/src/ul_harq.cc new file mode 100644 index 000000000..4cb5228c6 --- /dev/null +++ b/srsapps/ue/mac/src/ul_harq.cc @@ -0,0 +1,241 @@ +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/log.h" + +#include "srsapps/ue/mac/mac.h" +#include "srsapps/ue/mac/ul_harq.h" + +namespace srslte { + namespace ue { + + /*********************************************************** + * + * HARQ ENTITY + * + *********************************************************/ + +ul_harq_entity::ul_harq_entity() { + proc = new ul_harq_process[NOF_HARQ_PROC]; // BCCH process is separate +} +ul_harq_entity::~ul_harq_entity() { +delete proc; +} +bool ul_harq_entity::init(srslte_cell_t cell, uint32_t max_payload_len, log *log_h_, timers *timers_db_, mux *mux_unit_) { + log_h = log_h_; + mux_unit = mux_unit_; + timers_db = timers_db_; + + for (uint32_t i=0;iis_temp_rnti() && grant->get_ndi() != proc[pid].get_ndi()) || + (grant->is_crnti() && !proc[pid].has_grant()) || + grant->is_from_rar()) + { + // New transmission + uint8_t* msg3_ptr = (uint8_t*) mux_unit->msg3_pop(tti, grant->get_tbs()); + + // Uplink grant in a RAR + if (msg3_ptr && grant->is_from_rar()) { + proc[pid].generate_new_tx(msg3_ptr, true, grant, phy_h->get_ul_buffer(tti+4)); + mux_unit->msg3_release(); + + // Normal UL grant + } else { + // Request a MAC PDU from the Multiplexing & Assemble Unit + uint8_t* mac_pdu = mux_unit->pdu_pop(tti, grant->get_tbs()); + if (mac_pdu) { + proc[pid].generate_new_tx(mac_pdu, false, grant, phy_h->get_ul_buffer(tti+4)); + mux_unit->pdu_release(); + } else { + Warning("Uplink grant with MAC PDU available in Multiplex Unit\n"); + } + } + } else { + // Adaptive Re-TX + proc[pid].generate_retx(grant, phy_h->get_ul_buffer(tti+4)); + } + } else if (proc[pid].has_grant()) { + // Non-Adaptive Re-Tx + proc[pid].generate_retx(phy_h->get_ul_buffer(tti+4)); + } + + // Receive and route HARQ feedbacks + for (uint32_t i=0;iget_dl_buffer(tti)->decode_ack(proc[pid].get_grant())); + } + } +} + +bool ul_harq_entity::is_last_retx_msg3() +{ + return last_retx_is_msg3; +} + + + +/*********************************************************** + * + * HARQ PROCESS + * + *********************************************************/ + +static int rv_of_irv[4] = {0, 2, 3, 1}; +static int irv_of_rv[4] = {0, 3, 1, 2}; + +ul_harq_entity::ul_harq_process::ul_harq_process() : cur_grant(0) { + payload = NULL; + max_payload_len = 0; + current_tx_nb = 0; + current_irv = 0; + is_grant_configured = false; + bzero(&cur_grant, sizeof(ul_sched_grant)); +} +void ul_harq_entity::ul_harq_process::reset() { + current_tx_nb = 0; + current_irv = 0; + is_grant_configured = false; + bzero(&cur_grant, sizeof(ul_sched_grant)); + srslte_softbuffer_tx_reset(&softbuffer); +} +bool ul_harq_entity::ul_harq_process::has_grant() { + return is_grant_configured; +} +void ul_harq_entity::ul_harq_process::reset_ndi() { + ndi = false; +} +bool ul_harq_entity::ul_harq_process::get_ndi() +{ + return ndi; +} + +ul_sched_grant* ul_harq_entity::ul_harq_process::get_grant() +{ + return &cur_grant; +} + +void ul_harq_entity::ul_harq_process::set_harq_feedback(bool ack) { + harq_feedback = ack; +} +void ul_harq_entity::ul_harq_process::set_maxHARQ_Tx(uint32_t maxHARQ_Tx_, uint32_t maxHARQ_Msg3Tx_) { + maxHARQ_Tx = maxHARQ_Tx_; + maxHARQ_Msg3Tx = maxHARQ_Msg3Tx_; +} + +bool ul_harq_entity::ul_harq_process::init(srslte_cell_t cell, uint32_t max_payload_len_, ul_harq_entity *parent) { + max_payload_len = max_payload_len_; + if (srslte_softbuffer_tx_init(&softbuffer, cell)) { + fprintf(stderr, "Error initiating soft buffer\n"); + return false; + } else { + harq_entity = parent; + log_h = harq_entity->log_h; + payload = (uint8_t*) srslte_vec_malloc(sizeof(uint8_t) * max_payload_len); + return payload?true:false; + } +} + +// Retransmission with or w/o grant (Section 5.4.2.2) +void ul_harq_entity::ul_harq_process::generate_retx(ul_sched_grant* grant, ul_buffer* ul) +{ + current_tx_nb++; + + if (grant) { + // HARQ entity requests an adaptive transmission + memcpy(&cur_grant, grant, sizeof(grant)); + current_irv = irv_of_rv[grant->get_rv()%4]; + harq_feedback = false; + generate_tx(ul); + } else { + // HARQ entity requests a non-adaptive transmission + if (!harq_feedback) { + generate_tx(ul); + } + } + + // On every Msg3 retransmission, restart mac-ContentionResolutionTimer as defined in Section 5.1.5 + if (is_msg3) { + harq_entity->timers_db->get(mac::CONTENTION_TIMER)->reset(); + } +} + +// New transmission (Section 5.4.2.2) +void ul_harq_entity::ul_harq_process::generate_new_tx(uint8_t *pdu_payload, bool is_msg3_, ul_sched_grant* ul_grant, ul_buffer* ul) +{ + if (ul_grant && pdu_payload && ul_grant->get_tbs() < max_payload_len) { + current_tx_nb = 0; + current_irv = 0; + // Store MAC PDU in the HARQ buffer + srslte_bit_pack_vector(pdu_payload, payload, ul_grant->get_tbs()); + // Store the uplink grant + memcpy(&cur_grant, ul_grant, sizeof(ul_grant)); + harq_feedback = false; + generate_tx(ul); + is_grant_configured = true; + is_msg3 = is_msg3_; + } +} + +void ul_harq_entity::ul_harq_process::generate_retx(ul_buffer* ul) +{ + generate_retx(NULL, ul); +} + + // Transmission of pending frame (Section 5.4.2.2) +void ul_harq_entity::ul_harq_process::generate_tx(ul_buffer* ul) +{ + cur_grant.set_rv(rv_of_irv[current_irv%4]); + ul->set_current_tx_nb(current_tx_nb); + ul->generate_data(&cur_grant, &softbuffer, payload); + current_irv = (current_irv+1)%4; + if (is_msg3) { + if (current_tx_nb == maxHARQ_Msg3Tx) { + reset(); + } + } else { + if (current_tx_nb == maxHARQ_Tx) { + reset(); + } + } + +} + +} +} \ No newline at end of file diff --git a/srsapps/ue/mac/test/CMakeLists.txt b/srsapps/ue/mac/test/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/srsapps/ue/mac/test/mac_test.cc b/srsapps/ue/mac/test/mac_test.cc new file mode 100644 index 000000000..84a7315fd --- /dev/null +++ b/srsapps/ue/mac/test/mac_test.cc @@ -0,0 +1,283 @@ + +#include + +#include "liblte_rrc.h" +#include "srsapps/radio/radio_uhd.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/tti_sync_cv.h" +#include "srsapps/common/log_stdout.h" +#include "srsapps/ue/mac/mac.h" + + + +/********************************************************************** + * Program arguments processing + ***********************************************************************/ +typedef struct { + float uhd_rx_freq; + float uhd_tx_freq; + float uhd_rx_gain; + float uhd_tx_gain; +}prog_args_t; + +void args_default(prog_args_t *args) { + args->uhd_rx_freq = -1.0; + args->uhd_tx_freq = -1.0; + args->uhd_rx_gain = 60.0; + args->uhd_tx_gain = 60.0; +} + +void usage(prog_args_t *args, char *prog) { + printf("Usage: %s [gv] -f rx_frequency (in Hz) -F tx_frequency (in Hz)\n", prog); + printf("\t-g UHD RX gain [Default %.2f dB]\n", args->uhd_rx_gain); + printf("\t-g UHD RX gain [Default %.2f dB]\n", args->uhd_tx_gain); + printf("\t-v [increase verbosity, default none]\n"); +} + +void parse_args(prog_args_t *args, int argc, char **argv) { + int opt; + args_default(args); + while ((opt = getopt(argc, argv, "gGfFv")) != -1) { + switch (opt) { + case 'g': + args->uhd_rx_gain = atof(argv[optind]); + break; + case 'G': + args->uhd_tx_gain = atof(argv[optind]); + break; + case 'f': + args->uhd_rx_freq = atof(argv[optind]); + break; + case 'F': + args->uhd_tx_freq = atof(argv[optind]); + break; + case 'v': + srslte_verbose++; + break; + default: + usage(args, argv[0]); + exit(-1); + } + } + if (args->uhd_rx_freq < 0 || args->uhd_tx_freq < 0) { + usage(args, argv[0]); + exit(-1); + } +} + +// Determine SI messages scheduling as in 36.331 5.2.3 Acquisition of an SI message +uint32_t sib_start_tti(uint32_t tti, uint32_t period, uint32_t x) { + return (period*10*(1+tti/(period*10))+x)%10240; // the 1 means next opportunity +} + +void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srslte::ue::mac *mac, srslte::ue::phy *phy) { + // RACH-CONFIGCOMMON + if (sib2->rr_config_common_sib.rach_cnfg.preambles_group_a_cnfg.present) { + mac->set_param(srslte::ue::mac_params::RA_NOFGROUPAPREAMBLES, + liblte_rrc_message_size_group_a_num[sib2->rr_config_common_sib.rach_cnfg.preambles_group_a_cnfg.size_of_ra]); + mac->set_param(srslte::ue::mac_params::RA_MESSAGESIZEA, + liblte_rrc_message_size_group_a_num[sib2->rr_config_common_sib.rach_cnfg.preambles_group_a_cnfg.msg_size]); + mac->set_param(srslte::ue::mac_params::RA_MESSAGEPOWEROFFSETB, + liblte_rrc_message_power_offset_group_b_num[sib2->rr_config_common_sib.rach_cnfg.preambles_group_a_cnfg.msg_pwr_offset_group_b]); + } + mac->set_param(srslte::ue::mac_params::RA_NOFPREAMBLES, + liblte_rrc_number_of_ra_preambles_num[sib2->rr_config_common_sib.rach_cnfg.num_ra_preambles]); + mac->set_param(srslte::ue::mac_params::RA_POWERRAMPINGSTEP, + liblte_rrc_power_ramping_step_num[sib2->rr_config_common_sib.rach_cnfg.pwr_ramping_step]); + mac->set_param(srslte::ue::mac_params::RA_INITRECEIVEDPOWER, + liblte_rrc_preamble_initial_received_target_power_num[sib2->rr_config_common_sib.rach_cnfg.preamble_init_rx_target_pwr]); + mac->set_param(srslte::ue::mac_params::RA_PREAMBLETRANSMAX, + liblte_rrc_preamble_trans_max_num[sib2->rr_config_common_sib.rach_cnfg.preamble_trans_max]); + mac->set_param(srslte::ue::mac_params::RA_RESPONSEWINDOW, + liblte_rrc_ra_response_window_size_num[sib2->rr_config_common_sib.rach_cnfg.ra_resp_win_size]); + mac->set_param(srslte::ue::mac_params::RA_CONTENTIONTIMER, + liblte_rrc_mac_contention_resolution_timer_num[sib2->rr_config_common_sib.rach_cnfg.mac_con_res_timer]); + mac->set_param(srslte::ue::mac_params::RA_MAXTXMSG3, + sib2->rr_config_common_sib.rach_cnfg.max_harq_msg3_tx); + + printf("Set RACH ConfigCommon: NofPreambles=%d, ResponseWindow=%d\n", + liblte_rrc_number_of_ra_preambles_num[sib2->rr_config_common_sib.rach_cnfg.num_ra_preambles], + liblte_rrc_ra_response_window_size_num[sib2->rr_config_common_sib.rach_cnfg.ra_resp_win_size]); + + // PDSCH ConfigCommon + mac->set_param(srslte::ue::mac_params::PDSCH_RSPOWER, + sib2->rr_config_common_sib.pdsch_cnfg.rs_power); + mac->set_param(srslte::ue::mac_params::PDSCH_PB, + sib2->rr_config_common_sib.pdsch_cnfg.p_b); + + // PUSCH ConfigCommon + phy->set_param(srslte::ue::phy_params::PUSCH_EN_64QAM, + sib2->rr_config_common_sib.pusch_cnfg.enable_64_qam); + phy->set_param(srslte::ue::phy_params::PUSCH_HOPPING_OFFSET, + sib2->rr_config_common_sib.pusch_cnfg.pusch_hopping_offset); + phy->set_param(srslte::ue::phy_params::PUSCH_HOPPING_N_SB, + sib2->rr_config_common_sib.pusch_cnfg.n_sb); + phy->set_param(srslte::ue::phy_params::PUSCH_HOPPING_INTRA_SF, + sib2->rr_config_common_sib.pusch_cnfg.hopping_mode == LIBLTE_RRC_HOPPING_MODE_INTRA_AND_INTER_SUBFRAME?1:0); + phy->set_param(srslte::ue::phy_params::PUSCH_RS_GROUP_HOPPING_EN, + sib2->rr_config_common_sib.pusch_cnfg.ul_rs.group_hopping_enabled?1:0); + phy->set_param(srslte::ue::phy_params::PUSCH_RS_SEQUENCE_HOPPING_EN, + sib2->rr_config_common_sib.pusch_cnfg.ul_rs.sequence_hopping_enabled?1:0); + phy->set_param(srslte::ue::phy_params::PUSCH_RS_CYCLIC_SHIFT, + sib2->rr_config_common_sib.pusch_cnfg.ul_rs.cyclic_shift); + phy->set_param(srslte::ue::phy_params::PUSCH_RS_GROUP_ASSIGNMENT, + sib2->rr_config_common_sib.pusch_cnfg.ul_rs.group_assignment_pusch); + + printf("Set PUSCH ConfigCommon: HopOffset=%d, RSGroup=%d, RSNcs=%d\n", + sib2->rr_config_common_sib.pusch_cnfg.pusch_hopping_offset, + sib2->rr_config_common_sib.pusch_cnfg.ul_rs.group_assignment_pusch, + sib2->rr_config_common_sib.pusch_cnfg.ul_rs.cyclic_shift); + + // PUCCH ConfigCommon + phy->set_param(srslte::ue::phy_params::PUCCH_DELTA_SHIFT, + liblte_rrc_delta_pucch_shift_num[sib2->rr_config_common_sib.pucch_cnfg.delta_pucch_shift]); + phy->set_param(srslte::ue::phy_params::PUCCH_CYCLIC_SHIFT, + sib2->rr_config_common_sib.pucch_cnfg.n_cs_an); + phy->set_param(srslte::ue::phy_params::PUCCH_N_PUCCH_1, + sib2->rr_config_common_sib.pucch_cnfg.n1_pucch_an); + phy->set_param(srslte::ue::phy_params::PUCCH_N_RB_2, + sib2->rr_config_common_sib.pucch_cnfg.n_rb_cqi); + printf("Set PUCCH ConfigCommon: DeltaShift=%d, CyclicShift=%d, N1=%d, NRB=%d\n", + liblte_rrc_delta_pucch_shift_num[sib2->rr_config_common_sib.pucch_cnfg.delta_pucch_shift], + sib2->rr_config_common_sib.pucch_cnfg.n_cs_an, + sib2->rr_config_common_sib.pucch_cnfg.n1_pucch_an, + sib2->rr_config_common_sib.pucch_cnfg.n_rb_cqi); + + + // PRACH Configcommon + phy->set_param(srslte::ue::phy_params::PRACH_ROOT_SEQ_IDX, + sib2->rr_config_common_sib.prach_cnfg.root_sequence_index); + phy->set_param(srslte::ue::phy_params::PRACH_HIGH_SPEED_FLAG, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.high_speed_flag?1:0); + phy->set_param(srslte::ue::phy_params::PRACH_FREQ_OFFSET, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.prach_freq_offset); + phy->set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.zero_correlation_zone_config); + phy->set_param(srslte::ue::phy_params::PRACH_CONFIG_INDEX, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.prach_config_index); + + printf("Set PRACH ConfigCommon: SeqIdx=%d, HS=%d, FreqOffset=%d, ZC=%d, ConfigIndex=%d\n", + sib2->rr_config_common_sib.prach_cnfg.root_sequence_index, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.high_speed_flag?1:0, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.prach_freq_offset, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.zero_correlation_zone_config, + sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.prach_config_index); +} + +int main(int argc, char *argv[]) +{ + prog_args_t prog_args; + srslte::ue::tti_sync_cv ttisync(10240); + srslte::radio_uhd radio_uhd; + srslte::ue::phy phy; + srslte::ue::mac mac; + srslte::log_stdout log("MAC"); + + parse_args(&prog_args, argc, argv); + + // Init Radio + radio_uhd.init(); + + // Init PHY + phy.init(&radio_uhd, &ttisync); + + // Init MAC + mac.init(&phy, &ttisync, &log); + + // Set RX freq and gain + radio_uhd.set_rx_freq(prog_args.uhd_rx_freq); + radio_uhd.set_rx_gain(prog_args.uhd_rx_gain); + radio_uhd.set_tx_freq(prog_args.uhd_tx_freq); + radio_uhd.set_tx_gain(prog_args.uhd_tx_gain); + + LIBLTE_BIT_MSG_STRUCT bit_msg; + LIBLTE_RRC_MIB_STRUCT bch_msg; + LIBLTE_RRC_BCCH_DLSCH_MSG_STRUCT dlsch_msg; + LIBLTE_RRC_UL_CCCH_MSG_STRUCT ul_ccch_msg; + LIBLTE_RRC_DL_CCCH_MSG_STRUCT dl_ccch_msg; + + uint32_t si_window_len, sib2_period; + int tti; + enum {START, SIB1, SIB2, CONNECT} state = START; + int n; + + while(1) { + switch(state) { + case START: + n = mac.recv_bcch_sdu(bit_msg.msg, LIBLTE_MAX_MSG_SIZE); + if (n > 0) { + bit_msg.N_bits = n; + liblte_rrc_unpack_bcch_bch_msg(&bit_msg, &bch_msg); + printf("MIB received %d bytes, BW=%s\n", n, liblte_rrc_dl_bandwidth_text[bch_msg.dl_bw]); + state = SIB1; + } + break; + case SIB1: + n = mac.recv_bcch_sdu(bit_msg.msg, LIBLTE_MAX_MSG_SIZE); + if (n > 0) { + bit_msg.N_bits = n; + liblte_rrc_unpack_bcch_dlsch_msg(&bit_msg, &dlsch_msg); + si_window_len = liblte_rrc_si_window_length_num[dlsch_msg.sibs[0].sib.sib1.si_window_length]; + sib2_period = liblte_rrc_si_periodicity_num[dlsch_msg.sibs[0].sib.sib1.sched_info[0].si_periodicity]; + printf("SIB1 received %d bytes, CellID=%d, si_window=%d, sib2_period=%d\n", + n/8, dlsch_msg.sibs[0].sib.sib1.cell_id&0xfff, si_window_len, sib2_period); + printf("Payload: "); + srslte_vec_fprint_hex(stdout, bit_msg.msg, n); + state = SIB2; + } else { + tti = mac.get_tti(); + mac.set_param(srslte::ue::mac_params::BCCH_SI_WINDOW_ST, sib_start_tti(tti, 2, 5)); + mac.set_param(srslte::ue::mac_params::BCCH_SI_WINDOW_LEN, 1); + } + break; + case SIB2: + n = mac.recv_bcch_sdu(bit_msg.msg, LIBLTE_MAX_MSG_SIZE); + if (n > 0) { + // Process SIB2 + bit_msg.N_bits = n; + liblte_rrc_unpack_bcch_dlsch_msg(&bit_msg, &dlsch_msg); + printf("SIB2 received %d bytes\n", n/8); + printf("Payload: "); + srslte_vec_fprint_hex(stdout, bit_msg.msg, n); + setup_mac_phy_sib2(&dlsch_msg.sibs[0].sib.sib2, &mac, &phy); + + // Prepare ConnectionRequest packet + ul_ccch_msg.msg_type = LIBLTE_RRC_UL_CCCH_MSG_TYPE_RRC_CON_REQ; + ul_ccch_msg.msg.rrc_con_req.ue_id_type = LIBLTE_RRC_CON_REQ_UE_ID_TYPE_RANDOM_VALUE; + ul_ccch_msg.msg.rrc_con_req.ue_id.random = 1000; + ul_ccch_msg.msg.rrc_con_req.cause = LIBLTE_RRC_CON_REQ_EST_CAUSE_MO_DATA; + liblte_rrc_pack_ul_ccch_msg(&ul_ccch_msg, &bit_msg); + + mac.set_param(srslte::ue::mac_params::CONTENTION_ID, ul_ccch_msg.msg.rrc_con_req.ue_id.random); + + // Send ConnectionRequest Packet + mac.send_ccch_sdu(bit_msg.msg, bit_msg.N_bits); + state = CONNECT; + } else { + tti = mac.get_tti(); + mac.set_param(srslte::ue::mac_params::BCCH_SI_WINDOW_ST, sib_start_tti(tti, sib2_period, 0)); + mac.set_param(srslte::ue::mac_params::BCCH_SI_WINDOW_LEN, si_window_len); + } + break; + case CONNECT: + // Waint for Connection Setup + n = mac.recv_ccch_sdu(bit_msg.msg, LIBLTE_MAX_MSG_SIZE); + if (n > 0) { + printf("ConnSetup received %d bytes\n", n/8); + bit_msg.N_bits = n; + liblte_rrc_unpack_dl_ccch_msg(&bit_msg, &dl_ccch_msg); + printf("Response: %s\n", liblte_rrc_dl_ccch_msg_type_text[dl_ccch_msg.msg_type]); + if (dl_ccch_msg.msg_type == LIBLTE_RRC_DL_CCCH_MSG_TYPE_RRC_CON_SETUP) { + // Process ConnectionRequest + } + exit(0); + } + break; + } + + usleep(50000); + } +} + + + diff --git a/srsapps/ue/phy/CMakeLists.txt b/srsapps/ue/phy/CMakeLists.txt new file mode 100644 index 000000000..30a33f1fe --- /dev/null +++ b/srsapps/ue/phy/CMakeLists.txt @@ -0,0 +1,32 @@ +# +# Copyright 2012-2013 The srsLTE Developers. See the +# COPYRIGHT file at the top-level directory of this distribution. +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# A copy of the GNU Lesser General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +FILE(GLOB SOURCES "src/*.cc") +ADD_LIBRARY(srsapps_ue_phy SHARED ${SOURCES}) +TARGET_LINK_LIBRARIES(srsapps_ue_phy srsapps_common) +INSTALL(TARGETS srsapps_ue_phy DESTINATION ${LIBRARY_DIR}) +LIBLTE_SET_PIC(srsapps_ue_phy) + +FILE(GLOB SOURCES "include/srsapps/ue/phy/*.h") +ADD_CUSTOM_TARGET (add_ue_phy_headers SOURCES ${HEADERS_ALL}) + +ADD_SUBDIRECTORY(test) + diff --git a/srslte/include/srslte/ue_itf/dl_buffer.h b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h similarity index 93% rename from srslte/include/srslte/ue_itf/dl_buffer.h rename to srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h index 70075f56f..dd3f93fe1 100644 --- a/srslte/include/srslte/ue_itf/dl_buffer.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h @@ -26,10 +26,10 @@ */ #include "srslte/srslte.h" -#include "srslte/ue_itf/queue.h" -#include "srslte/ue_itf/ul_sched_grant.h" -#include "srslte/ue_itf/dl_sched_grant.h" -#include "srslte/ue_itf/phy_params.h" +#include "srsapps/common/queue.h" +#include "srsapps/ue/phy/ul_sched_grant.h" +#include "srsapps/ue/phy/dl_sched_grant.h" +#include "srsapps/ue/phy/phy_params.h" #ifndef UEDLBUFFER_H #define UEDLBUFFER_H diff --git a/srslte/include/srslte/ue_itf/dl_sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h similarity index 98% rename from srslte/include/srslte/ue_itf/dl_sched_grant.h rename to srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h index 76eab82e4..e4b589bab 100644 --- a/srslte/include/srslte/ue_itf/dl_sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h @@ -27,7 +27,7 @@ #include #include "srslte/srslte.h" -#include "srslte/ue_itf/sched_grant.h" +#include "srsapps/ue/phy/sched_grant.h" #ifndef UEDLSCHEDGRANT_H #define UEDLSCHEDGRANT_H diff --git a/srslte/include/srslte/ue_itf/phy.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h similarity index 94% rename from srslte/include/srslte/ue_itf/phy.h rename to srsapps/ue/phy/include/srsapps/ue/phy/phy.h index a822c1d71..d54da2db6 100644 --- a/srslte/include/srslte/ue_itf/phy.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h @@ -26,13 +26,13 @@ */ #include "srslte/srslte.h" -#include "srslte/ue_itf/tti_sync.h" -#include "srslte/ue_itf/dl_buffer.h" -#include "srslte/ue_itf/ul_buffer.h" -#include "srslte/ue_itf/prach.h" -#include "srslte/ue_itf/phy_params.h" -#include "srslte/ue_itf/sched_grant.h" -#include "srslte/ue_itf/queue.h" +#include "srsapps/common/tti_sync.h" +#include "srsapps/ue/phy/dl_buffer.h" +#include "srsapps/ue/phy/ul_buffer.h" +#include "srsapps/ue/phy/prach.h" +#include "srsapps/ue/phy/phy_params.h" +#include "srsapps/ue/phy/sched_grant.h" +#include "srsapps/common/queue.h" #include "srslte/common/radio.h" #ifndef UEPHY_H diff --git a/srslte/include/srslte/ue_itf/phy_params.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h similarity index 98% rename from srslte/include/srslte/ue_itf/phy_params.h rename to srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h index 44ca38710..7b34872f7 100644 --- a/srslte/include/srslte/ue_itf/phy_params.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h @@ -26,7 +26,7 @@ */ #include "srslte/srslte.h" -#include "srslte/ue_itf/params_db.h" +#include "srsapps/common/params_db.h" #ifndef PHYPARAMS_H #define PHYPARAMS_H diff --git a/srslte/include/srslte/ue_itf/prach.h b/srsapps/ue/phy/include/srsapps/ue/phy/prach.h similarity index 96% rename from srslte/include/srslte/ue_itf/prach.h rename to srsapps/ue/phy/include/srsapps/ue/phy/prach.h index a93c772ae..3e000132c 100644 --- a/srslte/include/srslte/ue_itf/prach.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/prach.h @@ -27,8 +27,8 @@ #include "srslte/srslte.h" #include "srslte/common/radio.h" -#include "srslte/ue_itf/queue.h" -#include "srslte/ue_itf/phy_params.h" +#include "srsapps/common/queue.h" +#include "srsapps/ue/phy/phy_params.h" #ifndef UEPRACH_H #define UEPRACH_H diff --git a/srslte/include/srslte/ue_itf/sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h similarity index 98% rename from srslte/include/srslte/ue_itf/sched_grant.h rename to srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h index 2f411473b..59eb68fee 100644 --- a/srslte/include/srslte/ue_itf/sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h @@ -26,7 +26,7 @@ */ #include "srslte/srslte.h" -#include "queue.h" +#include "srsapps/common/queue.h" #ifndef UESCHEDGRANT_H #define UESCHEDGRANT_H diff --git a/srslte/include/srslte/ue_itf/ul_buffer.h b/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h similarity index 93% rename from srslte/include/srslte/ue_itf/ul_buffer.h rename to srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h index 2774b49a9..89477c959 100644 --- a/srslte/include/srslte/ue_itf/ul_buffer.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h @@ -27,10 +27,10 @@ #include "srslte/srslte.h" #include "srslte/common/radio.h" -#include "srslte/ue_itf/queue.h" -#include "srslte/ue_itf/ul_sched_grant.h" -#include "srslte/ue_itf/dl_sched_grant.h" -#include "srslte/ue_itf/phy_params.h" +#include "srsapps/common/queue.h" +#include "srsapps/ue/phy/ul_sched_grant.h" +#include "srsapps/ue/phy/dl_sched_grant.h" +#include "srsapps/ue/phy/phy_params.h" #ifndef UEULBUFFER_H #define UEULBUFFER_H diff --git a/srslte/include/srslte/ue_itf/ul_sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h similarity index 98% rename from srslte/include/srslte/ue_itf/ul_sched_grant.h rename to srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h index c80e87d32..43e88d9a0 100644 --- a/srslte/include/srslte/ue_itf/ul_sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h @@ -27,7 +27,7 @@ #include #include "srslte/srslte.h" -#include "srslte/ue_itf/sched_grant.h" +#include "srsapps/ue/phy/sched_grant.h" #ifndef UEULSCHEDGRANT_H #define UEULSCHEDGRANT_H diff --git a/srslte/lib/ue_itf/src/dl_buffer.cc b/srsapps/ue/phy/src/dl_buffer.cc similarity index 97% rename from srslte/lib/ue_itf/src/dl_buffer.cc rename to srsapps/ue/phy/src/dl_buffer.cc index 392bb0aeb..6c4053367 100644 --- a/srslte/lib/ue_itf/src/dl_buffer.cc +++ b/srsapps/ue/phy/src/dl_buffer.cc @@ -30,10 +30,10 @@ #include #include "srslte/srslte.h" -#include "srslte/ue_itf/sched_grant.h" -#include "srslte/ue_itf/dl_buffer.h" -#include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/phy_params.h" +#include "srsapps/ue/phy/sched_grant.h" +#include "srsapps/ue/phy/dl_buffer.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/phy/phy_params.h" namespace srslte { diff --git a/srslte/lib/ue_itf/src/phy.cc b/srsapps/ue/phy/src/phy.cc similarity index 98% rename from srslte/lib/ue_itf/src/phy.cc rename to srsapps/ue/phy/src/phy.cc index fbecc53f3..9277d48ab 100644 --- a/srslte/lib/ue_itf/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -32,10 +32,10 @@ #include "srslte/srslte.h" -#include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/prach.h" -#include "srslte/ue_itf/ul_buffer.h" -#include "srslte/ue_itf/dl_buffer.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/phy/prach.h" +#include "srsapps/ue/phy/ul_buffer.h" +#include "srsapps/ue/phy/dl_buffer.h" namespace srslte { namespace ue { diff --git a/srslte/lib/ue_itf/src/prach.cc b/srsapps/ue/phy/src/prach.cc similarity index 98% rename from srslte/lib/ue_itf/src/prach.cc rename to srsapps/ue/phy/src/prach.cc index ecdb9ea8e..af1266568 100644 --- a/srslte/lib/ue_itf/src/prach.cc +++ b/srsapps/ue/phy/src/prach.cc @@ -31,9 +31,9 @@ #include "srslte/srslte.h" #include "srslte/cuhd/cuhd.h" -#include "srslte/ue_itf/prach.h" -#include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/phy_params.h" +#include "srsapps/ue/phy/prach.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/phy/phy_params.h" namespace srslte { namespace ue { diff --git a/srslte/lib/ue_itf/src/ul_buffer.cc b/srsapps/ue/phy/src/ul_buffer.cc similarity index 98% rename from srslte/lib/ue_itf/src/ul_buffer.cc rename to srsapps/ue/phy/src/ul_buffer.cc index ccfcccf55..c10470ed7 100644 --- a/srslte/lib/ue_itf/src/ul_buffer.cc +++ b/srsapps/ue/phy/src/ul_buffer.cc @@ -30,10 +30,10 @@ #include #include "srslte/srslte.h" -#include "srslte/ue_itf/sched_grant.h" -#include "srslte/ue_itf/ul_buffer.h" -#include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/phy_params.h" +#include "srsapps/ue/phy/sched_grant.h" +#include "srsapps/ue/phy/ul_buffer.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/phy/phy_params.h" namespace srslte { namespace ue { diff --git a/srslte/lib/ue_itf/test/CMakeLists.txt b/srsapps/ue/phy/test/CMakeLists.txt similarity index 81% rename from srslte/lib/ue_itf/test/CMakeLists.txt rename to srsapps/ue/phy/test/CMakeLists.txt index ce9da9c20..14ef73de5 100644 --- a/srslte/lib/ue_itf/test/CMakeLists.txt +++ b/srsapps/ue/phy/test/CMakeLists.txt @@ -20,11 +20,10 @@ # -LIST(FIND OPTIONAL_LIBS cuhd CUHD_FIND) -IF(${CUHD_FIND} GREATER -1) +IF(UHD_FOUND) ADD_EXECUTABLE(ue_itf_test_sib1 ue_itf_test_sib1.cc) - TARGET_LINK_LIBRARIES(ue_itf_test_sib1 srslte++ cuhd) + TARGET_LINK_LIBRARIES(ue_itf_test_sib1 srsapps_ue_phy srsapps_radio srslte) ADD_EXECUTABLE(ue_itf_test_prach ue_itf_test_prach.cc) - TARGET_LINK_LIBRARIES(ue_itf_test_prach srslte++ cuhd) -ENDIF(${CUHD_FIND} GREATER -1) + TARGET_LINK_LIBRARIES(ue_itf_test_prach srsapps_ue_phy srsapps_radio srslte) +ENDIF(UHD_FOUND) diff --git a/srslte/lib/ue_itf/test/ue_itf_test_prach.cc b/srsapps/ue/phy/test/ue_itf_test_prach.cc similarity index 99% rename from srslte/lib/ue_itf/test/ue_itf_test_prach.cc rename to srsapps/ue/phy/test/ue_itf_test_prach.cc index 0d48a833a..45f45da26 100644 --- a/srslte/lib/ue_itf/test/ue_itf_test_prach.cc +++ b/srsapps/ue/phy/test/ue_itf_test_prach.cc @@ -28,9 +28,9 @@ #include #include "srslte/utils/debug.h" -#include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/tti_sync_cv.h" -#include "srslte/cuhd/radio_uhd.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/tti_sync_cv.h" +#include "srsapps/radio/radio_uhd.h" /********************************************************************** * Program arguments processing diff --git a/srslte/lib/ue_itf/test/ue_itf_test_sib1.cc b/srsapps/ue/phy/test/ue_itf_test_sib1.cc similarity index 97% rename from srslte/lib/ue_itf/test/ue_itf_test_sib1.cc rename to srsapps/ue/phy/test/ue_itf_test_sib1.cc index 8e25ac6d6..e250d345b 100644 --- a/srslte/lib/ue_itf/test/ue_itf_test_sib1.cc +++ b/srsapps/ue/phy/test/ue_itf_test_sib1.cc @@ -28,9 +28,9 @@ #include #include "srslte/utils/debug.h" -#include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/tti_sync_cv.h" -#include "srslte/cuhd/radio_uhd.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/common/tti_sync_cv.h" +#include "srsapps/radio/radio_uhd.h" /********************************************************************** diff --git a/srslte/CMakeLists.txt b/srslte/CMakeLists.txt index 0deb408ab..229624ea0 100644 --- a/srslte/CMakeLists.txt +++ b/srslte/CMakeLists.txt @@ -46,4 +46,3 @@ ADD_CUSTOM_TARGET (add_srslte_headers SOURCES ${HEADERS_ALL}) ######################################################################## ADD_SUBDIRECTORY(lib) ADD_SUBDIRECTORY(examples) -#add_subdirectory(tutorial_examples) diff --git a/srslte/examples/CMakeLists.txt b/srslte/examples/CMakeLists.txt index fed7b112a..6173ddc31 100644 --- a/srslte/examples/CMakeLists.txt +++ b/srslte/examples/CMakeLists.txt @@ -38,36 +38,27 @@ target_link_libraries(ll_example srslte) add_executable(synch_file synch_file.c) target_link_libraries(synch_file srslte) -LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) - - - ################################################################# # These can be compiled without UHD or graphics support ################################################################# -add_executable(pdsch_ue pdsch_ue.c cuhd_utils.c) -target_link_libraries(pdsch_ue srslte) +add_executable(pdsch_ue pdsch_ue.c) +target_link_libraries(pdsch_ue srslte pthread) add_executable(pdsch_enodeb pdsch_enodeb.c) target_link_libraries(pdsch_enodeb srslte pthread) -LIST(FIND OPTIONAL_LIBS cuhd CUHD_FIND) -IF(${CUHD_FIND} EQUAL -1) - SET_TARGET_PROPERTIES(pdsch_ue PROPERTIES COMPILE_DEFINITIONS "DISABLE_UHD") - SET_TARGET_PROPERTIES(pdsch_enodeb PROPERTIES COMPILE_DEFINITIONS "DISABLE_UHD") -ELSE(${CUHD_FIND} EQUAL -1) - target_link_libraries(pdsch_ue cuhd pthread) - target_link_libraries(pdsch_enodeb cuhd) -ENDIF(${CUHD_FIND} EQUAL -1) +IF(UHD_FOUND) +ELSE(UHD_FOUND) + add_definitions(-DDISABLE_UHD) + add_definitions(-DDISABLE_UHD) +ENDIF(UHD_FOUND) -FIND_PACKAGE(SRSGUI) IF(SRSGUI_FOUND) - include_directories(${SRSGUI_INCLUDE_DIRS}) target_link_libraries(pdsch_ue ${SRSGUI_LIBRARIES}) ELSE(SRSGUI_FOUND) - SET_TARGET_PROPERTIES(pdsch_ue PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS") + add_definitions(-DDISABLE_GRAPHICS) ENDIF(SRSGUI_FOUND) @@ -75,25 +66,29 @@ ENDIF(SRSGUI_FOUND) # These examples need the UHD driver ################################################################# -IF(${CUHD_FIND} GREATER -1) +IF(UHD_FOUND) - add_executable(cell_search cell_search.c cuhd_utils.c) - target_link_libraries(cell_search srslte cuhd ) + add_executable(cell_search cell_search.c) + target_link_libraries(cell_search srslte ) - add_executable(prach_ue prach_ue.c cuhd_utils.c) - target_link_libraries(prach_ue srslte cuhd) + add_executable(prach_ue prach_ue.c) + target_link_libraries(prach_ue srslte ) - add_executable(cell_measurement cell_measurement.c cuhd_utils.c) - target_link_libraries(cell_measurement cuhd srslte) + add_executable(cell_measurement cell_measurement.c) + target_link_libraries(cell_measurement srslte) - add_executable(usrp_capture usrp_capture.c cuhd_utils.c) - target_link_libraries(usrp_capture cuhd srslte) + add_executable(usrp_capture usrp_capture.c) + target_link_libraries(usrp_capture srslte) - add_executable(usrp_capture_sync usrp_capture_sync.c cuhd_utils.c) - target_link_libraries(usrp_capture_sync cuhd srslte) + add_executable(usrp_capture_sync usrp_capture_sync.c) + target_link_libraries(usrp_capture_sync srslte) MESSAGE(STATUS " UHD examples will be installed.") -ELSE(${CUHD_FIND} GREATER -1) - MESSAGE(STATUS " UHD examples NOT INSTALLED: CUHD library not compiled.") -ENDIF(${CUHD_FIND} GREATER -1) +ELSE(UHD_FOUND) + MESSAGE(STATUS " UHD examples NOT INSTALLED.") +ENDIF(UHD_FOUND) + +# Add subdirectories +add_subdirectory(tutorial_examples) + diff --git a/srslte/examples/cell_measurement.c b/srslte/examples/cell_measurement.c index 68a38f8e4..e96f12da3 100644 --- a/srslte/examples/cell_measurement.c +++ b/srslte/examples/cell_measurement.c @@ -38,7 +38,7 @@ #include "srslte/srslte.h" #include "srslte/cuhd/cuhd.h" -#include "cuhd_utils.h" +#include "srslte/cuhd/cuhd_utils.h" #define B210_DEFAULT_GAIN 40.0 #define B210_DEFAULT_GAIN_CORREC 110.0 // Gain of the Rx chain when the gain is set to 40 diff --git a/srslte/examples/cell_search.c b/srslte/examples/cell_search.c index c1c41385f..e42a0e511 100644 --- a/srslte/examples/cell_search.c +++ b/srslte/examples/cell_search.c @@ -37,7 +37,7 @@ #include "srslte/srslte.h" -#include "cuhd_utils.h" +#include "srslte/cuhd/cuhd_utils.h" #ifndef DISABLE_UHD diff --git a/srslte/examples/pdsch_enodeb.c b/srslte/examples/pdsch_enodeb.c index 92658284c..0c3d82b8a 100644 --- a/srslte/examples/pdsch_enodeb.c +++ b/srslte/examples/pdsch_enodeb.c @@ -39,6 +39,8 @@ #ifndef DISABLE_UHD #include "srslte/cuhd/cuhd.h" void *uhd; +#else +#warning Compiling pdsch_ue with no UHD support #endif char *output_file_name = NULL; diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index 4205afc89..d0dc73077 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -43,14 +43,15 @@ #ifndef DISABLE_UHD #include "srslte/cuhd/cuhd.h" -#include "cuhd_utils.h" +#include "srslte/cuhd/cuhd_utils.h" cell_search_cfg_t cell_detect_config = { 5000, 200, // nof_frames_total 10.0 // threshold }; - +#else +#warning Compiling pdsch_ue with no UHD support #endif //#define STDOUT_COMPACT @@ -374,11 +375,13 @@ int main(int argc, char **argv) { float rsrp=0.0, rsrq=0.0, snr=0.0; bool decode_pdsch; int pdcch_tx=0; - + +#ifndef DISABLE_UHD if (prog_args.uhd_gain < 0) { srslte_ue_sync_start_agc(&ue_sync, cuhd_set_rx_gain_th, cell_detect_config.init_agc); } - +#endif + INFO("\nEntering main loop...\n\n", 0); /* Main loop */ while (!go_exit && (sf_cnt < prog_args.nof_subframes || prog_args.nof_subframes == -1)) { diff --git a/srslte/examples/prach_ue.c b/srslte/examples/prach_ue.c index 0114fe6d5..5fffb9d52 100644 --- a/srslte/examples/prach_ue.c +++ b/srslte/examples/prach_ue.c @@ -42,7 +42,7 @@ #include "srslte/cuhd/cuhd.h" -#include "cuhd_utils.h" +#include "srslte/cuhd/cuhd_utils.h" cell_search_cfg_t cell_detect_config = { 5000, diff --git a/srslte/tutorial_examples/CMakeLists.txt b/srslte/examples/tutorial_examples/CMakeLists.txt similarity index 71% rename from srslte/tutorial_examples/CMakeLists.txt rename to srslte/examples/tutorial_examples/CMakeLists.txt index b16301069..501db7792 100644 --- a/srslte/tutorial_examples/CMakeLists.txt +++ b/srslte/examples/tutorial_examples/CMakeLists.txt @@ -24,19 +24,16 @@ # EXAMPLES shown in WinnForum 2015 Tutorial ################################################################# +IF(SRSGUI_FOUND AND UHD_FOUND) -FIND_PACKAGE(SRSGUI) + add_executable(pss pss.c) + target_link_libraries(pss srslte ${SRSGUI_LIBRARIES}) -IF(SRSGUI_FOUND) - include_directories(${SRSGUI_INCLUDE_DIRS}) + add_executable(ue_rx ue_rx.c) + target_link_libraries(ue_rx srslte ${SRSGUI_LIBRARIES} pthread) - add_executable(pss pss.c) - target_link_libraries(pss srslte cuhd ${SRSGUI_LIBRARIES}) + add_executable(simple_tx simple_tx.c) + target_link_libraries(simple_tx srslte) - include_directories("../examples") - add_executable(ue_rx ue_rx.c ../examples/cuhd_utils.c) - target_link_libraries(ue_rx srslte cuhd ${SRSGUI_LIBRARIES} pthread) -ENDIF(SRSGUI_FOUND) +ENDIF(SRSGUI_FOUND AND UHD_FOUND) -add_executable(simple_tx simple_tx.c) -target_link_libraries(simple_tx srslte cuhd) diff --git a/srslte/tutorial_examples/pss.c b/srslte/examples/tutorial_examples/pss.c similarity index 100% rename from srslte/tutorial_examples/pss.c rename to srslte/examples/tutorial_examples/pss.c diff --git a/srslte/tutorial_examples/simple_tx.c b/srslte/examples/tutorial_examples/simple_tx.c similarity index 100% rename from srslte/tutorial_examples/simple_tx.c rename to srslte/examples/tutorial_examples/simple_tx.c diff --git a/srslte/tutorial_examples/ue_rx.c b/srslte/examples/tutorial_examples/ue_rx.c similarity index 100% rename from srslte/tutorial_examples/ue_rx.c rename to srslte/examples/tutorial_examples/ue_rx.c diff --git a/common/include/srslte/config.h b/srslte/include/srslte/config.h similarity index 100% rename from common/include/srslte/config.h rename to srslte/include/srslte/config.h diff --git a/cuhd/include/srslte/cuhd/cuhd.h b/srslte/include/srslte/cuhd/cuhd.h similarity index 99% rename from cuhd/include/srslte/cuhd/cuhd.h rename to srslte/include/srslte/cuhd/cuhd.h index d445956be..36088cd05 100644 --- a/cuhd/include/srslte/cuhd/cuhd.h +++ b/srslte/include/srslte/cuhd/cuhd.h @@ -34,7 +34,6 @@ extern "C" { #include #include "srslte/config.h" -#include "srslte/cuhd/cuhd_utils.h" SRSLTE_API int cuhd_open(char *args, void **handler); diff --git a/srslte/examples/cuhd_utils.h b/srslte/include/srslte/cuhd/cuhd_utils.h similarity index 58% rename from srslte/examples/cuhd_utils.h rename to srslte/include/srslte/cuhd/cuhd_utils.h index a1f4e4679..d1d75353a 100644 --- a/srslte/examples/cuhd_utils.h +++ b/srslte/include/srslte/cuhd/cuhd_utils.h @@ -33,20 +33,27 @@ typedef struct SRSLTE_API { uint32_t max_frames_pss; // maximum number of 5ms frames to capture for PSS correlation float threshold; // early-stops cell detection if mean PSR is above this value float init_agc; // 0 or negative to disable AGC -}cell_search_cfg_t; - -int cuhd_mib_decoder(void *uhd, - cell_search_cfg_t *config, - srslte_cell_t *cell); - -int cuhd_cell_search(void *uhd, - cell_search_cfg_t *config, - int force_N_id_2, - srslte_cell_t *cell); - -int cuhd_search_and_decode_mib(void *uhd, - cell_search_cfg_t *config, - int force_N_id_2, - srslte_cell_t *cell); +} cell_search_cfg_t; + +SRSLTE_API int cuhd_rssi_scan(void *uhd, + float *freqs, + float *rssi, + int nof_bands, + double fs, + int nsamp); + +SRSLTE_API int cuhd_mib_decoder(void *uhd, + cell_search_cfg_t *config, + srslte_cell_t *cell); + +SRSLTE_API int cuhd_cell_search(void *uhd, + cell_search_cfg_t *config, + int force_N_id_2, + srslte_cell_t *cell); + +SRSLTE_API int cuhd_search_and_decode_mib(void *uhd, + cell_search_cfg_t *config, + int force_N_id_2, + srslte_cell_t *cell); diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index 31b5da677..aae96a50f 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -25,8 +25,9 @@ ######################################################################## include(CheckFunctionExistsMath) +FIND_PACKAGE(SRSGUI) +FIND_PACKAGE(UHD) FIND_PACKAGE(FFTW3F REQUIRED) # TODO: distribute kissfft instead -INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) IF(${DISABLE_VOLK}) IF(${DISABLE_VOLK} EQUAL 0) @@ -38,7 +39,21 @@ ELSE(${DISABLE_VOLK}) FIND_PACKAGE(Volk) ENDIF(${DISABLE_VOLK}) -FIND_PACKAGE(SRSGUI) +IF(FFTW3F_FOUND) + INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) + LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS}) +ENDIF(FFTW3F_FOUND) + +IF(UHD_FOUND) + INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) + LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) +ENDIF(UHD_FOUND) + +IF(SRSGUI_FOUND) + INCLUDE_DIRECTORIES(${SRSGUI_INCLUDE_DIRS}) + LINK_DIRECTORIES(${SRSGUI_LIBRARY_DIRS}) +ENDIF(SRSGUI_FOUND) + ######################################################################## # Recurse subdirectories and compile all source files into the same lib @@ -47,13 +62,22 @@ FILE(GLOB modules *) SET(SOURCES_ALL "") FOREACH (_module ${modules}) IF(IS_DIRECTORY ${_module}) - FILE(GLOB_RECURSE tmp "${_module}/src/*.c") - LIST(APPEND SOURCES_ALL ${tmp}) + IF ((NOT ${_module} MATCHES "cuhd") OR UHD_FOUND) + FILE(GLOB_RECURSE tmp "${_module}/src/*.c") + LIST(APPEND SOURCES_ALL ${tmp}) + FILE(GLOB_RECURSE tmp2 "${_module}/src/*.cpp") + LIST(APPEND SOURCES_ALL ${tmp2}) + ENDIF ((NOT ${_module} MATCHES "cuhd") OR UHD_FOUND) ENDIF(IS_DIRECTORY ${_module}) ENDFOREACH() ADD_LIBRARY(srslte SHARED ${SOURCES_ALL}) + TARGET_LINK_LIBRARIES(srslte m ${FFTW3F_LIBRARIES}) +IF(UHD_FOUND) + TARGET_LINK_LIBRARIES(srslte ${UHD_LIBRARIES}) +ENDIF(UHD_FOUND) + INSTALL(TARGETS srslte DESTINATION ${LIBRARY_DIR}) LIBLTE_SET_PIC(srslte) @@ -77,20 +101,3 @@ FOREACH (_file ${cmakefiles}) ENDIF () ENDFOREACH() -######################################################################## -# Create C++ library -######################################################################## -FILE(GLOB modules *) -SET(SOURCES_CPP_ALL "") -FOREACH (_module ${modules}) - IF(IS_DIRECTORY ${_module}) - FILE(GLOB_RECURSE tmp "${_module}/src/*.cc") - LIST(APPEND SOURCES_CPP_ALL ${tmp}) - ENDIF(IS_DIRECTORY ${_module}) -ENDFOREACH() - -ADD_LIBRARY(srslte++ SHARED ${SOURCES_CPP_ALL}) -TARGET_LINK_LIBRARIES(srslte++ cuhd srslte m pthread ${FFTW3F_LIBRARIES}) -INSTALL(TARGETS srslte++ DESTINATION ${LIBRARY_DIR}) -LIBLTE_SET_PIC(srslte++) - diff --git a/cuhd/lib/cuhd_handler.hpp b/srslte/lib/cuhd/src/cuhd_handler.hpp similarity index 100% rename from cuhd/lib/cuhd_handler.hpp rename to srslte/lib/cuhd/src/cuhd_handler.hpp diff --git a/cuhd/lib/cuhd_imp.cpp b/srslte/lib/cuhd/src/cuhd_imp.cpp similarity index 100% rename from cuhd/lib/cuhd_imp.cpp rename to srslte/lib/cuhd/src/cuhd_imp.cpp diff --git a/srslte/examples/cuhd_utils.c b/srslte/lib/cuhd/src/cuhd_utils.c similarity index 85% rename from srslte/examples/cuhd_utils.c rename to srslte/lib/cuhd/src/cuhd_utils.c index 62233137d..e0a9ca2c2 100644 --- a/srslte/examples/cuhd_utils.c +++ b/srslte/lib/cuhd/src/cuhd_utils.c @@ -36,11 +36,53 @@ #include #include "srslte/srslte.h" -#include "cuhd_utils.h" - -#ifndef DISABLE_UHD #include "srslte/cuhd/cuhd.h" +#include "srslte/cuhd/cuhd_utils.h" + +int cuhd_rssi_scan(void *uhd, float *freqs, float *rssi, int nof_bands, double fs, int nsamp) { + int i, j; + int ret = -1; + _Complex float *buffer; + double f; + + buffer = calloc(nsamp, sizeof(_Complex float)); + if (!buffer) { + goto free_and_exit; + } + + cuhd_set_rx_gain(uhd, 20.0); + cuhd_set_rx_srate(uhd, fs); + + for (i=0;i Date: Fri, 8 May 2015 16:54:50 +0200 Subject: [PATCH 05/19] Fixed headers not installing --- srsapps/CMakeLists.txt | 6 +++++- srsapps/common/CMakeLists.txt | 8 +++++++- srsapps/radio/CMakeLists.txt | 8 +++++++- srsapps/ue/mac/CMakeLists.txt | 10 ++++++++-- srsapps/ue/phy/CMakeLists.txt | 8 +++++++- 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/srsapps/CMakeLists.txt b/srsapps/CMakeLists.txt index d1cc391f3..f7786b57a 100644 --- a/srsapps/CMakeLists.txt +++ b/srsapps/CMakeLists.txt @@ -19,10 +19,14 @@ # and at http://www.gnu.org/licenses/. # +######################################################################## +# Install headers +######################################################################## + INCLUDE_DIRECTORIES(radio/include/) INCLUDE_DIRECTORIES(common/include/) add_subdirectory(radio) -add_subdirectory(ue) add_subdirectory(common) +add_subdirectory(ue) diff --git a/srsapps/common/CMakeLists.txt b/srsapps/common/CMakeLists.txt index a22a423c4..ad5344f2c 100644 --- a/srsapps/common/CMakeLists.txt +++ b/srsapps/common/CMakeLists.txt @@ -19,10 +19,16 @@ # and at http://www.gnu.org/licenses/. # +INSTALL(DIRECTORY include/ + DESTINATION "${INCLUDE_DIR}" + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_common SHARED ${SOURCES}) INSTALL(TARGETS srsapps_common DESTINATION ${LIBRARY_DIR}) LIBLTE_SET_PIC(srsapps_common) -FILE(GLOB SOURCES "include/srsapps/common/*.h") +FILE(GLOB HEADERS_ALL "include/srsapps/common/*.h") ADD_CUSTOM_TARGET (add_srsapps_common_headers SOURCES ${HEADERS_ALL}) diff --git a/srsapps/radio/CMakeLists.txt b/srsapps/radio/CMakeLists.txt index f0ed75dc6..98a1ac11e 100644 --- a/srsapps/radio/CMakeLists.txt +++ b/srsapps/radio/CMakeLists.txt @@ -21,6 +21,12 @@ FIND_PACKAGE(UHD) +INSTALL(DIRECTORY include/ + DESTINATION "${INCLUDE_DIR}" + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + IF(UHD_FOUND) FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_radio SHARED ${SOURCES}) @@ -28,5 +34,5 @@ IF(UHD_FOUND) LIBLTE_SET_PIC(srsapps_radio) ENDIF(UHD_FOUND) -FILE(GLOB SOURCES "include/srsapps/radio/*.h") +FILE(GLOB HEADERS_ALL "include/srsapps/radio/*.h") ADD_CUSTOM_TARGET (add_srsapps_radio_headers SOURCES ${HEADERS_ALL}) diff --git a/srsapps/ue/mac/CMakeLists.txt b/srsapps/ue/mac/CMakeLists.txt index 899a09459..05595631f 100644 --- a/srsapps/ue/mac/CMakeLists.txt +++ b/srsapps/ue/mac/CMakeLists.txt @@ -19,11 +19,17 @@ # and at http://www.gnu.org/licenses/. # +INSTALL(DIRECTORY include/ + DESTINATION "${INCLUDE_DIR}" + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_ue_mac SHARED ${SOURCES}) INSTALL(TARGETS srsapps_ue_mac DESTINATION ${LIBRARY_DIR}) LIBLTE_SET_PIC(srsapps_ue_mac) -FILE(GLOB SOURCES "include/*.h") -ADD_CUSTOM_TARGET (add_srsapps_ue_mac_headers SOURCES ${HEADERS_ALL}) +FILE(GLOB HEADERS_ALL "include/srsapps/ue/mac/*.h") +ADD_CUSTOM_TARGET (add_ue_mac_headers SOURCES ${HEADERS_ALL}) diff --git a/srsapps/ue/phy/CMakeLists.txt b/srsapps/ue/phy/CMakeLists.txt index 30a33f1fe..6226e84d1 100644 --- a/srsapps/ue/phy/CMakeLists.txt +++ b/srsapps/ue/phy/CMakeLists.txt @@ -19,13 +19,19 @@ # and at http://www.gnu.org/licenses/. # +INSTALL(DIRECTORY include/ + DESTINATION "${INCLUDE_DIR}" + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_ue_phy SHARED ${SOURCES}) TARGET_LINK_LIBRARIES(srsapps_ue_phy srsapps_common) INSTALL(TARGETS srsapps_ue_phy DESTINATION ${LIBRARY_DIR}) LIBLTE_SET_PIC(srsapps_ue_phy) -FILE(GLOB SOURCES "include/srsapps/ue/phy/*.h") +FILE(GLOB HEADERS_ALL "include/srsapps/ue/phy/*.h") ADD_CUSTOM_TARGET (add_ue_phy_headers SOURCES ${HEADERS_ALL}) ADD_SUBDIRECTORY(test) From c828da3e58c74d26379361d5fec52c204869b4c1 Mon Sep 17 00:00:00 2001 From: ismagom Date: Fri, 8 May 2015 17:05:40 +0200 Subject: [PATCH 06/19] Changed license to AGPL --- CMakeLists.txt | 12 +- LICENSE | 816 ++++++++++++++---- mex/CMakeLists.txt | 8 +- mex/include/srslte/mex/mexutils.h | 8 +- mex/lib/CMakeLists.txt | 12 +- mex/lib/mexutils.c | 8 +- scripts/xml2aloe/template/src/template.c | 8 +- scripts/xml2aloe/template/src/template.h | 8 +- .../xml2aloe/template/test/test_generate.c | 8 +- srsapps/CMakeLists.txt | 8 +- srsapps/common/CMakeLists.txt | 10 +- srsapps/common/include/srsapps/common/log.h | 8 +- .../include/srsapps/common/log_stdout.h | 8 +- .../common/include/srsapps/common/params_db.h | 8 +- srsapps/common/include/srsapps/common/queue.h | 8 +- .../common/include/srsapps/common/tti_sync.h | 8 +- .../include/srsapps/common/tti_sync_cv.h | 8 +- srsapps/common/src/log_stdout.cc | 8 +- srsapps/common/src/queue.cc | 8 +- srsapps/common/src/tti_sync_cv.cc | 8 +- srsapps/radio/CMakeLists.txt | 10 +- .../radio/include/srsapps/radio/radio_uhd.h | 8 +- srsapps/radio/src/radio_uhd.cc | 8 +- srsapps/ue/CMakeLists.txt | 8 +- srsapps/ue/mac/CMakeLists.txt | 10 +- srsapps/ue/mac/src/mac.cc | 8 +- srsapps/ue/phy/CMakeLists.txt | 10 +- .../ue/phy/include/srsapps/ue/phy/dl_buffer.h | 8 +- .../include/srsapps/ue/phy/dl_sched_grant.h | 8 +- srsapps/ue/phy/include/srsapps/ue/phy/phy.h | 8 +- .../phy/include/srsapps/ue/phy/phy_params.h | 8 +- srsapps/ue/phy/include/srsapps/ue/phy/prach.h | 8 +- .../phy/include/srsapps/ue/phy/sched_grant.h | 8 +- .../ue/phy/include/srsapps/ue/phy/ul_buffer.h | 8 +- .../include/srsapps/ue/phy/ul_sched_grant.h | 8 +- srsapps/ue/phy/test/CMakeLists.txt | 8 +- srsapps/ue/phy/test/ue_itf_test_prach.cc | 8 +- srsapps/ue/phy/test/ue_itf_test_sib1.cc | 8 +- srslte/CMakeLists.txt | 8 +- srslte/examples/CMakeLists.txt | 8 +- srslte/examples/cell_measurement.c | 8 +- srslte/examples/cell_search.c | 8 +- srslte/examples/hl_example.c | 8 +- srslte/examples/ll_example.c | 8 +- srslte/examples/pdsch_enodeb.c | 8 +- srslte/examples/pdsch_ue.c | 8 +- srslte/examples/prach_ue.c | 8 +- srslte/examples/synch_file.c | 8 +- .../examples/tutorial_examples/CMakeLists.txt | 8 +- srslte/examples/tutorial_examples/pss.c | 14 +- srslte/examples/tutorial_examples/simple_tx.c | 8 +- srslte/examples/tutorial_examples/ue_rx.c | 8 +- srslte/examples/usrp_capture.c | 8 +- srslte/examples/usrp_capture_sync.c | 8 +- srslte/include/srslte/agc/agc.h | 8 +- .../include/srslte/ch_estimation/chest_dl.h | 8 +- .../srslte/ch_estimation/refsignal_dl.h | 8 +- .../srslte/ch_estimation/refsignal_ul.h | 8 +- srslte/include/srslte/channel/ch_awgn.h | 8 +- srslte/include/srslte/common/phy_common.h | 8 +- srslte/include/srslte/common/radio.h | 8 +- srslte/include/srslte/common/sequence.h | 8 +- srslte/include/srslte/common/timestamp.h | 8 +- srslte/include/srslte/config.h | 8 +- srslte/include/srslte/cuhd/cuhd.h | 8 +- srslte/include/srslte/cuhd/cuhd_utils.h | 8 +- srslte/include/srslte/dft/dft.h | 8 +- srslte/include/srslte/dft/dft_precoding.h | 8 +- srslte/include/srslte/dft/ofdm.h | 8 +- srslte/include/srslte/fec/cbsegm.h | 8 +- srslte/include/srslte/fec/convcoder.h | 8 +- srslte/include/srslte/fec/crc.h | 8 +- srslte/include/srslte/fec/rm_conv.h | 8 +- srslte/include/srslte/fec/rm_turbo.h | 8 +- srslte/include/srslte/fec/softbuffer.h | 8 +- srslte/include/srslte/fec/tc_interl.h | 8 +- srslte/include/srslte/fec/turbocoder.h | 8 +- srslte/include/srslte/fec/turbodecoder.h | 8 +- srslte/include/srslte/fec/viterbi.h | 8 +- srslte/include/srslte/io/binsource.h | 8 +- srslte/include/srslte/io/filesink.h | 8 +- srslte/include/srslte/io/filesource.h | 8 +- srslte/include/srslte/io/format.h | 8 +- srslte/include/srslte/io/netsink.h | 8 +- srslte/include/srslte/io/netsource.h | 8 +- srslte/include/srslte/mimo/layermap.h | 8 +- srslte/include/srslte/mimo/precoding.h | 8 +- srslte/include/srslte/modem/demod_hard.h | 8 +- srslte/include/srslte/modem/demod_soft.h | 8 +- srslte/include/srslte/modem/mod.h | 8 +- srslte/include/srslte/modem/modem_table.h | 8 +- srslte/include/srslte/phch/cqi.h | 8 +- srslte/include/srslte/phch/dci.h | 8 +- srslte/include/srslte/phch/pbch.h | 8 +- srslte/include/srslte/phch/pcfich.h | 8 +- srslte/include/srslte/phch/pdcch.h | 8 +- srslte/include/srslte/phch/pdsch.h | 8 +- srslte/include/srslte/phch/pdsch_cfg.h | 8 +- srslte/include/srslte/phch/phich.h | 8 +- srslte/include/srslte/phch/prach.h | 8 +- srslte/include/srslte/phch/pucch.h | 8 +- srslte/include/srslte/phch/pusch.h | 8 +- srslte/include/srslte/phch/pusch_cfg.h | 8 +- srslte/include/srslte/phch/ra.h | 8 +- srslte/include/srslte/phch/regs.h | 8 +- srslte/include/srslte/phch/sch.h | 8 +- srslte/include/srslte/phch/uci.h | 8 +- srslte/include/srslte/resampling/decim.h | 8 +- srslte/include/srslte/resampling/interp.h | 8 +- .../include/srslte/resampling/resample_arb.h | 8 +- srslte/include/srslte/scrambling/scrambling.h | 8 +- srslte/include/srslte/srslte.h | 8 +- srslte/include/srslte/sync/cfo.h | 8 +- srslte/include/srslte/sync/pss.h | 8 +- srslte/include/srslte/sync/sfo.h | 8 +- srslte/include/srslte/sync/sss.h | 8 +- srslte/include/srslte/sync/sync.h | 8 +- srslte/include/srslte/ue/ue_cell_search.h | 8 +- srslte/include/srslte/ue/ue_dl.h | 8 +- srslte/include/srslte/ue/ue_mib.h | 8 +- srslte/include/srslte/ue/ue_phy.h | 8 +- srslte/include/srslte/ue/ue_sync.h | 8 +- srslte/include/srslte/ue/ue_ul.h | 8 +- srslte/include/srslte/utils/bit.h | 8 +- srslte/include/srslte/utils/cexptab.h | 8 +- srslte/include/srslte/utils/convolution.h | 8 +- srslte/include/srslte/utils/debug.h | 8 +- srslte/include/srslte/utils/vector.h | 8 +- srslte/lib/CMakeLists.txt | 10 +- srslte/lib/agc/src/agc.c | 8 +- srslte/lib/ch_estimation/src/chest_dl.c | 8 +- srslte/lib/ch_estimation/src/refsignal_dl.c | 8 +- srslte/lib/ch_estimation/src/refsignal_ul.c | 8 +- srslte/lib/ch_estimation/src/ul_rs_tables.h | 8 +- srslte/lib/ch_estimation/test/CMakeLists.txt | 8 +- srslte/lib/ch_estimation/test/chest_test_dl.c | 8 +- .../ch_estimation/test/chest_test_dl_mex.c | 8 +- .../ch_estimation/test/refsignal_pusch_mex.c | 8 +- .../ch_estimation/test/refsignal_ul_test.c | 8 +- srslte/lib/channel/src/ch_awgn.c | 8 +- srslte/lib/channel/src/gauss.c | 8 +- srslte/lib/channel/src/gauss.h | 8 +- srslte/lib/common/src/phy_common.c | 8 +- srslte/lib/common/src/sequence.c | 8 +- srslte/lib/common/src/timestamp.c | 8 +- srslte/lib/cuhd/src/cuhd_handler.hpp | 8 +- srslte/lib/cuhd/src/cuhd_imp.cpp | 8 +- srslte/lib/dft/src/dft.c | 8 +- srslte/lib/dft/src/dft_precoding.c | 8 +- srslte/lib/dft/src/ofdm.c | 8 +- srslte/lib/dft/test/CMakeLists.txt | 8 +- srslte/lib/dft/test/ofdm_test.c | 8 +- srslte/lib/fec/src/cbsegm.c | 8 +- srslte/lib/fec/src/convcoder.c | 8 +- srslte/lib/fec/src/crc.c | 8 +- srslte/lib/fec/src/parity.c | 2 +- srslte/lib/fec/src/parity.h | 2 +- srslte/lib/fec/src/rm_conv.c | 8 +- srslte/lib/fec/src/rm_turbo.c | 8 +- srslte/lib/fec/src/softbuffer.c | 8 +- srslte/lib/fec/src/tc_interl_lte.c | 8 +- srslte/lib/fec/src/tc_interl_umts.c | 8 +- srslte/lib/fec/src/turbocoder.c | 8 +- srslte/lib/fec/src/turbodecoder.c | 8 +- srslte/lib/fec/src/viterbi.c | 8 +- srslte/lib/fec/src/viterbi37.h | 8 +- srslte/lib/fec/src/viterbi37_port.c | 2 +- srslte/lib/fec/src/viterbi39.h | 8 +- srslte/lib/fec/src/viterbi39_port.c | 2 +- srslte/lib/fec/test/CMakeLists.txt | 8 +- srslte/lib/fec/test/crc_test.c | 8 +- srslte/lib/fec/test/crc_test.h | 8 +- srslte/lib/fec/test/rm_conv_test.c | 8 +- srslte/lib/fec/test/rm_turbo_rx_mex.c | 14 +- srslte/lib/fec/test/rm_turbo_test.c | 8 +- srslte/lib/fec/test/turbodecoder_test.c | 8 +- srslte/lib/fec/test/turbodecoder_test.h | 8 +- srslte/lib/fec/test/turbodecoder_test_mex.c | 14 +- srslte/lib/fec/test/viterbi_test.c | 8 +- srslte/lib/fec/test/viterbi_test.h | 8 +- srslte/lib/fec/test/viterbi_test_mex.c | 14 +- srslte/lib/io/src/binsource.c | 8 +- srslte/lib/io/src/filesink.c | 8 +- srslte/lib/io/src/filesource.c | 8 +- srslte/lib/io/src/netsink.c | 8 +- srslte/lib/io/src/netsource.c | 8 +- srslte/lib/mimo/src/layermap.c | 8 +- srslte/lib/mimo/src/precoding.c | 8 +- srslte/lib/mimo/test/CMakeLists.txt | 8 +- srslte/lib/mimo/test/layermap_test.c | 8 +- srslte/lib/mimo/test/precoding_test.c | 8 +- srslte/lib/modem/src/demod_hard.c | 8 +- srslte/lib/modem/src/demod_soft.c | 8 +- srslte/lib/modem/src/hard_demod_lte.c | 8 +- srslte/lib/modem/src/hard_demod_lte.h | 8 +- srslte/lib/modem/src/lte_tables.c | 8 +- srslte/lib/modem/src/lte_tables.h | 8 +- srslte/lib/modem/src/mod.c | 8 +- srslte/lib/modem/src/modem_table.c | 8 +- srslte/lib/modem/src/soft_algs.c | 8 +- srslte/lib/modem/src/soft_algs.h | 8 +- srslte/lib/modem/test/CMakeLists.txt | 8 +- srslte/lib/modem/test/modem_test.c | 8 +- srslte/lib/modem/test/soft_demod_test.c | 8 +- srslte/lib/phch/src/cqi.c | 8 +- srslte/lib/phch/src/dci.c | 8 +- srslte/lib/phch/src/pbch.c | 8 +- srslte/lib/phch/src/pcfich.c | 8 +- srslte/lib/phch/src/pdcch.c | 8 +- srslte/lib/phch/src/pdsch.c | 8 +- srslte/lib/phch/src/phich.c | 8 +- srslte/lib/phch/src/prach.c | 8 +- srslte/lib/phch/src/prb_dl.c | 8 +- srslte/lib/phch/src/prb_dl.h | 8 +- srslte/lib/phch/src/pucch.c | 8 +- srslte/lib/phch/src/pusch.c | 8 +- srslte/lib/phch/src/ra.c | 8 +- srslte/lib/phch/src/regs.c | 8 +- srslte/lib/phch/src/sch.c | 8 +- srslte/lib/phch/src/sequences.c | 8 +- srslte/lib/phch/src/uci.c | 8 +- srslte/lib/phch/test/CMakeLists.txt | 8 +- srslte/lib/phch/test/dci_unpacking.c | 8 +- srslte/lib/phch/test/dlsch_encode_test_mex.c | 14 +- srslte/lib/phch/test/pbch_file_test.c | 8 +- srslte/lib/phch/test/pbch_test.c | 8 +- srslte/lib/phch/test/pbch_test_mex.c | 14 +- srslte/lib/phch/test/pcfich_file_test.c | 8 +- srslte/lib/phch/test/pcfich_test.c | 8 +- srslte/lib/phch/test/pcfich_test_mex.c | 14 +- srslte/lib/phch/test/pdcch_file_test.c | 8 +- srslte/lib/phch/test/pdcch_test.c | 8 +- srslte/lib/phch/test/pdcch_test_mex.c | 14 +- srslte/lib/phch/test/pdsch_file_test.c | 8 +- srslte/lib/phch/test/pdsch_test.c | 8 +- srslte/lib/phch/test/pdsch_test_mex.c | 14 +- srslte/lib/phch/test/phich_file_test.c | 8 +- srslte/lib/phch/test/phich_test.c | 8 +- srslte/lib/phch/test/prach_test_mex.c | 14 +- srslte/lib/phch/test/pucch_encode_test_mex.c | 14 +- srslte/lib/phch/test/pucch_test.c | 8 +- srslte/lib/phch/test/pusch_encode_test_mex.c | 14 +- srslte/lib/phch/test/pusch_test.c | 8 +- srslte/lib/phch/test/ulsch_encode_test_mex.c | 14 +- srslte/lib/resampling/src/decim.c | 8 +- srslte/lib/resampling/src/interp.c | 8 +- srslte/lib/resampling/src/resample_arb.c | 8 +- srslte/lib/resampling/test/CMakeLists.txt | 8 +- srslte/lib/scrambling/src/scrambling.c | 8 +- srslte/lib/scrambling/test/CMakeLists.txt | 8 +- srslte/lib/scrambling/test/scrambling_test.c | 8 +- srslte/lib/sync/src/cfo.c | 8 +- srslte/lib/sync/src/cp.c | 8 +- srslte/lib/sync/src/find_sss.c | 8 +- srslte/lib/sync/src/gen_sss.c | 8 +- srslte/lib/sync/src/pss.c | 8 +- srslte/lib/sync/src/sfo.c | 8 +- srslte/lib/sync/src/sss.c | 8 +- srslte/lib/sync/src/sync.c | 8 +- srslte/lib/sync/test/CMakeLists.txt | 8 +- srslte/lib/sync/test/cfo_test.c | 8 +- srslte/lib/sync/test/pss_file.c | 8 +- srslte/lib/sync/test/pss_mex.c | 14 +- srslte/lib/sync/test/pss_usrp.c | 8 +- srslte/lib/sync/test/sss_mex.c | 14 +- srslte/lib/sync/test/sync_test.c | 8 +- srslte/lib/ue/src/ue_cell_search.c | 8 +- srslte/lib/ue/src/ue_dl.c | 8 +- srslte/lib/ue/src/ue_mib.c | 8 +- srslte/lib/ue/src/ue_sync.c | 8 +- srslte/lib/ue/src/ue_ul.c | 8 +- srslte/lib/utils/src/bit.c | 8 +- srslte/lib/utils/src/cexptab.c | 8 +- srslte/lib/utils/src/convolution.c | 8 +- srslte/lib/utils/src/debug.c | 8 +- srslte/lib/utils/src/vector.c | 8 +- srslte/lib/utils/test/CMakeLists.txt | 8 +- 277 files changed, 1802 insertions(+), 1306 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bb92e8dd..168eca793 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # @@ -128,11 +128,11 @@ ADD_CUSTOM_TARGET(uninstall ######################################################################## # Macro to add -fPIC property to static libs ######################################################################## -MACRO(LIBLTE_SET_PIC) +MACRO(SRSLTE_SET_PIC) IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) SET_TARGET_PROPERTIES(${ARGV} PROPERTIES COMPILE_FLAGS -fPIC) ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) -ENDMACRO(LIBLTE_SET_PIC) +ENDMACRO(SRSLTE_SET_PIC) ######################################################################## # Print summary diff --git a/LICENSE b/LICENSE index 6600f1c98..2def0e883 100644 --- a/LICENSE +++ b/LICENSE @@ -1,165 +1,661 @@ -GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. \ No newline at end of file diff --git a/mex/CMakeLists.txt b/mex/CMakeLists.txt index fbaa0c8a5..fa17d5ce3 100644 --- a/mex/CMakeLists.txt +++ b/mex/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/mex/include/srslte/mex/mexutils.h b/mex/include/srslte/mex/mexutils.h index e189454e0..b5635bdd5 100644 --- a/mex/include/srslte/mex/mexutils.h +++ b/mex/include/srslte/mex/mexutils.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/mex/lib/CMakeLists.txt b/mex/lib/CMakeLists.txt index b4f7732e6..681e6a492 100644 --- a/mex/lib/CMakeLists.txt +++ b/mex/lib/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # @@ -41,7 +41,7 @@ if(MATLAB_FOUND) message(STATUS "Found MATLAB in ${MATLAB_ROOT}") add_library(srslte_mex SHARED mexutils.c) install(TARGETS srslte_mex DESTINATION ${LIBRARY_DIR}) - liblte_set_pic(srslte_mex) + SRSLTE_SET_PIC(srslte_mex) include_directories(${MATLAB_INCLUDE_DIR}) endif(MATLAB_FOUND) @@ -50,7 +50,7 @@ if(OCTAVE_FOUND) if (NOT MATLAB_FOUND) add_library(srslte_mex SHARED mexutils.c) install(TARGETS srslte_mex DESTINATION ${LIBRARY_DIR}) - liblte_set_pic(srslte_mex) + SRSLTE_SET_PIC(srslte_mex) endif (NOT MATLAB_FOUND) include_directories(${OCTAVE_INCLUDE_DIR}) endif(OCTAVE_FOUND) diff --git a/mex/lib/mexutils.c b/mex/lib/mexutils.c index 742d30193..7b2803190 100644 --- a/mex/lib/mexutils.c +++ b/mex/lib/mexutils.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/scripts/xml2aloe/template/src/template.c b/scripts/xml2aloe/template/src/template.c index e7d08ca21..41bc2dbbc 100644 --- a/scripts/xml2aloe/template/src/template.c +++ b/scripts/xml2aloe/template/src/template.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/scripts/xml2aloe/template/src/template.h b/scripts/xml2aloe/template/src/template.h index f67b6d610..7d0a04121 100644 --- a/scripts/xml2aloe/template/src/template.h +++ b/scripts/xml2aloe/template/src/template.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/scripts/xml2aloe/template/test/test_generate.c b/scripts/xml2aloe/template/test/test_generate.c index ce073a4db..e794eb68c 100644 --- a/scripts/xml2aloe/template/test/test_generate.c +++ b/scripts/xml2aloe/template/test/test_generate.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/CMakeLists.txt b/srsapps/CMakeLists.txt index f7786b57a..b45914ec2 100644 --- a/srsapps/CMakeLists.txt +++ b/srsapps/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srsapps/common/CMakeLists.txt b/srsapps/common/CMakeLists.txt index ad5344f2c..13a0fbf62 100644 --- a/srsapps/common/CMakeLists.txt +++ b/srsapps/common/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # @@ -28,7 +28,7 @@ INSTALL(DIRECTORY include/ FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_common SHARED ${SOURCES}) INSTALL(TARGETS srsapps_common DESTINATION ${LIBRARY_DIR}) -LIBLTE_SET_PIC(srsapps_common) +SRSLTE_SET_PIC(srsapps_common) FILE(GLOB HEADERS_ALL "include/srsapps/common/*.h") ADD_CUSTOM_TARGET (add_srsapps_common_headers SOURCES ${HEADERS_ALL}) diff --git a/srsapps/common/include/srsapps/common/log.h b/srsapps/common/include/srsapps/common/log.h index e054574f9..ad3432185 100644 --- a/srsapps/common/include/srsapps/common/log.h +++ b/srsapps/common/include/srsapps/common/log.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/include/srsapps/common/log_stdout.h b/srsapps/common/include/srsapps/common/log_stdout.h index cb2135493..2dda1717b 100644 --- a/srsapps/common/include/srsapps/common/log_stdout.h +++ b/srsapps/common/include/srsapps/common/log_stdout.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/include/srsapps/common/params_db.h b/srsapps/common/include/srsapps/common/params_db.h index cf48d9e98..b2c9ec020 100644 --- a/srsapps/common/include/srsapps/common/params_db.h +++ b/srsapps/common/include/srsapps/common/params_db.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/include/srsapps/common/queue.h b/srsapps/common/include/srsapps/common/queue.h index 666171d1b..5f81bf2eb 100644 --- a/srsapps/common/include/srsapps/common/queue.h +++ b/srsapps/common/include/srsapps/common/queue.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/include/srsapps/common/tti_sync.h b/srsapps/common/include/srsapps/common/tti_sync.h index 5d9035df2..421d23836 100644 --- a/srsapps/common/include/srsapps/common/tti_sync.h +++ b/srsapps/common/include/srsapps/common/tti_sync.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/include/srsapps/common/tti_sync_cv.h b/srsapps/common/include/srsapps/common/tti_sync_cv.h index 37cd8319a..b08a263bd 100644 --- a/srsapps/common/include/srsapps/common/tti_sync_cv.h +++ b/srsapps/common/include/srsapps/common/tti_sync_cv.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/src/log_stdout.cc b/srsapps/common/src/log_stdout.cc index e928c04c1..21cbb89bb 100644 --- a/srsapps/common/src/log_stdout.cc +++ b/srsapps/common/src/log_stdout.cc @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/src/queue.cc b/srsapps/common/src/queue.cc index 2caf5ccae..c53045f3f 100644 --- a/srsapps/common/src/queue.cc +++ b/srsapps/common/src/queue.cc @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/common/src/tti_sync_cv.cc b/srsapps/common/src/tti_sync_cv.cc index 67dc41988..8e5e16a6f 100644 --- a/srsapps/common/src/tti_sync_cv.cc +++ b/srsapps/common/src/tti_sync_cv.cc @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/radio/CMakeLists.txt b/srsapps/radio/CMakeLists.txt index 98a1ac11e..f7cff323e 100644 --- a/srsapps/radio/CMakeLists.txt +++ b/srsapps/radio/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # @@ -31,7 +31,7 @@ IF(UHD_FOUND) FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_radio SHARED ${SOURCES}) INSTALL(TARGETS srsapps_radio DESTINATION ${LIBRARY_DIR}) - LIBLTE_SET_PIC(srsapps_radio) + SRSLTE_SET_PIC(srsapps_radio) ENDIF(UHD_FOUND) FILE(GLOB HEADERS_ALL "include/srsapps/radio/*.h") diff --git a/srsapps/radio/include/srsapps/radio/radio_uhd.h b/srsapps/radio/include/srsapps/radio/radio_uhd.h index a4d219d7c..7cf7c72fe 100644 --- a/srsapps/radio/include/srsapps/radio/radio_uhd.h +++ b/srsapps/radio/include/srsapps/radio/radio_uhd.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/radio/src/radio_uhd.cc b/srsapps/radio/src/radio_uhd.cc index 30de38298..6995aaf8d 100644 --- a/srsapps/radio/src/radio_uhd.cc +++ b/srsapps/radio/src/radio_uhd.cc @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/CMakeLists.txt b/srsapps/ue/CMakeLists.txt index f09fc8c6b..980e7c5a1 100644 --- a/srsapps/ue/CMakeLists.txt +++ b/srsapps/ue/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srsapps/ue/mac/CMakeLists.txt b/srsapps/ue/mac/CMakeLists.txt index 05595631f..8ece6f709 100644 --- a/srsapps/ue/mac/CMakeLists.txt +++ b/srsapps/ue/mac/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # @@ -28,7 +28,7 @@ INSTALL(DIRECTORY include/ FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_ue_mac SHARED ${SOURCES}) INSTALL(TARGETS srsapps_ue_mac DESTINATION ${LIBRARY_DIR}) -LIBLTE_SET_PIC(srsapps_ue_mac) +SRSLTE_SET_PIC(srsapps_ue_mac) FILE(GLOB HEADERS_ALL "include/srsapps/ue/mac/*.h") ADD_CUSTOM_TARGET (add_ue_mac_headers SOURCES ${HEADERS_ALL}) diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc index 2f9d0fb6f..93e114a1c 100644 --- a/srsapps/ue/mac/src/mac.cc +++ b/srsapps/ue/mac/src/mac.cc @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/CMakeLists.txt b/srsapps/ue/phy/CMakeLists.txt index 6226e84d1..198ee85d0 100644 --- a/srsapps/ue/phy/CMakeLists.txt +++ b/srsapps/ue/phy/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # @@ -29,7 +29,7 @@ FILE(GLOB SOURCES "src/*.cc") ADD_LIBRARY(srsapps_ue_phy SHARED ${SOURCES}) TARGET_LINK_LIBRARIES(srsapps_ue_phy srsapps_common) INSTALL(TARGETS srsapps_ue_phy DESTINATION ${LIBRARY_DIR}) -LIBLTE_SET_PIC(srsapps_ue_phy) +SRSLTE_SET_PIC(srsapps_ue_phy) FILE(GLOB HEADERS_ALL "include/srsapps/ue/phy/*.h") ADD_CUSTOM_TARGET (add_ue_phy_headers SOURCES ${HEADERS_ALL}) diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h index dd3f93fe1..54155af96 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h index e4b589bab..af2af87d7 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h index d54da2db6..8085193fb 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h index 7b34872f7..2d2af146b 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/prach.h b/srsapps/ue/phy/include/srsapps/ue/phy/prach.h index 3e000132c..40a09bb8f 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/prach.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/prach.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h index 59eb68fee..e40e72f0a 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h b/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h index 89477c959..89812d248 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h index 43e88d9a0..346d7a4c4 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/test/CMakeLists.txt b/srsapps/ue/phy/test/CMakeLists.txt index 14ef73de5..736011d2e 100644 --- a/srsapps/ue/phy/test/CMakeLists.txt +++ b/srsapps/ue/phy/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srsapps/ue/phy/test/ue_itf_test_prach.cc b/srsapps/ue/phy/test/ue_itf_test_prach.cc index 45f45da26..74b3701a4 100644 --- a/srsapps/ue/phy/test/ue_itf_test_prach.cc +++ b/srsapps/ue/phy/test/ue_itf_test_prach.cc @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srsapps/ue/phy/test/ue_itf_test_sib1.cc b/srsapps/ue/phy/test/ue_itf_test_sib1.cc index e250d345b..1debf2823 100644 --- a/srsapps/ue/phy/test/ue_itf_test_sib1.cc +++ b/srsapps/ue/phy/test/ue_itf_test_sib1.cc @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/CMakeLists.txt b/srslte/CMakeLists.txt index 229624ea0..a9121a5b8 100644 --- a/srslte/CMakeLists.txt +++ b/srslte/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/examples/CMakeLists.txt b/srslte/examples/CMakeLists.txt index 6173ddc31..961cae98d 100644 --- a/srslte/examples/CMakeLists.txt +++ b/srslte/examples/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/examples/cell_measurement.c b/srslte/examples/cell_measurement.c index e96f12da3..b528e2c8e 100644 --- a/srslte/examples/cell_measurement.c +++ b/srslte/examples/cell_measurement.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/cell_search.c b/srslte/examples/cell_search.c index e42a0e511..4d211e218 100644 --- a/srslte/examples/cell_search.c +++ b/srslte/examples/cell_search.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/hl_example.c b/srslte/examples/hl_example.c index 05acd5fb0..e344b4907 100644 --- a/srslte/examples/hl_example.c +++ b/srslte/examples/hl_example.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/ll_example.c b/srslte/examples/ll_example.c index e93b56cad..2e9c5df90 100644 --- a/srslte/examples/ll_example.c +++ b/srslte/examples/ll_example.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/pdsch_enodeb.c b/srslte/examples/pdsch_enodeb.c index 0c3d82b8a..c317d2a32 100644 --- a/srslte/examples/pdsch_enodeb.c +++ b/srslte/examples/pdsch_enodeb.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index d0dc73077..87266d824 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/prach_ue.c b/srslte/examples/prach_ue.c index 5fffb9d52..2e292465e 100644 --- a/srslte/examples/prach_ue.c +++ b/srslte/examples/prach_ue.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/synch_file.c b/srslte/examples/synch_file.c index bd19965b9..ad8264002 100644 --- a/srslte/examples/synch_file.c +++ b/srslte/examples/synch_file.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/tutorial_examples/CMakeLists.txt b/srslte/examples/tutorial_examples/CMakeLists.txt index 501db7792..0de79c29e 100644 --- a/srslte/examples/tutorial_examples/CMakeLists.txt +++ b/srslte/examples/tutorial_examples/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/examples/tutorial_examples/pss.c b/srslte/examples/tutorial_examples/pss.c index c2dae1830..633aab519 100644 --- a/srslte/examples/tutorial_examples/pss.c +++ b/srslte/examples/tutorial_examples/pss.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/tutorial_examples/simple_tx.c b/srslte/examples/tutorial_examples/simple_tx.c index 3ee4729ea..83bd9373a 100644 --- a/srslte/examples/tutorial_examples/simple_tx.c +++ b/srslte/examples/tutorial_examples/simple_tx.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/tutorial_examples/ue_rx.c b/srslte/examples/tutorial_examples/ue_rx.c index 621668cac..fb623ba02 100644 --- a/srslte/examples/tutorial_examples/ue_rx.c +++ b/srslte/examples/tutorial_examples/ue_rx.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/usrp_capture.c b/srslte/examples/usrp_capture.c index 085f66555..a4f555663 100644 --- a/srslte/examples/usrp_capture.c +++ b/srslte/examples/usrp_capture.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/examples/usrp_capture_sync.c b/srslte/examples/usrp_capture_sync.c index 87bb60ef3..073029e51 100644 --- a/srslte/examples/usrp_capture_sync.c +++ b/srslte/examples/usrp_capture_sync.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/agc/agc.h b/srslte/include/srslte/agc/agc.h index 5b150c93c..8f9d891ee 100644 --- a/srslte/include/srslte/agc/agc.h +++ b/srslte/include/srslte/agc/agc.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ch_estimation/chest_dl.h b/srslte/include/srslte/ch_estimation/chest_dl.h index 259f69b2f..30bda0213 100644 --- a/srslte/include/srslte/ch_estimation/chest_dl.h +++ b/srslte/include/srslte/ch_estimation/chest_dl.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ch_estimation/refsignal_dl.h b/srslte/include/srslte/ch_estimation/refsignal_dl.h index c7e3c03ff..dacffb312 100644 --- a/srslte/include/srslte/ch_estimation/refsignal_dl.h +++ b/srslte/include/srslte/ch_estimation/refsignal_dl.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ch_estimation/refsignal_ul.h b/srslte/include/srslte/ch_estimation/refsignal_ul.h index 7bd242e50..a362e0eb6 100644 --- a/srslte/include/srslte/ch_estimation/refsignal_ul.h +++ b/srslte/include/srslte/ch_estimation/refsignal_ul.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/channel/ch_awgn.h b/srslte/include/srslte/channel/ch_awgn.h index e323978bf..7b5983ec6 100644 --- a/srslte/include/srslte/channel/ch_awgn.h +++ b/srslte/include/srslte/channel/ch_awgn.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/common/phy_common.h b/srslte/include/srslte/common/phy_common.h index e3f7b765b..ea26bea45 100644 --- a/srslte/include/srslte/common/phy_common.h +++ b/srslte/include/srslte/common/phy_common.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/common/radio.h b/srslte/include/srslte/common/radio.h index 934a97923..833f462c7 100644 --- a/srslte/include/srslte/common/radio.h +++ b/srslte/include/srslte/common/radio.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/common/sequence.h b/srslte/include/srslte/common/sequence.h index a9f8d637a..6a22f8876 100644 --- a/srslte/include/srslte/common/sequence.h +++ b/srslte/include/srslte/common/sequence.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/common/timestamp.h b/srslte/include/srslte/common/timestamp.h index 26f8c736a..bc39f2c6a 100644 --- a/srslte/include/srslte/common/timestamp.h +++ b/srslte/include/srslte/common/timestamp.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/config.h b/srslte/include/srslte/config.h index 19445de96..c1962c3cc 100644 --- a/srslte/include/srslte/config.h +++ b/srslte/include/srslte/config.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/cuhd/cuhd.h b/srslte/include/srslte/cuhd/cuhd.h index 36088cd05..00eface40 100644 --- a/srslte/include/srslte/cuhd/cuhd.h +++ b/srslte/include/srslte/cuhd/cuhd.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/cuhd/cuhd_utils.h b/srslte/include/srslte/cuhd/cuhd_utils.h index d1d75353a..e3053bbc2 100644 --- a/srslte/include/srslte/cuhd/cuhd_utils.h +++ b/srslte/include/srslte/cuhd/cuhd_utils.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/dft/dft.h b/srslte/include/srslte/dft/dft.h index 680e8575d..eec8b7853 100644 --- a/srslte/include/srslte/dft/dft.h +++ b/srslte/include/srslte/dft/dft.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/dft/dft_precoding.h b/srslte/include/srslte/dft/dft_precoding.h index c5dbc17a5..9aa8856cb 100644 --- a/srslte/include/srslte/dft/dft_precoding.h +++ b/srslte/include/srslte/dft/dft_precoding.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/dft/ofdm.h b/srslte/include/srslte/dft/ofdm.h index 7ceff8057..e87920ff3 100644 --- a/srslte/include/srslte/dft/ofdm.h +++ b/srslte/include/srslte/dft/ofdm.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/cbsegm.h b/srslte/include/srslte/fec/cbsegm.h index ad0628618..2208770d4 100644 --- a/srslte/include/srslte/fec/cbsegm.h +++ b/srslte/include/srslte/fec/cbsegm.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/convcoder.h b/srslte/include/srslte/fec/convcoder.h index 9117070b3..409a4e8e1 100644 --- a/srslte/include/srslte/fec/convcoder.h +++ b/srslte/include/srslte/fec/convcoder.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/crc.h b/srslte/include/srslte/fec/crc.h index 6ec73b7d5..1afd26d9c 100644 --- a/srslte/include/srslte/fec/crc.h +++ b/srslte/include/srslte/fec/crc.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/rm_conv.h b/srslte/include/srslte/fec/rm_conv.h index 178f42685..5c20c7a78 100644 --- a/srslte/include/srslte/fec/rm_conv.h +++ b/srslte/include/srslte/fec/rm_conv.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/rm_turbo.h b/srslte/include/srslte/fec/rm_turbo.h index ff01ecea6..17b0675df 100644 --- a/srslte/include/srslte/fec/rm_turbo.h +++ b/srslte/include/srslte/fec/rm_turbo.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/softbuffer.h b/srslte/include/srslte/fec/softbuffer.h index a7e5077d9..a35073746 100644 --- a/srslte/include/srslte/fec/softbuffer.h +++ b/srslte/include/srslte/fec/softbuffer.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/tc_interl.h b/srslte/include/srslte/fec/tc_interl.h index 4f851bc25..6d38523d6 100644 --- a/srslte/include/srslte/fec/tc_interl.h +++ b/srslte/include/srslte/fec/tc_interl.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/turbocoder.h b/srslte/include/srslte/fec/turbocoder.h index 739211c0d..697d1e80a 100644 --- a/srslte/include/srslte/fec/turbocoder.h +++ b/srslte/include/srslte/fec/turbocoder.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/turbodecoder.h b/srslte/include/srslte/fec/turbodecoder.h index 8fd76e090..ab0f856d2 100644 --- a/srslte/include/srslte/fec/turbodecoder.h +++ b/srslte/include/srslte/fec/turbodecoder.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/fec/viterbi.h b/srslte/include/srslte/fec/viterbi.h index d12237c75..0727b1a04 100644 --- a/srslte/include/srslte/fec/viterbi.h +++ b/srslte/include/srslte/fec/viterbi.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/io/binsource.h b/srslte/include/srslte/io/binsource.h index fbc601894..96ed2a7b8 100644 --- a/srslte/include/srslte/io/binsource.h +++ b/srslte/include/srslte/io/binsource.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/io/filesink.h b/srslte/include/srslte/io/filesink.h index fa76b89df..bdee4c9c7 100644 --- a/srslte/include/srslte/io/filesink.h +++ b/srslte/include/srslte/io/filesink.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/io/filesource.h b/srslte/include/srslte/io/filesource.h index 4903090d5..714d7a21b 100644 --- a/srslte/include/srslte/io/filesource.h +++ b/srslte/include/srslte/io/filesource.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/io/format.h b/srslte/include/srslte/io/format.h index b975f3c5f..06462b131 100644 --- a/srslte/include/srslte/io/format.h +++ b/srslte/include/srslte/io/format.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/io/netsink.h b/srslte/include/srslte/io/netsink.h index 0783e47d8..efa84e8c4 100644 --- a/srslte/include/srslte/io/netsink.h +++ b/srslte/include/srslte/io/netsink.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/io/netsource.h b/srslte/include/srslte/io/netsource.h index bf8dccc66..ef9de216d 100644 --- a/srslte/include/srslte/io/netsource.h +++ b/srslte/include/srslte/io/netsource.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/mimo/layermap.h b/srslte/include/srslte/mimo/layermap.h index be6bb6ebb..5c02e726b 100644 --- a/srslte/include/srslte/mimo/layermap.h +++ b/srslte/include/srslte/mimo/layermap.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/mimo/precoding.h b/srslte/include/srslte/mimo/precoding.h index 20cec2671..f49899511 100644 --- a/srslte/include/srslte/mimo/precoding.h +++ b/srslte/include/srslte/mimo/precoding.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/modem/demod_hard.h b/srslte/include/srslte/modem/demod_hard.h index 5fe112c03..1fd455210 100644 --- a/srslte/include/srslte/modem/demod_hard.h +++ b/srslte/include/srslte/modem/demod_hard.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/modem/demod_soft.h b/srslte/include/srslte/modem/demod_soft.h index 942441caa..ae8cb1946 100644 --- a/srslte/include/srslte/modem/demod_soft.h +++ b/srslte/include/srslte/modem/demod_soft.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/modem/mod.h b/srslte/include/srslte/modem/mod.h index 2295c088e..612d76186 100644 --- a/srslte/include/srslte/modem/mod.h +++ b/srslte/include/srslte/modem/mod.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/modem/modem_table.h b/srslte/include/srslte/modem/modem_table.h index 3a349b297..e72db2bc4 100644 --- a/srslte/include/srslte/modem/modem_table.h +++ b/srslte/include/srslte/modem/modem_table.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/cqi.h b/srslte/include/srslte/phch/cqi.h index 183021a60..6c2676f7f 100644 --- a/srslte/include/srslte/phch/cqi.h +++ b/srslte/include/srslte/phch/cqi.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/dci.h b/srslte/include/srslte/phch/dci.h index c23342144..f76aaa303 100644 --- a/srslte/include/srslte/phch/dci.h +++ b/srslte/include/srslte/phch/dci.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pbch.h b/srslte/include/srslte/phch/pbch.h index 6787340f4..eacf272c1 100644 --- a/srslte/include/srslte/phch/pbch.h +++ b/srslte/include/srslte/phch/pbch.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pcfich.h b/srslte/include/srslte/phch/pcfich.h index 15457c7b1..20e57657f 100644 --- a/srslte/include/srslte/phch/pcfich.h +++ b/srslte/include/srslte/phch/pcfich.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pdcch.h b/srslte/include/srslte/phch/pdcch.h index 2b77b804a..b6c287b8f 100644 --- a/srslte/include/srslte/phch/pdcch.h +++ b/srslte/include/srslte/phch/pdcch.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pdsch.h b/srslte/include/srslte/phch/pdsch.h index e97878550..ec8ae4135 100644 --- a/srslte/include/srslte/phch/pdsch.h +++ b/srslte/include/srslte/phch/pdsch.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pdsch_cfg.h b/srslte/include/srslte/phch/pdsch_cfg.h index 547bb0a80..bf67dbfc4 100644 --- a/srslte/include/srslte/phch/pdsch_cfg.h +++ b/srslte/include/srslte/phch/pdsch_cfg.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/phich.h b/srslte/include/srslte/phch/phich.h index e1fbd4067..f0bc11bc0 100644 --- a/srslte/include/srslte/phch/phich.h +++ b/srslte/include/srslte/phch/phich.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/prach.h b/srslte/include/srslte/phch/prach.h index 518a75637..5b7113ca4 100644 --- a/srslte/include/srslte/phch/prach.h +++ b/srslte/include/srslte/phch/prach.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pucch.h b/srslte/include/srslte/phch/pucch.h index 4b9eaebb1..3c77b4426 100644 --- a/srslte/include/srslte/phch/pucch.h +++ b/srslte/include/srslte/phch/pucch.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pusch.h b/srslte/include/srslte/phch/pusch.h index 565d4428a..ff4900eb3 100644 --- a/srslte/include/srslte/phch/pusch.h +++ b/srslte/include/srslte/phch/pusch.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/pusch_cfg.h b/srslte/include/srslte/phch/pusch_cfg.h index bf8286e00..21db6c211 100644 --- a/srslte/include/srslte/phch/pusch_cfg.h +++ b/srslte/include/srslte/phch/pusch_cfg.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/ra.h b/srslte/include/srslte/phch/ra.h index a00a93408..7a0d9b348 100644 --- a/srslte/include/srslte/phch/ra.h +++ b/srslte/include/srslte/phch/ra.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/regs.h b/srslte/include/srslte/phch/regs.h index 04d899412..de8dc92a0 100644 --- a/srslte/include/srslte/phch/regs.h +++ b/srslte/include/srslte/phch/regs.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/sch.h b/srslte/include/srslte/phch/sch.h index d89a482da..af3abde87 100644 --- a/srslte/include/srslte/phch/sch.h +++ b/srslte/include/srslte/phch/sch.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/phch/uci.h b/srslte/include/srslte/phch/uci.h index 69e068151..8c78674ba 100644 --- a/srslte/include/srslte/phch/uci.h +++ b/srslte/include/srslte/phch/uci.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/resampling/decim.h b/srslte/include/srslte/resampling/decim.h index 44e144c3c..304600650 100644 --- a/srslte/include/srslte/resampling/decim.h +++ b/srslte/include/srslte/resampling/decim.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/resampling/interp.h b/srslte/include/srslte/resampling/interp.h index 49b103bcc..0ac00605c 100644 --- a/srslte/include/srslte/resampling/interp.h +++ b/srslte/include/srslte/resampling/interp.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/resampling/resample_arb.h b/srslte/include/srslte/resampling/resample_arb.h index 0d7a6b672..b91004142 100644 --- a/srslte/include/srslte/resampling/resample_arb.h +++ b/srslte/include/srslte/resampling/resample_arb.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/scrambling/scrambling.h b/srslte/include/srslte/scrambling/scrambling.h index 8f5c7e9ae..8e9b43bbd 100644 --- a/srslte/include/srslte/scrambling/scrambling.h +++ b/srslte/include/srslte/scrambling/scrambling.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/srslte.h b/srslte/include/srslte/srslte.h index 162c4bcdf..fcef7490b 100644 --- a/srslte/include/srslte/srslte.h +++ b/srslte/include/srslte/srslte.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/sync/cfo.h b/srslte/include/srslte/sync/cfo.h index de85ebdd5..df0967905 100644 --- a/srslte/include/srslte/sync/cfo.h +++ b/srslte/include/srslte/sync/cfo.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/sync/pss.h b/srslte/include/srslte/sync/pss.h index 3ea092c35..f02e5a41a 100644 --- a/srslte/include/srslte/sync/pss.h +++ b/srslte/include/srslte/sync/pss.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/sync/sfo.h b/srslte/include/srslte/sync/sfo.h index d17e7c482..7178e2d26 100644 --- a/srslte/include/srslte/sync/sfo.h +++ b/srslte/include/srslte/sync/sfo.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/sync/sss.h b/srslte/include/srslte/sync/sss.h index d57d27398..153235388 100644 --- a/srslte/include/srslte/sync/sss.h +++ b/srslte/include/srslte/sync/sss.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/sync/sync.h b/srslte/include/srslte/sync/sync.h index a21901ccc..2dcde5244 100644 --- a/srslte/include/srslte/sync/sync.h +++ b/srslte/include/srslte/sync/sync.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ue/ue_cell_search.h b/srslte/include/srslte/ue/ue_cell_search.h index adb64d416..8f114109d 100644 --- a/srslte/include/srslte/ue/ue_cell_search.h +++ b/srslte/include/srslte/ue/ue_cell_search.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ue/ue_dl.h b/srslte/include/srslte/ue/ue_dl.h index ac67a5004..1024e80ca 100644 --- a/srslte/include/srslte/ue/ue_dl.h +++ b/srslte/include/srslte/ue/ue_dl.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ue/ue_mib.h b/srslte/include/srslte/ue/ue_mib.h index 6d363a155..124840c79 100644 --- a/srslte/include/srslte/ue/ue_mib.h +++ b/srslte/include/srslte/ue/ue_mib.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ue/ue_phy.h b/srslte/include/srslte/ue/ue_phy.h index 6ad32a2bf..b54e220fd 100644 --- a/srslte/include/srslte/ue/ue_phy.h +++ b/srslte/include/srslte/ue/ue_phy.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ue/ue_sync.h b/srslte/include/srslte/ue/ue_sync.h index db1a038c6..3d4f4b243 100644 --- a/srslte/include/srslte/ue/ue_sync.h +++ b/srslte/include/srslte/ue/ue_sync.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/ue/ue_ul.h b/srslte/include/srslte/ue/ue_ul.h index 4d984dd48..5f61fcc97 100644 --- a/srslte/include/srslte/ue/ue_ul.h +++ b/srslte/include/srslte/ue/ue_ul.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/utils/bit.h b/srslte/include/srslte/utils/bit.h index 8df7d40b8..713866b7e 100644 --- a/srslte/include/srslte/utils/bit.h +++ b/srslte/include/srslte/utils/bit.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/utils/cexptab.h b/srslte/include/srslte/utils/cexptab.h index e89de4395..a74d9ca39 100644 --- a/srslte/include/srslte/utils/cexptab.h +++ b/srslte/include/srslte/utils/cexptab.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/utils/convolution.h b/srslte/include/srslte/utils/convolution.h index f788f45e9..4125f21e5 100644 --- a/srslte/include/srslte/utils/convolution.h +++ b/srslte/include/srslte/utils/convolution.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/utils/debug.h b/srslte/include/srslte/utils/debug.h index fd0be1e35..2e781c9b5 100644 --- a/srslte/include/srslte/utils/debug.h +++ b/srslte/include/srslte/utils/debug.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/include/srslte/utils/vector.h b/srslte/include/srslte/utils/vector.h index 121afa9f2..e098ce454 100644 --- a/srslte/include/srslte/utils/vector.h +++ b/srslte/include/srslte/utils/vector.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index aae96a50f..7ce0d8b06 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # @@ -79,7 +79,7 @@ IF(UHD_FOUND) ENDIF(UHD_FOUND) INSTALL(TARGETS srslte DESTINATION ${LIBRARY_DIR}) -LIBLTE_SET_PIC(srslte) +SRSLTE_SET_PIC(srslte) IF(VOLK_FOUND) INCLUDE_DIRECTORIES(${VOLK_INCLUDE_DIRS}) diff --git a/srslte/lib/agc/src/agc.c b/srslte/lib/agc/src/agc.c index 1aab82275..bcd26c80c 100644 --- a/srslte/lib/agc/src/agc.c +++ b/srslte/lib/agc/src/agc.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/src/chest_dl.c index ac0c07925..fb4c41f09 100644 --- a/srslte/lib/ch_estimation/src/chest_dl.c +++ b/srslte/lib/ch_estimation/src/chest_dl.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/src/refsignal_dl.c b/srslte/lib/ch_estimation/src/refsignal_dl.c index b418fa5a2..0c2792367 100644 --- a/srslte/lib/ch_estimation/src/refsignal_dl.c +++ b/srslte/lib/ch_estimation/src/refsignal_dl.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/src/refsignal_ul.c b/srslte/lib/ch_estimation/src/refsignal_ul.c index d9150b082..9b6216419 100644 --- a/srslte/lib/ch_estimation/src/refsignal_ul.c +++ b/srslte/lib/ch_estimation/src/refsignal_ul.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/src/ul_rs_tables.h b/srslte/lib/ch_estimation/src/ul_rs_tables.h index 66bb021fb..8a31fc810 100644 --- a/srslte/lib/ch_estimation/src/ul_rs_tables.h +++ b/srslte/lib/ch_estimation/src/ul_rs_tables.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/test/CMakeLists.txt b/srslte/lib/ch_estimation/test/CMakeLists.txt index 3d832283b..f8238469b 100644 --- a/srslte/lib/ch_estimation/test/CMakeLists.txt +++ b/srslte/lib/ch_estimation/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/ch_estimation/test/chest_test_dl.c b/srslte/lib/ch_estimation/test/chest_test_dl.c index 31817dc03..efbc6b213 100644 --- a/srslte/lib/ch_estimation/test/chest_test_dl.c +++ b/srslte/lib/ch_estimation/test/chest_test_dl.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/test/chest_test_dl_mex.c b/srslte/lib/ch_estimation/test/chest_test_dl_mex.c index 247efa513..e158be0b0 100644 --- a/srslte/lib/ch_estimation/test/chest_test_dl_mex.c +++ b/srslte/lib/ch_estimation/test/chest_test_dl_mex.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/test/refsignal_pusch_mex.c b/srslte/lib/ch_estimation/test/refsignal_pusch_mex.c index 69811c4e1..806ad0cba 100644 --- a/srslte/lib/ch_estimation/test/refsignal_pusch_mex.c +++ b/srslte/lib/ch_estimation/test/refsignal_pusch_mex.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ch_estimation/test/refsignal_ul_test.c b/srslte/lib/ch_estimation/test/refsignal_ul_test.c index 70c0eba71..a94dd258d 100644 --- a/srslte/lib/ch_estimation/test/refsignal_ul_test.c +++ b/srslte/lib/ch_estimation/test/refsignal_ul_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/channel/src/ch_awgn.c b/srslte/lib/channel/src/ch_awgn.c index 8aac882c4..49aa50a09 100644 --- a/srslte/lib/channel/src/ch_awgn.c +++ b/srslte/lib/channel/src/ch_awgn.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/channel/src/gauss.c b/srslte/lib/channel/src/gauss.c index 36dab2e85..be37186ac 100644 --- a/srslte/lib/channel/src/gauss.c +++ b/srslte/lib/channel/src/gauss.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/channel/src/gauss.h b/srslte/lib/channel/src/gauss.h index 522bce32b..cc44fea12 100644 --- a/srslte/lib/channel/src/gauss.h +++ b/srslte/lib/channel/src/gauss.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/common/src/phy_common.c b/srslte/lib/common/src/phy_common.c index 57f75367d..7b2fdd72b 100644 --- a/srslte/lib/common/src/phy_common.c +++ b/srslte/lib/common/src/phy_common.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/common/src/sequence.c b/srslte/lib/common/src/sequence.c index ad84569fa..a273e0801 100644 --- a/srslte/lib/common/src/sequence.c +++ b/srslte/lib/common/src/sequence.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/common/src/timestamp.c b/srslte/lib/common/src/timestamp.c index 6b1645b03..161f5cffa 100644 --- a/srslte/lib/common/src/timestamp.c +++ b/srslte/lib/common/src/timestamp.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/cuhd/src/cuhd_handler.hpp b/srslte/lib/cuhd/src/cuhd_handler.hpp index 72b036cc4..256d164a8 100644 --- a/srslte/lib/cuhd/src/cuhd_handler.hpp +++ b/srslte/lib/cuhd/src/cuhd_handler.hpp @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/cuhd/src/cuhd_imp.cpp b/srslte/lib/cuhd/src/cuhd_imp.cpp index ed82c0aae..8173f74a0 100644 --- a/srslte/lib/cuhd/src/cuhd_imp.cpp +++ b/srslte/lib/cuhd/src/cuhd_imp.cpp @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/dft/src/dft.c b/srslte/lib/dft/src/dft.c index 3c67a34d7..4a51ddda3 100644 --- a/srslte/lib/dft/src/dft.c +++ b/srslte/lib/dft/src/dft.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/dft/src/dft_precoding.c b/srslte/lib/dft/src/dft_precoding.c index dff6ff2f2..fbab31424 100644 --- a/srslte/lib/dft/src/dft_precoding.c +++ b/srslte/lib/dft/src/dft_precoding.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/dft/src/ofdm.c b/srslte/lib/dft/src/ofdm.c index ec9d87f2b..d8069005e 100644 --- a/srslte/lib/dft/src/ofdm.c +++ b/srslte/lib/dft/src/ofdm.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/dft/test/CMakeLists.txt b/srslte/lib/dft/test/CMakeLists.txt index b092327c1..76f862a8d 100644 --- a/srslte/lib/dft/test/CMakeLists.txt +++ b/srslte/lib/dft/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/dft/test/ofdm_test.c b/srslte/lib/dft/test/ofdm_test.c index 58730afd4..89cd2049d 100644 --- a/srslte/lib/dft/test/ofdm_test.c +++ b/srslte/lib/dft/test/ofdm_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/cbsegm.c b/srslte/lib/fec/src/cbsegm.c index 3e3a4d85b..73fcfa874 100644 --- a/srslte/lib/fec/src/cbsegm.c +++ b/srslte/lib/fec/src/cbsegm.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/convcoder.c b/srslte/lib/fec/src/convcoder.c index d61cb9c7f..c8f4e74b6 100644 --- a/srslte/lib/fec/src/convcoder.c +++ b/srslte/lib/fec/src/convcoder.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/crc.c b/srslte/lib/fec/src/crc.c index e2f58e790..ca9323bf5 100644 --- a/srslte/lib/fec/src/crc.c +++ b/srslte/lib/fec/src/crc.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/parity.c b/srslte/lib/fec/src/parity.c index b12edfaee..a5ce08df9 100644 --- a/srslte/lib/fec/src/parity.c +++ b/srslte/lib/fec/src/parity.c @@ -1,6 +1,6 @@ /* * Copyright 2004, Phil Karn, KA9Q - * May be used under the terms of the GNU Lesser General Public License (LGPL) + * May be used under the terms of the GNU Affero General Public License (LGPL) */ #include diff --git a/srslte/lib/fec/src/parity.h b/srslte/lib/fec/src/parity.h index d2d4d0c56..247a6faee 100644 --- a/srslte/lib/fec/src/parity.h +++ b/srslte/lib/fec/src/parity.h @@ -1,6 +1,6 @@ /* * Copyright 2004, Phil Karn, KA9Q - * May be used under the terms of the GNU Lesser General Public License (LGPL) + * May be used under the terms of the GNU Affero General Public License (LGPL) */ diff --git a/srslte/lib/fec/src/rm_conv.c b/srslte/lib/fec/src/rm_conv.c index dcee3e641..5f1a8cea6 100644 --- a/srslte/lib/fec/src/rm_conv.c +++ b/srslte/lib/fec/src/rm_conv.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/rm_turbo.c b/srslte/lib/fec/src/rm_turbo.c index 468753a2a..3bbf18828 100644 --- a/srslte/lib/fec/src/rm_turbo.c +++ b/srslte/lib/fec/src/rm_turbo.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/softbuffer.c b/srslte/lib/fec/src/softbuffer.c index 7508cbcf4..98975c2af 100644 --- a/srslte/lib/fec/src/softbuffer.c +++ b/srslte/lib/fec/src/softbuffer.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/tc_interl_lte.c b/srslte/lib/fec/src/tc_interl_lte.c index ad8b1cf33..c996f9298 100644 --- a/srslte/lib/fec/src/tc_interl_lte.c +++ b/srslte/lib/fec/src/tc_interl_lte.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/tc_interl_umts.c b/srslte/lib/fec/src/tc_interl_umts.c index 2856d1e40..c84b5c7e5 100644 --- a/srslte/lib/fec/src/tc_interl_umts.c +++ b/srslte/lib/fec/src/tc_interl_umts.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/turbocoder.c b/srslte/lib/fec/src/turbocoder.c index 51d8e05dd..f7f6ac013 100644 --- a/srslte/lib/fec/src/turbocoder.c +++ b/srslte/lib/fec/src/turbocoder.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/turbodecoder.c b/srslte/lib/fec/src/turbodecoder.c index 88c621ae2..f51eb8384 100644 --- a/srslte/lib/fec/src/turbodecoder.c +++ b/srslte/lib/fec/src/turbodecoder.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/viterbi.c b/srslte/lib/fec/src/viterbi.c index 750f49407..579a74f1f 100644 --- a/srslte/lib/fec/src/viterbi.c +++ b/srslte/lib/fec/src/viterbi.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/viterbi37.h b/srslte/lib/fec/src/viterbi37.h index 5777f9a97..c312c16fe 100644 --- a/srslte/lib/fec/src/viterbi37.h +++ b/srslte/lib/fec/src/viterbi37.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/viterbi37_port.c b/srslte/lib/fec/src/viterbi37_port.c index 3a530e2f3..c89a6c72b 100644 --- a/srslte/lib/fec/src/viterbi37_port.c +++ b/srslte/lib/fec/src/viterbi37_port.c @@ -1,6 +1,6 @@ /* K=9 r=1/3 Viterbi decoder in portable C * Copyright Aug 2006, Phil Karn, KA9Q - * May be used under the terms of the GNU Lesser General Public License (LGPL) + * May be used under the terms of the GNU Affero General Public License (LGPL) */ #include #include diff --git a/srslte/lib/fec/src/viterbi39.h b/srslte/lib/fec/src/viterbi39.h index 4898fd323..6ec85c84b 100644 --- a/srslte/lib/fec/src/viterbi39.h +++ b/srslte/lib/fec/src/viterbi39.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/src/viterbi39_port.c b/srslte/lib/fec/src/viterbi39_port.c index c039f5d88..320e180ee 100644 --- a/srslte/lib/fec/src/viterbi39_port.c +++ b/srslte/lib/fec/src/viterbi39_port.c @@ -1,6 +1,6 @@ /* K=9 r=1/3 Viterbi decoder in portable C * Copyright Aug 2006, Phil Karn, KA9Q - * May be used under the terms of the GNU Lesser General Public License (LGPL) + * May be used under the terms of the GNU Affero General Public License (LGPL) */ #include #include diff --git a/srslte/lib/fec/test/CMakeLists.txt b/srslte/lib/fec/test/CMakeLists.txt index 596dca9ee..86b549df6 100644 --- a/srslte/lib/fec/test/CMakeLists.txt +++ b/srslte/lib/fec/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/fec/test/crc_test.c b/srslte/lib/fec/test/crc_test.c index 3f812cf1c..9448df909 100644 --- a/srslte/lib/fec/test/crc_test.c +++ b/srslte/lib/fec/test/crc_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/crc_test.h b/srslte/lib/fec/test/crc_test.h index 1bd8cc357..825f30280 100644 --- a/srslte/lib/fec/test/crc_test.h +++ b/srslte/lib/fec/test/crc_test.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/rm_conv_test.c b/srslte/lib/fec/test/rm_conv_test.c index aac7d7749..417bc3f3c 100644 --- a/srslte/lib/fec/test/rm_conv_test.c +++ b/srslte/lib/fec/test/rm_conv_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/rm_turbo_rx_mex.c b/srslte/lib/fec/test/rm_turbo_rx_mex.c index e7b508ba0..5ad1ca90e 100644 --- a/srslte/lib/fec/test/rm_turbo_rx_mex.c +++ b/srslte/lib/fec/test/rm_turbo_rx_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/rm_turbo_test.c b/srslte/lib/fec/test/rm_turbo_test.c index 8a24ce60e..738d33ed5 100644 --- a/srslte/lib/fec/test/rm_turbo_test.c +++ b/srslte/lib/fec/test/rm_turbo_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/turbodecoder_test.c b/srslte/lib/fec/test/turbodecoder_test.c index fcabcdc45..a482e1e94 100644 --- a/srslte/lib/fec/test/turbodecoder_test.c +++ b/srslte/lib/fec/test/turbodecoder_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/turbodecoder_test.h b/srslte/lib/fec/test/turbodecoder_test.h index 2ac729de9..b9579ccb6 100644 --- a/srslte/lib/fec/test/turbodecoder_test.h +++ b/srslte/lib/fec/test/turbodecoder_test.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/turbodecoder_test_mex.c b/srslte/lib/fec/test/turbodecoder_test_mex.c index ba3a1de19..4e58c8407 100644 --- a/srslte/lib/fec/test/turbodecoder_test_mex.c +++ b/srslte/lib/fec/test/turbodecoder_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/viterbi_test.c b/srslte/lib/fec/test/viterbi_test.c index f2790d76a..10a164474 100644 --- a/srslte/lib/fec/test/viterbi_test.c +++ b/srslte/lib/fec/test/viterbi_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/viterbi_test.h b/srslte/lib/fec/test/viterbi_test.h index 66ead0902..9d22ae24e 100644 --- a/srslte/lib/fec/test/viterbi_test.h +++ b/srslte/lib/fec/test/viterbi_test.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/fec/test/viterbi_test_mex.c b/srslte/lib/fec/test/viterbi_test_mex.c index 874628d30..4ce9542e9 100644 --- a/srslte/lib/fec/test/viterbi_test_mex.c +++ b/srslte/lib/fec/test/viterbi_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/io/src/binsource.c b/srslte/lib/io/src/binsource.c index 9a735abe7..2c9d3e368 100644 --- a/srslte/lib/io/src/binsource.c +++ b/srslte/lib/io/src/binsource.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/io/src/filesink.c b/srslte/lib/io/src/filesink.c index 7bfe73260..ef72f9fc8 100644 --- a/srslte/lib/io/src/filesink.c +++ b/srslte/lib/io/src/filesink.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/io/src/filesource.c b/srslte/lib/io/src/filesource.c index 3f6b095a6..5343fd3e2 100644 --- a/srslte/lib/io/src/filesource.c +++ b/srslte/lib/io/src/filesource.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/io/src/netsink.c b/srslte/lib/io/src/netsink.c index 2e754628e..286eb8974 100644 --- a/srslte/lib/io/src/netsink.c +++ b/srslte/lib/io/src/netsink.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/io/src/netsource.c b/srslte/lib/io/src/netsource.c index 1c016174d..81b1bce12 100644 --- a/srslte/lib/io/src/netsource.c +++ b/srslte/lib/io/src/netsource.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/mimo/src/layermap.c b/srslte/lib/mimo/src/layermap.c index d09d2b44b..c42f3c77e 100644 --- a/srslte/lib/mimo/src/layermap.c +++ b/srslte/lib/mimo/src/layermap.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/mimo/src/precoding.c b/srslte/lib/mimo/src/precoding.c index 554b7ff05..dca29fa6c 100644 --- a/srslte/lib/mimo/src/precoding.c +++ b/srslte/lib/mimo/src/precoding.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/mimo/test/CMakeLists.txt b/srslte/lib/mimo/test/CMakeLists.txt index c67dae8db..4691c9d20 100644 --- a/srslte/lib/mimo/test/CMakeLists.txt +++ b/srslte/lib/mimo/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/mimo/test/layermap_test.c b/srslte/lib/mimo/test/layermap_test.c index 207b63a2c..82204a880 100644 --- a/srslte/lib/mimo/test/layermap_test.c +++ b/srslte/lib/mimo/test/layermap_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/mimo/test/precoding_test.c b/srslte/lib/mimo/test/precoding_test.c index e41871c90..a5a27093f 100644 --- a/srslte/lib/mimo/test/precoding_test.c +++ b/srslte/lib/mimo/test/precoding_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/demod_hard.c b/srslte/lib/modem/src/demod_hard.c index 439e95383..742ec05a1 100644 --- a/srslte/lib/modem/src/demod_hard.c +++ b/srslte/lib/modem/src/demod_hard.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/demod_soft.c b/srslte/lib/modem/src/demod_soft.c index b824aed0f..6be766bc2 100644 --- a/srslte/lib/modem/src/demod_soft.c +++ b/srslte/lib/modem/src/demod_soft.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/hard_demod_lte.c b/srslte/lib/modem/src/hard_demod_lte.c index f1370a2fe..ed6d4617e 100644 --- a/srslte/lib/modem/src/hard_demod_lte.c +++ b/srslte/lib/modem/src/hard_demod_lte.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/hard_demod_lte.h b/srslte/lib/modem/src/hard_demod_lte.h index e60b362ee..65ed5a435 100644 --- a/srslte/lib/modem/src/hard_demod_lte.h +++ b/srslte/lib/modem/src/hard_demod_lte.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/lte_tables.c b/srslte/lib/modem/src/lte_tables.c index 22dd90815..b89f0446c 100644 --- a/srslte/lib/modem/src/lte_tables.c +++ b/srslte/lib/modem/src/lte_tables.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/lte_tables.h b/srslte/lib/modem/src/lte_tables.h index 53ab0ea62..2cf5ac3c4 100644 --- a/srslte/lib/modem/src/lte_tables.h +++ b/srslte/lib/modem/src/lte_tables.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/mod.c b/srslte/lib/modem/src/mod.c index b8dcec8ee..7776dc7ad 100644 --- a/srslte/lib/modem/src/mod.c +++ b/srslte/lib/modem/src/mod.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/modem_table.c b/srslte/lib/modem/src/modem_table.c index 37d53bab0..6761e728a 100644 --- a/srslte/lib/modem/src/modem_table.c +++ b/srslte/lib/modem/src/modem_table.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/soft_algs.c b/srslte/lib/modem/src/soft_algs.c index 9f3c58124..b021d3f2b 100644 --- a/srslte/lib/modem/src/soft_algs.c +++ b/srslte/lib/modem/src/soft_algs.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/src/soft_algs.h b/srslte/lib/modem/src/soft_algs.h index c393a73f3..0d387b425 100644 --- a/srslte/lib/modem/src/soft_algs.h +++ b/srslte/lib/modem/src/soft_algs.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/test/CMakeLists.txt b/srslte/lib/modem/test/CMakeLists.txt index 6bbdd1c6e..b5f39cd30 100644 --- a/srslte/lib/modem/test/CMakeLists.txt +++ b/srslte/lib/modem/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/modem/test/modem_test.c b/srslte/lib/modem/test/modem_test.c index d053d23e6..624fcc93f 100644 --- a/srslte/lib/modem/test/modem_test.c +++ b/srslte/lib/modem/test/modem_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/modem/test/soft_demod_test.c b/srslte/lib/modem/test/soft_demod_test.c index 895878568..a93c53d42 100644 --- a/srslte/lib/modem/test/soft_demod_test.c +++ b/srslte/lib/modem/test/soft_demod_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/cqi.c b/srslte/lib/phch/src/cqi.c index 1d8b4a8a9..3a05fd78b 100644 --- a/srslte/lib/phch/src/cqi.c +++ b/srslte/lib/phch/src/cqi.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/dci.c b/srslte/lib/phch/src/dci.c index 2dd8f0bf6..05740f5b5 100644 --- a/srslte/lib/phch/src/dci.c +++ b/srslte/lib/phch/src/dci.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/pbch.c b/srslte/lib/phch/src/pbch.c index 6587bb2f7..2c7c0180f 100644 --- a/srslte/lib/phch/src/pbch.c +++ b/srslte/lib/phch/src/pbch.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/pcfich.c b/srslte/lib/phch/src/pcfich.c index 6c76179b4..f8e13d5aa 100644 --- a/srslte/lib/phch/src/pcfich.c +++ b/srslte/lib/phch/src/pcfich.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/pdcch.c b/srslte/lib/phch/src/pdcch.c index d693ad790..3bd64b911 100644 --- a/srslte/lib/phch/src/pdcch.c +++ b/srslte/lib/phch/src/pdcch.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/pdsch.c b/srslte/lib/phch/src/pdsch.c index 871ec8911..d8f8a2758 100644 --- a/srslte/lib/phch/src/pdsch.c +++ b/srslte/lib/phch/src/pdsch.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/phich.c b/srslte/lib/phch/src/phich.c index 331c48c76..b753c8b45 100644 --- a/srslte/lib/phch/src/phich.c +++ b/srslte/lib/phch/src/phich.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/prach.c b/srslte/lib/phch/src/prach.c index 8d8875d99..3975f87be 100644 --- a/srslte/lib/phch/src/prach.c +++ b/srslte/lib/phch/src/prach.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/prb_dl.c b/srslte/lib/phch/src/prb_dl.c index 1a71d94a9..b9b84924c 100644 --- a/srslte/lib/phch/src/prb_dl.c +++ b/srslte/lib/phch/src/prb_dl.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/prb_dl.h b/srslte/lib/phch/src/prb_dl.h index 83e8ea81e..5cf88aba1 100644 --- a/srslte/lib/phch/src/prb_dl.h +++ b/srslte/lib/phch/src/prb_dl.h @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/pucch.c b/srslte/lib/phch/src/pucch.c index 722cc14ea..abdfb36be 100644 --- a/srslte/lib/phch/src/pucch.c +++ b/srslte/lib/phch/src/pucch.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/pusch.c b/srslte/lib/phch/src/pusch.c index cedf11d07..e3e51321c 100644 --- a/srslte/lib/phch/src/pusch.c +++ b/srslte/lib/phch/src/pusch.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/ra.c b/srslte/lib/phch/src/ra.c index ffd4614a5..09d215b8c 100644 --- a/srslte/lib/phch/src/ra.c +++ b/srslte/lib/phch/src/ra.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/regs.c b/srslte/lib/phch/src/regs.c index a4b7e7f25..6563a5a51 100644 --- a/srslte/lib/phch/src/regs.c +++ b/srslte/lib/phch/src/regs.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/sch.c b/srslte/lib/phch/src/sch.c index 42e9075d6..195809d4b 100644 --- a/srslte/lib/phch/src/sch.c +++ b/srslte/lib/phch/src/sch.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/sequences.c b/srslte/lib/phch/src/sequences.c index cc6c80694..6bac74144 100644 --- a/srslte/lib/phch/src/sequences.c +++ b/srslte/lib/phch/src/sequences.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/src/uci.c b/srslte/lib/phch/src/uci.c index 8c48a8864..518c70241 100644 --- a/srslte/lib/phch/src/uci.c +++ b/srslte/lib/phch/src/uci.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/CMakeLists.txt b/srslte/lib/phch/test/CMakeLists.txt index 8d13984c3..3dc7f279d 100644 --- a/srslte/lib/phch/test/CMakeLists.txt +++ b/srslte/lib/phch/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/phch/test/dci_unpacking.c b/srslte/lib/phch/test/dci_unpacking.c index 6a1880af3..3c0f4ebc3 100644 --- a/srslte/lib/phch/test/dci_unpacking.c +++ b/srslte/lib/phch/test/dci_unpacking.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/dlsch_encode_test_mex.c b/srslte/lib/phch/test/dlsch_encode_test_mex.c index a0976ebaa..cebfe465e 100644 --- a/srslte/lib/phch/test/dlsch_encode_test_mex.c +++ b/srslte/lib/phch/test/dlsch_encode_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pbch_file_test.c b/srslte/lib/phch/test/pbch_file_test.c index 66333571c..c5c15c8d3 100644 --- a/srslte/lib/phch/test/pbch_file_test.c +++ b/srslte/lib/phch/test/pbch_file_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pbch_test.c b/srslte/lib/phch/test/pbch_test.c index 0a7b12941..2cfd3b3f8 100644 --- a/srslte/lib/phch/test/pbch_test.c +++ b/srslte/lib/phch/test/pbch_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pbch_test_mex.c b/srslte/lib/phch/test/pbch_test_mex.c index 5ec35fe0e..1afad7ecb 100644 --- a/srslte/lib/phch/test/pbch_test_mex.c +++ b/srslte/lib/phch/test/pbch_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pcfich_file_test.c b/srslte/lib/phch/test/pcfich_file_test.c index 981a3e91b..618534ffd 100644 --- a/srslte/lib/phch/test/pcfich_file_test.c +++ b/srslte/lib/phch/test/pcfich_file_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pcfich_test.c b/srslte/lib/phch/test/pcfich_test.c index b8feb8ca8..5bad2805c 100644 --- a/srslte/lib/phch/test/pcfich_test.c +++ b/srslte/lib/phch/test/pcfich_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pcfich_test_mex.c b/srslte/lib/phch/test/pcfich_test_mex.c index 780516df9..76615b378 100644 --- a/srslte/lib/phch/test/pcfich_test_mex.c +++ b/srslte/lib/phch/test/pcfich_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pdcch_file_test.c b/srslte/lib/phch/test/pdcch_file_test.c index fdcb99507..0fe44006a 100644 --- a/srslte/lib/phch/test/pdcch_file_test.c +++ b/srslte/lib/phch/test/pdcch_file_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pdcch_test.c b/srslte/lib/phch/test/pdcch_test.c index 3abc911e8..d7ae0a846 100644 --- a/srslte/lib/phch/test/pdcch_test.c +++ b/srslte/lib/phch/test/pdcch_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pdcch_test_mex.c b/srslte/lib/phch/test/pdcch_test_mex.c index 5e091a6c8..5d62d6546 100644 --- a/srslte/lib/phch/test/pdcch_test_mex.c +++ b/srslte/lib/phch/test/pdcch_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pdsch_file_test.c b/srslte/lib/phch/test/pdsch_file_test.c index 8329f3991..303794a85 100644 --- a/srslte/lib/phch/test/pdsch_file_test.c +++ b/srslte/lib/phch/test/pdsch_file_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pdsch_test.c b/srslte/lib/phch/test/pdsch_test.c index e831b531d..20154c684 100644 --- a/srslte/lib/phch/test/pdsch_test.c +++ b/srslte/lib/phch/test/pdsch_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pdsch_test_mex.c b/srslte/lib/phch/test/pdsch_test_mex.c index 3754b95f9..dffa76b54 100644 --- a/srslte/lib/phch/test/pdsch_test_mex.c +++ b/srslte/lib/phch/test/pdsch_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/phich_file_test.c b/srslte/lib/phch/test/phich_file_test.c index 3479cb686..74867fefa 100644 --- a/srslte/lib/phch/test/phich_file_test.c +++ b/srslte/lib/phch/test/phich_file_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/phich_test.c b/srslte/lib/phch/test/phich_test.c index f9eeb6876..dbde87816 100644 --- a/srslte/lib/phch/test/phich_test.c +++ b/srslte/lib/phch/test/phich_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/prach_test_mex.c b/srslte/lib/phch/test/prach_test_mex.c index fbb986a02..59ba498e4 100644 --- a/srslte/lib/phch/test/prach_test_mex.c +++ b/srslte/lib/phch/test/prach_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pucch_encode_test_mex.c b/srslte/lib/phch/test/pucch_encode_test_mex.c index 98ff3d22e..c9ecb8d0b 100644 --- a/srslte/lib/phch/test/pucch_encode_test_mex.c +++ b/srslte/lib/phch/test/pucch_encode_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pucch_test.c b/srslte/lib/phch/test/pucch_test.c index e05e0d215..fee71d6c6 100644 --- a/srslte/lib/phch/test/pucch_test.c +++ b/srslte/lib/phch/test/pucch_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pusch_encode_test_mex.c b/srslte/lib/phch/test/pusch_encode_test_mex.c index 0f9f96b29..ce17969c6 100644 --- a/srslte/lib/phch/test/pusch_encode_test_mex.c +++ b/srslte/lib/phch/test/pusch_encode_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/pusch_test.c b/srslte/lib/phch/test/pusch_test.c index 01e536969..628b18290 100644 --- a/srslte/lib/phch/test/pusch_test.c +++ b/srslte/lib/phch/test/pusch_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/phch/test/ulsch_encode_test_mex.c b/srslte/lib/phch/test/ulsch_encode_test_mex.c index e8ed5eb9e..627b9cf86 100644 --- a/srslte/lib/phch/test/ulsch_encode_test_mex.c +++ b/srslte/lib/phch/test/ulsch_encode_test_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/resampling/src/decim.c b/srslte/lib/resampling/src/decim.c index 21387487a..74b7fb013 100644 --- a/srslte/lib/resampling/src/decim.c +++ b/srslte/lib/resampling/src/decim.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/resampling/src/interp.c b/srslte/lib/resampling/src/interp.c index 00e560c74..eeadafa55 100644 --- a/srslte/lib/resampling/src/interp.c +++ b/srslte/lib/resampling/src/interp.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/resampling/src/resample_arb.c b/srslte/lib/resampling/src/resample_arb.c index 829171ce4..3c9e1035e 100644 --- a/srslte/lib/resampling/src/resample_arb.c +++ b/srslte/lib/resampling/src/resample_arb.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/resampling/test/CMakeLists.txt b/srslte/lib/resampling/test/CMakeLists.txt index 99e7a64ae..2d4d6b289 100644 --- a/srslte/lib/resampling/test/CMakeLists.txt +++ b/srslte/lib/resampling/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/scrambling/src/scrambling.c b/srslte/lib/scrambling/src/scrambling.c index a4cf87a5b..a995268e3 100644 --- a/srslte/lib/scrambling/src/scrambling.c +++ b/srslte/lib/scrambling/src/scrambling.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/scrambling/test/CMakeLists.txt b/srslte/lib/scrambling/test/CMakeLists.txt index 8c55cfb6b..9e23bc10c 100644 --- a/srslte/lib/scrambling/test/CMakeLists.txt +++ b/srslte/lib/scrambling/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/scrambling/test/scrambling_test.c b/srslte/lib/scrambling/test/scrambling_test.c index 32dedb6b1..15ba36316 100644 --- a/srslte/lib/scrambling/test/scrambling_test.c +++ b/srslte/lib/scrambling/test/scrambling_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/cfo.c b/srslte/lib/sync/src/cfo.c index 36c3f328b..6121e15b6 100644 --- a/srslte/lib/sync/src/cfo.c +++ b/srslte/lib/sync/src/cfo.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/cp.c b/srslte/lib/sync/src/cp.c index 5ae341f77..b11199b25 100644 --- a/srslte/lib/sync/src/cp.c +++ b/srslte/lib/sync/src/cp.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/find_sss.c b/srslte/lib/sync/src/find_sss.c index 2e69fd3be..6fe27aad2 100644 --- a/srslte/lib/sync/src/find_sss.c +++ b/srslte/lib/sync/src/find_sss.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/gen_sss.c b/srslte/lib/sync/src/gen_sss.c index 9fed03bfd..71cecfe76 100644 --- a/srslte/lib/sync/src/gen_sss.c +++ b/srslte/lib/sync/src/gen_sss.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/pss.c b/srslte/lib/sync/src/pss.c index e5a1f1518..f24d933b7 100644 --- a/srslte/lib/sync/src/pss.c +++ b/srslte/lib/sync/src/pss.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/sfo.c b/srslte/lib/sync/src/sfo.c index a5da7da57..9b2ac765c 100644 --- a/srslte/lib/sync/src/sfo.c +++ b/srslte/lib/sync/src/sfo.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/sss.c b/srslte/lib/sync/src/sss.c index 96725bb34..14c833fa3 100644 --- a/srslte/lib/sync/src/sss.c +++ b/srslte/lib/sync/src/sss.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/src/sync.c b/srslte/lib/sync/src/sync.c index f96a6b6e3..9aca3bb8d 100644 --- a/srslte/lib/sync/src/sync.c +++ b/srslte/lib/sync/src/sync.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/test/CMakeLists.txt b/srslte/lib/sync/test/CMakeLists.txt index be6fb4bd1..36efa2299 100644 --- a/srslte/lib/sync/test/CMakeLists.txt +++ b/srslte/lib/sync/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # diff --git a/srslte/lib/sync/test/cfo_test.c b/srslte/lib/sync/test/cfo_test.c index 9189b8b37..257af0902 100644 --- a/srslte/lib/sync/test/cfo_test.c +++ b/srslte/lib/sync/test/cfo_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/test/pss_file.c b/srslte/lib/sync/test/pss_file.c index 75b0497bc..c7f6ce857 100644 --- a/srslte/lib/sync/test/pss_file.c +++ b/srslte/lib/sync/test/pss_file.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/test/pss_mex.c b/srslte/lib/sync/test/pss_mex.c index 17cec73e4..192e6a774 100644 --- a/srslte/lib/sync/test/pss_mex.c +++ b/srslte/lib/sync/test/pss_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/test/pss_usrp.c b/srslte/lib/sync/test/pss_usrp.c index d88a2f127..ee7504996 100644 --- a/srslte/lib/sync/test/pss_usrp.c +++ b/srslte/lib/sync/test/pss_usrp.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/test/sss_mex.c b/srslte/lib/sync/test/sss_mex.c index da8291adf..bbc7c5852 100644 --- a/srslte/lib/sync/test/sss_mex.c +++ b/srslte/lib/sync/test/sss_mex.c @@ -2,24 +2,24 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The libLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * - * This file is part of the libLTE library. + * This file is part of the srsLTE library. * - * libLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * - * libLTE is distributed in the hope that it will be useful, + * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/sync/test/sync_test.c b/srslte/lib/sync/test/sync_test.c index aab6699b2..88765eced 100644 --- a/srslte/lib/sync/test/sync_test.c +++ b/srslte/lib/sync/test/sync_test.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ue/src/ue_cell_search.c b/srslte/lib/ue/src/ue_cell_search.c index c73c9b989..6246f6ea8 100644 --- a/srslte/lib/ue/src/ue_cell_search.c +++ b/srslte/lib/ue/src/ue_cell_search.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ue/src/ue_dl.c b/srslte/lib/ue/src/ue_dl.c index 8d5e3e7bf..c77d6b587 100644 --- a/srslte/lib/ue/src/ue_dl.c +++ b/srslte/lib/ue/src/ue_dl.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ue/src/ue_mib.c b/srslte/lib/ue/src/ue_mib.c index 9dbe49cbd..69e42cf92 100644 --- a/srslte/lib/ue/src/ue_mib.c +++ b/srslte/lib/ue/src/ue_mib.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ue/src/ue_sync.c b/srslte/lib/ue/src/ue_sync.c index 4c10e51f0..784d0611b 100644 --- a/srslte/lib/ue/src/ue_sync.c +++ b/srslte/lib/ue/src/ue_sync.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/ue/src/ue_ul.c b/srslte/lib/ue/src/ue_ul.c index 466b1ab91..849e93270 100644 --- a/srslte/lib/ue/src/ue_ul.c +++ b/srslte/lib/ue/src/ue_ul.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/utils/src/bit.c b/srslte/lib/utils/src/bit.c index daa85d740..1884dd2d6 100644 --- a/srslte/lib/utils/src/bit.c +++ b/srslte/lib/utils/src/bit.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/utils/src/cexptab.c b/srslte/lib/utils/src/cexptab.c index 83cbfea77..597cd4123 100644 --- a/srslte/lib/utils/src/cexptab.c +++ b/srslte/lib/utils/src/cexptab.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/utils/src/convolution.c b/srslte/lib/utils/src/convolution.c index fb47066e8..df2e183c5 100644 --- a/srslte/lib/utils/src/convolution.c +++ b/srslte/lib/utils/src/convolution.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/utils/src/debug.c b/srslte/lib/utils/src/debug.c index 5d2b1be3d..f278d7511 100644 --- a/srslte/lib/utils/src/debug.c +++ b/srslte/lib/utils/src/debug.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/utils/src/vector.c b/srslte/lib/utils/src/vector.c index e289b5003..e7f2478a4 100644 --- a/srslte/lib/utils/src/vector.c +++ b/srslte/lib/utils/src/vector.c @@ -2,7 +2,7 @@ * * \section COPYRIGHT * - * Copyright 2013-2014 The srsLTE Developers. See the + * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE @@ -10,16 +10,16 @@ * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * GNU Affero General Public License for more details. * - * A copy of the GNU Lesser General Public License can be found in + * A copy of the GNU Affero General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * diff --git a/srslte/lib/utils/test/CMakeLists.txt b/srslte/lib/utils/test/CMakeLists.txt index e72465623..657c2343b 100644 --- a/srslte/lib/utils/test/CMakeLists.txt +++ b/srslte/lib/utils/test/CMakeLists.txt @@ -1,20 +1,20 @@ # -# Copyright 2012-2013 The srsLTE Developers. See the +# Copyright 2013-2015 The srsLTE Developers. See the # COPYRIGHT file at the top-level directory of this distribution. # # This file is part of the srsLTE library. # # srsLTE is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as +# it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # srsLTE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. +# GNU Affero General Public License for more details. # -# A copy of the GNU Lesser General Public License can be found in +# A copy of the GNU Affero General Public License can be found in # the LICENSE file in the top-level directory of this distribution # and at http://www.gnu.org/licenses/. # From 881a90d62c17992d7d4020dca8212a96b7ee5e6d Mon Sep 17 00:00:00 2001 From: ismagom Date: Fri, 8 May 2015 17:59:22 +0200 Subject: [PATCH 07/19] Enabled mac_test (link with openlte library). Added license to srsapps --- CMakeLists.txt | 2 +- cmake/modules/FindopenLTE.cmake | 52 +++++++++++++++ srsapps/CMakeLists.txt | 2 + .../common/include/srsapps/common/binsem.h | 27 ++++++++ .../common/include/srsapps/common/config.h | 64 +++++++++++++++++++ srsapps/common/include/srsapps/common/log.h | 1 + .../include/srsapps/common/log_stdout.h | 1 + .../common/include/srsapps/common/params_db.h | 6 +- srsapps/common/include/srsapps/common/qbuff.h | 31 ++++++++- srsapps/common/include/srsapps/common/queue.h | 6 +- .../common/include/srsapps/common/timers.h | 35 ++++++++-- .../common/include/srsapps/common/tti_sync.h | 9 ++- .../include/srsapps/common/tti_sync_cv.h | 8 ++- srsapps/common/src/qbuff.cc | 28 ++++++++ .../radio/include/srsapps/radio/radio_uhd.h | 6 +- srsapps/ue/mac/CMakeLists.txt | 1 + srsapps/ue/mac/include/srsapps/ue/mac/demux.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/dl_harq.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/dl_sps.h | 28 ++++++++ srsapps/ue/mac/include/srsapps/ue/mac/mac.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/mac_io.h | 28 ++++++++ .../mac/include/srsapps/ue/mac/mac_params.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/mac_pdu.h | 28 ++++++++ srsapps/ue/mac/include/srsapps/ue/mac/mux.h | 28 ++++++++ srsapps/ue/mac/include/srsapps/ue/mac/proc.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/proc_bsr.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/proc_phr.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/proc_ra.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/proc_sr.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/ul_harq.h | 28 ++++++++ .../ue/mac/include/srsapps/ue/mac/ul_sps.h | 28 ++++++++ srsapps/ue/mac/src/demux.cc | 27 ++++++++ srsapps/ue/mac/src/dl_harq.cc | 27 ++++++++ srsapps/ue/mac/src/dl_sps.cc | 27 ++++++++ srsapps/ue/mac/src/mac_pdu.cc | 27 ++++++++ srsapps/ue/mac/src/mux.cc | 27 ++++++++ srsapps/ue/mac/src/proc_ra.cc | 27 ++++++++ srsapps/ue/mac/src/ul_harq.cc | 27 ++++++++ srsapps/ue/mac/test/CMakeLists.txt | 28 ++++++++ srsapps/ue/mac/test/mac_test.cc | 27 ++++++++ .../ue/phy/include/srsapps/ue/phy/dl_buffer.h | 6 +- .../include/srsapps/ue/phy/dl_sched_grant.h | 7 +- srsapps/ue/phy/include/srsapps/ue/phy/phy.h | 5 +- .../phy/include/srsapps/ue/phy/phy_params.h | 4 +- srsapps/ue/phy/include/srsapps/ue/phy/prach.h | 6 +- .../phy/include/srsapps/ue/phy/sched_grant.h | 6 +- .../ue/phy/include/srsapps/ue/phy/ul_buffer.h | 3 +- .../include/srsapps/ue/phy/ul_sched_grant.h | 3 +- 48 files changed, 952 insertions(+), 31 deletions(-) create mode 100644 cmake/modules/FindopenLTE.cmake create mode 100644 srsapps/common/include/srsapps/common/config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 168eca793..27cc90b66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,7 @@ macro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG(${flag} ${have}) if(${have}) - add_definitions(${flag}) + add_definitions(${flag}) endif(${have}) endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE) diff --git a/cmake/modules/FindopenLTE.cmake b/cmake/modules/FindopenLTE.cmake new file mode 100644 index 000000000..e48758940 --- /dev/null +++ b/cmake/modules/FindopenLTE.cmake @@ -0,0 +1,52 @@ +# - Try to find openLTE's liblte + +find_package(PkgConfig) +pkg_check_modules(PC_OPENLTE QUIET srslte) +set(OPENLTE_DEFINITIONS ${PC_OPENLTE_CFLAGS_OTHER}) + +FIND_PATH( + OPENLTE_LIBLTE_DIRS + NAMES liblte_common.h typedefs.h + HINTS ${PC_OPENLTE_SRCDIR}/liblte/hdr + ${PC_OPENLTE_INCLUDEDIR} + ${PC_OPENLTE_INCLUDE_DIRS} + $ENV{OPENLTE_DIR}/liblte/hdr + PATHS /usr/local/include + /usr/include +) + +FIND_PATH( + OPENLTE_COMMON_DIRS + NAMES typedefs.h + HINTS ${PC_OPENLTE_SRCDIR}/cmn_hdr + ${PC_OPENLTE_INCLUDEDIR} + ${PC_OPENLTE_INCLUDE_DIRS} + $ENV{OPENLTE_DIR}/liblte/hdr + PATHS /usr/local/include + /usr/include +) + +FIND_LIBRARY( + OPENLTE_LIBRARIES + NAMES lte + HINTS ${PC_OPENLTE_BUILDDIR}/liblte + ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + $ENV{OPENLTE_DIR}/lib + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) + +IF(OPENLTE_LIBLTE_DIRS AND OPENLTE_COMMON_DIRS) + SET(OPENLTE_INCLUDE_DIRS ${OPENLTE_LIBLTE_DIRS} ${OPENLTE_COMMON_DIRS}) +ENDIF(OPENLTE_LIBLTE_DIRS AND OPENLTE_COMMON_DIRS) + +message(STATUS "OPENLTE LIBRARIES " ${OPENLTE_LIBRARIES}) +message(STATUS "OPENLTE INCLUDE DIRS " ${OPENLTE_INCLUDE_DIRS}) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENLTE DEFAULT_MSG OPENLTE_LIBRARIES OPENLTE_INCLUDE_DIRS) +MARK_AS_ADVANCED(OPENLTE_LIBRARIES OPENLTE_INCLUDE_DIRS) + diff --git a/srsapps/CMakeLists.txt b/srsapps/CMakeLists.txt index b45914ec2..02f0cd2b2 100644 --- a/srsapps/CMakeLists.txt +++ b/srsapps/CMakeLists.txt @@ -23,6 +23,8 @@ # Install headers ######################################################################## +remove_definitions(-fvisibility=hidden) + INCLUDE_DIRECTORIES(radio/include/) INCLUDE_DIRECTORIES(common/include/) diff --git a/srsapps/common/include/srsapps/common/binsem.h b/srsapps/common/include/srsapps/common/binsem.h index e116c7ef0..5a8cad53c 100644 --- a/srsapps/common/include/srsapps/common/binsem.h +++ b/srsapps/common/include/srsapps/common/binsem.h @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include diff --git a/srsapps/common/include/srsapps/common/config.h b/srsapps/common/include/srsapps/common/config.h new file mode 100644 index 000000000..defb66c37 --- /dev/null +++ b/srsapps/common/include/srsapps/common/config.h @@ -0,0 +1,64 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#ifndef CONFIG_H +#define CONFIG_H + +// Generic helper definitions for shared library support +#if defined _WIN32 || defined __CYGWIN__ + #define SRSAPPS_IMPORT __declspec(dllimport) + #define SRSAPPS_EXPORT __declspec(dllexport) + #define SRSAPPS_LOCAL +#else + #if __GNUC__ >= 4 + #define SRSAPPS_IMPORT __attribute__ ((visibility ("default"))) + #define SRSAPPS_EXPORT __attribute__ ((visibility ("default"))) + #else + #define SRSAPPS_IMPORT + #define SRSAPPS_EXPORT + #define SRSAPPS_LOCAL + #endif +#endif + +// Define SRSAPPS_API +// is used for the public API symbols. +#ifdef SRSAPPS_DLL_EXPORTS // defined if we are building the SRSAPPS DLL (instead of using it) + #define SRSAPPS_EXPORT +#else + #define SRSAPPS_IMPORT +#endif + + +// Common error codes +#define SRSAPPS_SUCCESS 0 +#define SRSAPPS_ERROR -1 +#define SRSAPPS_ERROR_INVALID_INPUTS -2 + +// cf_t definition +typedef _Complex float cf_t; + +#endif // CONFIG_H diff --git a/srsapps/common/include/srsapps/common/log.h b/srsapps/common/include/srsapps/common/log.h index ad3432185..5dc22566a 100644 --- a/srsapps/common/include/srsapps/common/log.h +++ b/srsapps/common/include/srsapps/common/log.h @@ -25,6 +25,7 @@ * */ + #include #include diff --git a/srsapps/common/include/srsapps/common/log_stdout.h b/srsapps/common/include/srsapps/common/log_stdout.h index 2dda1717b..23c38ab30 100644 --- a/srsapps/common/include/srsapps/common/log_stdout.h +++ b/srsapps/common/include/srsapps/common/log_stdout.h @@ -29,6 +29,7 @@ #include #include + #include "srsapps/common/log.h" /****************************************************************************** diff --git a/srsapps/common/include/srsapps/common/params_db.h b/srsapps/common/include/srsapps/common/params_db.h index b2c9ec020..bfeadff18 100644 --- a/srsapps/common/include/srsapps/common/params_db.h +++ b/srsapps/common/include/srsapps/common/params_db.h @@ -24,16 +24,18 @@ * and at http://www.gnu.org/licenses/. * */ + + #include -#include "srslte/config.h" + #ifndef PARAMS_H #define PARAMS_H namespace srslte { namespace ue { - class SRSLTE_API params_db + class params_db { public: params_db(uint32_t nof_params_) { diff --git a/srsapps/common/include/srsapps/common/qbuff.h b/srsapps/common/include/srsapps/common/qbuff.h index fb885b525..4c04f911f 100644 --- a/srsapps/common/include/srsapps/common/qbuff.h +++ b/srsapps/common/include/srsapps/common/qbuff.h @@ -1,6 +1,33 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include -#include "srslte/config.h" + #ifndef QBUFF_H #define QBUFF_H @@ -26,7 +53,7 @@ namespace srslte { - class SRSLTE_API qbuff + class qbuff { public: qbuff(); diff --git a/srsapps/common/include/srsapps/common/queue.h b/srsapps/common/include/srsapps/common/queue.h index 5f81bf2eb..4d7889ea6 100644 --- a/srsapps/common/include/srsapps/common/queue.h +++ b/srsapps/common/include/srsapps/common/queue.h @@ -25,6 +25,8 @@ * */ + + #include /****************************************************************************** * File: queue.h @@ -34,7 +36,7 @@ * Reference: *****************************************************************************/ -#include "srslte/config.h" + #ifndef QUEUE_H #define QUEUE_H @@ -42,7 +44,7 @@ namespace srslte { namespace ue { -class SRSLTE_API queue +class queue { public: diff --git a/srsapps/common/include/srsapps/common/timers.h b/srsapps/common/include/srsapps/common/timers.h index cbb28e8f0..eed55c90d 100644 --- a/srsapps/common/include/srsapps/common/timers.h +++ b/srsapps/common/include/srsapps/common/timers.h @@ -1,22 +1,49 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include -#include "srslte/config.h" + #ifndef TIMERS_H #define TIMERS_H namespace srslte { -class SRSLTE_API timer_callback +class timer_callback { public: virtual void timer_expired(uint32_t timer_id) = 0; }; -class SRSLTE_API timers +class timers { public: - class SRSLTE_API timer + class timer { public: timer() { counter = 0; timeout = 0; running = false; }; diff --git a/srsapps/common/include/srsapps/common/tti_sync.h b/srsapps/common/include/srsapps/common/tti_sync.h index 421d23836..52cc8501f 100644 --- a/srsapps/common/include/srsapps/common/tti_sync.h +++ b/srsapps/common/include/srsapps/common/tti_sync.h @@ -1,4 +1,4 @@ - /** +/** * * \section COPYRIGHT * @@ -25,8 +25,11 @@ * */ + + + #include -#include "srslte/config.h" + #ifndef TTISYNC_H #define TTISYNC_H @@ -39,7 +42,7 @@ namespace ue { * The consumer waits while its counter is lower than the producer counter. * The PHY is the consumer. The MAC is the producer. */ -class SRSLTE_API tti_sync +class tti_sync { public: tti_sync(uint32_t modulus_) diff --git a/srsapps/common/include/srsapps/common/tti_sync_cv.h b/srsapps/common/include/srsapps/common/tti_sync_cv.h index b08a263bd..35b020974 100644 --- a/srsapps/common/include/srsapps/common/tti_sync_cv.h +++ b/srsapps/common/include/srsapps/common/tti_sync_cv.h @@ -1,4 +1,4 @@ - /** +/** * * \section COPYRIGHT * @@ -25,9 +25,11 @@ * */ + + #include #include "srsapps/common/tti_sync.h" -#include "srslte/config.h" + #ifndef TTISYNC_CV_H #define TTISYNC_CV_H @@ -39,7 +41,7 @@ namespace ue { /* Implements tti_sync interface with condition variables. */ -class SRSLTE_API tti_sync_cv : public tti_sync +class tti_sync_cv : public tti_sync { public: tti_sync_cv(uint32_t modulus); diff --git a/srsapps/common/src/qbuff.cc b/srsapps/common/src/qbuff.cc index abdd811d2..cb9916b2a 100644 --- a/srsapps/common/src/qbuff.cc +++ b/srsapps/common/src/qbuff.cc @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include #include #include diff --git a/srsapps/radio/include/srsapps/radio/radio_uhd.h b/srsapps/radio/include/srsapps/radio/radio_uhd.h index 7cf7c72fe..490200722 100644 --- a/srsapps/radio/include/srsapps/radio/radio_uhd.h +++ b/srsapps/radio/include/srsapps/radio/radio_uhd.h @@ -1,4 +1,4 @@ - /** +/** * * \section COPYRIGHT * @@ -25,6 +25,8 @@ * */ + + #include "srslte/srslte.h" #include "srslte/common/radio.h" #include "srslte/cuhd/cuhd.h" @@ -37,7 +39,7 @@ namespace srslte { /* Interface to the RF frontend. */ - class SRSLTE_API radio_uhd : public radio + class radio_uhd : public radio { public: bool init(); diff --git a/srsapps/ue/mac/CMakeLists.txt b/srsapps/ue/mac/CMakeLists.txt index 8ece6f709..525b13f91 100644 --- a/srsapps/ue/mac/CMakeLists.txt +++ b/srsapps/ue/mac/CMakeLists.txt @@ -33,3 +33,4 @@ SRSLTE_SET_PIC(srsapps_ue_mac) FILE(GLOB HEADERS_ALL "include/srsapps/ue/mac/*.h") ADD_CUSTOM_TARGET (add_ue_mac_headers SOURCES ${HEADERS_ALL}) +ADD_SUBDIRECTORY(test) diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h index af386555f..824803b67 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include "srsapps/ue/phy/phy.h" #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h index f1aab3755..befa2c1ff 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h b/srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h index 4bbfeb0d4..c2e2d3c3a 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/dl_sps.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h index 6b77fdc29..d591a7020 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h index b2e98f92f..6b6cab6ea 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_io.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include #include "srsapps/common/qbuff.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h index d640fdf17..aed3c23d3 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include "srslte/srslte.h" #include "srsapps/common/params_db.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h index 1e5bf219c..58bfb65e6 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h index f976709aa..d35748749 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc.h index 60189d57b..6f32b8913 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h index bf96b7174..309a173cc 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h index e44fcf61c..b05f37ceb 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_phr.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h index 19c3c3025..25f7c3cb8 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h index bdc191786..d2cc3283b 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h index 616d04fc6..e4a2b83ff 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include "srsapps/ue/phy/phy.h" diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h b/srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h index 944847a53..a5e707f45 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/ul_sps.h @@ -1,3 +1,31 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/src/demux.cc b/srsapps/ue/mac/src/demux.cc index dcacd440a..898cb47e3 100644 --- a/srsapps/ue/mac/src/demux.cc +++ b/srsapps/ue/mac/src/demux.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include "srsapps/ue/mac/mac.h" #include "srsapps/ue/mac/demux.h" diff --git a/srsapps/ue/mac/src/dl_harq.cc b/srsapps/ue/mac/src/dl_harq.cc index 819e0d35e..3937e59bf 100644 --- a/srsapps/ue/mac/src/dl_harq.cc +++ b/srsapps/ue/mac/src/dl_harq.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include "srsapps/ue/phy/phy.h" #include "srsapps/ue/phy/dl_sched_grant.h" diff --git a/srsapps/ue/mac/src/dl_sps.cc b/srsapps/ue/mac/src/dl_sps.cc index 9073c37aa..b3356336e 100644 --- a/srsapps/ue/mac/src/dl_sps.cc +++ b/srsapps/ue/mac/src/dl_sps.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include "srsapps/ue/mac/dl_sps.h" namespace srslte { diff --git a/srsapps/ue/mac/src/mac_pdu.cc b/srsapps/ue/mac/src/mac_pdu.cc index 3cfe629da..af92e2dd6 100644 --- a/srsapps/ue/mac/src/mac_pdu.cc +++ b/srsapps/ue/mac/src/mac_pdu.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include "srsapps/ue/mac/mac_pdu.h" namespace srslte { diff --git a/srsapps/ue/mac/src/mux.cc b/srsapps/ue/mac/src/mux.cc index 1fb98c3af..5e85b6caf 100644 --- a/srsapps/ue/mac/src/mux.cc +++ b/srsapps/ue/mac/src/mux.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include "srsapps/ue/mac/mux.h" #include "srsapps/ue/mac/mac.h" diff --git a/srsapps/ue/mac/src/proc_ra.cc b/srsapps/ue/mac/src/proc_ra.cc index e8d01de36..0fa6c4e8f 100644 --- a/srsapps/ue/mac/src/proc_ra.cc +++ b/srsapps/ue/mac/src/proc_ra.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include #include diff --git a/srsapps/ue/mac/src/ul_harq.cc b/srsapps/ue/mac/src/ul_harq.cc index 4cb5228c6..8c6fd431f 100644 --- a/srsapps/ue/mac/src/ul_harq.cc +++ b/srsapps/ue/mac/src/ul_harq.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include "srsapps/ue/phy/phy.h" #include "srsapps/common/log.h" diff --git a/srsapps/ue/mac/test/CMakeLists.txt b/srsapps/ue/mac/test/CMakeLists.txt index e69de29bb..412c8f966 100644 --- a/srsapps/ue/mac/test/CMakeLists.txt +++ b/srsapps/ue/mac/test/CMakeLists.txt @@ -0,0 +1,28 @@ +# +# Copyright 2013-2015 The srsLTE Developers. See the +# COPYRIGHT file at the top-level directory of this distribution. +# +# This file is part of the srsLTE library. +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +FIND_PACKAGE(openLTE) + +IF(UHD_FOUND AND OPENLTE_FOUND) + INCLUDE_DIRECTORIES(${OPENLTE_INCLUDE_DIRS}) + ADD_EXECUTABLE(mac_test mac_test.cc) + TARGET_LINK_LIBRARIES(mac_test srsapps_ue_mac srsapps_ue_phy srsapps_common srsapps_radio srslte ${OPENLTE_LIBRARIES}) +ENDIF(UHD_FOUND AND OPENLTE_FOUND) diff --git a/srsapps/ue/mac/test/mac_test.cc b/srsapps/ue/mac/test/mac_test.cc index 84a7315fd..b8a8d812f 100644 --- a/srsapps/ue/mac/test/mac_test.cc +++ b/srsapps/ue/mac/test/mac_test.cc @@ -1,3 +1,30 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + #include diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h index 54155af96..228777cc4 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h @@ -1,4 +1,4 @@ - /** +/** * * \section COPYRIGHT * @@ -25,6 +25,8 @@ * */ + + #include "srslte/srslte.h" #include "srsapps/common/queue.h" #include "srsapps/ue/phy/ul_sched_grant.h" @@ -40,7 +42,7 @@ namespace ue { /* Class for the processing of Downlink buffers. The MAC obtains a buffer for a given TTI and then * gets ul/dl scheduling grants and/or processes phich/pdsch channels */ - class SRSLTE_API dl_buffer : public queue::element { + class dl_buffer : public queue::element { public: int buffer_id; diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h index af2af87d7..72f1e6b64 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/dl_sched_grant.h @@ -1,4 +1,4 @@ - /** +/** * * \section COPYRIGHT * @@ -24,6 +24,9 @@ * and at http://www.gnu.org/licenses/. * */ + + + #include #include "srslte/srslte.h" @@ -36,7 +39,7 @@ namespace srslte { namespace ue { /* Uplink/Downlink scheduling grant generated by a successfully decoded PDCCH */ - class SRSLTE_API dl_sched_grant : public sched_grant { + class dl_sched_grant : public sched_grant { public: dl_sched_grant(rnti_type_t type, uint16_t rnti) : sched_grant(type, rnti) {} diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h index 8085193fb..6840a186a 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h @@ -25,6 +25,9 @@ * */ + + + #include "srslte/srslte.h" #include "srsapps/common/tti_sync.h" #include "srsapps/ue/phy/dl_buffer.h" @@ -56,7 +59,7 @@ namespace ue { typedef _Complex float cf_t; -class SRSLTE_API phy +class phy { public: phy() { diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h index 2d2af146b..05cdcbfb4 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h @@ -25,6 +25,8 @@ * */ + + #include "srslte/srslte.h" #include "srsapps/common/params_db.h" @@ -35,7 +37,7 @@ namespace srslte { namespace ue { - class SRSLTE_API phy_params : public params_db + class phy_params : public params_db { public: diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/prach.h b/srsapps/ue/phy/include/srsapps/ue/phy/prach.h index 40a09bb8f..0e5d02a9c 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/prach.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/prach.h @@ -1,4 +1,4 @@ - /** +/** * * \section COPYRIGHT * @@ -25,6 +25,8 @@ * */ + + #include "srslte/srslte.h" #include "srslte/common/radio.h" #include "srsapps/common/queue.h" @@ -36,7 +38,7 @@ namespace srslte { namespace ue { - class SRSLTE_API prach { + class prach { public: prach() { params_db = NULL; diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h index e40e72f0a..85e2c047b 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/sched_grant.h @@ -1,4 +1,4 @@ - /** +/** * * \section COPYRIGHT * @@ -25,6 +25,8 @@ * */ + + #include "srslte/srslte.h" #include "srsapps/common/queue.h" @@ -35,7 +37,7 @@ namespace srslte { namespace ue { /* Uplink/Downlink scheduling grant generated by a successfully decoded PDCCH */ - class SRSLTE_API sched_grant { + class sched_grant { public: typedef enum { RNTI_TYPE_NOTDEFINED = 0, diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h b/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h index 89812d248..bc6c14381 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/ul_buffer.h @@ -25,6 +25,7 @@ * */ + #include "srslte/srslte.h" #include "srslte/common/radio.h" #include "srsapps/common/queue.h" @@ -42,7 +43,7 @@ namespace ue { /* Uplink scheduling assignment. The MAC instructs the PHY to prepare an UL packet (PUSCH or PUCCH) * for transmission. The MAC must call generate_data() to set the packet ready for transmission */ - class SRSLTE_API ul_buffer : public queue::element { + class ul_buffer : public queue::element { public: bool init_cell(srslte_cell_t cell, phy_params *params_db); diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h b/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h index 346d7a4c4..62ad34166 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/ul_sched_grant.h @@ -26,6 +26,7 @@ */ #include + #include "srslte/srslte.h" #include "srsapps/ue/phy/sched_grant.h" @@ -36,7 +37,7 @@ namespace srslte { namespace ue { /* Uplink/Downlink scheduling grant generated by a successfully decoded PDCCH */ - class SRSLTE_API ul_sched_grant : public sched_grant { + class ul_sched_grant : public sched_grant { public: ul_sched_grant(rnti_type_t type, uint16_t rnti) : sched_grant(type, rnti) {} From 68d193a725241df755370308faa9c8315346a6c3 Mon Sep 17 00:00:00 2001 From: ismagom Date: Wed, 13 May 2015 11:44:01 +0200 Subject: [PATCH 08/19] Working on mac_test --- matlab/sync/cfo_estimate_cp.m | 26 +- matlab/sync/cfo_test.m | 28 +- matlab/sync/compute_m0.m | 55 -- matlab/sync/compute_m1.m | 49 -- matlab/sync/convfft.m | 57 -- .../sync/find_coarse_time_and_freq_offset.m | 82 --- matlab/sync/find_pss.m | 31 +- matlab/tests/prach_test.m | 16 +- .../common/include/srsapps/common/tti_sync.h | 1 + .../include/srsapps/common/tti_sync_cv.h | 1 + srsapps/common/src/tti_sync_cv.cc | 5 + srsapps/ue/mac/include/srsapps/ue/mac/demux.h | 10 +- .../ue/mac/include/srsapps/ue/mac/dl_harq.h | 2 +- .../ue/mac/include/srsapps/ue/mac/mac_pdu.h | 165 ----- srsapps/ue/mac/include/srsapps/ue/mac/mux.h | 10 +- srsapps/ue/mac/include/srsapps/ue/mac/pdu.h | 285 ++++++++ .../ue/mac/include/srsapps/ue/mac/proc_ra.h | 15 +- .../ue/mac/include/srsapps/ue/mac/ul_harq.h | 12 +- srsapps/ue/mac/src/demux.cc | 37 +- srsapps/ue/mac/src/dl_harq.cc | 9 +- srsapps/ue/mac/src/mac.cc | 49 +- srsapps/ue/mac/src/mac_pdu.cc | 214 ------ srsapps/ue/mac/src/mux.cc | 31 +- srsapps/ue/mac/src/pdu.cc | 497 ++++++++++++++ srsapps/ue/mac/src/proc_ra.cc | 96 ++- srsapps/ue/mac/src/ul_harq.cc | 48 +- srsapps/ue/mac/test/CMakeLists.txt | 2 +- srsapps/ue/mac/test/mac_test.cc | 14 +- .../ue/phy/include/srsapps/ue/phy/dl_buffer.h | 4 +- srsapps/ue/phy/src/dl_buffer.cc | 37 +- srsapps/ue/phy/src/phy.cc | 14 +- srsapps/ue/phy/src/prach.cc | 25 +- srsapps/ue/phy/src/ul_buffer.cc | 45 +- srsapps/ue/phy/test/CMakeLists.txt | 4 +- srsapps/ue/phy/test/ue_itf_test_prach.cc | 26 +- srslte/examples/CMakeLists.txt | 15 +- srslte/examples/prach_ue.c | 9 +- .../examples/tutorial_examples/CMakeLists.txt | 7 +- srslte/examples/tutorial_examples/ue_rx.c | 629 ------------------ srslte/include/srslte/phch/dci.h | 3 + srslte/lib/CMakeLists.txt | 16 +- srslte/lib/phch/src/dci.c | 15 +- srslte/lib/phch/src/pdcch.c | 14 +- srslte/lib/phch/src/prach.c | 9 +- srslte/lib/phch/src/pusch.c | 1 - srslte/lib/phch/src/regs.c | 4 +- srslte/lib/phch/src/sch.c | 5 +- srslte/lib/phch/test/prach_test_mex.c | 3 +- srslte/lib/sync/src/sync.c | 10 +- srslte/lib/sync/test/CMakeLists.txt | 2 +- srslte/lib/ue/src/ue_cell_search.c | 2 +- srslte/lib/ue/src/ue_dl.c | 4 +- srslte/lib/ue/src/ue_mib.c | 4 +- srslte/lib/ue/src/ue_sync.c | 18 +- srslte/lib/ue/src/ue_ul.c | 2 - 55 files changed, 1224 insertions(+), 1550 deletions(-) delete mode 100644 matlab/sync/compute_m0.m delete mode 100644 matlab/sync/compute_m1.m delete mode 100644 matlab/sync/convfft.m delete mode 100644 matlab/sync/find_coarse_time_and_freq_offset.m delete mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/pdu.h delete mode 100644 srsapps/ue/mac/src/mac_pdu.cc create mode 100644 srsapps/ue/mac/src/pdu.cc delete mode 100644 srslte/examples/tutorial_examples/ue_rx.c diff --git a/matlab/sync/cfo_estimate_cp.m b/matlab/sync/cfo_estimate_cp.m index e04960dad..0d3a4d723 100644 --- a/matlab/sync/cfo_estimate_cp.m +++ b/matlab/sync/cfo_estimate_cp.m @@ -1,12 +1,18 @@ -function cfo = cfo_estimate_cp(input, Nsyms, sym_len, cp0_len, cp_len) +function cfo = cfo_estimate_cp(input_slot, Nsyms, sym_len, cp0_len, cp_len) -r=zeros(Nsyms, 1); -r(1)=sum(input(1:cp0_len).*conj(input(1+sym_len:cp0_len+sym_len))); -s=cp0_len+sym_len+1; -e=cp0_len+sym_len+cp_len; -for i=2:Nsyms - r(i)=sum(input(s:e).*conj(input(s+sym_len:e+sym_len))); - s=s+sym_len+cp_len; - e=e+sym_len+cp_len; +% Start correlating from the end. Nsyms is the number of symbols to +% correlate starting from the end. + +s=length(input_slot)-sym_len-cp_len; +e=length(input_slot)-sym_len; +for i=1:Nsyms + r(i)=sum(input_slot(s:e).*conj(input_slot(s+sym_len:e+sym_len))); + if (i < 7) + s=s-sym_len-cp_len; + e=e-sym_len-cp_len; + else + s=s-sym_len-cp0_len; + e=e-sym_len-cp0_len; + end end -cfo=-angle(mean(r))/2/pi; \ No newline at end of file +cfo=-angle(mean(r))/pi; \ No newline at end of file diff --git a/matlab/sync/cfo_test.m b/matlab/sync/cfo_test.m index e3bf39c51..128964f13 100644 --- a/matlab/sync/cfo_test.m +++ b/matlab/sync/cfo_test.m @@ -1,27 +1,21 @@ -%clear; -M=1000; +clear; sym_len=128; -x=lte(1:M*15360*sym_len/2048*2000/1536); -%x=read_complex('../../../eclipse_osldlib/test.dat'); -%y=resample(x,99839996,100000000); - -input=resample(x,1536,2000); -%input=x; -%input=y(1:M*15360*sym_len/2048); -%input=resample(x,3840000,1920000); +hflen = (sym_len/128)*1920*10; +N_id_2=1; +input=read_complex('../../build/lte_signal.dat', hflen*500); cp0_len=160*sym_len/2048; cp1_len=144*sym_len/2048; -slots=reshape(input,15360*sym_len/2048,[]); -[n m]=size(slots); +subframes=reshape(input,hflen,[]); +[n m]=size(subframes); -cfo=zeros(m,1); -output=zeros(size(input)); +cfo=zeros(m,2); for i=1:m - cfo(i)=cfo_estimate(slots(:,i),7,sym_len,cp1_len,cp1_len); - t=(i-1)*n+1:i*n; - %output(t)=input(t).*exp(-1i*2*pi*cfo(i)*t/sym_len); + cfo(i,1) = cfo_estimate_cp(subframes(1:960,i),1,sym_len,cp0_len,cp1_len); + [~, cfo(i,2)] = find_pss(subframes(:,i),N_id_2); + end plot(cfo) +legend('CP-based','PSS-based') \ No newline at end of file diff --git a/matlab/sync/compute_m0.m b/matlab/sync/compute_m0.m deleted file mode 100644 index f109bd1de..000000000 --- a/matlab/sync/compute_m0.m +++ /dev/null @@ -1,55 +0,0 @@ -function [ s0_m0 z1_m0 ] = compute_m0( m0) -%COMPUTE_S Summary of this function goes here -% Detailed explanation goes here - - % Generate s_tilda - x_s_tilda(0+1) = 0; - x_s_tilda(1+1) = 0; - x_s_tilda(2+1) = 0; - x_s_tilda(3+1) = 0; - x_s_tilda(4+1) = 1; - for(i_hat=0:25) - x_s_tilda(i_hat+5+1) = mod((x_s_tilda(i_hat+2+1) + x_s_tilda(i_hat+1)), 2); - end - for(idx=0:30) - s_tilda(idx+1) = 1 - 2*x_s_tilda(idx+1); - end - - % Generate c_tilda - x_c_tilda(0+1) = 0; - x_c_tilda(1+1) = 0; - x_c_tilda(2+1) = 0; - x_c_tilda(3+1) = 0; - x_c_tilda(4+1) = 1; - for(i_hat=0:25) - x_c_tilda(i_hat+5+1) = mod((x_c_tilda(i_hat+3+1) + x_c_tilda(i_hat+1)), 2); - end - for(idx=0:30) - c_tilda(idx+1) = 1 - 2*x_c_tilda(idx+1); - end - - % Generate z_tilda - x_z_tilda(0+1) = 0; - x_z_tilda(1+1) = 0; - x_z_tilda(2+1) = 0; - x_z_tilda(3+1) = 0; - x_z_tilda(4+1) = 1; - for(i_hat=0:25) - x_z_tilda(i_hat+5+1) = mod((x_z_tilda(i_hat+4+1) + x_z_tilda(i_hat+2+1) + x_z_tilda(i_hat+1+1) + x_z_tilda(i_hat+1)), 2); - end - for(idx=0:30) - z_tilda(idx+1) = 1 - 2*x_z_tilda(idx+1); - end - - % Generate s0_m0 and s1_m1 - for(n=0:30) - s0_m0(n+1) = s_tilda(mod(n + m0, 31)+1); - end - - % Generate z1_m0 and z1_m1 - for(n=0:30) - z1_m0(n+1) = z_tilda(mod(n + mod(m0, 8), 31)+1); - end - -end - diff --git a/matlab/sync/compute_m1.m b/matlab/sync/compute_m1.m deleted file mode 100644 index 8fdb4c0e7..000000000 --- a/matlab/sync/compute_m1.m +++ /dev/null @@ -1,49 +0,0 @@ -function [ s1_m1 ] = compute_m1( m1, N_id_2) -%COMPUTE_S Summary of this function goes here -% Detailed explanation goes here - - % Generate s_tilda - x_s_tilda(0+1) = 0; - x_s_tilda(1+1) = 0; - x_s_tilda(2+1) = 0; - x_s_tilda(3+1) = 0; - x_s_tilda(4+1) = 1; - for(i_hat=0:25) - x_s_tilda(i_hat+5+1) = mod((x_s_tilda(i_hat+2+1) + x_s_tilda(i_hat+1)), 2); - end - for(idx=0:30) - s_tilda(idx+1) = 1 - 2*x_s_tilda(idx+1); - end - - % Generate c_tilda - x_c_tilda(0+1) = 0; - x_c_tilda(1+1) = 0; - x_c_tilda(2+1) = 0; - x_c_tilda(3+1) = 0; - x_c_tilda(4+1) = 1; - for(i_hat=0:25) - x_c_tilda(i_hat+5+1) = mod((x_c_tilda(i_hat+3+1) + x_c_tilda(i_hat+1)), 2); - end - for(idx=0:30) - c_tilda(idx+1) = 1 - 2*x_c_tilda(idx+1); - end - - % Generate z_tilda - x_z_tilda(0+1) = 0; - x_z_tilda(1+1) = 0; - x_z_tilda(2+1) = 0; - x_z_tilda(3+1) = 0; - x_z_tilda(4+1) = 1; - for(i_hat=0:25) - x_z_tilda(i_hat+5+1) = mod((x_z_tilda(i_hat+4+1) + x_z_tilda(i_hat+2+1) + x_z_tilda(i_hat+1+1) + x_z_tilda(i_hat+1)), 2); - end - for(idx=0:30) - z_tilda(idx+1) = 1 - 2*x_z_tilda(idx+1); - end - - % Generate s0_m0 and s1_m1 - for(n=0:30) - s1_m1(n+1) = s_tilda(mod(n + m1, 31)+1); - end -end - diff --git a/matlab/sync/convfft.m b/matlab/sync/convfft.m deleted file mode 100644 index 5ccf9a886..000000000 --- a/matlab/sync/convfft.m +++ /dev/null @@ -1,57 +0,0 @@ -function [out] = convfft(z1,z2) -%CONVFFT FFT-based convolution and polynomial multiplication. -% C = CONVFFT(A, B) convolves vectors A and B. The resulting -% vector is length LENGTH(A)+LENGTH(B)-1. -% If A and B are vectors of polynomial coefficients, convolving -% them is equivalent to multiplying the two polynomials. -% -% Please contribute if you find this software useful. -% Report bugs to luigi.rosa@tiscali.it -% -%***************************************************************** -% Luigi Rosa -% Via Centrale 27 -% 67042 Civita di Bagno -% L'Aquila --- ITALY -% email luigi.rosa@tiscali.it -% mobile +39 340 3463208 -% http://utenti.lycos.it/matlab -%***************************************************************** -% - - -z1x=size(z1,1); -z1y=size(z1,2); -z2x=size(z2,1); -z2y=size(z2,2); -if (~isa(z1,'double'))||(~isa(z2,'double'))||(ndims(z1)>2)||(ndims(z2)>2) - disp('Error: input vector must be unidimensional double array'); - out=[]; - return; -else - if ((z1x>1)&&(z1y>1)) || ((z2x>1)&&(z2y>1)) - out=[]; - disp('Error: input vectors are double matrices'); - return; - - else - - if (z1x==1)&&(z1y>1) - z1=z1'; - z1x=z1y; - end - - - if (z2x==1)&&(z2y>1) - z2=z2'; - z2x=z2y; - end - - - if (any(any(imag(z1))))||(any(any(imag(z2)))) - out=(ifft(fft(z1,z1x+z2x-1).*fft(z2,z1x+z2x-1))); - else - out=real(ifft(fft(z1,z1x+z2x-1).*fft(z2,z1x+z2x-1))); - end - end -end \ No newline at end of file diff --git a/matlab/sync/find_coarse_time_and_freq_offset.m b/matlab/sync/find_coarse_time_and_freq_offset.m deleted file mode 100644 index 7293c17a9..000000000 --- a/matlab/sync/find_coarse_time_and_freq_offset.m +++ /dev/null @@ -1,82 +0,0 @@ -function [coarse_start freq_offset] = find_coarse_time_and_freq_offset(in, N_cp_l_else) - - % Decompose input - in_re = real(in); - in_im = imag(in); - - abs_corr = zeros(1,960); - for(slot=0:10) - for(n=1:40:960) - corr_re = 0; - corr_im = 0; - for(z=1:N_cp_l_else) - index = (slot*960) + n-1 + z; - corr_re = corr_re + in_re(index)*in_re(index+128) + in_im(index)*in_im(index+128); - corr_im = corr_im + in_re(index)*in_im(index+128) - in_im(index)*in_re(index+128); - end - abs_corr(n) = abs_corr(n) + corr_re*corr_re + corr_im*corr_im; - end - end - - % Find first and second max - abs_corr_idx = zeros(1,2); - for(m=0:1) - abs_corr_max = 0; - for(n=1:480) - if(abs_corr((m*480)+n) > abs_corr_max) - abs_corr_max = abs_corr((m*480)+n); - abs_corr_idx(m+1) = (m*480)+n; - end - end - end - - % Fine correlation and fraction frequency offset - abs_corr = zeros(1,960); - corr_freq_err = zeros(1,960); - for(slot=1:10) - for(idx=1:2) - if((abs_corr_idx(idx) - 40) < 1) - abs_corr_idx(idx) = 41; - end - if((abs_corr_idx(idx) + 40) > 960) - abs_corr_idx(idx) = 960 - 40; - end - for(n=abs_corr_idx(idx)-40:abs_corr_idx(idx)+40) - corr_re = 0; - corr_im = 0; - for(z=1:N_cp_l_else) - index = (slot*960) + n-1 + z; - corr_re = corr_re + in_re(index)*in_re(index+128) + in_im(index)*in_im(index+128); - corr_im = corr_im + in_re(index)*in_im(index+128) - in_im(index)*in_re(index+128); - end - abs_corr(n) = abs_corr(n) + corr_re*corr_re + corr_im*corr_im; - corr_freq_err(n) = corr_freq_err(n) + atan2(corr_im, corr_re)/(128*2*pi*(0.0005/960)); - end - end - end - - % Find first and second max - abs_corr_idx = zeros(1,2); - for(m=0:1) - abs_corr_max = 0; - for(n=1:480) - if(abs_corr((m*480)+n) > abs_corr_max) - abs_corr_max = abs_corr((m*480)+n); - abs_corr_idx(m+1) = (m*480)+n; - end - end - end - - % Determine frequency offset FIXME No integer offset is calculated here - freq_offset = (corr_freq_err(abs_corr_idx(1))/10 + corr_freq_err(abs_corr_idx(2))/10)/2;23 - - % Determine the symbol start locations from the correlation peaks - % FIXME Needs some work - tmp = abs_corr_idx(1); - while(tmp > 0) - tmp = tmp - 2192; - end - for(n=1:7) - coarse_start(n) = tmp + (n*2192); - end -end \ No newline at end of file diff --git a/matlab/sync/find_pss.m b/matlab/sync/find_pss.m index 94486553f..c4b460173 100644 --- a/matlab/sync/find_pss.m +++ b/matlab/sync/find_pss.m @@ -1,31 +1,18 @@ -function [ fs eps p_m w2] = find_pss( x, N_id_2, doplot, threshold) - if nargin == 2 - doplot = false; - threshold = 0; - end - if nargin == 3 - threshold = 0; - end +function [ fs, cfo, p_m, w2] = find_pss( x, N_id_2) c=lte_pss_zc(N_id_2); cc=[zeros(33,1); c; zeros(33,1)]; ccf=[0; cc(65:128); cc(2:64)]; ccf=conj(ifft(ccf)); - w2=conv(x,ccf); - if (doplot) - %plot(10*log10(abs(w2)));%./mean(abs(w2)))); - plot(abs(w2)) - %axis([0 length(w2) 0 20]) - end - [m i]=max(abs(w2)); - fs=i-960; - p_m = m/mean(abs(w2)); - - if doplot - fprintf('Frame starts at %d, m=%g, p=%g, p/m=%g dB\n',fs, ... - mean(abs(w2)), m, 10*log10(m/mean(abs(w2)))); - end + [m, fs]=max(abs(w2)); + + y=ccf.*x(fs-128:fs-1); + y0=y(1:64); + y1=y(65:length(y)); + cfo=angle(conj(sum(y0))*sum(y1))/pi; + p_m = m/mean(abs(w2)); + end diff --git a/matlab/tests/prach_test.m b/matlab/tests/prach_test.m index 5fbee677e..1263860a2 100644 --- a/matlab/tests/prach_test.m +++ b/matlab/tests/prach_test.m @@ -2,18 +2,18 @@ clear ueConfig=struct('NULRB',6,'DuplexMode','FDD','CyclicPrefix','Normal'); prachConfig=struct('Format',0,'SeqIdx',0,'PreambleIdx',0,'CyclicShiftIdx',0,'HighSpeed',0,'TimingOffset',0,'FreqIdx',0,'FreqOffset',0); -addpath('../../debug/lte/phy/lib/phch/test') +addpath('../../debug/srslte/lib/phch/test') -NULRB=[15 25 50 100]; +NULRB=[6 15 25 50 100]; % FreqIdx, FreqOffset and TimeOffset need to be tested -for n_rb=1:length(NULRB) - for format=1:3; - for seqIdx=0:17:837 +for n_rb=3:length(NULRB) + for format=0; + for seqIdx=0:17:237 fprintf('RB: %d, format %d, seqIdx: %d\n',NULRB(n_rb),format,seqIdx); for preambleIdx=0:23:63 - for CyclicShift=0:6:15 + for CyclicShift=1:3:15 %for hs=0:1 hs=0; ueConfig.NULRB=NULRB(n_rb); @@ -22,8 +22,8 @@ for n_rb=1:length(NULRB) prachConfig.PreambleIdx=preambleIdx; prachConfig.CyclicShiftIdx=CyclicShift; prachConfig.HighSpeed=hs; - prachConfig.FreqIdx=5; - prachConfig.FreqOffest=5; + prachConfig.FreqIdx=0; + prachConfig.FreqOffset=0; lib=srslte_prach(ueConfig,prachConfig); [mat, info]=ltePRACH(ueConfig,prachConfig); diff --git a/srsapps/common/include/srsapps/common/tti_sync.h b/srsapps/common/include/srsapps/common/tti_sync.h index 52cc8501f..6779e76c8 100644 --- a/srsapps/common/include/srsapps/common/tti_sync.h +++ b/srsapps/common/include/srsapps/common/tti_sync.h @@ -51,6 +51,7 @@ class tti_sync init_counters(0); } virtual void increase() = 0; + virtual void resync() = 0; virtual uint32_t wait() = 0; virtual void set_producer_cntr(uint32_t) = 0; uint32_t get_producer_cntr() { return producer_cntr; } diff --git a/srsapps/common/include/srsapps/common/tti_sync_cv.h b/srsapps/common/include/srsapps/common/tti_sync_cv.h index 35b020974..fea9a6db7 100644 --- a/srsapps/common/include/srsapps/common/tti_sync_cv.h +++ b/srsapps/common/include/srsapps/common/tti_sync_cv.h @@ -48,6 +48,7 @@ class tti_sync_cv : public tti_sync ~tti_sync_cv(); void increase(); uint32_t wait(); + void resync(); void set_producer_cntr(uint32_t producer_cntr); private: diff --git a/srsapps/common/src/tti_sync_cv.cc b/srsapps/common/src/tti_sync_cv.cc index 8e5e16a6f..da5b5096a 100644 --- a/srsapps/common/src/tti_sync_cv.cc +++ b/srsapps/common/src/tti_sync_cv.cc @@ -56,6 +56,11 @@ namespace srslte { return x; } + void tti_sync_cv::resync() + { + consumer_cntr = producer_cntr; + } + void tti_sync_cv::set_producer_cntr(uint32_t producer_cntr) { pthread_mutex_lock(&mutex); diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h index 824803b67..f4182b50e 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h @@ -32,7 +32,7 @@ #include "srsapps/ue/mac/mac_io.h" #include "srsapps/common/timers.h" #include "srsapps/ue/mac/mac_params.h" -#include "srsapps/ue/mac/mac_pdu.h" +#include "srsapps/ue/mac/pdu.h" #ifndef DEMUX_H #define DEMUX_H @@ -57,11 +57,11 @@ public: uint64_t get_contention_resolution_id(); private: - mac_pdu mac_msg; - mac_pdu pending_mac_msg; + sch_pdu mac_msg; + sch_pdu pending_mac_msg; - void process_pdu(mac_pdu *pdu); - bool process_ce(mac_pdu::mac_subh *subheader); + void process_pdu(sch_pdu *pdu); + bool process_ce(sch_subh *subheader); uint64_t contention_resolution_id; bool pending_temp_rnti; diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h index befa2c1ff..dbddbc9f6 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h @@ -75,6 +75,7 @@ private: uint32_t pid; private: + bool is_initiated; dl_harq_entity *harq_entity; uint8_t *payload; uint32_t max_payload_len; @@ -89,7 +90,6 @@ private: srslte_softbuffer_rx_t softbuffer; }; - dl_harq_process *proc; timers *timers_db; demux *demux_unit; diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h deleted file mode 100644 index 58bfb65e6..000000000 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_pdu.h +++ /dev/null @@ -1,165 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2015 The srsLTE Developers. See the - * COPYRIGHT file at the top-level directory of this distribution. - * - * \section LICENSE - * - * This file is part of the srsLTE library. - * - * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsLTE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * A copy of the GNU Affero General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - - -#include -#include "srsapps/common/log.h" - -#ifndef MACPDU_H -#define MACPDU_H - -/* MAC PDU Packing/Unpacking functions */ - -namespace srslte { -namespace ue { - -class mac_pdu -{ -public: - - class mac_subh - { - public: - - typedef enum { - C_RNTI = 0, - CON_RES_ID, - TA_CMD, - PHD, - SDU - } cetype; - - // Reading functions - bool is_sdu(); - cetype ce_type(); - - uint32_t get_sdu_lcid(); - uint32_t get_sdu_nbytes(); - uint8_t* get_sdu_ptr(); - - uint16_t get_c_rnti(); - uint64_t get_con_res_id(); - uint8_t get_ta_cmd(); - uint8_t get_phd(); - - // Writing functions - bool set_sdu(uint8_t *ptr, uint32_t nof_bytes); - bool set_c_rnti(uint16_t crnti); - bool set_con_res_id(uint64_t con_res_id); - bool set_ta_cmd(uint8_t ta_cmd); - bool set_phd(uint8_t phd); - - private: - static const int MAX_CE_PAYLOAD_LEN = 8; - uint32_t lcid; - uint32_t nof_bytes; - uint8_t* sdu_payload_ptr; - uint8_t ce_payload[MAX_CE_PAYLOAD_LEN]; - }; - - mac_pdu(uint32_t max_subheaders); - - void reset(); - void init(uint32_t pdu_len); - - bool read_next(); - bool write_next(); - mac_subh* get(); - - bool write_packet(uint8_t *ptr); - void parse_packet(uint8_t *ptr); - - - -protected: - mac_subh *subheaders; - uint32_t pdu_len; - uint32_t rem_len; - uint32_t rp, wp; - uint32_t nof_subheaders; - uint32_t max_subheaders; -}; - -class mac_rar_pdu -{ -public: - class mac_rar - { - - public: - - static const uint32_t RAR_GRANT_LEN = 20; - - // Reading functions - uint32_t get_rapid(); - uint32_t get_ta_cmd(); - uint16_t get_temp_crnti(); - void get_sched_grant(uint8_t grant[RAR_GRANT_LEN]); - - // Writing functoins - void set_rapid(uint32_t rapid); - void set_ta_cmd(uint32_t ta); - void set_temp_crnti(uint16_t temp_rnti); - void set_sched_grant(uint8_t grant[RAR_GRANT_LEN]); - private: - uint8_t grant[RAR_GRANT_LEN]; - uint32_t ta; - uint16_t temp_rnti; - }; - - mac_rar_pdu(uint32_t max_rars); - - void reset(); - void init(uint32_t pdu_len); - - bool read_next(); - bool write_next(); - mac_rar* get(); - - void set_backoff(uint8_t bi); - bool is_backoff(); - uint8_t get_backoff(); - - bool write_packet(uint8_t *ptr); - void parse_packet(uint8_t *ptr); - - -private: - mac_rar *rars; - uint32_t pdu_len; - uint32_t rem_len; - uint32_t rp, wp; - uint32_t nof_rars; - uint32_t max_rars; - -}; - -} -} - -#endif - diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h index d35748749..9972e8f68 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h @@ -31,7 +31,7 @@ #include "srsapps/common/log.h" #include "srsapps/ue/mac/mac_io.h" #include "srsapps/ue/mac/mac_params.h" -#include "srsapps/ue/mac/mac_pdu.h" +#include "srsapps/ue/mac/pdu.h" #ifndef MUX_H #define MUX_H @@ -48,6 +48,8 @@ public: void reset(); void init(log *log_h, mac_io *mac_io_h); + bool is_pending_sdu(); + uint8_t* pdu_pop(uint32_t tti_, uint32_t pdu_sz); bool pdu_move_to_msg3(uint32_t tti, uint32_t pdu_sz); void pdu_release(); @@ -63,8 +65,8 @@ public: private: bool assemble_pdu(uint32_t pdu_sz); - bool allocate_sdu(uint32_t lcid, mac_pdu *pdu, uint32_t *sdu_sz); - bool allocate_sdu(uint32_t lcid, mac_pdu *pdu); + bool allocate_sdu(uint32_t lcid, sch_pdu *pdu, uint32_t *sdu_sz); + bool allocate_sdu(uint32_t lcid, sch_pdu *pdu); int64_t Bj[mac_io::NOF_UL_LCH]; int PBR[mac_io::NOF_UL_LCH]; // -1 sets to infinity @@ -89,7 +91,7 @@ private: /* PDU Buffer */ static const uint32_t PDU_BUFF_SZ = 16*1024; qbuff pdu_buff; - mac_pdu pdu_msg; + sch_pdu pdu_msg; }; } diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/pdu.h b/srsapps/ue/mac/include/srsapps/ue/mac/pdu.h new file mode 100644 index 000000000..15ad95329 --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/pdu.h @@ -0,0 +1,285 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + + +#include +#include "srsapps/common/log.h" +#include +#include + + +#ifndef MACPDU_H +#define MACPDU_H + +/* MAC PDU Packing/Unpacking functions. Section 6 of 36.321 */ + +namespace srslte { +namespace ue { + + +template +class pdu +{ +public: + + pdu(uint32_t max_subheaders_) : subheaders(max_subheaders_) { + max_subheaders = max_subheaders_; + nof_subheaders = 0; + cur_idx = -1; + pdu_len = 0; + rem_len = 0; + for (int i=0;i= 0) { + return &subheaders[cur_idx]; + } + } + + // Section 6.1.2 + void parse_packet(uint8_t *ptr) { + nof_subheaders = 0; + while(subheaders[nof_subheaders].read_subheader(&ptr)) { + nof_subheaders++; + } + nof_subheaders++; + for (int i=0;i subheaders; + uint32_t pdu_len; + uint32_t rem_len; + int cur_idx; + int nof_subheaders; + uint32_t max_subheaders; + bool pdu_is_ul; +}; + +template +class subh +{ +public: + + virtual bool read_subheader(uint8_t** ptr) = 0; + virtual void read_payload(uint8_t **ptr) = 0; + virtual void write_subheader(uint8_t** ptr, bool is_last) = 0; + virtual void write_payload(uint8_t **ptr) = 0; + virtual void fprint(FILE *stream) = 0; + + pdu* parent; + +private: + virtual void init() = 0; +}; + + + +class sch_subh : public subh +{ + +public: + + typedef enum { + PHD_REPORT = 26, + C_RNTI = 27, + CON_RES_ID = 28, + TRUNC_BSR = 28, + TA_CMD = 29, + SHORT_BSR = 29, + DRX_CMD = 30, + LONG_BSR = 30, + PADDING = 31, + SDU = 0 + } cetype; + + // Reading functions + bool is_sdu(); + cetype ce_type(); + + bool read_subheader(uint8_t** ptr); + void read_payload(uint8_t **ptr); + uint32_t get_sdu_lcid(); + uint32_t get_sdu_nbytes(); + uint8_t* get_sdu_ptr(); + + uint16_t get_c_rnti(); + uint64_t get_con_res_id(); + uint8_t get_ta_cmd(); + uint8_t get_phd(); + + // Writing functions + void write_subheader(uint8_t** ptr, bool is_last); + void write_payload(uint8_t **ptr); + bool set_sdu(uint32_t lcid, uint8_t *ptr, uint32_t nof_bytes); + bool set_c_rnti(uint16_t crnti); + bool set_con_res_id(uint64_t con_res_id); + bool set_ta_cmd(uint8_t ta_cmd); + bool set_phd(uint8_t phd); + void set_padding(); + + void init(); + void fprint(FILE *stream); + +private: + static const int MAX_CE_PAYLOAD_LEN = 8; + uint32_t lcid; + uint32_t nof_bytes; + uint8_t* sdu_payload_ptr; + bool F_bit; + uint8_t ce_payload[MAX_CE_PAYLOAD_LEN]; + uint32_t sizeof_ce(uint32_t lcid, bool is_ul); +}; + +class sch_pdu : public pdu +{ +public: + + sch_pdu(uint32_t max_rars) : pdu(max_rars) {} + + bool write_packet(uint8_t *ptr); + bool has_space_ce(uint32_t nbytes); + bool has_space_sdu(uint32_t nbytes); + static uint32_t size_plus_header_pdu(uint32_t nbytes); + bool update_space_ce(uint32_t nbytes); + bool update_space_sdu(uint32_t nbytes); + void fprint(FILE *stream); + +}; + +class rar_subh : public subh +{ +public: + + static const uint32_t RAR_GRANT_LEN = 20; + + // Reading functions + bool read_subheader(uint8_t** ptr); + void read_payload(uint8_t** ptr); + uint32_t get_rapid(); + uint32_t get_ta_cmd(); + uint16_t get_temp_crnti(); + void get_sched_grant(uint8_t grant[RAR_GRANT_LEN]); + + // Writing functoins + void write_subheader(uint8_t** ptr, bool is_last); + void write_payload(uint8_t** ptr); + void set_rapid(uint32_t rapid); + void set_ta_cmd(uint32_t ta); + void set_temp_crnti(uint16_t temp_rnti); + void set_sched_grant(uint8_t grant[RAR_GRANT_LEN]); + + void init(); + void fprint(FILE *stream); + +private: + uint8_t grant[RAR_GRANT_LEN]; + uint32_t ta; + uint16_t temp_rnti; + uint32_t preamble; +}; + +class rar_pdu : public pdu +{ +public: + + rar_pdu(uint32_t max_rars); + + void set_backoff(uint8_t bi); + bool has_backoff(); + uint8_t get_backoff(); + + bool write_packet(uint8_t* ptr); + void fprint(FILE *stream); + +private: + bool has_backoff_indicator; + uint8_t backoff_indicator; +}; + +} +} + +#endif + diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h index 25f7c3cb8..408b9f7c0 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h @@ -37,7 +37,7 @@ #include "srsapps/common/timers.h" #include "srsapps/ue/mac/mux.h" #include "srsapps/ue/mac/demux.h" -#include "srsapps/ue/mac/mac_pdu.h" +#include "srsapps/ue/mac/pdu.h" #ifndef PROCRA_H #define PROCRA_H @@ -50,7 +50,7 @@ namespace ue { class ra_proc : public proc,timer_callback { public: - ra_proc() : rar_pdu(20) {}; + ra_proc() : rar_pdu_msg(20) {}; bool init(mac_params *params_db, phy *phy_h, log *log_h, timers *timers_db, mux *mux_unit, demux *demux_unit); void reset(); @@ -64,10 +64,12 @@ class ra_proc : public proc,timer_callback bool in_progress(); void pdcch_to_crnti(bool is_ul_grant); void timer_expired(uint32_t timer_id); -private: +private: + void process_timeadv_cmd(uint32_t tti, uint32_t ta_cmd); void step_initialization(); + void step_initialization_wait(); void step_resource_selection(); void step_preamble_transmission(); void step_response_reception(); @@ -79,7 +81,7 @@ private: // Buffer to receive RAR PDU static const uint32_t MAX_RAR_PDU_LEN = 2048; uint8_t rar_pdu_buffer[MAX_RAR_PDU_LEN]; - mac_rar_pdu rar_pdu; + rar_pdu rar_pdu_msg; // Random Access parameters provided by higher layers defined in 5.1.1 // They are read from params_db during initialization init() @@ -115,7 +117,8 @@ private: enum { IDLE = 0, - INITIALIZATION, // Section 5.1.1 + INITIALIZATION, // Section 5.1.1 + INITIALIZATION_WAIT, RESOURCE_SELECTION, // Section 5.1.2 PREAMBLE_TRANSMISSION, // Section 5.1.3 RESPONSE_RECEPTION, // Section 5.1.4 @@ -140,6 +143,8 @@ private: mux *mux_unit; demux *demux_unit; + pthread_t pt_init_prach; + uint64_t received_contention_id; uint64_t transmitted_contention_id; uint16_t transmitted_crnti; diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h index e4a2b83ff..42673a383 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h @@ -54,14 +54,14 @@ public: ul_harq_entity(); ~ul_harq_entity(); - bool init(srslte_cell_t cell, uint32_t max_payload_len, log *log_h, timers* timers_, mux *mux_unit); + bool init(srslte_cell_t cell, log *log_h, timers* timers_, mux *mux_unit); void set_maxHARQ_Tx(uint32_t maxHARQ_Tx, uint32_t maxHARQ_Msg3Tx); void reset(); void reset_ndi(); bool is_sps(uint32_t pid); void run_tti(uint32_t tti, ul_sched_grant *grant, phy *phy_); - void run_tti(uint32_t tti, phy *phy_); + void run_tti(uint32_t tti, dl_buffer *dl_buffer, phy *phy_); bool is_last_retx_msg3(); private: @@ -69,7 +69,7 @@ private: class ul_harq_process { public: ul_harq_process(); - bool init(srslte_cell_t cell, uint32_t max_payload_len, ul_harq_entity *parent); + bool init(srslte_cell_t cell, ul_harq_entity *parent); void reset(); void reset_ndi(); void set_maxHARQ_Tx(uint32_t maxHARQ_Tx_, uint32_t maxHARQ_Msg3Tx_); @@ -83,6 +83,7 @@ private: void set_harq_feedback(bool ack); bool get_ndi(); + uint32_t tti; private: uint32_t current_tx_nb; uint32_t current_irv; @@ -91,14 +92,13 @@ private: srslte::log *log_h; ul_harq_entity *harq_entity; ul_sched_grant cur_grant; - uint8_t *payload; - uint32_t max_payload_len; bool is_grant_configured; srslte_softbuffer_tx_t softbuffer; uint32_t maxHARQ_Tx, maxHARQ_Msg3Tx; bool is_msg3; + bool is_initiated; - void generate_tx(ul_buffer* ul); + void generate_tx(uint8_t *pdu_payload, ul_buffer* ul); }; bool last_retx_is_msg3; diff --git a/srsapps/ue/mac/src/demux.cc b/srsapps/ue/mac/src/demux.cc index 898cb47e3..b43e655b2 100644 --- a/srsapps/ue/mac/src/demux.cc +++ b/srsapps/ue/mac/src/demux.cc @@ -81,13 +81,16 @@ void demux::push_pdu_temp_crnti(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bi tti = tti_; if (!pending_temp_rnti) { // Unpack DLSCH MAC PDU - pending_mac_msg.init(nof_bits); + pending_mac_msg.init(nof_bits/8); pending_mac_msg.parse_packet(mac_pdu); + pending_mac_msg.fprint(stdout); + //MIRAR ACK PENDING. EL QUE PASSA ES QUE AL HARQ NO FA RES SI EL CONTENTION RES ID ES 0, PERQUE ES 0??? + // Look for Contention Resolution UE ID contention_resolution_id = 0; - while(pending_mac_msg.read_next()) { - if (pending_mac_msg.get()->ce_type() == mac_pdu::mac_subh::CON_RES_ID) { + while(pending_mac_msg.next()) { + if (pending_mac_msg.get()->ce_type() == sch_subh::CON_RES_ID) { contention_resolution_id = pending_mac_msg.get()->get_con_res_id(); } } @@ -103,7 +106,7 @@ void demux::push_pdu(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) { tti = tti_; // Unpack DLSCH MAC PDU - mac_msg.init(nof_bits); + mac_msg.init(nof_bits/8); mac_msg.parse_packet(mac_pdu); process_pdu(&mac_msg); Debug("Normal MAC PDU processed\n"); @@ -124,26 +127,26 @@ void demux::demultiplex_pending_pdu(uint32_t tti_) -void demux::process_pdu(mac_pdu *pdu) +void demux::process_pdu(sch_pdu *pdu_msg) { - while(pdu->read_next()) { - if (pdu->get()->is_sdu()) { + while(pdu_msg->next()) { + if (pdu_msg->get()->is_sdu()) { // Route logical channel - if (pdu->get()->get_sdu_lcid() <= mac_io::MAC_LCH_DTCH2_DL) { - qbuff *dest_lch = mac_io_h->get(pdu->get()->get_sdu_lcid()); + if (pdu_msg->get()->get_sdu_lcid() <= mac_io::MAC_LCH_DTCH2_DL) { + qbuff *dest_lch = mac_io_h->get(pdu_msg->get()->get_sdu_lcid()); if (dest_lch) { - dest_lch->send(pdu->get()->get_sdu_ptr(), pdu->get()->get_sdu_nbytes()*8); + dest_lch->send(pdu_msg->get()->get_sdu_ptr(), pdu_msg->get()->get_sdu_nbytes()*8); Debug("Sent MAC SDU len=%d bytes to lchid=%d\n", - pdu->get()->get_sdu_nbytes(), pdu->get()->get_sdu_lcid()); + pdu_msg->get()->get_sdu_nbytes(), pdu_msg->get()->get_sdu_lcid()); } else { - Error("Getting destination channel LCID=%d\n", pdu->get()->get_sdu_lcid()); + Error("Getting destination channel LCID=%d\n", pdu_msg->get()->get_sdu_lcid()); } } else { - Warning("Received SDU for unsupported LCID=%d\n", pdu->get()->get_sdu_lcid()); + Warning("Received SDU for unsupported LCID=%d\n", pdu_msg->get()->get_sdu_lcid()); } // Process MAC Control Element } else { - if (!process_ce(pdu->get())) { + if (!process_ce(pdu_msg->get())) { Warning("Received Subheader with invalid or unkonwn LCID\n"); } } @@ -151,13 +154,13 @@ void demux::process_pdu(mac_pdu *pdu) } -bool demux::process_ce(mac_pdu::mac_subh *subh) { +bool demux::process_ce(sch_subh *subh) { switch(subh->ce_type()) { - case mac_pdu::mac_subh::CON_RES_ID: + case sch_subh::CON_RES_ID: contention_resolution_id = subh->get_c_rnti(); Debug("Saved Contention Resolution ID=%d\n", contention_resolution_id); break; - case mac_pdu::mac_subh::TA_CMD: + case sch_subh::TA_CMD: phy_h->set_timeadv(subh->get_ta_cmd()); // Start or restart timeAlignmentTimer diff --git a/srsapps/ue/mac/src/dl_harq.cc b/srsapps/ue/mac/src/dl_harq.cc index 3937e59bf..827aa8c95 100644 --- a/srsapps/ue/mac/src/dl_harq.cc +++ b/srsapps/ue/mac/src/dl_harq.cc @@ -105,10 +105,11 @@ void dl_harq_entity::send_pending_ack_contention_resolution() * HARQ PROCESS * *********************************************************/ - + dl_harq_entity::dl_harq_process::dl_harq_process() : cur_grant(0),pending_ack_grant(0) { is_first_tx = true; is_first_decoded = true; + is_initiated = false; bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant)); payload = NULL; max_payload_len = 0; @@ -118,7 +119,9 @@ void dl_harq_entity::dl_harq_process::reset() { is_first_tx = true; is_first_decoded = true; bzero(&cur_grant, sizeof(srslte::ue::dl_sched_grant)); - srslte_softbuffer_rx_reset(&softbuffer); + if (is_initiated) { + srslte_softbuffer_rx_reset(&softbuffer); + } } void dl_harq_entity::dl_harq_process::send_pending_ack_contention_resolution() @@ -169,6 +172,7 @@ void dl_harq_entity::dl_harq_process::receive_data(uint32_t tti, srslte::ue::dl_ pending_ul_buffer = phy_h->get_ul_buffer(tti+4); harq_entity->pending_ack_pid = pid; memcpy(&pending_ack_grant, &cur_grant, sizeof(dl_sched_grant)); + Debug("ACK pending contention resolution\n"); } else { Debug("Generating ACK\n"); // Generate ACK @@ -209,6 +213,7 @@ bool dl_harq_entity::dl_harq_process::init(srslte_cell_t cell, uint32_t max_payl fprintf(stderr, "Error initiating soft buffer\n"); return false; } else { + is_initiated = true; harq_entity = parent; log_h = harq_entity->log_h; payload = (uint8_t*) srslte_vec_malloc(sizeof(uint8_t) * max_payload_len); diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc index 93e114a1c..a6c9d2188 100644 --- a/srsapps/ue/mac/src/mac.cc +++ b/srsapps/ue/mac/src/mac.cc @@ -53,7 +53,14 @@ bool mac::init(phy *phy_h_, tti_sync* ttisync_, log* log_h_) reset(); - if (!pthread_create(&mac_thread, NULL, mac_thread_fnc, this)) { + pthread_attr_t attr; + struct sched_param param; + param.sched_priority = -20; + pthread_attr_init(&attr); + pthread_attr_setschedpolicy(&attr, SCHED_FIFO); + pthread_attr_setschedparam(&attr, ¶m); + + if (!pthread_create(&mac_thread, &attr, mac_thread_fnc, this)) { started = true; } else { perror("pthread_create"); @@ -63,8 +70,7 @@ bool mac::init(phy *phy_h_, tti_sync* ttisync_, log* log_h_) void mac::stop() { - started = false; - + started = false; pthread_join(mac_thread, NULL); } @@ -126,7 +132,7 @@ void mac::main_radio_loop() { // Init HARQ for this cell Info("Init UL/DL HARQ\n"); - ul_harq.init(cell, 8*1024, log_h, &timers_db, &mux_unit); + ul_harq.init(cell, log_h, &timers_db, &mux_unit); dl_harq.init(cell, 8*1024, log_h, &timers_db, &demux_unit); // Set the current PHY cell to the detected cell @@ -134,13 +140,17 @@ void mac::main_radio_loop() { if (phy_h->set_cell(cell)) { Info("Starting RX streaming\n"); if (phy_h->start_rxtx()) { - tti = ttisync->wait(); Info("Receiver synchronized\n"); // Send MIB to RRC mac_io_lch.get(mac_io::MAC_LCH_BCCH_DL)->send(bch_payload, SRSLTE_BCH_PAYLOAD_LEN); - is_synchronized = true; + ttisync->resync(); + Info("Wait to sync\n"); + for (int i=0;i<1000;i++) { + tti = ttisync->wait(); + } + is_synchronized = true; } else { Error("Starting PHY receiver\n"); exit(-1); @@ -151,14 +161,14 @@ void mac::main_radio_loop() { } } else { Warning("Cell not found\n"); + sleep(1); } - sleep(1); } if (is_synchronized) { /* Warning: Here order of invocation of procedures is important!! */ - + tti = ttisync->wait(); - + // Step all procedures ra_procedure.step(tti); sr_procedure.step(tti); @@ -181,10 +191,18 @@ void mac::main_radio_loop() { // Process UL grants if RA procedure is done or in contention resolution if (ra_procedure.is_successful() || ra_procedure.is_contention_resolution()) { - Info("Processing UL grants\n"); process_ul_grants(tti); } timers_db.step_all(); + + // Check if there is pending CCCH SDU in Multiplexing Unit + if (mux_unit.is_pending_sdu()) { + // Start RA procedure + if (!ra_procedure.in_progress() && !ra_procedure.is_successful()) { + Info("Starting RA procedure by RLC order\n"); + ra_procedure.start_rlc_order(); + } + } } } } @@ -267,7 +285,6 @@ void mac::process_dl_grants(uint32_t tti) { for (int i = mac_params::RNTI_C;i<=mac_params::RNTI_RA;i++) { // Check C-RNTI, SPS-RNTI and Temporal RNTI if (params_db.get_param(i) != 0) { - Info("Searching DL grants for RNTI: %d\n", params_db.get_param(i)); dl_sched_grant ue_grant(rnti_type(i), params_db.get_param(i)); if (dl_buffer->get_dl_grant(&ue_grant)) { // If PDCCH for C-RNTI and RA procedure in Contention Resolution, notify it @@ -362,12 +379,16 @@ void mac::process_ul_grants(uint32_t tti) { if (params_db.get_param(i) != 0) { ul_sched_grant ul_grant(rnti_type(i), params_db.get_param(i)); if (dl_buffer->get_ul_grant(&ul_grant)) { + if (ul_grant.is_from_rar()) { + dl_buffer->release_pending_rar_grant(); + } if (ra_procedure.is_contention_resolution() && i == mac_params::RNTI_C) { ra_procedure.pdcch_to_crnti(true); } if (i == mac_params::RNTI_C || i == mac_params::RNTI_TEMP || ra_procedure.is_running()) { - if (i == mac_params::RNTI_C && ul_harq.is_sps(tti)) - ul_grant.set_ndi(true); + if (i == mac_params::RNTI_C && ul_harq.is_sps(tti)) { + ul_grant.set_ndi(true); + } ul_harq.run_tti(tti, &ul_grant, phy_h); if (i == mac_params::RNTI_TEMP) { // Discard already processed RAR grant @@ -401,7 +422,7 @@ void mac::process_ul_grants(uint32_t tti) { return; } } - ul_harq.run_tti(tti, phy_h); + ul_harq.run_tti(tti, dl_buffer, phy_h); } diff --git a/srsapps/ue/mac/src/mac_pdu.cc b/srsapps/ue/mac/src/mac_pdu.cc deleted file mode 100644 index af92e2dd6..000000000 --- a/srsapps/ue/mac/src/mac_pdu.cc +++ /dev/null @@ -1,214 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2015 The srsLTE Developers. See the - * COPYRIGHT file at the top-level directory of this distribution. - * - * \section LICENSE - * - * This file is part of the srsLTE library. - * - * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsLTE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * A copy of the GNU Affero General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - -#include "srsapps/ue/mac/mac_pdu.h" - -namespace srslte { - namespace ue { -mac_pdu::mac_subh* mac_pdu::get() -{ - -} -void mac_pdu::init(uint32_t pdu_len) -{ - -} -mac_pdu::mac_pdu(uint32_t max_subheaders) -{ - -} -mac_pdu::mac_subh::cetype mac_pdu::mac_subh::ce_type() -{ - -} -uint16_t mac_pdu::mac_subh::get_c_rnti() -{ - -} -uint64_t mac_pdu::mac_subh::get_con_res_id() -{ - -} -uint8_t mac_pdu::mac_subh::get_phd() -{ - -} -uint32_t mac_pdu::mac_subh::get_sdu_lcid() -{ - -} -uint32_t mac_pdu::mac_subh::get_sdu_nbytes() -{ - -} -uint8_t* mac_pdu::mac_subh::get_sdu_ptr() -{ - -} -uint8_t mac_pdu::mac_subh::get_ta_cmd() -{ - -} -bool mac_pdu::mac_subh::is_sdu() -{ - -} -bool mac_pdu::mac_subh::set_c_rnti(uint16_t crnti) -{ - -} -bool mac_pdu::mac_subh::set_con_res_id(uint64_t con_res_id) -{ - -} -bool mac_pdu::mac_subh::set_phd(uint8_t phd) -{ - -} -bool mac_pdu::mac_subh::set_sdu(uint8_t* ptr, uint32_t nof_bytes) -{ - -} -bool mac_pdu::mac_subh::set_ta_cmd(uint8_t ta_cmd) -{ - -} -void mac_pdu::parse_packet(uint8_t* ptr) -{ - -} -bool mac_pdu::read_next() -{ - -} -void mac_pdu::reset() -{ - -} -bool mac_pdu::write_next() -{ - -} -bool mac_pdu::write_packet(uint8_t* ptr) -{ - -} - - - -mac_rar_pdu::mac_rar* mac_rar_pdu::get() -{ - -} -uint8_t mac_rar_pdu::get_backoff() -{ - -} -void mac_rar_pdu::init(uint32_t pdu_len) -{ - -} -bool mac_rar_pdu::is_backoff() -{ - -} -uint32_t mac_rar_pdu::mac_rar::get_rapid() -{ - -} -void mac_rar_pdu::mac_rar::get_sched_grant(uint8_t grant[]) -{ - -} -uint32_t mac_rar_pdu::mac_rar::get_ta_cmd() -{ - -} -uint16_t mac_rar_pdu::mac_rar::get_temp_crnti() -{ - -} -void mac_rar_pdu::mac_rar::set_rapid(uint32_t rapid) -{ - -} -void mac_rar_pdu::mac_rar::set_sched_grant(uint8_t grant[]) -{ - -} -void mac_rar_pdu::mac_rar::set_ta_cmd(uint32_t ta) -{ - -} -void mac_rar_pdu::mac_rar::set_temp_crnti(uint16_t temp_rnti) -{ - -} -mac_rar_pdu::mac_rar_pdu(uint32_t max_rars) -{ - -} -void mac_rar_pdu::parse_packet(uint8_t* ptr) -{ - -} -bool mac_rar_pdu::read_next() -{ - -} -void mac_rar_pdu::reset() -{ - -} -void mac_rar_pdu::set_backoff(uint8_t bi) -{ - -} -bool mac_rar_pdu::write_next() -{ - -} -bool mac_rar_pdu::write_packet(uint8_t* ptr) -{ - -} - - - - - } -} - -#ifdef kk -bool demux::lcid_is_lch(uint32_t lcid) { - if (lcid <= LIBLTE_MAC_DLSCH_DCCH_LCID_END) { - return true; - } else { - return false; - } -} -#endif diff --git a/srsapps/ue/mac/src/mux.cc b/srsapps/ue/mac/src/mux.cc index 5e85b6caf..52270f1e1 100644 --- a/srsapps/ue/mac/src/mux.cc +++ b/srsapps/ue/mac/src/mux.cc @@ -64,6 +64,11 @@ void mux::reset() } } +bool mux::is_pending_sdu() +{ + return !mac_io_h->get(mac_io::MAC_LCH_CCCH_UL)->isempty(); +} + void mux::set_priority(uint32_t lch_id, uint32_t set_priority, int set_PBR, uint32_t set_BSD) { pthread_mutex_lock(&mutex); @@ -145,7 +150,7 @@ void mux::append_crnti_ce_next_tx(uint16_t crnti) { pending_crnti_ce = crnti; } -bool mux::assemble_pdu(uint32_t pdu_sz) { +bool mux::assemble_pdu(uint32_t pdu_sz_nbits) { uint8_t *buff = (uint8_t*) pdu_buff.request(); if (!buff) { @@ -154,13 +159,13 @@ bool mux::assemble_pdu(uint32_t pdu_sz) { } // Make sure pdu_sz is byte-aligned - pdu_sz = 8*(pdu_sz/8); + pdu_sz_nbits = 8*(pdu_sz_nbits/8); // Acquire mutex. Cannot change priorities, PBR or BSD after assemble finishes pthread_mutex_lock(&mutex); // Update Bj - for (int i=0;i=mac_io::NOF_UL_LCH;i++) { + for (int i=0;i= 0) { Bj[i] += PBR[i]; @@ -174,12 +179,13 @@ bool mux::assemble_pdu(uint32_t pdu_sz) { uint32_t sdu_sz = 0; - pdu_msg.init(pdu_sz); + pdu_msg.init(pdu_sz_nbits/8, true); // MAC control element for C-RNTI or data from UL-CCCH if (!allocate_sdu(UL_IDX(mac_io::MAC_LCH_CCCH_UL), &pdu_msg)) { if (pending_crnti_ce) { - if (pdu_msg.write_next()) { + if (pdu_msg.new_subh()) { + pdu_msg.next(); if (!pdu_msg.get()->set_c_rnti(pending_crnti_ce)) { Warning("Pending C-RNTI CE could not be inserted in MAC PDU\n"); } @@ -225,7 +231,7 @@ bool mux::assemble_pdu(uint32_t pdu_sz) { /* Generate MAC PDU and save to buffer */ if (pdu_msg.write_packet(buff)) { - pdu_buff.push(pdu_sz); + pdu_buff.push(pdu_sz_nbits); } else { Error("Writing PDU message to packet\n"); return false; @@ -234,21 +240,22 @@ bool mux::assemble_pdu(uint32_t pdu_sz) { } -bool mux::allocate_sdu(uint32_t lcid, mac_pdu *pdu) +bool mux::allocate_sdu(uint32_t lcid, sch_pdu *pdu_msg) { - return allocate_sdu(lcid, pdu, NULL); + return allocate_sdu(lcid, pdu_msg, NULL); } -bool mux::allocate_sdu(uint32_t lcid, mac_pdu *pdu, uint32_t *sdu_sz) +bool mux::allocate_sdu(uint32_t lcid, sch_pdu *pdu_msg, uint32_t *sdu_sz) { // Get n-th pending SDU pointer and length uint32_t buff_len; - uint8_t *buff_ptr = (uint8_t*) mac_io_h->get(lcid)->pop(&buff_len, nof_tx_pkts[lcid]); + uint8_t *buff_ptr = (uint8_t*) mac_io_h->get(mac_io::MAC_LCH_CCCH_UL + lcid)->pop(&buff_len, nof_tx_pkts[lcid]); if (buff_ptr) { // there is pending SDU to allocate - if (pdu->write_next()) { // there is space for a new subheader - if (pdu->get()->set_sdu(buff_ptr, buff_len)) { // new SDU could be added + if (pdu_msg->new_subh()) { // there is space for a new subheader + pdu_msg->next(); + if (pdu_msg->get()->set_sdu(lcid, buff_ptr, buff_len/8)) { // new SDU could be added // Increase number of pop'ed packets from queue nof_tx_pkts[lcid]++; return true; diff --git a/srsapps/ue/mac/src/pdu.cc b/srsapps/ue/mac/src/pdu.cc new file mode 100644 index 000000000..058efae63 --- /dev/null +++ b/srsapps/ue/mac/src/pdu.cc @@ -0,0 +1,497 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include +#include +#include + +#include "srsapps/ue/mac/pdu.h" +#include "srslte/srslte.h" + +namespace srslte { + namespace ue { + + +void sch_pdu::fprint(FILE* stream) +{ + fprintf(stream, "MAC SDU for UL/DL-SCH. "); + pdu::fprint(stream); +} + +void sch_subh::fprint(FILE* stream) +{ + if (is_sdu()) { + fprintf(stream, "SDU LCHID=%d, SDU nof_bytes=%d\n", lcid, nof_bytes); + } else { + switch(lcid) { + case C_RNTI: + fprintf(stream, "C-RNTI CE: %d\n", get_c_rnti()); + break; + case CON_RES_ID: + fprintf(stream, "Contention Resolution ID CE: %d\n", get_con_res_id()); + break; + case TA_CMD: + fprintf(stream, "Time Advance Command CE: %d\n", get_ta_cmd()); + break; + } + } +} + +// Section 6.1.2 +bool sch_pdu::write_packet(uint8_t* ptr) +{ + // Add single or two-byte padding if required + if (rem_len == 1 || rem_len == 2) { + sch_subh padding; + padding.set_padding(); + for (int i=0;i= 0) { + last_sdu--; + } + int last_ce = nof_subheaders-1; + while(subheaders[last_ce].is_sdu() && last_ce >= 0) { + last_ce--; + } + int last_sh = subheaders[last_sdu].is_sdu()?last_sdu:last_ce; + // Write subheaders for MAC CE first + for (int i=0;i= nbytes + 1) { + return true; + } else { + return false; + } +} +bool sch_pdu::has_space_sdu(uint32_t nbytes) +{ + if (rem_len >= size_plus_header_pdu(nbytes)) { + return true; + } else { + return false; + } +} +bool sch_pdu::update_space_ce(uint32_t nbytes) +{ + if (has_space_ce(nbytes)) { + rem_len -= nbytes + 1; + } +} +bool sch_pdu::update_space_sdu(uint32_t nbytes) +{ + if (has_space_sdu(nbytes)) { + rem_len -= size_plus_header_pdu(nbytes); + } +} + + + +void sch_subh::init() +{ + lcid = 0; + nof_bytes = 0; + sdu_payload_ptr = NULL; + bzero(ce_payload, sizeof(uint8_t) * MAX_CE_PAYLOAD_LEN); +} + +sch_subh::cetype sch_subh::ce_type() +{ + if (lcid >= PHD_REPORT) { + return (cetype) lcid; + } else { + return SDU; + } +} + +uint32_t sch_subh::sizeof_ce(uint32_t lcid, bool is_ul) +{ + if (is_ul) { + switch(lcid) { + case PHD_REPORT: + return 1; + case C_RNTI: + return 2; + case TRUNC_BSR: + return 1; + case SHORT_BSR: + return 1; + case LONG_BSR: + return 3; + case PADDING: + return 0; + } + } else { + switch(lcid) { + case CON_RES_ID: + return 6; + case TA_CMD: + return 1; + case DRX_CMD: + return 0; + case PADDING: + return 0; + } + } +} +bool sch_subh::is_sdu() +{ + return ce_type() == SDU; +} +uint16_t sch_subh::get_c_rnti() +{ + return *((uint16_t*) ce_payload); +} +uint64_t sch_subh::get_con_res_id() +{ + return *((uint64_t*) ce_payload); +} +uint8_t sch_subh::get_phd() +{ + return *((uint8_t*) ce_payload); +} +uint32_t sch_subh::get_sdu_lcid() +{ + return *((uint32_t*) ce_payload); +} +uint32_t sch_subh::get_sdu_nbytes() +{ + return *((uint32_t*) ce_payload); +} +uint8_t* sch_subh::get_sdu_ptr() +{ + return sdu_payload_ptr; +} +uint8_t sch_subh::get_ta_cmd() +{ + return *((uint8_t*) ce_payload); +} +void sch_subh::set_padding() +{ + lcid = PADDING; +} +bool sch_subh::set_c_rnti(uint16_t crnti) +{ + if (((sch_pdu*)parent)->has_space_ce(2)) { + *((uint16_t*) ce_payload) = crnti; + lcid = C_RNTI; + ((sch_pdu*)parent)->update_space_ce(2); + return true; + } else { + return false; + } +} +bool sch_subh::set_con_res_id(uint64_t con_res_id) +{ + if (((sch_pdu*)parent)->has_space_ce(6)) { + *((uint64_t*) ce_payload) = con_res_id; + lcid = CON_RES_ID; + ((sch_pdu*)parent)->update_space_ce(6); + return true; + } else { + return false; + } +} +bool sch_subh::set_phd(uint8_t phd) +{ + if (((sch_pdu*)parent)->has_space_ce(1)) { + *((uint8_t*) ce_payload) = phd; + lcid = PHD_REPORT; + ((sch_pdu*)parent)->update_space_ce(1); + return true; + } else { + return false; + } +} +bool sch_subh::set_sdu(uint32_t lcid_, uint8_t* ptr, uint32_t nof_bytes_) +{ + if (((sch_pdu*)parent)->has_space_sdu(nof_bytes_)) { + sdu_payload_ptr = ptr; + nof_bytes = nof_bytes_; + lcid = lcid_; + ((sch_pdu*)parent)->update_space_sdu(nof_bytes_); + return true; + } else { + return false; + } +} +bool sch_subh::set_ta_cmd(uint8_t ta_cmd) +{ + if (((sch_pdu*)parent)->has_space_ce(1)) { + *((uint8_t*) ce_payload) = ta_cmd; + lcid = TA_CMD; + ((sch_pdu*)parent)->update_space_ce(1); + return true; + } else { + return false; + } +} +// Section 6.2.1 +void sch_subh::write_subheader(uint8_t** ptr, bool is_last) +{ + if (is_sdu()) { + // MAC SDU: R/R/E/LCID/F/L subheader + srslte_bit_pack(0, ptr, 2); // R, R + srslte_bit_pack(is_last?1:0, ptr, 1); // E + srslte_bit_pack(lcid, ptr, 5); // LCID + + // 2nd and 3rd octet + srslte_bit_pack(F_bit?1:0, ptr, 1); // F + srslte_bit_pack(nof_bytes, ptr, nof_bytes<128?7:15); // L + } else { + // MAC CE: R/R/E/LCID MAC Subheader + srslte_bit_pack(0, ptr, 2); // R, R + srslte_bit_pack(is_last?1:0, ptr, 1); // E + srslte_bit_pack(lcid, ptr, 5); // LCID + } +} +void sch_subh::write_payload(uint8_t** ptr) +{ + if (is_sdu()) { + memcpy(*ptr, sdu_payload_ptr, nof_bytes*8*sizeof(uint8_t)); + } else { + srslte_bit_pack_vector(ce_payload, *ptr, nof_bytes*8); + } + *ptr += nof_bytes*8; +} +bool sch_subh::read_subheader(uint8_t** ptr) +{ + // Skip R + *ptr += 2; + bool e_bit = srslte_bit_unpack(ptr, 1)?true:false; + lcid = srslte_bit_unpack(ptr, 5); + if (is_sdu()) { + F_bit = srslte_bit_unpack(ptr, 1)?true:false; + nof_bytes = srslte_bit_unpack(ptr, F_bit?7:15); + } else { + nof_bytes = sizeof_ce(lcid, parent->is_ul()); + } + return e_bit; +} +void sch_subh::read_payload(uint8_t** ptr) +{ + if (is_sdu()) { + sdu_payload_ptr = *ptr; + } else { + srslte_bit_unpack_vector(ce_payload, *ptr, nof_bytes*8); + } + *ptr += nof_bytes*8; +} + + + + + + + + + + + + +void rar_pdu::fprint(FILE* stream) +{ + fprintf(stream, "MAC PDU for RAR. "); + if (has_backoff_indicator) { + fprintf(stream, "Backoff Indicator %d. ", backoff_indicator); + } + pdu::fprint(stream); +} + +void rar_subh::fprint(FILE* stream) +{ + fprintf(stream, "RAPID: %d, Temp C-RNTI: %d, TA: %d, UL Grant: ", preamble, temp_rnti, ta); + srslte_vec_fprint_hex(stream, grant, 20); +} + +rar_pdu::rar_pdu(uint32_t max_rars_) : pdu(max_rars_) +{ + backoff_indicator = 0; + has_backoff_indicator = false; +} +uint8_t rar_pdu::get_backoff() +{ + return backoff_indicator; +} +bool rar_pdu::has_backoff() +{ + return has_backoff_indicator; +} +void rar_pdu::set_backoff(uint8_t bi) +{ + has_backoff_indicator = true; + backoff_indicator = bi; +} + +// Section 6.1.5 +bool rar_pdu::write_packet(uint8_t* ptr) +{ + // Write Backoff Indicator, if any + if (has_backoff_indicator) { + if (nof_subheaders > 0) { + srslte_bit_pack(1, &ptr, 1); // E + srslte_bit_pack(0, &ptr, 1); // T + srslte_bit_pack(0, &ptr, 2); // R, R + srslte_bit_pack(backoff_indicator, &ptr, 4); + } + } + // Write RAR subheaders + for (int i=0;iset_backoff((uint8_t) srslte_bit_unpack(ptr, 4)); + } + return e_bit; +} + + + + + } +} diff --git a/srsapps/ue/mac/src/proc_ra.cc b/srsapps/ue/mac/src/proc_ra.cc index 0fa6c4e8f..c0cc11aa7 100644 --- a/srsapps/ue/mac/src/proc_ra.cc +++ b/srsapps/ue/mac/src/proc_ra.cc @@ -28,6 +28,7 @@ #include #include +#include #include "srsapps/ue/mac/mac_params.h" #include "srsapps/ue/mac/mac_io.h" @@ -126,8 +127,9 @@ uint32_t interval(uint32_t x1, uint32_t x2) { } } -const char* state_str[10] = {"Idle", +const char* state_str[11] = {"Idle", "RA Initializat.: ", + "RA Initial.Wait: ", "RA ResSelection: ", "RA PreambleTx : ", "RA PreambleRx : ", @@ -163,6 +165,15 @@ void ra_proc::process_timeadv_cmd(uint32_t tti, uint32_t ta) { } } +void* init_prach_thread(void *arg) { + phy* phy_h = (phy*) arg; + if (phy_h->init_prach()) { + return (void*) 0; + } else { + return (void*) -1; + } +} + void ra_proc::step_initialization() { read_params(); pdcch_to_crnti_received = PDCCH_CRNTI_NOT_RECEIVED; @@ -172,10 +183,27 @@ void ra_proc::step_initialization() { first_rar_received = true; mux_unit->msg3_flush(); backoff_param_ms = 0; - phy_h->init_prach(); - state = RESOURCE_SELECTION; - rInfo("Done\n"); + if (pthread_create(&pt_init_prach, NULL, init_prach_thread, phy_h)) { + perror("pthread_create"); + state = RA_PROBLEM; + } else { + state = INITIALIZATION_WAIT; + } +} +void ra_proc::step_initialization_wait() { + int n = pthread_kill(pt_init_prach, 0); + if (n) { + void *status; + pthread_join(pt_init_prach, &status); + if (status) { + rError("Initializing PRACH on PHY\n"); + state = RA_PROBLEM; + } else { + rInfo("PRACH init OK\n"); + state = RESOURCE_SELECTION; + } + } } void ra_proc::step_resource_selection() { @@ -232,8 +260,7 @@ void ra_proc::step_response_reception() { dl_buffer *dl_buffer = phy_h->get_dl_buffer(tti); if (dl_buffer->get_dl_grant(&rar_grant)) { - rInfo("DL grant found RA-RNTI=%d\n", ra_rnti); - + rInfo("DL grant found RA-RNTI=%d\n", ra_rnti); if (rar_grant.get_tbs() > MAX_RAR_PDU_LEN) { rError("RAR PDU exceeds local RAR PDU buffer (%d>%d)\n", rar_grant.get_tbs(), MAX_RAR_PDU_LEN); state = RESPONSE_ERROR; @@ -241,28 +268,33 @@ void ra_proc::step_response_reception() { } // Decode packet + dl_buffer->reset_softbuffer(); if (dl_buffer->decode_data(&rar_grant, rar_pdu_buffer)) { - rar_pdu.init(rar_grant.get_tbs()); + rDebug("RAR decoded successfully TBS=%d\n", rar_grant.get_tbs()); + + rar_pdu_msg.init(rar_grant.get_tbs()/8); + rar_pdu_msg.parse_packet(rar_pdu_buffer); + rar_pdu_msg.fprint(stdout); // Set Backoff parameter - if (rar_pdu.is_backoff()) { - backoff_param_ms = backoff_table[rar_pdu.get_backoff()%16]; + if (rar_pdu_msg.has_backoff()) { + backoff_param_ms = backoff_table[rar_pdu_msg.get_backoff()%16]; } else { backoff_param_ms = 0; } - while(rar_pdu.read_next()) { - if (rar_pdu.get()->get_rapid() == sel_preamble) { + while(rar_pdu_msg.next()) { + if (rar_pdu_msg.get()->get_rapid() == sel_preamble) { rInfo("Received RAPID=%d\n", sel_preamble); - process_timeadv_cmd(tti, rar_pdu.get()->get_ta_cmd()); + process_timeadv_cmd(tti, rar_pdu_msg.get()->get_ta_cmd()); // FIXME: Indicate received target power //phy_h->set_target_power_rar(iniReceivedTargetPower, (preambleTransmissionCounter-1)*powerRampingStep); // Indicate grant to PHY layer. RAR grants have 6 sf delay (4 is the default delay) - uint8_t grant[mac_rar_pdu::mac_rar::RAR_GRANT_LEN]; - rar_pdu.get()->get_sched_grant(grant); + uint8_t grant[rar_subh::RAR_GRANT_LEN]; + rar_pdu_msg.get()->get_sched_grant(grant); phy_h->get_dl_buffer(tti+2)->set_rar_grant(grant); if (preambleIndex > 0) { @@ -270,7 +302,7 @@ void ra_proc::step_response_reception() { state = COMPLETION; } else { // Preamble selected by UE MAC - params_db->set_param(mac_params::RNTI_TEMP, rar_pdu.get()->get_temp_crnti()); + params_db->set_param(mac_params::RNTI_TEMP, rar_pdu_msg.get()->get_temp_crnti()); if (first_rar_received) { first_rar_received = false; @@ -287,23 +319,26 @@ void ra_proc::step_response_reception() { } // Get TransportBlock size for the grant - ul_sched_grant msg3_grant(rar_pdu.get()->get_temp_crnti()); + ul_sched_grant msg3_grant(sched_grant::RNTI_TYPE_TEMP, rar_pdu_msg.get()->get_temp_crnti()); phy_h->get_dl_buffer(tti+2)->get_ul_grant(&msg3_grant); // Move MAC PDU from Multiplexing and assembly unit to Msg3 mux_unit->pdu_move_to_msg3(tti, msg3_grant.get_tbs()); // 56 is the minimum grant provided - - state = CONTENTION_RESOLUTION; - - // Start contention resolution timer - timers_db->get(mac::CONTENTION_TIMER)->reset(); - timers_db->get(mac::CONTENTION_TIMER)->run(); - } + } + rDebug("Going to Contention Resolution state\n"); + state = CONTENTION_RESOLUTION; + + // Start contention resolution timer + timers_db->get(mac::CONTENTION_TIMER)->reset(); + timers_db->get(mac::CONTENTION_TIMER)->run(); } + } else { + rDebug("Found RAR for preamble %d\n", rar_pdu_msg.get()->get_rapid()); } } } } + srslte_verbose = SRSLTE_VERBOSE_NONE; } if (interval_ra > 3+responseWindowSize && interval_ra < 10000) { rInfo("Timeout while trying to receive RAR\n"); @@ -344,10 +379,11 @@ void ra_proc::step_backoff_wait() { void ra_proc::step_contention_resolution() { // If Msg3 has been sent - if (mux_unit->msg3_isempty()) { + if (mux_unit->msg3_isempty()) { msg3_transmitted = true; if (pdcch_to_crnti_received != PDCCH_CRNTI_NOT_RECEIVED) { + rInfo("PDCCH for C-RNTI received\n"); // Random Access initiated by MAC itself or PDCCH order (transmission of MAC C-RNTI CE) if (start_mode == MAC_ORDER && pdcch_to_crnti_received == PDCCH_CRNTI_UL_GRANT || start_mode == PDCCH_ORDER) @@ -363,6 +399,7 @@ void ra_proc::step_contention_resolution() { // Random Access initiated by RRC by the transmission of CCCH SDU received_contention_id = demux_unit->get_contention_resolution_id(); if (received_contention_id) { + rInfo("Received UE Contention Resolution ID\n"); // MAC PDU successfully decoded and contains MAC CE contention Id if (transmitted_contention_id == received_contention_id) { @@ -374,13 +411,17 @@ void ra_proc::step_contention_resolution() { demux_unit->demultiplex_pending_pdu(tti); state = COMPLETION; } else { + rInfo("Transmitted UE Contention Id differs from received Contention ID\n"); // Discard MAC PDU state = RESPONSE_ERROR; } params_db->set_param(mac_params::RNTI_TEMP, 0); } } + } else { + rDebug("Msg3 not yet transmitted\n"); } + } void ra_proc::step_completition() { @@ -400,6 +441,9 @@ void ra_proc::step(uint32_t tti_) case INITIALIZATION: step_initialization(); break; + case INITIALIZATION_WAIT: + step_initialization_wait(); + break; case RESOURCE_SELECTION: step_resource_selection(); break; @@ -430,6 +474,7 @@ void ra_proc::start_mac_order() if (state == IDLE || state == COMPLETION || state == RA_PROBLEM) { start_mode = MAC_ORDER; state = INITIALIZATION; + run(); } } @@ -438,6 +483,7 @@ void ra_proc::start_pdcch_order() if (state == IDLE || state == COMPLETION || state == RA_PROBLEM) { start_mode = PDCCH_ORDER; state = INITIALIZATION; + run(); } } @@ -446,12 +492,14 @@ void ra_proc::start_rlc_order() if (state == IDLE || state == COMPLETION || state == RA_PROBLEM) { start_mode = RLC_ORDER; state = INITIALIZATION; + run(); } } // Contention Resolution Timer is expired (Section 5.1.5) void ra_proc::timer_expired(uint32_t timer_id) { + rInfo("Contention Resolution Timer expired. Going to Response Error\n"); params_db->set_param(mac_params::RNTI_TEMP, 0); state = RESPONSE_ERROR; } diff --git a/srsapps/ue/mac/src/ul_harq.cc b/srsapps/ue/mac/src/ul_harq.cc index 8c6fd431f..1f7de273b 100644 --- a/srsapps/ue/mac/src/ul_harq.cc +++ b/srsapps/ue/mac/src/ul_harq.cc @@ -46,13 +46,13 @@ ul_harq_entity::ul_harq_entity() { ul_harq_entity::~ul_harq_entity() { delete proc; } -bool ul_harq_entity::init(srslte_cell_t cell, uint32_t max_payload_len, log *log_h_, timers *timers_db_, mux *mux_unit_) { +bool ul_harq_entity::init(srslte_cell_t cell, log *log_h_, timers *timers_db_, mux *mux_unit_) { log_h = log_h_; mux_unit = mux_unit_; timers_db = timers_db_; for (uint32_t i=0;ilog_h; - payload = (uint8_t*) srslte_vec_malloc(sizeof(uint8_t) * max_payload_len); - return payload?true:false; } } // Retransmission with or w/o grant (Section 5.4.2.2) void ul_harq_entity::ul_harq_process::generate_retx(ul_sched_grant* grant, ul_buffer* ul) { - current_tx_nb++; - + current_tx_nb++; if (grant) { // HARQ entity requests an adaptive transmission memcpy(&cur_grant, grant, sizeof(grant)); current_irv = irv_of_rv[grant->get_rv()%4]; harq_feedback = false; - generate_tx(ul); + generate_tx(NULL, ul); } else { // HARQ entity requests a non-adaptive transmission if (!harq_feedback) { - generate_tx(ul); + generate_tx(NULL, ul); } } @@ -226,17 +225,17 @@ void ul_harq_entity::ul_harq_process::generate_retx(ul_sched_grant* grant, ul_bu // New transmission (Section 5.4.2.2) void ul_harq_entity::ul_harq_process::generate_new_tx(uint8_t *pdu_payload, bool is_msg3_, ul_sched_grant* ul_grant, ul_buffer* ul) { - if (ul_grant && pdu_payload && ul_grant->get_tbs() < max_payload_len) { + if (ul_grant && pdu_payload) { current_tx_nb = 0; current_irv = 0; - // Store MAC PDU in the HARQ buffer - srslte_bit_pack_vector(pdu_payload, payload, ul_grant->get_tbs()); + srslte_softbuffer_tx_reset(&softbuffer); // Store the uplink grant - memcpy(&cur_grant, ul_grant, sizeof(ul_grant)); + memcpy(&cur_grant, ul_grant, sizeof(ul_sched_grant)); harq_feedback = false; - generate_tx(ul); + generate_tx(pdu_payload, ul); is_grant_configured = true; is_msg3 = is_msg3_; + Info("New %s transmission PDU Len %d bytes\n", is_msg3_?"Msg3":"", cur_grant.get_tbs()); } } @@ -246,12 +245,13 @@ void ul_harq_entity::ul_harq_process::generate_retx(ul_buffer* ul) } // Transmission of pending frame (Section 5.4.2.2) -void ul_harq_entity::ul_harq_process::generate_tx(ul_buffer* ul) +void ul_harq_entity::ul_harq_process::generate_tx(uint8_t *pdu_payload, ul_buffer* ul) { cur_grant.set_rv(rv_of_irv[current_irv%4]); ul->set_current_tx_nb(current_tx_nb); - ul->generate_data(&cur_grant, &softbuffer, payload); + ul->generate_data(&cur_grant, &softbuffer, pdu_payload); current_irv = (current_irv+1)%4; + Info("UL transmission RV=%d, TBS=%d\n", cur_grant.get_rv(), cur_grant.get_tbs()); if (is_msg3) { if (current_tx_nb == maxHARQ_Msg3Tx) { reset(); diff --git a/srsapps/ue/mac/test/CMakeLists.txt b/srsapps/ue/mac/test/CMakeLists.txt index 412c8f966..9b3c92b00 100644 --- a/srsapps/ue/mac/test/CMakeLists.txt +++ b/srsapps/ue/mac/test/CMakeLists.txt @@ -24,5 +24,5 @@ FIND_PACKAGE(openLTE) IF(UHD_FOUND AND OPENLTE_FOUND) INCLUDE_DIRECTORIES(${OPENLTE_INCLUDE_DIRS}) ADD_EXECUTABLE(mac_test mac_test.cc) - TARGET_LINK_LIBRARIES(mac_test srsapps_ue_mac srsapps_ue_phy srsapps_common srsapps_radio srslte ${OPENLTE_LIBRARIES}) + TARGET_LINK_LIBRARIES(mac_test srsapps_ue_mac srsapps_ue_phy srsapps_common srsapps_radio srslte ${OPENLTE_LIBRARIES} srslte_uhd) ENDIF(UHD_FOUND AND OPENLTE_FOUND) diff --git a/srsapps/ue/mac/test/mac_test.cc b/srsapps/ue/mac/test/mac_test.cc index b8a8d812f..564d77ce3 100644 --- a/srsapps/ue/mac/test/mac_test.cc +++ b/srsapps/ue/mac/test/mac_test.cc @@ -122,9 +122,10 @@ void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srslte::u mac->set_param(srslte::ue::mac_params::RA_MAXTXMSG3, sib2->rr_config_common_sib.rach_cnfg.max_harq_msg3_tx); - printf("Set RACH ConfigCommon: NofPreambles=%d, ResponseWindow=%d\n", + printf("Set RACH ConfigCommon: NofPreambles=%d, ResponseWindow=%d, ContentionResolutionTimer=%d ms\n", liblte_rrc_number_of_ra_preambles_num[sib2->rr_config_common_sib.rach_cnfg.num_ra_preambles], - liblte_rrc_ra_response_window_size_num[sib2->rr_config_common_sib.rach_cnfg.ra_resp_win_size]); + liblte_rrc_ra_response_window_size_num[sib2->rr_config_common_sib.rach_cnfg.ra_resp_win_size], + liblte_rrc_mac_contention_resolution_timer_num[sib2->rr_config_common_sib.rach_cnfg.mac_con_res_timer]); // PDSCH ConfigCommon mac->set_param(srslte::ue::mac_params::PDSCH_RSPOWER, @@ -133,6 +134,7 @@ void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srslte::u sib2->rr_config_common_sib.pdsch_cnfg.p_b); // PUSCH ConfigCommon + phy->set_param(srslte::ue::phy_params::PUSCH_BETA, 10); phy->set_param(srslte::ue::phy_params::PUSCH_EN_64QAM, sib2->rr_config_common_sib.pusch_cnfg.enable_64_qam); phy->set_param(srslte::ue::phy_params::PUSCH_HOPPING_OFFSET, @@ -150,12 +152,14 @@ void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srslte::u phy->set_param(srslte::ue::phy_params::PUSCH_RS_GROUP_ASSIGNMENT, sib2->rr_config_common_sib.pusch_cnfg.ul_rs.group_assignment_pusch); - printf("Set PUSCH ConfigCommon: HopOffset=%d, RSGroup=%d, RSNcs=%d\n", + printf("Set PUSCH ConfigCommon: HopOffset=%d, RSGroup=%d, RSNcs=%d, N_sb=%d\n", sib2->rr_config_common_sib.pusch_cnfg.pusch_hopping_offset, sib2->rr_config_common_sib.pusch_cnfg.ul_rs.group_assignment_pusch, - sib2->rr_config_common_sib.pusch_cnfg.ul_rs.cyclic_shift); + sib2->rr_config_common_sib.pusch_cnfg.ul_rs.cyclic_shift, + sib2->rr_config_common_sib.pusch_cnfg.n_sb); // PUCCH ConfigCommon + phy->set_param(srslte::ue::phy_params::PUCCH_BETA, 10); phy->set_param(srslte::ue::phy_params::PUCCH_DELTA_SHIFT, liblte_rrc_delta_pucch_shift_num[sib2->rr_config_common_sib.pucch_cnfg.delta_pucch_shift]); phy->set_param(srslte::ue::phy_params::PUCCH_CYCLIC_SHIFT, @@ -276,7 +280,7 @@ int main(int argc, char *argv[]) liblte_rrc_pack_ul_ccch_msg(&ul_ccch_msg, &bit_msg); mac.set_param(srslte::ue::mac_params::CONTENTION_ID, ul_ccch_msg.msg.rrc_con_req.ue_id.random); - + // Send ConnectionRequest Packet mac.send_ccch_sdu(bit_msg.msg, bit_msg.N_bits); state = CONNECT; diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h index 228777cc4..27a505560 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/dl_buffer.h @@ -54,7 +54,9 @@ namespace ue { bool get_dl_grant(dl_sched_grant *grant); void discard_pending_rar_grant(); void set_rar_grant(srslte_dci_rar_grant_t *rar_grant); - void set_rar_grant(uint8_t grant[SRSLTE_RAR_GRANT_LEN]); + void set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN]); + void release_pending_rar_grant(); + void reset_softbuffer(); bool decode_ack(ul_sched_grant *pusch_grant); bool decode_data(dl_sched_grant *pdsch_grant, uint8_t *payload); // returns true or false for CRC OK/NOK bool decode_data(dl_sched_grant *grant, srslte_softbuffer_rx_t *softbuffer, uint8_t *payload); diff --git a/srsapps/ue/phy/src/dl_buffer.cc b/srsapps/ue/phy/src/dl_buffer.cc index 6c4053367..06a24dc40 100644 --- a/srsapps/ue/phy/src/dl_buffer.cc +++ b/srsapps/ue/phy/src/dl_buffer.cc @@ -68,7 +68,7 @@ bool dl_buffer::recv_ue_sync(srslte_ue_sync_t *ue_sync, srslte_timestamp_t *rx_t { bool ret = false; if (signal_buffer) { - INFO("DL Buffer TTI %d: Receiving packet\n", tti); + DEBUG("DL Buffer TTI %d: Receiving packet\n", tti); cf_t *sf_buffer = NULL; sf_symbols_and_ce_done = false; pdcch_llr_extracted = false; @@ -86,12 +86,14 @@ void dl_buffer::discard_pending_rar_grant() { pending_rar_grant = false; } +void dl_buffer::release_pending_rar_grant() { + pending_rar_grant = false; +} + bool dl_buffer::get_ul_grant(ul_sched_grant *grant) { if (signal_buffer) { - printf("get_ul_grant tti=%d, is_temp_rnti=%d\n", tti, grant->is_temp_rnti()); if (pending_rar_grant && grant->is_temp_rnti()) { - printf("Get pending RAR grant tti=%d\n", tti); return grant->create_from_rar(&rar_grant, cell, 0, params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET)); } else { if (!sf_symbols_and_ce_done) { @@ -117,39 +119,41 @@ bool dl_buffer::get_ul_grant(ul_sched_grant *grant) } } -void dl_buffer::set_rar_grant(uint8_t grant[SRSLTE_RAR_GRANT_LEN]) +// Unpack RAR grant as defined in Section 6.2 of 36.213 +void dl_buffer::set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN]) { - srslte_dci_rar_grant_t rar_grant; - + pending_rar_grant = true; + srslte_dci_rar_grant_unpack(&rar_grant, grant_payload); + srslte_dci_rar_grant_fprint(stdout, &rar_grant); } void dl_buffer::set_rar_grant(srslte_dci_rar_grant_t* rar_grant_) { - printf("Set pending RAR grant tti=%d\n", tti); pending_rar_grant = true; memcpy(&rar_grant, rar_grant_, sizeof(srslte_dci_rar_grant_t)); + srslte_dci_rar_grant_fprint(stdout, &rar_grant); } bool dl_buffer::get_dl_grant(dl_sched_grant *grant) { if (signal_buffer && is_ready()) { - INFO("DL Buffer TTI %d: Getting DL grant\n", tti); + DEBUG("DL Buffer TTI %d: Getting DL grant\n", tti); if (!sf_symbols_and_ce_done) { - INFO("DL Buffer TTI %d: Getting DL grant. Calling fft estimate\n", tti); + DEBUG("DL Buffer TTI %d: Getting DL grant. Calling fft estimate\n", tti); if (srslte_ue_dl_decode_fft_estimate(&ue_dl, signal_buffer, tti%10, &cfi) < 0) { return false; } sf_symbols_and_ce_done = true; } if (!pdcch_llr_extracted) { - INFO("DL Buffer TTI %d: Getting DL grant. extracting LLR\n", tti); + DEBUG("DL Buffer TTI %d: Getting DL grant. extracting LLR\n", tti); if (srslte_pdcch_extract_llr(&ue_dl.pdcch, ue_dl.sf_symbols, ue_dl.ce, 0, tti%10, cfi)) { return false; } pdcch_llr_extracted = true; } - if (SRSLTE_VERBOSE_ISINFO()) { + if (SRSLTE_VERBOSE_ISDEBUG()) { srslte_vec_save_file((char*) "ce1", ue_dl.ce[0], SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp)*sizeof(cf_t)); srslte_vec_save_file((char*) "ce2", ue_dl.ce[1], SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp)*sizeof(cf_t)); srslte_vec_save_file((char*) "pdcch_d", ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce*sizeof(cf_t)); @@ -179,6 +183,11 @@ bool dl_buffer::decode_ack(ul_sched_grant *grant) } } +void dl_buffer::reset_softbuffer() +{ + srslte_softbuffer_rx_reset(&ue_dl.softbuffer); +} + bool dl_buffer::decode_data(dl_sched_grant *grant, uint8_t *payload) { return decode_data(grant, &ue_dl.softbuffer, payload); @@ -187,9 +196,9 @@ bool dl_buffer::decode_data(dl_sched_grant *grant, uint8_t *payload) bool dl_buffer::decode_data(dl_sched_grant *grant, srslte_softbuffer_rx_t *softbuffer, uint8_t *payload) { if (signal_buffer && is_ready()) { - INFO("DL Buffer TTI %d: Decoding PDSCH\n", tti); + DEBUG("DL Buffer TTI %d: Decoding PDSCH\n", tti); if (!sf_symbols_and_ce_done) { - INFO("DL Buffer TTI %d: Decoding PDSCH. Calling fft estimate\n", tti); + DEBUG("DL Buffer TTI %d: Decoding PDSCH. Calling fft estimate\n", tti); if (srslte_ue_dl_decode_fft_estimate(&ue_dl, signal_buffer, tti%10, &cfi) < 0) { return false; } @@ -201,7 +210,7 @@ bool dl_buffer::decode_data(dl_sched_grant *grant, srslte_softbuffer_rx_t *softb int ret = srslte_pdsch_decode_rnti(&ue_dl.pdsch, &ue_dl.pdsch_cfg, softbuffer, ue_dl.sf_symbols, ue_dl.ce, 0, grant->get_rnti(), payload); - if (SRSLTE_VERBOSE_ISINFO()) { + if (SRSLTE_VERBOSE_ISDEBUG()) { srslte_vec_save_file((char*) "pdsch_d", ue_dl.pdsch.d, ue_dl.pdsch_cfg.grant.nof_re*sizeof(cf_t)); } if (ret == SRSLTE_SUCCESS) { diff --git a/srsapps/ue/phy/src/phy.cc b/srsapps/ue/phy/src/phy.cc index 9277d48ab..22ef60725 100644 --- a/srsapps/ue/phy/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -43,6 +43,7 @@ namespace ue { bool phy::init(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_) { started = false; + radio_is_streaming = false; ttisync = ttisync_; radio_handler = radio_handler_; ul_buffer_queue = new queue(6, sizeof(ul_buffer)); @@ -55,8 +56,7 @@ bool phy::init(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_) pthread_attr_t attr; struct sched_param param; - param.sched_priority = 99; - + param.sched_priority = -20; pthread_attr_init(&attr); pthread_attr_setschedpolicy(&attr, SCHED_FIFO); pthread_attr_setschedparam(&attr, ¶m); @@ -115,10 +115,10 @@ void phy::set_param(phy_params::phy_param_t param, int64_t value) { // FIXME: Add PRACH power control bool phy::send_prach(uint32_t preamble_idx) { - send_prach(preamble_idx, -1, 0); + return send_prach(preamble_idx, -1, 0); } bool phy::send_prach(uint32_t preamble_idx, int allowed_subframe) { - send_prach(preamble_idx, allowed_subframe, 0); + return send_prach(preamble_idx, allowed_subframe, 0); } bool phy::send_prach(uint32_t preamble_idx, int allowed_subframe, int target_power_dbm) { @@ -202,7 +202,8 @@ void* phy::phy_thread_fnc(void *arg) { int radio_recv_wrapper_cs(void *h,void *data, uint32_t nsamples, srslte_timestamp_t *rx_time) { radio *radio_handler = (radio*) h; - return radio_handler->rx_now(data, nsamples, rx_time); + int n = radio_handler->rx_now(data, nsamples, rx_time); + return n; } bool phy::set_cell(srslte_cell_t cell_) { @@ -251,6 +252,9 @@ ul_buffer* phy::get_ul_buffer_adv(uint32_t tti) dl_buffer* phy::get_dl_buffer(uint32_t tti) { + if (tti + 6 < get_current_tti()) { + printf("Warning access to PHY too late. Requested TTI=%d while PHY is in %d\n", tti, get_current_tti()); + } return (dl_buffer*) dl_buffer_queue->get(tti); } diff --git a/srsapps/ue/phy/src/prach.cc b/srsapps/ue/phy/src/prach.cc index af1266568..7e9e3a40e 100644 --- a/srsapps/ue/phy/src/prach.cc +++ b/srsapps/ue/phy/src/prach.cc @@ -42,10 +42,10 @@ namespace ue { void prach::free_cell() { if (initiated) { - for (uint32_t i=0;i<64;i++) { + for (int i=0;i<64;i++) { if (buffer[i]) { - free(buffer[i]); - } + free(buffer[i]); + } } if (signal_buffer) { free(signal_buffer); @@ -69,12 +69,12 @@ bool prach::init_cell(srslte_cell_t cell_, phy_params *params_db_) } len = prach_obj.N_seq + prach_obj.N_cp; - for (uint32_t i=0;i<64;i++) { + for (int i=0;i<64;i++) { buffer[i] = (cf_t*) srslte_vec_malloc(len*sizeof(cf_t)); if(!buffer[i]) { return false; - } - if(srslte_prach_gen(&prach_obj, i, params_db->get_param(phy_params::PRACH_FREQ_OFFSET), buffer[i])){ + } + if(srslte_prach_gen(&prach_obj, i, params_db->get_param(phy_params::PRACH_FREQ_OFFSET), buffer[i])) { return false; } } @@ -86,10 +86,10 @@ bool prach::init_cell(srslte_cell_t cell_, phy_params *params_db_) } bool prach::prepare_to_send(uint32_t preamble_idx_) { - prepare_to_send(preamble_idx_, -1, 0); + return prepare_to_send(preamble_idx_, -1, 0); } bool prach::prepare_to_send(uint32_t preamble_idx_, int allowed_subframe_) { - prepare_to_send(preamble_idx_, allowed_subframe_, 0); + return prepare_to_send(preamble_idx_, allowed_subframe_, 0); } bool prach::prepare_to_send(uint32_t preamble_idx_, int allowed_subframe_, int target_power_dbm) { @@ -129,7 +129,7 @@ bool prach::is_ready_to_send(uint32_t current_tti_) { } } } - INFO("PRACH Buffer: Not ready to send at tti: %d\n", current_tti_); + DEBUG("PRACH Buffer: Not ready to send at tti: %d\n", current_tti_); return false; } @@ -149,12 +149,13 @@ bool prach::send(radio *radio_handler, float cfo, srslte_timestamp_t rx_time) srslte_timestamp_add(&tx_time, 0, 1e-3*tx_advance_sf); // Correct CFO before transmission - srslte_cfo_correct(&cfo_h, buffer[preamble_idx], signal_buffer, 2*cfo / srslte_symbol_sz(cell.nof_prb)); + srslte_cfo_correct(&cfo_h, buffer[preamble_idx], signal_buffer, 1.5*cfo/srslte_symbol_sz(cell.nof_prb)); // transmit radio_handler->tx(signal_buffer, len, tx_time); - INFO("PRACH transmitted CFO: %f, preamble=%d, len=%d rx_time=%f, tx_time=%f\n", cfo*15000, preamble_idx, len, rx_time.frac_secs, tx_time.frac_secs); - //srslte_vec_save_file("prach", buffer[preamble_idx], len*sizeof(cf_t)); + INFO("PRACH transmitted CFO: %f, preamble=%d, len=%d rx_time=%f, tx_time=%f\n", + cfo*15000, preamble_idx, len, rx_time.frac_secs, tx_time.frac_secs); + //srslte_vec_save_file("prach", buffer, len*sizeof(cf_t)); preamble_idx = -1; } diff --git a/srsapps/ue/phy/src/ul_buffer.cc b/srsapps/ue/phy/src/ul_buffer.cc index c10470ed7..f3f227f6c 100644 --- a/srsapps/ue/phy/src/ul_buffer.cc +++ b/srsapps/ue/phy/src/ul_buffer.cc @@ -28,6 +28,8 @@ #include #include #include +#include + #include "srslte/srslte.h" #include "srsapps/ue/phy/sched_grant.h" @@ -99,8 +101,7 @@ bool ul_buffer::uci_ready() { } bool ul_buffer::generate_data() { - ul_sched_grant dummy(0); - return generate_data(&dummy, NULL); + return generate_data(NULL, NULL); } bool ul_buffer::generate_data(ul_sched_grant *grant, @@ -108,7 +109,7 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, { generate_data(grant, &ue_ul.softbuffer, payload); } - + bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *softbuffer, uint8_t *payload) { if (is_ready()) { @@ -124,13 +125,15 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *sof dmrs_cfg.delta_ss = params_db->get_param(phy_params::PUSCH_RS_GROUP_ASSIGNMENT); srslte_pusch_hopping_cfg_t pusch_hopping; - bzero(&pusch_hopping, sizeof(srslte_pusch_hopping_cfg_t)); - pusch_hopping.n_sb = params_db->get_param(phy_params::PUSCH_HOPPING_N_SB); - pusch_hopping.hop_mode = params_db->get_param(phy_params::PUSCH_HOPPING_INTRA_SF) ? - pusch_hopping.SRSLTE_PUSCH_HOP_MODE_INTRA_SF : - pusch_hopping.SRSLTE_PUSCH_HOP_MODE_INTER_SF; - pusch_hopping.hopping_offset = params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET); - pusch_hopping.current_tx_nb = grant->get_current_tx_nb(); + if (grant) { + bzero(&pusch_hopping, sizeof(srslte_pusch_hopping_cfg_t)); + pusch_hopping.n_sb = params_db->get_param(phy_params::PUSCH_HOPPING_N_SB); + pusch_hopping.hop_mode = params_db->get_param(phy_params::PUSCH_HOPPING_INTRA_SF) ? + pusch_hopping.SRSLTE_PUSCH_HOP_MODE_INTRA_SF : + pusch_hopping.SRSLTE_PUSCH_HOP_MODE_INTER_SF; + pusch_hopping.hopping_offset = params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET); + pusch_hopping.current_tx_nb = grant->get_current_tx_nb(); + } srslte_pucch_cfg_t pucch_cfg; bzero(&pucch_cfg, sizeof(srslte_pucch_cfg_t)); @@ -159,7 +162,7 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *sof int n = 0; // Transmit on PUSCH if UL grant available, otherwise in PUCCH - if (payload) { + if (grant) { grant->to_pusch_cfg(tti%10, cell.cp, &pusch_cfg); n = srslte_ue_ul_pusch_encode_cfg(&ue_ul, &pusch_cfg, @@ -191,16 +194,26 @@ bool ul_buffer::send(srslte::radio* radio_handler, float time_adv_sec, float cfo srslte_timestamp_t tx_time; srslte_timestamp_copy(&tx_time, &rx_time); srslte_timestamp_add(&tx_time, 0, tx_advance_sf*1e-3 - time_adv_sec); - INFO("Send PUSCH TTI: %d, CFO: %f, len=%d, rx_time= %.6f tx_time = %.6f TA: %.1f us\n", + + // Compute peak + float max = -1; + if (SRSLTE_VERBOSE_ISINFO()) { + float *t = (float*) signal_buffer; + for (int i=0;i<2*SRSLTE_SF_LEN_PRB(cell.nof_prb);i++) { + if (fabsf(t[i]) > max) { + max = fabsf(t[i]); + } + } + } + INFO("Send PUSCH TTI: %d, CFO: %f, len=%d, rx_time= %.6f tx_time = %.6f TA: %.1f us PeakAmplitude=%f\n", tti, cfo*15000, SRSLTE_SF_LEN_PRB(cell.nof_prb), srslte_timestamp_real(&rx_time), - srslte_timestamp_real(&tx_time), time_adv_sec*1000000); + srslte_timestamp_real(&tx_time), time_adv_sec*1000000, max); // Correct CFO before transmission - srslte_cfo_correct(&ue_ul.cfo, signal_buffer, signal_buffer, cfo / srslte_symbol_sz(cell.nof_prb)); - - radio_handler->tx(signal_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb), tx_time); + srslte_cfo_correct(&ue_ul.cfo, signal_buffer, signal_buffer, 1.5*cfo / srslte_symbol_sz(cell.nof_prb)); + radio_handler->tx(signal_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb), tx_time); ready(); } diff --git a/srsapps/ue/phy/test/CMakeLists.txt b/srsapps/ue/phy/test/CMakeLists.txt index 736011d2e..37535af02 100644 --- a/srsapps/ue/phy/test/CMakeLists.txt +++ b/srsapps/ue/phy/test/CMakeLists.txt @@ -22,8 +22,8 @@ IF(UHD_FOUND) ADD_EXECUTABLE(ue_itf_test_sib1 ue_itf_test_sib1.cc) - TARGET_LINK_LIBRARIES(ue_itf_test_sib1 srsapps_ue_phy srsapps_radio srslte) + TARGET_LINK_LIBRARIES(ue_itf_test_sib1 srsapps_ue_phy srsapps_radio srslte srslte_uhd) ADD_EXECUTABLE(ue_itf_test_prach ue_itf_test_prach.cc) - TARGET_LINK_LIBRARIES(ue_itf_test_prach srsapps_ue_phy srsapps_radio srslte) + TARGET_LINK_LIBRARIES(ue_itf_test_prach srsapps_ue_phy srsapps_radio srslte srslte_uhd) ENDIF(UHD_FOUND) diff --git a/srsapps/ue/phy/test/ue_itf_test_prach.cc b/srsapps/ue/phy/test/ue_itf_test_prach.cc index 74b3701a4..f1daabccf 100644 --- a/srsapps/ue/phy/test/ue_itf_test_prach.cc +++ b/srsapps/ue/phy/test/ue_itf_test_prach.cc @@ -208,7 +208,7 @@ void config_phy() { phy.set_param(srslte::ue::phy_params::PRACH_FREQ_OFFSET, 0); phy.set_param(srslte::ue::phy_params::PRACH_HIGH_SPEED_FLAG, 0); phy.set_param(srslte::ue::phy_params::PRACH_ROOT_SEQ_IDX, 0); - phy.set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, 1); + phy.set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, 4); phy.set_param(srslte::ue::phy_params::PUSCH_BETA, 10); phy.set_param(srslte::ue::phy_params::PUSCH_RS_GROUP_HOPPING_EN, 0); @@ -233,6 +233,8 @@ uint32_t interval(uint32_t x1, uint32_t x2) { } } +srslte_softbuffer_rx_t softbuffer; + // This is the MAC implementation void run_tti(uint32_t tti) { INFO("MAC running tti: %d\n", tti); @@ -247,7 +249,7 @@ void run_tti(uint32_t tti) { // Indicate PHY to transmit the PRACH when possible if (phy.send_prach(preamble_idx)) { nof_tx_ra++; - state = RAR; + state = RAR; } else { fprintf(stderr, "Error sending PRACH\n"); exit(-1); @@ -265,12 +267,10 @@ void run_tti(uint32_t tti) { // Get DL grant for RA-RNTI=2 if (dl_buffer->get_dl_grant(&rar_grant)) { + srslte_softbuffer_rx_reset(&softbuffer); // Decode packet - if (dl_buffer->decode_data(&rar_grant, payload)) { + if (dl_buffer->decode_data(&rar_grant, &softbuffer, payload)) { rar_unpack(payload, &rar_msg); - if (!prog_args.continous) { - printf("Received RAR for preamble %d\n", rar_msg.RAPID); - } if (rar_msg.RAPID == preamble_idx) { INFO("Received RAR at TTI: %d\n", tti); @@ -358,6 +358,7 @@ void run_tti(uint32_t tti) { state = RA; } } else { + srslte_softbuffer_rx_reset(&softbuffer); state = CONNSETUP; } } @@ -369,7 +370,7 @@ void run_tti(uint32_t tti) { if (dl_buffer->get_dl_grant(&conn_setup_grant)) { // Decode packet - if (dl_buffer->decode_data(&conn_setup_grant, payload)) { + if (dl_buffer->decode_data(&conn_setup_grant, &softbuffer, payload)) { nof_rx_connsetup++; state = RA; nof_rtx_connsetup=0; @@ -397,6 +398,7 @@ void run_tti(uint32_t tti) { state = RA; } } + if (srslte_verbose == SRSLTE_VERBOSE_NONE && prog_args.continous) { printf("RECV RAR %2.1f \%% RECV ConnSetup %2.1f \%% (%5u/%5u) \r", (float) 100*nof_rx_rar/nof_tx_ra, @@ -404,6 +406,7 @@ void run_tti(uint32_t tti) { nof_rx_connsetup, nof_tx_ra); } + } int main(int argc, char *argv[]) @@ -426,7 +429,7 @@ int main(int argc, char *argv[]) // Setup PHY parameters config_phy(); - + // Set RX freq and gain phy.get_radio()->set_rx_freq(prog_args.uhd_rx_freq); phy.get_radio()->set_tx_freq(prog_args.uhd_tx_freq); @@ -446,6 +449,13 @@ int main(int argc, char *argv[]) exit(-1); } + if (!phy.init_prach()) { + printf("Error initiating PRACH\n"); + exit(-1); + } + + srslte_softbuffer_rx_init(&softbuffer, cell); + /* Instruct the PHY to start RX streaming and synchronize */ if (!phy.start_rxtx()) { printf("Could not start RX\n"); diff --git a/srslte/examples/CMakeLists.txt b/srslte/examples/CMakeLists.txt index 961cae98d..1d03ca2f6 100644 --- a/srslte/examples/CMakeLists.txt +++ b/srslte/examples/CMakeLists.txt @@ -50,11 +50,14 @@ add_executable(pdsch_enodeb pdsch_enodeb.c) target_link_libraries(pdsch_enodeb srslte pthread) IF(UHD_FOUND) + target_link_libraries(pdsch_ue srslte_uhd) + target_link_libraries(pdsch_enodeb srslte_uhd) ELSE(UHD_FOUND) add_definitions(-DDISABLE_UHD) - add_definitions(-DDISABLE_UHD) ENDIF(UHD_FOUND) +FIND_PACKAGE(SRSGUI) + IF(SRSGUI_FOUND) target_link_libraries(pdsch_ue ${SRSGUI_LIBRARIES}) ELSE(SRSGUI_FOUND) @@ -69,19 +72,19 @@ ENDIF(SRSGUI_FOUND) IF(UHD_FOUND) add_executable(cell_search cell_search.c) - target_link_libraries(cell_search srslte ) + target_link_libraries(cell_search srslte srslte_uhd) add_executable(prach_ue prach_ue.c) - target_link_libraries(prach_ue srslte ) + target_link_libraries(prach_ue srslte srslte_uhd) add_executable(cell_measurement cell_measurement.c) - target_link_libraries(cell_measurement srslte) + target_link_libraries(cell_measurement srslte srslte_uhd) add_executable(usrp_capture usrp_capture.c) - target_link_libraries(usrp_capture srslte) + target_link_libraries(usrp_capture srslte srslte_uhd) add_executable(usrp_capture_sync usrp_capture_sync.c) - target_link_libraries(usrp_capture_sync srslte) + target_link_libraries(usrp_capture_sync srslte srslte_uhd) MESSAGE(STATUS " UHD examples will be installed.") diff --git a/srslte/examples/prach_ue.c b/srslte/examples/prach_ue.c index 2e292465e..383e962d5 100644 --- a/srslte/examples/prach_ue.c +++ b/srslte/examples/prach_ue.c @@ -327,6 +327,7 @@ int main(int argc, char **argv) { printf("Tunning TX receiver to %.3f MHz\n", (double ) prog_args.uhd_tx_freq/1000000); +#ifdef kk ret = cuhd_search_and_decode_mib(uhd, &cell_detect_config, prog_args.force_N_id_2, &cell); if (ret < 0) { fprintf(stderr, "Error searching for cell\n"); @@ -335,6 +336,10 @@ int main(int argc, char **argv) { printf("Cell not found\n"); exit(0); } +#endif +cell.nof_prb = 50; +cell.id = 1; +cell.nof_ports = 1; /* set sampling frequency */ int srate = srslte_sampling_freq_hz(cell.nof_prb); @@ -471,7 +476,7 @@ int main(int argc, char **argv) { cuhd_send_timed(uhd, prach_buffer, prach_buffer_len, next_tx_time.full_secs, next_tx_time.frac_secs); - srslte_vec_save_file("prach_ue", prach_buffer, prach_buffer_len*sizeof(cf_t)); + srslte_vec_save_file("prach_ue.dat", prach_buffer, prach_buffer_len*sizeof(cf_t)); ra_rnti = 2; rar_window_start = sfn+1; @@ -536,6 +541,8 @@ int main(int argc, char **argv) { cuhd_send_timed(uhd, ul_signal, SRSLTE_SF_LEN_PRB(cell.nof_prb), next_tx_time.full_secs, next_tx_time.frac_secs); + srslte_vec_save_file("prach_ue_connreq.dat", ul_signal, sizeof(cf_t)*SRSLTE_SF_LEN_PRB(cell.nof_prb)); + //cuhd_start_rx_stream(uhd); state = RECV_CONNSETUP; conn_setup_trial = 0; diff --git a/srslte/examples/tutorial_examples/CMakeLists.txt b/srslte/examples/tutorial_examples/CMakeLists.txt index 0de79c29e..ceeba063d 100644 --- a/srslte/examples/tutorial_examples/CMakeLists.txt +++ b/srslte/examples/tutorial_examples/CMakeLists.txt @@ -27,13 +27,10 @@ IF(SRSGUI_FOUND AND UHD_FOUND) add_executable(pss pss.c) - target_link_libraries(pss srslte ${SRSGUI_LIBRARIES}) - - add_executable(ue_rx ue_rx.c) - target_link_libraries(ue_rx srslte ${SRSGUI_LIBRARIES} pthread) + target_link_libraries(pss srslte ${SRSGUI_LIBRARIES} srslte_uhd) add_executable(simple_tx simple_tx.c) - target_link_libraries(simple_tx srslte) + target_link_libraries(simple_tx srslte srslte_uhd) ENDIF(SRSGUI_FOUND AND UHD_FOUND) diff --git a/srslte/examples/tutorial_examples/ue_rx.c b/srslte/examples/tutorial_examples/ue_rx.c deleted file mode 100644 index fb623ba02..000000000 --- a/srslte/examples/tutorial_examples/ue_rx.c +++ /dev/null @@ -1,629 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2015 The srsLTE Developers. See the - * COPYRIGHT file at the top-level directory of this distribution. - * - * \section LICENSE - * - * This file is part of the srsLTE library. - * - * srsLTE is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * srsLTE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * A copy of the GNU Affero General Public License can be found in - * the LICENSE file in the top-level directory of this distribution - * and at http://www.gnu.org/licenses/. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "srslte/srslte.h" - - -#ifndef DISABLE_UHD -#include "srslte/cuhd/cuhd.h" -#include "cuhd_utils.h" - -cell_search_cfg_t cell_detect_config = { - 5000, - 100, // nof_frames_total - 10.0 // threshold -}; - -#endif - -//#define STDOUT_COMPACT - -#ifndef DISABLE_GRAPHICS -#include "srsgui/srsgui.h" -void init_plots(); -pthread_t plot_thread; -sem_t plot_sem; -uint32_t plot_sf_idx=0; -#endif - - -#define B210_DEFAULT_GAIN 40.0 -#define B210_DEFAULT_GAIN_CORREC 110.0 // Gain of the Rx chain when the gain is set to 40 - -float gain_offset = B210_DEFAULT_GAIN_CORREC; - - -/********************************************************************** - * Program arguments processing - ***********************************************************************/ -typedef struct { - int nof_subframes; - bool disable_plots; - int force_N_id_2; - bool enable_cfo; - int time_offset; - uint16_t rnti; - char *input_file_name; - uint32_t file_nof_prb; - char *uhd_args; - float uhd_freq; - float uhd_freq_offset; - float uhd_gain; - int net_port; - char *net_address; - int net_port_signal; - char *net_address_signal; -}prog_args_t; - -void args_default(prog_args_t *args) { - args->nof_subframes = -1; - args->rnti = SRSLTE_SIRNTI; - args->force_N_id_2 = -1; // Pick the best - args->input_file_name = NULL; - args->enable_cfo = true; - args->time_offset = 0; - args->file_nof_prb = 6; - args->uhd_args = ""; - args->uhd_freq = -1.0; - args->uhd_freq = 8000000.0; - args->uhd_gain = 60.0; - args->net_port = -1; - args->net_address = "127.0.0.1"; - args->net_port_signal = -1; - args->net_address_signal = "127.0.0.1"; -} - -void usage(prog_args_t *args, char *prog) { - printf("Usage: %s [agilcdnruv] -f rx_frequency (in Hz) | -i input_file\n", prog); -#ifndef DISABLE_UHD - printf("\t-a UHD args [Default %s]\n", args->uhd_args); - printf("\t-g UHD RX gain [Default %.2f dB]\n", args->uhd_gain); - printf("\t-o UHD RX freq offset [Default %.1f MHz]\n", args->uhd_freq_offset/1000000); -#else - printf("\t UHD is disabled. CUHD library not available\n"); -#endif - printf("\t-i input_file [Default USRP]\n"); - printf("\t-p nof_prb for input file [Default %d]\n", args->file_nof_prb); - printf("\t-r RNTI [Default 0x%x]\n",args->rnti); - printf("\t-l Force N_id_2 [Default best]\n"); - printf("\t-c Disable CFO correction [Default %s]\n", args->enable_cfo?"Enabled":"Disabled"); - printf("\t-t Add time offset [Default %d]\n", args->time_offset); -#ifndef DISABLE_GRAPHICS - printf("\t-d disable plots [Default enabled]\n"); -#else - printf("\t plots are disabled. Graphics library not available\n"); -#endif - printf("\t-n nof_subframes [Default %d]\n", args->nof_subframes); - printf("\t-s remote UDP port to send input signal (-1 does nothing with it) [Default %d]\n", args->net_port_signal); - printf("\t-S remote UDP address to send input signal [Default %s]\n", args->net_address_signal); - printf("\t-u remote TCP port to send data (-1 does nothing with it) [Default %d]\n", args->net_port); - printf("\t-U remote TCP address to send data [Default %s]\n", args->net_address); - printf("\t-v [set srslte_verbose to debug, default none]\n"); -} - -void parse_args(prog_args_t *args, int argc, char **argv) { - int opt; - args_default(args); - while ((opt = getopt(argc, argv, "aoglipdnvrfctuUsS")) != -1) { - switch (opt) { - case 'i': - args->input_file_name = argv[optind]; - break; - case 'p': - args->file_nof_prb = atoi(argv[optind]); - break; - case 'a': - args->uhd_args = argv[optind]; - break; - case 'g': - args->uhd_gain = atof(argv[optind]); - break; - case 'o': - args->uhd_freq_offset = atof(argv[optind]); - break; - case 'f': - args->uhd_freq = atof(argv[optind]); - break; - case 'n': - args->nof_subframes = atoi(argv[optind]); - break; - case 'c': - args->enable_cfo = false; - break; - case 't': - args->time_offset = atoi(argv[optind]); - break; - case 'r': - args->rnti = atoi(argv[optind]); - break; - case 'l': - args->force_N_id_2 = atoi(argv[optind]); - break; - case 'u': - args->net_port = atoi(argv[optind]); - break; - case 'U': - args->net_address = argv[optind]; - break; - case 's': - args->net_port_signal = atoi(argv[optind]); - break; - case 'S': - args->net_address_signal = argv[optind]; - break; - case 'd': - args->disable_plots = true; - break; - case 'v': - srslte_verbose++; - break; - default: - usage(args, argv[0]); - exit(-1); - } - } - if (args->uhd_freq < 0 && args->input_file_name == NULL) { - usage(args, argv[0]); - exit(-1); - } -} -/**********************************************************************/ - -/* TODO: Do something with the output data */ -uint8_t data[20000], data_packed[20000]; - -bool go_exit = false; - -void sig_int_handler(int signo) -{ - if (signo == SIGINT) { - go_exit = true; - } -} - -#ifndef DISABLE_UHD -int cuhd_recv_wrapper(void *h, void *data, uint32_t nsamples, srslte_timestamp_t *t) { - DEBUG(" ---- Receive %d samples ---- \n", nsamples); - return cuhd_recv(h, data, nsamples, 1); -} -#endif - -extern float mean_exec_time; - -enum receiver_state { DECODE_MIB, DECODE_PDSCH} state; - -srslte_ue_dl_t ue_dl; -srslte_ue_sync_t ue_sync; -prog_args_t prog_args; - -uint32_t sfn = 0; // system frame number -cf_t *sf_buffer = NULL; -srslte_netsink_t net_sink, net_sink_signal; - -int main(int argc, char **argv) { - int ret; - srslte_cell_t cell; - int64_t sf_cnt; - srslte_ue_mib_t ue_mib; -#ifndef DISABLE_UHD - void *uhd; -#endif - uint32_t nof_trials = 0; - int n; - uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN]; - uint32_t sfn_offset; - - parse_args(&prog_args, argc, argv); - - if (prog_args.net_port > 0) { - if (srslte_netsink_init(&net_sink, prog_args.net_address, prog_args.net_port, SRSLTE_NETSINK_TCP)) { - fprintf(stderr, "Error initiating UDP socket to %s:%d\n", prog_args.net_address, prog_args.net_port); - exit(-1); - } - srslte_netsink_set_nonblocking(&net_sink); - } - if (prog_args.net_port_signal > 0) { - if (srslte_netsink_init(&net_sink_signal, prog_args.net_address_signal, prog_args.net_port_signal, SRSLTE_NETSINK_UDP)) { - fprintf(stderr, "Error initiating UDP socket to %s:%d\n", prog_args.net_address_signal, prog_args.net_port_signal); - exit(-1); - } - srslte_netsink_set_nonblocking(&net_sink_signal); - } - -#ifndef DISABLE_UHD - if (!prog_args.input_file_name) { - printf("Opening UHD device...\n"); - if (cuhd_open(prog_args.uhd_args, &uhd)) { - fprintf(stderr, "Error opening uhd\n"); - exit(-1); - } - /* Set receiver gain */ - cuhd_set_rx_gain(uhd, prog_args.uhd_gain); - - /* set receiver frequency */ - cuhd_set_rx_freq_offset(uhd, (double) prog_args.uhd_freq, prog_args.uhd_freq_offset); - cuhd_rx_wait_lo_locked(uhd); - printf("Tunning receiver to %.3f MHz\n", (double ) prog_args.uhd_freq/1000000); - - ret = cuhd_search_and_decode_mib(uhd, &cell_detect_config, prog_args.force_N_id_2, &cell); - if (ret < 0) { - fprintf(stderr, "Error searching for cell\n"); - exit(-1); - } else if (ret == 0) { - printf("Cell not found\n"); - exit(0); - } - - /* set sampling frequency */ - int srate = srslte_sampling_freq_hz(cell.nof_prb); - if (srate != -1) { - cuhd_set_rx_srate(uhd, (double) srate); - } else { - fprintf(stderr, "Invalid number of PRB %d\n", cell.nof_prb); - return SRSLTE_ERROR; - } - - INFO("Stopping UHD and flushing buffer...\r",0); - cuhd_stop_rx_stream(uhd); - cuhd_flush_buffer(uhd); - - if (srslte_ue_mib_init(&ue_mib, cell)) { - fprintf(stderr, "Error initaiting UE MIB decoder\n"); - exit(-1); - } - } -#endif - - /* If reading from file, go straight to PDSCH decoding. Otherwise, decode MIB first */ - if (prog_args.input_file_name) { - state = DECODE_PDSCH; - /* preset cell configuration */ - cell.id = 1; - cell.cp = SRSLTE_CP_NORM; - cell.phich_length = SRSLTE_PHICH_NORM; - cell.phich_resources = SRSLTE_PHICH_R_1; - cell.nof_ports = 1; - cell.nof_prb = prog_args.file_nof_prb; - - if (srslte_ue_sync_init_file(&ue_sync, prog_args.file_nof_prb, prog_args.input_file_name)) { - fprintf(stderr, "Error initiating ue_sync\n"); - exit(-1); - } - - } else { -#ifndef DISABLE_UHD - state = DECODE_MIB; - if (srslte_ue_sync_init(&ue_sync, cell, cuhd_recv_wrapper, uhd)) { - fprintf(stderr, "Error initiating ue_sync\n"); - exit(-1); - } -#endif - } - - if (srslte_ue_dl_init(&ue_dl, cell)) { // This is the User RNTI - fprintf(stderr, "Error initiating UE downlink processing module\n"); - exit(-1); - } - - /* Configure downlink receiver for the SI-RNTI since will be the only one we'll use */ - srslte_ue_dl_set_rnti(&ue_dl, prog_args.rnti); - - /* Initialize subframe counter */ - sf_cnt = 0; - - // Register Ctrl+C handler - signal(SIGINT, sig_int_handler); - -#ifndef DISABLE_GRAPHICS - if (!prog_args.disable_plots) { - init_plots(cell); - } -#endif - -#ifndef DISABLE_UHD - if (!prog_args.input_file_name) { - cuhd_start_rx_stream(uhd); - } -#endif - - // Variables for measurements - uint32_t nframes=0; - float rsrp=0.0, rsrq=0.0, snr=0.0; - bool decode_pdsch; - int pdcch_tx=0; - srslte_ra_dl_dci_t old_ra_dl; - bzero(&old_ra_dl, sizeof(srslte_ra_dl_dci_t)); - - ue_sync.correct_cfo = prog_args.enable_cfo; - - /* Main loop */ - while (!go_exit && (sf_cnt < prog_args.nof_subframes || prog_args.nof_subframes == -1)) { - - ret = srslte_ue_sync_get_buffer(&ue_sync, &sf_buffer); - if (ret < 0) { - fprintf(stderr, "Error calling srslte_ue_sync_work()\n"); - } - - /* srslte_ue_sync_get_buffer returns 1 if successfully read 1 aligned subframe */ - if (ret == 1) { - switch (state) { - case DECODE_MIB: - if (srslte_ue_sync_get_sfidx(&ue_sync) == 0) { - srslte_pbch_decode_reset(&ue_mib.pbch); - n = srslte_ue_mib_decode(&ue_mib, sf_buffer, bch_payload, NULL, &sfn_offset); - if (n < 0) { - fprintf(stderr, "Error decoding UE MIB\n"); - exit(-1); - } else if (n == SRSLTE_UE_MIB_FOUND) { - srslte_pbch_mib_unpack(bch_payload, &cell, &sfn); - srslte_cell_fprint(stdout, &cell, sfn); - printf("Decoded MIB. SFN: %d, offset: %d\n", sfn, sfn_offset); - sfn = (sfn + sfn_offset)%1024; - state = DECODE_PDSCH; - } - } - break; - case DECODE_PDSCH: - if (prog_args.rnti != SRSLTE_SIRNTI) { - decode_pdsch = true; - } else { - /* We are looking for SIB1 Blocks, search only in appropiate places */ - if ((srslte_ue_sync_get_sfidx(&ue_sync) == 5 && (sfn%2)==0)) { - decode_pdsch = true; - } else { - decode_pdsch = false; - } - } - if (decode_pdsch) { - if (prog_args.rnti != SRSLTE_SIRNTI) { - n = srslte_ue_dl_decode(&ue_dl, &sf_buffer[prog_args.time_offset], data_packed, srslte_ue_sync_get_sfidx(&ue_sync)); - } else { - n = srslte_ue_dl_decode_rnti_rv(&ue_dl, &sf_buffer[prog_args.time_offset], data_packed, srslte_ue_sync_get_sfidx(&ue_sync), SRSLTE_SIRNTI, - ((int) ceilf((float)3*(((sfn)/2)%4)/2))%4); - } - if (memcmp(&ue_dl.ra_dl, &old_ra_dl, sizeof(srslte_ra_dl_dci_t))) { - memcpy(&old_ra_dl, &ue_dl.ra_dl, sizeof(srslte_ra_dl_dci_t)); - fflush(stdout);printf("\nCFI:\t%d\n", ue_dl.cfi); - printf("Format: %s\n", srslte_dci_format_string(ue_dl.dci_format)); - srslte_ra_pdsch_fprint(stdout, &old_ra_dl, cell.nof_prb); - } - if (n < 0) { - // fprintf(stderr, "Error decoding UE DL\n");fflush(stdout); - } else if (n > 0) { - /* Send data if socket active */ - if (prog_args.net_port > 0) { - srslte_bit_unpack_vector(data_packed, data, n); - srslte_netsink_write(&net_sink, data, 1+(n-1)/8); - } - } - nof_trials++; - - rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrq(&ue_dl.chest), rsrq, 0.05); - rsrp = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrp(&ue_dl.chest), rsrp, 0.05); - snr = SRSLTE_VEC_EMA(srslte_chest_dl_get_snr(&ue_dl.chest), snr, 0.01); - nframes++; - if (isnan(rsrq)) { - rsrq = 0; - } - if (isnan(snr)) { - snr = 0; - } - if (isnan(rsrp)) { - rsrp = 0; - } - -#ifdef adjust_estimator - /* Adjust channel estimator based on SNR */ - if (10*log10(snr) < 5.0) { - float f_low_snr[5]={0.05, 0.15, 0.6, 0.15, 0.05}; - srslte_chest_dl_set_filter_freq(&ue_dl.chest, f_low_snr, 5); - } else if (10*log10(snr) < 10.0) { - float f_mid_snr[3]={0.1, 0.8, 0.1}; - srslte_chest_dl_set_filter_freq(&ue_dl.chest, f_mid_snr, 3); - } else { - float f_high_snr[3]={0.05, 0.9, 0.05}; - srslte_chest_dl_set_filter_freq(&ue_dl.chest, f_high_snr, 3); - } -#endif - - } - if (srslte_ue_sync_get_sfidx(&ue_sync) != 5 && srslte_ue_sync_get_sfidx(&ue_sync) != 0) { - pdcch_tx++; - } - - - // Plot and Printf - if (srslte_ue_sync_get_sfidx(&ue_sync) == 5) { -#ifdef STDOUT_COMPACT - printf("SFN: %4d, PDCCH-Miss: %5.2f%% (%d missed), PDSCH-BLER: %5.2f%% (%d errors)\r", - sfn, 100*(1-(float) ue_dl.nof_detected/nof_trials),pdcch_tx-ue_dl.nof_detected, - (float) 100*ue_dl.pkt_errors/ue_dl.pkts_total,ue_dl.pkt_errors); -#else - printf("CFO: %+6.2f KHz, SFO: %+6.2f Khz, " - "RSRP: %+5.1f dBm, RSRQ: %5.1f dB, SNR: %4.1f dB, " - "PDCCH-Miss: %5.2f%% (%d), PDSCH-BLER: %5.2f%% (%d)\r", - srslte_ue_sync_get_cfo(&ue_sync)/1000, srslte_ue_sync_get_sfo(&ue_sync)/1000, - 10*log10(rsrp*1000)-gain_offset, - 10*log10(rsrq), 10*log10(snr), - 100*(1-(float) ue_dl.nof_detected/nof_trials), pdcch_tx-ue_dl.nof_detected, - (float) 100*ue_dl.pkt_errors/ue_dl.pkts_total, ue_dl.pkt_errors); - -#endif - } - break; - } - if (srslte_ue_sync_get_sfidx(&ue_sync) == 9) { - sfn++; - if (sfn == 1024) { - sfn = 0; - } - } - - #ifndef DISABLE_GRAPHICS - if (!prog_args.disable_plots) { - plot_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync); - sem_post(&plot_sem); - } - #endif - } else if (ret == 0) { - printf("Finding PSS... Peak: %8.1f, FrameCnt: %d, State: %d\r", - srslte_sync_get_peak_value(&ue_sync.sfind), - ue_sync.frame_total_cnt, ue_sync.state); - } - - sf_cnt++; - } // Main loop - - srslte_ue_dl_free(&ue_dl); - srslte_ue_sync_free(&ue_sync); - -#ifndef DISABLE_UHD - if (!prog_args.input_file_name) { - srslte_ue_mib_free(&ue_mib); - cuhd_close(uhd); - } -#endif - printf("\nBye\n"); - exit(0); -} - - - - - - - - -/********************************************************************** - * Plotting Functions - ***********************************************************************/ -#ifndef DISABLE_GRAPHICS - - -plot_real_t poutfft; -plot_real_t pce_angle, pce; -plot_scatter_t pscatequal, pscatequal_pdcch; - -float tmp_plot[SRSLTE_SLOT_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)]; -float tmp_plot2[SRSLTE_SLOT_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)]; -float tmp_plot3[SRSLTE_SLOT_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)]; - -void *plot_thread_run(void *arg) { - int i; - uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp); - - while(1) { - sem_wait(&plot_sem); - - uint32_t nof_symbols = ue_dl.harq_process[0].dl_alloc.re_sf[plot_sf_idx]; - for (i = 0; i < nof_re; i++) { - tmp_plot[i] = 20 * log10f(cabsf(ue_dl.sf_symbols[i])); - if (isinf(tmp_plot[i])) { - tmp_plot[i] = -80; - } - } - for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) { - tmp_plot2[i] = 20 * log10f(cabsf(ue_dl.chest.pilot_estimates_average[0][i])); - if (isinf(tmp_plot2[i])) { - tmp_plot2[i] = -80; - } - } - for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) { - tmp_plot3[i] = cargf(ue_dl.chest.pilot_estimates_average[0][i]); - } - plot_real_setNewData(&poutfft, tmp_plot, nof_re); - plot_real_setNewData(&pce, tmp_plot2, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0)); - plot_real_setNewData(&pce_angle, tmp_plot3, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0)); - - plot_scatter_setNewData(&pscatequal, ue_dl.pdsch.d, nof_symbols); - plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce); - - if (plot_sf_idx == 1) { - if (prog_args.net_port_signal > 0) { - srslte_netsink_write(&net_sink_signal, &sf_buffer[srslte_ue_sync_sf_len(&ue_sync)/7], - srslte_ue_sync_sf_len(&ue_sync)); - } - } - - } - - return NULL; -} - -void init_plots() { - - sdrgui_init(); - - plot_real_init(&poutfft); - plot_real_setTitle(&poutfft, "Output FFT - Magnitude"); - plot_real_setLabels(&poutfft, "Index", "dB"); - plot_real_setYAxisScale(&poutfft, -40, 40); - - plot_real_init(&pce); - plot_real_setTitle(&pce, "Channel Response - Magnitude"); - plot_real_setLabels(&pce, "Index", "dB"); - - plot_real_init(&pce_angle); - plot_real_setTitle(&pce_angle, "Channel Response - Argument"); - plot_real_setLabels(&pce_angle, "Index", "Radiants"); - plot_real_setYAxisScale(&pce_angle, -M_PI, M_PI); - - plot_scatter_init(&pscatequal); - plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols"); - plot_scatter_setXAxisScale(&pscatequal, -2, 2); - plot_scatter_setYAxisScale(&pscatequal, -2, 2); - - plot_scatter_init(&pscatequal_pdcch); - plot_scatter_setTitle(&pscatequal_pdcch, "PDCCH - Equalized Symbols"); - plot_scatter_setXAxisScale(&pscatequal_pdcch, -2, 2); - plot_scatter_setYAxisScale(&pscatequal_pdcch, -2, 2); - - if (sem_init(&plot_sem, 0, 0)) { - perror("sem_init"); - exit(-1); - } - - if (pthread_create(&plot_thread, NULL, plot_thread_run, NULL)) { - perror("pthread_create"); - exit(-1); - } -} - -#endif diff --git a/srslte/include/srslte/phch/dci.h b/srslte/include/srslte/phch/dci.h index f76aaa303..1bd6cc2dc 100644 --- a/srslte/include/srslte/phch/dci.h +++ b/srslte/include/srslte/phch/dci.h @@ -120,6 +120,9 @@ SRSLTE_API int srslte_dci_rar_to_ul_grant(srslte_dci_rar_grant_t *rar, SRSLTE_API void srslte_dci_rar_grant_unpack(srslte_dci_rar_grant_t *rar, uint8_t grant[SRSLTE_RAR_GRANT_LEN]); +SRSLTE_API void srslte_dci_rar_grant_fprint(FILE *stream, + srslte_dci_rar_grant_t *rar); + SRSLTE_API srslte_dci_format_t srslte_dci_format_from_string(char *str); SRSLTE_API char* srslte_dci_format_string(srslte_dci_format_t format); diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index 7ce0d8b06..1bd38c370 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -44,11 +44,6 @@ IF(FFTW3F_FOUND) LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS}) ENDIF(FFTW3F_FOUND) -IF(UHD_FOUND) - INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) - LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) -ENDIF(UHD_FOUND) - IF(SRSGUI_FOUND) INCLUDE_DIRECTORIES(${SRSGUI_INCLUDE_DIRS}) LINK_DIRECTORIES(${SRSGUI_LIBRARY_DIRS}) @@ -62,20 +57,23 @@ FILE(GLOB modules *) SET(SOURCES_ALL "") FOREACH (_module ${modules}) IF(IS_DIRECTORY ${_module}) - IF ((NOT ${_module} MATCHES "cuhd") OR UHD_FOUND) + IF (NOT ${_module} MATCHES "cuhd") FILE(GLOB_RECURSE tmp "${_module}/src/*.c") LIST(APPEND SOURCES_ALL ${tmp}) FILE(GLOB_RECURSE tmp2 "${_module}/src/*.cpp") LIST(APPEND SOURCES_ALL ${tmp2}) - ENDIF ((NOT ${_module} MATCHES "cuhd") OR UHD_FOUND) + ENDIF (NOT ${_module} MATCHES "cuhd") ENDIF(IS_DIRECTORY ${_module}) ENDFOREACH() ADD_LIBRARY(srslte SHARED ${SOURCES_ALL}) - TARGET_LINK_LIBRARIES(srslte m ${FFTW3F_LIBRARIES}) + IF(UHD_FOUND) - TARGET_LINK_LIBRARIES(srslte ${UHD_LIBRARIES}) + INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) + LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) + ADD_LIBRARY(srslte_uhd SHARED ${CMAKE_CURRENT_SOURCE_DIR}/cuhd/src/cuhd_imp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cuhd/src/cuhd_utils.c) + TARGET_LINK_LIBRARIES(srslte_uhd ${UHD_LIBRARIES}) ENDIF(UHD_FOUND) INSTALL(TARGETS srslte DESTINATION ${LIBRARY_DIR}) diff --git a/srslte/lib/phch/src/dci.c b/srslte/lib/phch/src/dci.c index 05740f5b5..94071a709 100644 --- a/srslte/lib/phch/src/dci.c +++ b/srslte/lib/phch/src/dci.c @@ -152,6 +152,15 @@ void srslte_dci_rar_grant_unpack(srslte_dci_rar_grant_t *rar, uint8_t grant[SRSL rar->cqi_request = srslte_bit_unpack(&grant_ptr, 1)?true:false; } +void srslte_dci_rar_grant_fprint(FILE *stream, srslte_dci_rar_grant_t *rar) { + fprintf(stream, "RBA: %d, MCS: %d, TPC: %d, Hopping=%s, UL-Delay=%s, CQI=%s\n", + rar->rba, rar->trunc_mcs, rar->tpc_pusch, + rar->hopping_flag?"yes":"no", + rar->ul_delay?"yes":"no", + rar->cqi_request?"yes":"no" + ); +} + /* Creates the UL PUSCH resource allocation grant from a DCI format 0 message */ int srslte_dci_msg_to_ul_grant(srslte_dci_msg_t *msg, srslte_cell_t cell, @@ -171,7 +180,6 @@ int srslte_dci_msg_to_ul_grant(srslte_dci_msg_t *msg, srslte_cell_t cell, bzero(grant, sizeof(srslte_ra_ul_dci_t)); if (srslte_dci_msg_unpack_pusch(msg, ul_dci, cell.nof_prb)) { - fprintf(stderr, "Can't unpack PDSCH message\n"); return ret; } @@ -379,8 +387,7 @@ int dci_format0_unpack(srslte_dci_msg_t *msg, srslte_ra_ul_dci_t *data, uint32_t return SRSLTE_ERROR; } if (*y++ != 0) { - fprintf(stderr, - "Invalid format differentiation field value. This is SRSLTE_DCI_FORMAT1A\n"); + INFO("DCI message is Format1A\n", 0); return SRSLTE_ERROR; } if (*y++ == 0) { @@ -633,7 +640,7 @@ int dci_format1As_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32 } if (*y++ != 1) { - fprintf(stderr, "Invalid format differentiation field value. This is SRSLTE_DCI_FORMAT0\n"); + INFO("DCI message is Format0\n", 0); return SRSLTE_ERROR; } diff --git a/srslte/lib/phch/src/pdcch.c b/srslte/lib/phch/src/pdcch.c index 3bd64b911..62d5f20a4 100644 --- a/srslte/lib/phch/src/pdcch.c +++ b/srslte/lib/phch/src/pdcch.c @@ -215,7 +215,7 @@ uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t *q, srslte_dci_location_t *c, c[k].L = l; c[k].ncce = ncce; - INFO("UE-specific SS Candidate %d: nCCE: %d, L: %d\n", + DEBUG("UE-specific SS Candidate %d: nCCE: %d, L: %d\n", k, c[k].ncce, c[k].L); k++; @@ -223,7 +223,7 @@ uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t *q, srslte_dci_location_t *c, } } - INFO("Initiated %d candidate(s) in the UE-specific search space for C-RNTI: 0x%x\n", k, rnti); + DEBUG("Initiated %d candidate(s) in the UE-specific search space for C-RNTI: 0x%x\n", k, rnti); return k; } @@ -297,7 +297,7 @@ static int dci_decode(srslte_pdcch_t *q, float *e, uint8_t *data, uint32_t E, ui x = &data[nof_bits]; p_bits = (uint16_t) srslte_bit_unpack(&x, 16); crc_res = ((uint16_t) srslte_crc_checksum(&q->crc, data, nof_bits) & 0xffff); - INFO("p_bits: 0x%x, crc_checksum: 0x%x, crc_rem: 0x%x\n", p_bits, crc_res, + DEBUG("p_bits: 0x%x, crc_checksum: 0x%x, crc_rem: 0x%x\n", p_bits, crc_res, p_bits ^ crc_res); if (crc) { @@ -331,7 +331,7 @@ int srslte_pdcch_decode_msg(srslte_pdcch_t *q, srslte_dci_msg_t *msg, srslte_dci uint32_t nof_bits = srslte_dci_format_sizeof(format, q->cell.nof_prb); uint32_t e_bits = PDCCH_FORMAT_NOF_BITS(location->L); - INFO("Decoding DCI offset %d, e_bits: %d, msg_len %d (nCCE: %d, L: %d)\n", + DEBUG("Decoding DCI offset %d, e_bits: %d, msg_len %d (nCCE: %d, L: %d)\n", location->ncce * 72, e_bits, nof_bits, location->ncce, location->L); ret = dci_decode(q, &q->llr[location->ncce * 72], @@ -369,7 +369,7 @@ int srslte_pdcch_extract_llr(srslte_pdcch_t *q, cf_t *sf_symbols, cf_t *ce[SRSLT nof_symbols = e_bits/2; ret = SRSLTE_ERROR; - INFO("Extracting LLRs: E: %d, SF: %d, CFI: %d\n", + DEBUG("Extracting LLRs: E: %d, SF: %d, CFI: %d\n", e_bits, nsubframe, cfi); /* number of layers equals number of ports */ @@ -427,7 +427,7 @@ static void crc_set_mask_rnti(uint8_t *crc, uint16_t rnti) { uint8_t mask[16]; uint8_t *r = mask; - INFO("Mask CRC with RNTI 0x%x\n", rnti); + DEBUG("Mask CRC with RNTI 0x%x\n", rnti); srslte_bit_pack(rnti, &r, 16); for (i = 0; i < 16; i++) { @@ -508,7 +508,7 @@ int srslte_pdcch_encode(srslte_pdcch_t *q, srslte_dci_msg_t *msg, srslte_dci_loc if (location.ncce + PDCCH_FORMAT_NOF_CCE(location.L) <= q->nof_cce && msg->nof_bits < SRSLTE_DCI_MAX_BITS) { - INFO("Encoding DCI: Nbits: %d, E: %d, nCCE: %d, L: %d, RNTI: 0x%x\n", + DEBUG("Encoding DCI: Nbits: %d, E: %d, nCCE: %d, L: %d, RNTI: 0x%x\n", msg->nof_bits, e_bits, location.ncce, location.L, rnti); dci_encode(q, msg->data, q->e, msg->nof_bits, e_bits, rnti); diff --git a/srslte/lib/phch/src/prach.c b/srslte/lib/phch/src/prach.c index 3975f87be..e44b379d0 100644 --- a/srslte/lib/phch/src/prach.c +++ b/srslte/lib/phch/src/prach.c @@ -44,7 +44,7 @@ #define PHI_4 2 // PRACH phi parameter for format 4 #define MAX_ROOTS 838 // Max number of root sequences -#define PRACH_AMP 0.5 +#define PRACH_AMP 0.4 /****************************************************** * Reference tables from 3GPP TS 36.211 v10.7.0 @@ -346,6 +346,8 @@ int srslte_prach_init(srslte_prach_t *p, p->N_cs = prach_Ncs_unrestricted[p->zczc]; } } + + printf("N_cs=%d, ZCZC=%d\n", p->N_cs, p->zczc); // Set up containers p->prach_bins = srslte_vec_malloc(sizeof(cf_t)*p->N_zc); @@ -438,9 +440,10 @@ int srslte_prach_gen(srslte_prach_t *p, // Copy preamble sequence into buffer for(int i=0;iN_seq;i++){ - signal[p->N_cp+i] = PRACH_AMP*p->ifft_out[i%p->N_ifft_prach]; + signal[p->N_cp+i] = p->ifft_out[i%p->N_ifft_prach]; } - + srslte_vec_sc_prod_cfc(signal, PRACH_AMP, signal, p->N_cp + p->N_seq); + ret = SRSLTE_SUCCESS; } diff --git a/srslte/lib/phch/src/pusch.c b/srslte/lib/phch/src/pusch.c index e3e51321c..a6a4ec837 100644 --- a/srslte/lib/phch/src/pusch.c +++ b/srslte/lib/phch/src/pusch.c @@ -410,7 +410,6 @@ int srslte_pusch_uci_encode_rnti(srslte_pusch_t *q, srslte_pusch_cfg_t *cfg, srs int ret = SRSLTE_ERROR_INVALID_INPUTS; if (q != NULL && - data != NULL && cfg != NULL) { if (cfg->grant.mcs.tbs > cfg->grant.nof_bits) { diff --git a/srslte/lib/phch/src/regs.c b/srslte/lib/phch/src/regs.c index 6563a5a51..26f076041 100644 --- a/srslte/lib/phch/src/regs.c +++ b/srslte/lib/phch/src/regs.c @@ -308,7 +308,7 @@ int regs_phich_init(srslte_regs_t *h) { ni=((h->cell.id*n[li]/n[0])+mi+i*n[li]/3) % n[li]; // Step 8 h->phich[mi].regs[i] = regs_phich[li][ni]; h->phich[mi].regs[i]->assigned = true; - INFO("Assigned PHICH REG#%d (%d,%d)\n",nreg,h->phich[mi].regs[i]->k0,li); + DEBUG("Assigned PHICH REG#%d (%d,%d)\n",nreg,h->phich[mi].regs[i]->k0,li); nreg++; } } @@ -487,7 +487,7 @@ int regs_pcfich_init(srslte_regs_t *h) { return SRSLTE_ERROR; } else { ch->regs[i]->assigned = true; - INFO("Assigned PCFICH REG#%d (%d,0)\n", i, k); + DEBUG("Assigned PCFICH REG#%d (%d,0)\n", i, k); } } return SRSLTE_SUCCESS; diff --git a/srslte/lib/phch/src/sch.c b/srslte/lib/phch/src/sch.c index 195809d4b..9822dea97 100644 --- a/srslte/lib/phch/src/sch.c +++ b/srslte/lib/phch/src/sch.c @@ -169,7 +169,6 @@ static int encode_tb(srslte_sch_t *q, int ret = SRSLTE_ERROR_INVALID_INPUTS; if (q != NULL && - data != NULL && e_bits != NULL && cb_segm != NULL && soft_buffer != NULL) @@ -182,7 +181,7 @@ static int encode_tb(srslte_sch_t *q, gamma = Gp%cb_segm->C; } - if (rv == 0) { + if (data) { /* Compute transport block CRC */ par = srslte_crc_checksum(&q->crc_tb, data, cb_segm->tbs); @@ -226,7 +225,7 @@ static int encode_tb(srslte_sch_t *q, INFO("CB#%d: cb_len: %d, rlen: %d, wp: %d, rp: %d, F: %d, E: %d\n", i, cb_len, rlen - F, wp, rp, F, n_e); - if (rv == 0) { + if (data) { /* Copy data to another buffer, making space for the Codeblock CRC */ if (i < cb_segm->C - 1) { diff --git a/srslte/lib/phch/test/prach_test_mex.c b/srslte/lib/phch/test/prach_test_mex.c index 59ba498e4..bb0cda68d 100644 --- a/srslte/lib/phch/test/prach_test_mex.c +++ b/srslte/lib/phch/test/prach_test_mex.c @@ -89,7 +89,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) return; } - uint32_t nof_samples = srslte_sampling_freq_hz(n_ul_rb) * 0.003; + uint32_t nof_samples = srslte_sampling_freq_hz(n_ul_rb) * 0.001; cf_t *signal = srslte_vec_malloc(sizeof(cf_t) * nof_samples); if (!signal) { @@ -102,6 +102,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) return; } + srslte_vec_sc_prod_cfc(signal, 1.0/sqrtf(N_ifft_ul), signal, prach.N_seq+prach.N_cp); if (nlhs >= 0) { mexutils_write_cf(signal, &plhs[0], nof_samples, 1); diff --git a/srslte/lib/sync/src/sync.c b/srslte/lib/sync/src/sync.c index 9aca3bb8d..4f1e325e5 100644 --- a/srslte/lib/sync/src/sync.c +++ b/srslte/lib/sync/src/sync.c @@ -242,7 +242,7 @@ int sync_sss(srslte_sync_t *q, cf_t *input, uint32_t peak_pos, srslte_cp_t cp) { /* Make sure we have enough room to find SSS sequence */ sss_idx = (int) peak_pos-2*q->fft_size-SRSLTE_CP_LEN(q->fft_size, (SRSLTE_CP_ISNORM(q->cp)?SRSLTE_CP_NORM_LEN:SRSLTE_CP_EXT_LEN)); if (sss_idx < 0) { - INFO("Not enough room to decode CP SSS (sss_idx=%d, peak_pos=%d)\n", sss_idx, peak_pos); + DEBUG("Not enough room to decode CP SSS (sss_idx=%d, peak_pos=%d)\n", sss_idx, peak_pos); return SRSLTE_ERROR; } DEBUG("Searching SSS around sss_idx: %d, peak_pos: %d\n", sss_idx, peak_pos); @@ -321,14 +321,14 @@ int srslte_sync_find(srslte_sync_t *q, cf_t *input, uint32_t find_offset, uint32 /* compute cumulative moving average CFO */ q->mean_cfo = SRSLTE_VEC_EMA(cfo, q->mean_cfo, CFO_EMA_ALPHA); } else { - INFO("No space for CFO computation. Frame starts at \n",peak_pos); + DEBUG("No space for CFO computation. Frame starts at \n",peak_pos); } if (q->detect_cp) { if (peak_pos + find_offset >= 2*(q->fft_size + SRSLTE_CP_LEN_EXT(q->fft_size))) { q->cp = srslte_sync_detect_cp(q, input, peak_pos + find_offset); } else { - INFO("Not enough room to detect CP length. Peak position: %d\n", peak_pos); + DEBUG("Not enough room to detect CP length. Peak position: %d\n", peak_pos); } } @@ -343,7 +343,7 @@ int srslte_sync_find(srslte_sync_t *q, cf_t *input, uint32_t find_offset, uint32 q->N_id_1 = 1000; if (sync_sss(q, input, find_offset + peak_pos, q->cp) < 0) { - INFO("No space for SSS processing. Frame starts at %d\n", peak_pos); + DEBUG("No space for SSS processing. Frame starts at %d\n", peak_pos); } } // Return 1 (peak detected) even if we couldn't estimate CFO and SSS @@ -352,7 +352,7 @@ int srslte_sync_find(srslte_sync_t *q, cf_t *input, uint32_t find_offset, uint32 ret = 0; } - INFO("SYNC ret=%d N_id_2=%d find_offset=%d pos=%d peak=%.2f threshold=%.2f sf_idx=%d, CFO=%.3f KHz\n", + DEBUG("SYNC ret=%d N_id_2=%d find_offset=%d pos=%d peak=%.2f threshold=%.2f sf_idx=%d, CFO=%.3f KHz\n", ret, q->N_id_2, find_offset, peak_pos, q->peak_value, q->threshold, q->sf_idx, 15*q->mean_cfo); } else if (srslte_N_id_2_isvalid(q->N_id_2)) { diff --git a/srslte/lib/sync/test/CMakeLists.txt b/srslte/lib/sync/test/CMakeLists.txt index 36efa2299..41499a37f 100644 --- a/srslte/lib/sync/test/CMakeLists.txt +++ b/srslte/lib/sync/test/CMakeLists.txt @@ -34,7 +34,7 @@ ENDIF(SRSGUI_FOUND) IF(UHD_FOUND) ADD_EXECUTABLE(pss_usrp pss_usrp.c) - TARGET_LINK_LIBRARIES(pss_usrp srslte) + TARGET_LINK_LIBRARIES(pss_usrp srslte srslte_uhd) IF(SRSGUI_FOUND) target_link_libraries(pss_usrp ${SRSGUI_LIBRARIES}) ELSE(SRSGUI_FOUND) diff --git a/srslte/lib/ue/src/ue_cell_search.c b/srslte/lib/ue/src/ue_cell_search.c index 6246f6ea8..bc00e9ea0 100644 --- a/srslte/lib/ue/src/ue_cell_search.c +++ b/srslte/lib/ue/src/ue_cell_search.c @@ -238,7 +238,7 @@ int srslte_ue_cellsearch_scan_N_id_2(srslte_ue_cellsearch_t * q, uint32_t N_id_2 q->candidates[nof_detected_frames].peak = q->ue_sync.strack.pss.peak_value; q->candidates[nof_detected_frames].psr = srslte_sync_get_peak_value(&q->ue_sync.strack); q->candidates[nof_detected_frames].cfo = srslte_ue_sync_get_cfo(&q->ue_sync); - INFO + DEBUG ("CELL SEARCH: [%3d/%3d/%d]: Found peak PSR=%.3f, Cell_id: %d CP: %s\n", nof_detected_frames, nof_scanned_frames, q->nof_frames_to_scan, q->candidates[nof_detected_frames].psr, q->candidates[nof_detected_frames].cell_id, diff --git a/srslte/lib/ue/src/ue_dl.c b/srslte/lib/ue/src/ue_dl.c index c77d6b587..4b36522e8 100644 --- a/srslte/lib/ue/src/ue_dl.c +++ b/srslte/lib/ue/src/ue_dl.c @@ -253,7 +253,7 @@ int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint3 fprintf(stderr, "Error decoding DCI msg\n"); return SRSLTE_ERROR; } - INFO("Decoded DCI message RNTI: 0x%x\n", crc_rem); + DEBUG("Decoded DCI message RNTI: 0x%x\n", crc_rem); } return crc_rem == rnti; } @@ -289,7 +289,7 @@ int srslte_ue_dl_find_dl_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint3 fprintf(stderr, "Error decoding DCI msg\n"); return SRSLTE_ERROR; } - INFO("Decoded DCI message RNTI: 0x%x\n", crc_rem); + DEBUG("Decoded DCI message RNTI: 0x%x\n", crc_rem); } } return crc_rem == rnti; diff --git a/srslte/lib/ue/src/ue_mib.c b/srslte/lib/ue/src/ue_mib.c index 69e42cf92..0e8acd330 100644 --- a/srslte/lib/ue/src/ue_mib.c +++ b/srslte/lib/ue/src/ue_mib.c @@ -152,7 +152,7 @@ int srslte_ue_mib_decode(srslte_ue_mib_t * q, cf_t *input, srslte_ue_mib_reset(q); ret = SRSLTE_UE_MIB_FOUND; } else { - INFO("MIB not decoded: %u\n", q->frame_cnt); + DEBUG("MIB not decoded: %u\n", q->frame_cnt); q->frame_cnt++; ret = SRSLTE_UE_MIB_NOTFOUND; } @@ -222,7 +222,7 @@ int srslte_ue_mib_sync_decode(srslte_ue_mib_sync_t * q, if (ret == 1) { mib_ret = srslte_ue_mib_decode(&q->ue_mib, sf_buffer, bch_payload, nof_tx_ports, sfn_offset); } else { - INFO("Resetting PBCH decoder after %d frames\n", q->ue_mib.frame_cnt); + DEBUG("Resetting PBCH decoder after %d frames\n", q->ue_mib.frame_cnt); srslte_ue_mib_reset(&q->ue_mib); } nof_frames++; diff --git a/srslte/lib/ue/src/ue_sync.c b/srslte/lib/ue/src/ue_sync.c index 784d0611b..c99cc086d 100644 --- a/srslte/lib/ue/src/ue_sync.c +++ b/srslte/lib/ue/src/ue_sync.c @@ -265,16 +265,16 @@ static int find_peak_ok(srslte_ue_sync_t *q) { /* Get the subframe index (0 or 5) */ q->sf_idx = srslte_sync_get_sf_idx(&q->sfind) + q->nof_recv_sf; } else { - INFO("Found peak at %d, SSS not detected\n", q->peak_idx); + DEBUG("Found peak at %d, SSS not detected\n", q->peak_idx); } q->frame_find_cnt++; - INFO("Found peak %d at %d, value %.3f, Cell_id: %d CP: %s\n", + DEBUG("Found peak %d at %d, value %.3f, Cell_id: %d CP: %s\n", q->frame_find_cnt, q->peak_idx, srslte_sync_get_last_peak_value(&q->sfind), q->cell.id, srslte_cp_string(q->cell.cp)); if (q->frame_find_cnt >= q->nof_avg_find_frames || q->peak_idx < 2*q->fft_size) { - INFO("Realigning frame, reading %d samples\n", q->peak_idx+q->sf_len/2); + DEBUG("Realigning frame, reading %d samples\n", q->peak_idx+q->sf_len/2); /* Receive the rest of the subframe so that we are subframe aligned*/ if (q->recv_callback(q->stream, q->input_buffer, q->peak_idx+q->sf_len/2, &q->last_timestamp) < 0) { return SRSLTE_ERROR; @@ -299,7 +299,7 @@ static int track_peak_ok(srslte_ue_sync_t *q, uint32_t track_idx) { /* Make sure subframe idx is what we expect */ if ((q->sf_idx != srslte_sync_get_sf_idx(&q->strack)) && q->decode_sss_on_track) { - INFO("Warning: Expected SF idx %d but got %d (%d,%g - %d,%g)!\n", + DEBUG("Warning: Expected SF idx %d but got %d (%d,%g - %d,%g)!\n", q->sf_idx, srslte_sync_get_sf_idx(&q->strack), q->strack.m0, q->strack.m0_value, q->strack.m1, q->strack.m1_value); q->sf_idx = srslte_sync_get_sf_idx(&q->strack); @@ -309,7 +309,7 @@ static int track_peak_ok(srslte_ue_sync_t *q, uint32_t track_idx) { q->time_offset = ((int) track_idx - (int) q->strack.frame_size/2 - (int) q->strack.fft_size); if (q->time_offset) { - INFO("Time offset adjustment: %d samples\n", q->time_offset); + DEBUG("Time offset adjustment: %d samples\n", q->time_offset); } /* compute cumulative moving average time offset */ @@ -318,7 +318,7 @@ static int track_peak_ok(srslte_ue_sync_t *q, uint32_t track_idx) { /* If the PSS peak is beyond the frame (we sample too slowly), discard the offseted samples to align next frame */ if (q->time_offset > 0 && q->time_offset < MAX_TIME_OFFSET) { - INFO("Positive time offset %d samples. Mean time offset %f.\n", q->time_offset, q->mean_time_offset); + DEBUG("Positive time offset %d samples. Mean time offset %f.\n", q->time_offset, q->mean_time_offset); if (q->recv_callback(q->stream, dummy, (uint32_t) q->time_offset, &q->last_timestamp) < 0) { fprintf(stderr, "Error receiving from USRP\n"); return SRSLTE_ERROR; @@ -338,10 +338,10 @@ static int track_peak_no(srslte_ue_sync_t *q) { /* if we missed too many PSS go back to FIND */ q->frame_no_cnt++; if (q->frame_no_cnt >= TRACK_MAX_LOST) { - INFO("\n%d frames lost. Going back to FIND\n", (int) q->frame_no_cnt); + DEBUG("\n%d frames lost. Going back to FIND\n", (int) q->frame_no_cnt); q->state = SF_FIND; } else { - INFO("Tracking peak not found. Peak %.3f, %d lost\n", + DEBUG("Tracking peak not found. Peak %.3f, %d lost\n", srslte_sync_get_last_peak_value(&q->strack), (int) q->frame_no_cnt); } @@ -398,7 +398,7 @@ int srslte_ue_sync_get_buffer(srslte_ue_sync_t *q, cf_t **sf_symbols) { if (q->sf_idx == 10) { q->sf_idx = 0; } - INFO("Reading %d samples. sf_idx = %d\n", q->sf_len, q->sf_idx); + DEBUG("Reading %d samples. sf_idx = %d\n", q->sf_len, q->sf_idx); ret = 1; *sf_symbols = q->input_buffer; } else { diff --git a/srslte/lib/ue/src/ue_ul.c b/srslte/lib/ue/src/ue_ul.c index 849e93270..5f9151e1b 100644 --- a/srslte/lib/ue/src/ue_ul.c +++ b/srslte/lib/ue/src/ue_ul.c @@ -309,7 +309,6 @@ int srslte_ue_ul_pusch_uci_encode_rnti(srslte_ue_ul_t *q, srslte_ra_ul_grant_t * if (q != NULL && grant != NULL && - data != NULL && output_signal != NULL) { @@ -341,7 +340,6 @@ int srslte_ue_ul_pusch_encode_cfg(srslte_ue_ul_t *q, srslte_pusch_cfg_t *cfg, if (q != NULL && cfg != NULL && - data != NULL && output_signal != NULL) { if (srslte_pusch_encode_rnti(&q->pusch, cfg, &q->softbuffer, data, rnti, q->sf_symbols)) { From 0b3c611f385a588df0c3a55a24e3fb1e3ccd35f5 Mon Sep 17 00:00:00 2001 From: ismagom Date: Sat, 16 May 2015 23:24:18 +0200 Subject: [PATCH 09/19] ConnectionSetup working with MAC test --- matlab/sync/cfo_test.m | 19 ++- matlab/tests/prach_test.m | 6 +- srsapps/common/include/srsapps/common/log.h | 47 ++++-- .../include/srsapps/common/log_stdout.h | 16 +- srsapps/common/src/log_stdout.cc | 56 ++++--- .../radio/include/srsapps/radio}/radio.h | 1 + .../radio/include/srsapps/radio/radio_uhd.h | 6 +- srsapps/radio/src/radio_uhd.cc | 27 +++- srsapps/ue/mac/include/srsapps/ue/mac/demux.h | 12 +- .../ue/mac/include/srsapps/ue/mac/dl_harq.h | 7 +- .../mac/include/srsapps/ue/mac/mac_params.h | 8 +- srsapps/ue/mac/include/srsapps/ue/mac/mux.h | 12 +- srsapps/ue/mac/include/srsapps/ue/mac/pdu.h | 7 +- .../ue/mac/include/srsapps/ue/mac/proc_ra.h | 5 +- .../ue/mac/include/srsapps/ue/mac/ul_harq.h | 31 ++-- srsapps/ue/mac/src/demux.cc | 45 +++--- srsapps/ue/mac/src/dl_harq.cc | 23 ++- srsapps/ue/mac/src/mac.cc | 43 +++--- srsapps/ue/mac/src/mux.cc | 28 ++-- srsapps/ue/mac/src/pdu.cc | 82 +++++++--- srsapps/ue/mac/src/proc_ra.cc | 40 ++--- srsapps/ue/mac/src/ul_harq.cc | 144 ++++++++++-------- srsapps/ue/mac/test/mac_test.cc | 98 ++++++++---- .../ue/phy/include/srsapps/ue/phy/dl_buffer.h | 5 +- srsapps/ue/phy/include/srsapps/ue/phy/phy.h | 14 +- srsapps/ue/phy/include/srsapps/ue/phy/prach.h | 6 +- .../ue/phy/include/srsapps/ue/phy/ul_buffer.h | 6 +- srsapps/ue/phy/src/dl_buffer.cc | 21 +-- srsapps/ue/phy/src/phy.cc | 84 +++++++--- srsapps/ue/phy/src/prach.cc | 15 +- srsapps/ue/phy/src/ul_buffer.cc | 32 +++- srsapps/ue/phy/test/ue_itf_test_prach.cc | 45 +++--- srsapps/ue/phy/test/ue_itf_test_sib1.cc | 30 ++-- srslte/examples/pdsch_ue.c | 4 +- srslte/include/srslte/agc/agc.h | 2 +- srslte/include/srslte/cuhd/cuhd.h | 7 +- srslte/include/srslte/ue/ue_ul.h | 1 + srslte/lib/cuhd/src/cuhd_handler.hpp | 2 + srslte/lib/cuhd/src/cuhd_imp.cpp | 20 ++- srslte/lib/phch/src/prach.c | 4 +- srslte/lib/phch/src/pucch.c | 5 +- srslte/lib/phch/src/ra.c | 53 ++++--- srslte/lib/phch/src/sch.c | 2 +- srslte/lib/phch/test/prach_test_mex.c | 2 +- srslte/lib/ue/src/ue_ul.c | 8 +- 45 files changed, 714 insertions(+), 417 deletions(-) rename {srslte/include/srslte/common => srsapps/radio/include/srsapps/radio}/radio.h (97%) diff --git a/matlab/sync/cfo_test.m b/matlab/sync/cfo_test.m index 128964f13..6835cbd58 100644 --- a/matlab/sync/cfo_test.m +++ b/matlab/sync/cfo_test.m @@ -1,21 +1,26 @@ clear; sym_len=128; -hflen = (sym_len/128)*1920*10; +hflen = (sym_len/128)*1920*5; +samp_rate = (sym_len/128)*1920000; N_id_2=1; -input=read_complex('../../build/lte_signal.dat', hflen*500); +input=read_complex('../../build/lte_signal.dat', hflen*200); cp0_len=160*sym_len/2048; cp1_len=144*sym_len/2048; +%t = (0:length(input)-1).'/samp_rate; +%input = input .* exp(-1i*2*pi*2000.0*t); + subframes=reshape(input,hflen,[]); [n m]=size(subframes); +cfdl=struct('NDLRB',6,'CyclicPrefix','Normal','DuplexMode','FDD'); cfo=zeros(m,2); for i=1:m - cfo(i,1) = cfo_estimate_cp(subframes(1:960,i),1,sym_len,cp0_len,cp1_len); - [~, cfo(i,2)] = find_pss(subframes(:,i),N_id_2); - + [toffset, cfo(i,2)] = find_pss(subframes(:,i),N_id_2); + cfo(i,1) = lteFrequencyOffset(cfdl,subframes(:,i),toffset)/15000; end -plot(cfo) -legend('CP-based','PSS-based') \ No newline at end of file +plot(cfo*15000) +legend('Matlab','PSS-based') +disp(mean(cfo)*15) diff --git a/matlab/tests/prach_test.m b/matlab/tests/prach_test.m index 1263860a2..43c034065 100644 --- a/matlab/tests/prach_test.m +++ b/matlab/tests/prach_test.m @@ -10,7 +10,7 @@ NULRB=[6 15 25 50 100]; for n_rb=3:length(NULRB) for format=0; - for seqIdx=0:17:237 + for seqIdx=7:17:237 fprintf('RB: %d, format %d, seqIdx: %d\n',NULRB(n_rb),format,seqIdx); for preambleIdx=0:23:63 for CyclicShift=1:3:15 @@ -24,10 +24,10 @@ for n_rb=3:length(NULRB) prachConfig.HighSpeed=hs; prachConfig.FreqIdx=0; prachConfig.FreqOffset=0; - lib=srslte_prach(ueConfig,prachConfig); + lib=srslte_prach(ueConfig,prachConfig)*2.4645; [mat, info]=ltePRACH(ueConfig,prachConfig); - err=mean(abs(mat(:)-lib(1:length(mat)))); + err=mean(abs(mat-lib)); if (err > 10^-3) disp(err) error('Error!'); diff --git a/srsapps/common/include/srsapps/common/log.h b/srsapps/common/include/srsapps/common/log.h index 5dc22566a..94d764509 100644 --- a/srsapps/common/include/srsapps/common/log.h +++ b/srsapps/common/include/srsapps/common/log.h @@ -40,10 +40,10 @@ #ifndef LOG_H #define LOG_H -#define Error(fmt, ...) log_h->error(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) -#define Warning(fmt, ...) log_h->warning(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) -#define Info(fmt, ...) log_h->info(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) -#define Debug(fmt, ...) log_h->debug(tti, __FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define Error(fmt, ...) log_h->error(__FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define Warning(fmt, ...) log_h->warning(__FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define Info(fmt, ...) log_h->info(__FILE__, __LINE__, fmt, ##__VA_ARGS__) +#define Debug(fmt, ...) log_h->debug(__FILE__, __LINE__, fmt, ##__VA_ARGS__) using namespace std; @@ -53,23 +53,42 @@ class log { public: - log(string service_name_) { service_name = service_name_; } + log(string service_name_) { service_name = service_name_; tti = 0; level = LOG_LEVEL_NONE; } + + // This function shall be called at the start of every tti for printing tti + void step(uint32_t tti_) { + tti = tti_; + } + + typedef enum { + LOG_LEVEL_NONE = 0, + LOG_LEVEL_INFO, + LOG_LEVEL_DEBUG + } log_level_t; + + void set_level_info() { + level = LOG_LEVEL_INFO; + } + void set_level_debug() { + level = LOG_LEVEL_DEBUG; + } // Pure virtual methods for logging - virtual void error(uint32_t tti, string message, ...) = 0; - virtual void warning(uint32_t tti, string message, ...) = 0; - virtual void info(uint32_t tti, string message, ...) = 0; - virtual void debug(uint32_t tti, string message, ...) = 0; + virtual void error(string message, ...) = 0; + virtual void warning(string message, ...) = 0; + virtual void info(string message, ...) = 0; + virtual void debug(string message, ...) = 0; // Same with line and file info - virtual void error(uint32_t tti, string file, int line, string message, ...) = 0; - virtual void warning(uint32_t tti, string file, int line, string message, ...) = 0; - virtual void info(uint32_t tti, string file, int line, string message, ...) = 0; - virtual void debug(uint32_t tti, string file, int line, string message, ...) = 0; + virtual void error(string file, int line, string message, ...) = 0; + virtual void warning(string file, int line, string message, ...) = 0; + virtual void info(string file, int line, string message, ...) = 0; + virtual void debug(string file, int line, string message, ...) = 0; protected: string get_service_name() { return service_name; } - + uint32_t tti; + log_level_t level; private: string service_name; }; diff --git a/srsapps/common/include/srsapps/common/log_stdout.h b/srsapps/common/include/srsapps/common/log_stdout.h index 23c38ab30..df5ac809d 100644 --- a/srsapps/common/include/srsapps/common/log_stdout.h +++ b/srsapps/common/include/srsapps/common/log_stdout.h @@ -53,16 +53,16 @@ public: log_stdout(string service_name_) : log(service_name_) { } - void error(uint32_t tti, string message, ...); - void warning(uint32_t tti, string message, ...); - void info(uint32_t tti, string message, ...); - void debug(uint32_t tti, string message, ...); + void error(string message, ...); + void warning(string message, ...); + void info(string message, ...); + void debug(string message, ...); // Same with line and file info - void error(uint32_t tti, string file, int line, string message, ...); - void warning(uint32_t tti, string file, int line, string message, ...); - void info(uint32_t tti, string file, int line, string message, ...); - void debug(uint32_t tti, string file, int line, string message, ...); + void error(string file, int line, string message, ...); + void warning(string file, int line, string message, ...); + void info(string file, int line, string message, ...); + void debug(string file, int line, string message, ...); private: typedef enum { diff --git a/srsapps/common/src/log_stdout.cc b/srsapps/common/src/log_stdout.cc index 21cbb89bb..81e6e51d1 100644 --- a/srsapps/common/src/log_stdout.cc +++ b/srsapps/common/src/log_stdout.cc @@ -59,7 +59,7 @@ void log_stdout::printlog(level_t type, uint32_t tti, string file, int line, str vprintf(msg.c_str(), args); } -void log_stdout::error(uint32_t tti, string msg, ...) +void log_stdout::error(string msg, ...) { va_list args; va_start(args, msg); @@ -67,23 +67,27 @@ void log_stdout::error(uint32_t tti, string msg, ...) va_end(args); } -void log_stdout::info(uint32_t tti, string msg, ...) +void log_stdout::info(string msg, ...) { - va_list args; - va_start(args, msg); - printlog(INFO, tti, msg, args); - va_end(args); + if (level >= LOG_LEVEL_INFO) { + va_list args; + va_start(args, msg); + printlog(INFO, tti, msg, args); + va_end(args); + } } -void log_stdout::debug(uint32_t tti, string msg, ...) +void log_stdout::debug(string msg, ...) { - va_list args; - va_start(args, msg); - printlog(DEBUG, tti, msg, args); - va_end(args); + if (level >= LOG_LEVEL_DEBUG) { + va_list args; + va_start(args, msg); + printlog(DEBUG, tti, msg, args); + va_end(args); + } } -void log_stdout::warning(uint32_t tti, string msg, ...) +void log_stdout::warning(string msg, ...) { va_list args; va_start(args, msg); @@ -92,7 +96,7 @@ void log_stdout::warning(uint32_t tti, string msg, ...) } -void log_stdout::error(uint32_t tti, string file, int line, string msg, ...) +void log_stdout::error(string file, int line, string msg, ...) { va_list args; va_start(args, msg); @@ -100,23 +104,27 @@ void log_stdout::error(uint32_t tti, string file, int line, string msg, ...) va_end(args); } -void log_stdout::info(uint32_t tti, string file, int line, string msg, ...) +void log_stdout::info(string file, int line, string msg, ...) { - va_list args; - va_start(args, msg); - printlog(INFO, tti, file, line, msg, args); - va_end(args); + if (level >= LOG_LEVEL_INFO) { + va_list args; + va_start(args, msg); + printlog(INFO, tti, file, line, msg, args); + va_end(args); + } } -void log_stdout::debug(uint32_t tti, string file, int line, string msg, ...) +void log_stdout::debug(string file, int line, string msg, ...) { - va_list args; - va_start(args, msg); - printlog(DEBUG, tti, file, line, msg, args); - va_end(args); + if (level >= LOG_LEVEL_DEBUG) { + va_list args; + va_start(args, msg); + printlog(DEBUG, tti, file, line, msg, args); + va_end(args); + } } -void log_stdout::warning(uint32_t tti, string file, int line, string msg, ...) +void log_stdout::warning(string file, int line, string msg, ...) { va_list args; va_start(args, msg); diff --git a/srslte/include/srslte/common/radio.h b/srsapps/radio/include/srsapps/radio/radio.h similarity index 97% rename from srslte/include/srslte/common/radio.h rename to srsapps/radio/include/srsapps/radio/radio.h index 833f462c7..0cf14fc5a 100644 --- a/srslte/include/srslte/common/radio.h +++ b/srsapps/radio/include/srsapps/radio/radio.h @@ -47,6 +47,7 @@ namespace srslte { virtual void set_tx_gain(float gain) = 0; virtual void set_rx_gain(float gain) = 0; + virtual double set_rx_gain_th(float gain) = 0; virtual void set_tx_freq(float freq) = 0; virtual void set_rx_freq(float freq) = 0; diff --git a/srsapps/radio/include/srsapps/radio/radio_uhd.h b/srsapps/radio/include/srsapps/radio/radio_uhd.h index 490200722..897ca5fb9 100644 --- a/srsapps/radio/include/srsapps/radio/radio_uhd.h +++ b/srsapps/radio/include/srsapps/radio/radio_uhd.h @@ -27,8 +27,8 @@ +#include "srsapps/radio/radio.h" #include "srslte/srslte.h" -#include "srslte/common/radio.h" #include "srslte/cuhd/cuhd.h" #ifndef RADIO_UHD_H @@ -44,6 +44,8 @@ namespace srslte { public: bool init(); bool init(char *args); + bool init_agc(); + bool init_agc(char *args); void get_time(srslte_timestamp_t *now); bool tx(void *buffer, uint32_t nof_samples, srslte_timestamp_t tx_time); @@ -52,6 +54,8 @@ namespace srslte { void set_tx_gain(float gain); void set_rx_gain(float gain); + void set_tx_rx_gain_offset(float offset); + double set_rx_gain_th(float gain); void set_tx_freq(float freq); void set_rx_freq(float freq); diff --git a/srsapps/radio/src/radio_uhd.cc b/srsapps/radio/src/radio_uhd.cc index 6995aaf8d..30cab5b78 100644 --- a/srsapps/radio/src/radio_uhd.cc +++ b/srsapps/radio/src/radio_uhd.cc @@ -26,7 +26,6 @@ */ #include "srslte/srslte.h" -#include "srslte/common/radio.h" #include "srsapps/radio/radio_uhd.h" @@ -47,6 +46,26 @@ bool radio_uhd::init(char *args) return true; } +bool radio_uhd::init_agc() +{ + return init_agc((char*) ""); +} + +void radio_uhd::set_tx_rx_gain_offset(float offset) { + cuhd_set_tx_rx_gain_offset(uhd, offset); +} + +bool radio_uhd::init_agc(char *args) +{ + printf("Opening UHD device with threaded RX Gain control ...\n"); + if (cuhd_open_th(args, &uhd, true)) { + fprintf(stderr, "Error opening uhd\n"); + return false; + } + cuhd_set_rx_gain(uhd, 40); + cuhd_set_tx_gain(uhd, 40); + return true; +} bool radio_uhd::rx_at(void* buffer, uint32_t nof_samples, srslte_timestamp_t rx_time) { fprintf(stderr, "Not implemented\n"); @@ -85,6 +104,12 @@ void radio_uhd::set_rx_gain(float gain) cur_rx_gain = cuhd_set_rx_gain(uhd, gain); } +double radio_uhd::set_rx_gain_th(float gain) +{ + cur_rx_gain = cuhd_set_rx_gain_th(uhd, gain); + return cur_rx_gain; +} + void radio_uhd::set_rx_srate(float srate) { cur_rx_srate = cuhd_set_rx_srate(uhd, srate); diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h index f4182b50e..c498473d8 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h @@ -48,11 +48,13 @@ public: demux(); void init(phy* phy_h_, log* log_h_, mac_io* mac_io_h_, timers* timers_db_); - void push_pdu(uint32_t tti, uint8_t *mac_pdu, uint32_t nof_bits); - void push_pdu_bcch(uint32_t tti, uint8_t *mac_pdu, uint32_t nof_bits); - void push_pdu_temp_crnti(uint32_t tti, uint8_t *mac_pdu, uint32_t nof_bits); + void push_pdu(uint8_t *mac_pdu, uint32_t nof_bits); + void push_pdu_bcch(uint8_t *mac_pdu, uint32_t nof_bits); + void push_pdu_temp_crnti(uint8_t *mac_pdu, uint32_t nof_bits); bool is_temp_crnti_pending(); - void demultiplex_pending_pdu(uint32_t tti); + bool is_contention_resolution_id_pending(); + void demultiplex_pending_pdu(); + void discard_pending_pdu(); uint64_t get_contention_resolution_id(); @@ -65,12 +67,12 @@ private: uint64_t contention_resolution_id; bool pending_temp_rnti; + bool has_pending_contention_resolution_id; phy *phy_h; log *log_h; mac_io *mac_io_h; timers *timers_db; - uint32_t tti; }; } } diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h index dbddbc9f6..7c20f1bdb 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/dl_harq.h @@ -52,10 +52,9 @@ public: const static uint32_t HARQ_BCCH_PID = NOF_HARQ_PROC; dl_harq_entity(); - ~dl_harq_entity(); bool init(srslte_cell_t cell, uint32_t max_payload_len, srslte::log *log_h_, timers *timers_, demux *demux_unit); bool is_sps(uint32_t pid); - void set_harq_info(uint32_t tti, uint32_t pid, dl_sched_grant *grant); + void set_harq_info(uint32_t pid, dl_sched_grant *grant); void receive_data(uint32_t tti, uint32_t pid, dl_buffer *dl_buffer, phy *phy_h); void reset(); bool is_ack_pending_resolution(); @@ -67,7 +66,7 @@ private: public: dl_harq_process(); bool init(srslte_cell_t cell, uint32_t max_payload_len, dl_harq_entity *parent); - void set_harq_info(uint32_t tti, dl_sched_grant *grant); + void set_harq_info(dl_sched_grant *grant); void receive_data(uint32_t tti, dl_buffer *dl_buffer, phy *phy_h); void reset(); // Called after the contention resolution is terminated to send pending ACKs, if any @@ -90,7 +89,7 @@ private: srslte_softbuffer_rx_t softbuffer; }; - dl_harq_process *proc; + dl_harq_process proc[NOF_HARQ_PROC+1]; timers *timers_db; demux *demux_unit; srslte::log *log_h; diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h index aed3c23d3..226463f2c 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h @@ -79,7 +79,13 @@ namespace ue { RA_PREAMBLETRANSMAX, RA_INITRECEIVEDPOWER, RA_CONTENTIONTIMER, - RA_MAXTXMSG3, + + SR_PUCCH_RESINDEX, + SR_CONFIG_INDEX, + SR_TRANS_MAX, + + HARQ_MAXTX, + HARQ_MAXMSG3TX, PDSCH_RSPOWER, PDSCH_PB, diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h index 9972e8f68..bc4ede63c 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h @@ -50,14 +50,14 @@ public: bool is_pending_sdu(); - uint8_t* pdu_pop(uint32_t tti_, uint32_t pdu_sz); - bool pdu_move_to_msg3(uint32_t tti, uint32_t pdu_sz); + uint8_t* pdu_pop(uint32_t pdu_sz); + bool pdu_move_to_msg3(uint32_t pdu_sz); void pdu_release(); - uint8_t* msg3_pop(uint32_t tti_, uint32_t pdu_sz); + uint8_t* msg3_pop(uint32_t pdu_sz); void msg3_flush(); - void msg3_release(); - bool msg3_isempty(); + void msg3_transmitted(); + bool msg3_is_transmitted(); void append_crnti_ce_next_tx(uint16_t crnti); @@ -81,7 +81,6 @@ private: log *log_h; mac_io *mac_io_h; - uint32_t tti; uint16_t pending_crnti_ce; /* Msg3 Buffer */ @@ -92,6 +91,7 @@ private: static const uint32_t PDU_BUFF_SZ = 16*1024; qbuff pdu_buff; sch_pdu pdu_msg; + bool msg3_has_been_transmitted; }; } diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/pdu.h b/srsapps/ue/mac/include/srsapps/ue/mac/pdu.h index 15ad95329..60a835932 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/pdu.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/pdu.h @@ -112,6 +112,7 @@ public: // Section 6.1.2 void parse_packet(uint8_t *ptr) { + uint8_t *init_ptr = ptr; nof_subheaders = 0; while(subheaders[nof_subheaders].read_subheader(&ptr)) { nof_subheaders++; @@ -177,6 +178,8 @@ public: // Reading functions bool is_sdu(); cetype ce_type(); + uint32_t size_plus_header(); + void set_payload_size(uint32_t size); bool read_subheader(uint8_t** ptr); void read_payload(uint8_t **ptr); @@ -218,10 +221,12 @@ public: sch_pdu(uint32_t max_rars) : pdu(max_rars) {} + void parse_packet(uint8_t *ptr); bool write_packet(uint8_t *ptr); bool has_space_ce(uint32_t nbytes); bool has_space_sdu(uint32_t nbytes); - static uint32_t size_plus_header_pdu(uint32_t nbytes); + uint32_t size(); + static uint32_t size_plus_header_sdu(uint32_t nbytes); bool update_space_ce(uint32_t nbytes); bool update_space_sdu(uint32_t nbytes); void fprint(FILE *stream); diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h index 408b9f7c0..6abc0aae4 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_ra.h @@ -59,6 +59,7 @@ class ra_proc : public proc,timer_callback void start_mac_order(); void step(uint32_t tti); bool is_successful(); + bool is_response_error(); bool is_contention_resolution(); bool is_error(); bool in_progress(); @@ -67,7 +68,7 @@ class ra_proc : public proc,timer_callback private: - void process_timeadv_cmd(uint32_t tti, uint32_t ta_cmd); + void process_timeadv_cmd(uint32_t ta_cmd); void step_initialization(); void step_initialization_wait(); void step_resource_selection(); @@ -98,7 +99,6 @@ private: uint32_t preambleTransMax; uint32_t iniReceivedTargetPower; int delta_preamble_db; - uint32_t maxharq_msg3tx; uint32_t contentionResolutionTimer; uint32_t maskIndex; int preambleIndex; @@ -145,7 +145,6 @@ private: pthread_t pt_init_prach; - uint64_t received_contention_id; uint64_t transmitted_contention_id; uint16_t transmitted_crnti; enum { diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h index 42673a383..d7ef12d6d 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/ul_harq.h @@ -51,18 +51,13 @@ public: const static uint32_t NOF_HARQ_PROC = 8; static uint32_t pidof(uint32_t tti); - ul_harq_entity(); - ~ul_harq_entity(); - - bool init(srslte_cell_t cell, log *log_h, timers* timers_, mux *mux_unit); - void set_maxHARQ_Tx(uint32_t maxHARQ_Tx, uint32_t maxHARQ_Msg3Tx); + bool init(srslte_cell_t cell, mac_params *params_db, log *log_h, timers* timers_, mux *mux_unit); void reset(); void reset_ndi(); bool is_sps(uint32_t pid); void run_tti(uint32_t tti, ul_sched_grant *grant, phy *phy_); - void run_tti(uint32_t tti, dl_buffer *dl_buffer, phy *phy_); - bool is_last_retx_msg3(); + void run_tti(uint32_t tti, phy *phy_); private: @@ -72,40 +67,40 @@ private: bool init(srslte_cell_t cell, ul_harq_entity *parent); void reset(); void reset_ndi(); - void set_maxHARQ_Tx(uint32_t maxHARQ_Tx_, uint32_t maxHARQ_Msg3Tx_); - void generate_retx(ul_buffer *ul); - void generate_retx(ul_sched_grant *ul_grant, ul_buffer *ul); - void generate_new_tx(uint8_t *payload, bool is_msg3, ul_sched_grant* grant, ul_buffer *ul); + void generate_retx(uint32_t tti_tx, ul_buffer *ul); + void generate_retx(uint32_t tti_tx, ul_sched_grant *ul_grant, ul_buffer *ul); + void generate_new_tx(uint32_t tti_tx, uint8_t *payload, bool is_msg3, ul_sched_grant* grant, ul_buffer *ul); + uint32_t get_rv(); bool has_grant(); ul_sched_grant *get_grant(); void set_harq_feedback(bool ack); bool get_ndi(); + uint32_t last_tx_tti(); - uint32_t tti; private: uint32_t current_tx_nb; uint32_t current_irv; bool harq_feedback; bool ndi; - srslte::log *log_h; + log *log_h; ul_harq_entity *harq_entity; ul_sched_grant cur_grant; bool is_grant_configured; srslte_softbuffer_tx_t softbuffer; - uint32_t maxHARQ_Tx, maxHARQ_Msg3Tx; bool is_msg3; bool is_initiated; + uint32_t tti_last_tx; - void generate_tx(uint8_t *pdu_payload, ul_buffer* ul); + void generate_tx(uint32_t tti_tx, uint8_t *pdu_payload, ul_buffer* ul); }; - bool last_retx_is_msg3; timers *timers_db; mux *mux_unit; - ul_harq_process *proc; - srslte::log *log_h; + ul_harq_process proc[NOF_HARQ_PROC]; + log *log_h; + mac_params *params_db; }; } diff --git a/srsapps/ue/mac/src/demux.cc b/srsapps/ue/mac/src/demux.cc index b43e655b2..0a9590c0f 100644 --- a/srsapps/ue/mac/src/demux.cc +++ b/srsapps/ue/mac/src/demux.cc @@ -36,6 +36,7 @@ demux::demux() : mac_msg(20),pending_mac_msg(20) { contention_resolution_id = 0; pending_temp_rnti = false; + has_pending_contention_resolution_id = false; } void demux::init(phy* phy_h_, log* log_h_, mac_io* mac_io_h_, timers* timers_db_) @@ -52,10 +53,15 @@ bool demux::is_temp_crnti_pending() return pending_temp_rnti; } +bool demux::is_contention_resolution_id_pending() { + return has_pending_contention_resolution_id; +} + uint64_t demux::get_contention_resolution_id() { uint64_t x = contention_resolution_id; contention_resolution_id = 0; + has_pending_contention_resolution_id = false; return x; } @@ -63,9 +69,8 @@ uint64_t demux::get_contention_resolution_id() /* Demultiplexing of MAC PDU associated with SI-RNTI. The PDU passes through * the MAC in transparent mode */ -void demux::push_pdu_bcch(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) +void demux::push_pdu_bcch(uint8_t *mac_pdu, uint32_t nof_bits) { - tti = tti_; mac_io_h->get(mac_io::MAC_LCH_BCCH_DL)->send(mac_pdu, nof_bits); Debug("Pushed BCCH MAC PDU in transparent mode\n"); } @@ -76,35 +81,32 @@ void demux::push_pdu_bcch(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) * wether the PDU shall pass to upper layers or not, which depends on the * Contention Resolution result */ -void demux::push_pdu_temp_crnti(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) +void demux::push_pdu_temp_crnti(uint8_t *mac_pdu, uint32_t nof_bits) { - tti = tti_; if (!pending_temp_rnti) { // Unpack DLSCH MAC PDU pending_mac_msg.init(nof_bits/8); pending_mac_msg.parse_packet(mac_pdu); - pending_mac_msg.fprint(stdout); - //MIRAR ACK PENDING. EL QUE PASSA ES QUE AL HARQ NO FA RES SI EL CONTENTION RES ID ES 0, PERQUE ES 0??? - // Look for Contention Resolution UE ID - contention_resolution_id = 0; while(pending_mac_msg.next()) { if (pending_mac_msg.get()->ce_type() == sch_subh::CON_RES_ID) { contention_resolution_id = pending_mac_msg.get()->get_con_res_id(); + has_pending_contention_resolution_id = true; + Info("Found Contention Resolution ID CE\n"); } } + pending_mac_msg.reset(); pending_temp_rnti = true; - Debug("Saved MAC PDU with Temporal C-RNTI in buffer\n"); + Info("Saved MAC PDU with Temporal C-RNTI in buffer\n"); } else { Warning("Error pushing PDU with Temporal C-RNTI: Another PDU is still in pending\n"); } } /* Demultiplexing of logical channels and dissassemble of MAC CE */ -void demux::push_pdu(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) +void demux::push_pdu(uint8_t *mac_pdu, uint32_t nof_bits) { - tti = tti_; // Unpack DLSCH MAC PDU mac_msg.init(nof_bits/8); mac_msg.parse_packet(mac_pdu); @@ -112,14 +114,18 @@ void demux::push_pdu(uint32_t tti_, uint8_t *mac_pdu, uint32_t nof_bits) Debug("Normal MAC PDU processed\n"); } -void demux::demultiplex_pending_pdu(uint32_t tti_) +void demux::discard_pending_pdu() +{ + pending_temp_rnti = false; + pending_mac_msg.reset(); +} + +void demux::demultiplex_pending_pdu() { - tti = tti_; if (pending_temp_rnti) { process_pdu(&pending_mac_msg); - Debug("Temporal C-RNTI MAC PDU processed\n"); - pending_temp_rnti = false; - pending_mac_msg.reset(); + discard_pending_pdu(); + Info("Temporal C-RNTI MAC PDU processed\n"); } else { Error("Error demultiplex pending PDU: No pending PDU\n"); } @@ -129,6 +135,7 @@ void demux::demultiplex_pending_pdu(uint32_t tti_) void demux::process_pdu(sch_pdu *pdu_msg) { + Info("Processing PDU\n"); while(pdu_msg->next()) { if (pdu_msg->get()->is_sdu()) { // Route logical channel @@ -136,7 +143,7 @@ void demux::process_pdu(sch_pdu *pdu_msg) qbuff *dest_lch = mac_io_h->get(pdu_msg->get()->get_sdu_lcid()); if (dest_lch) { dest_lch->send(pdu_msg->get()->get_sdu_ptr(), pdu_msg->get()->get_sdu_nbytes()*8); - Debug("Sent MAC SDU len=%d bytes to lchid=%d\n", + Info("Sent MAC SDU len=%d bytes to lchid=%d\n", pdu_msg->get()->get_sdu_nbytes(), pdu_msg->get()->get_sdu_lcid()); } else { Error("Getting destination channel LCID=%d\n", pdu_msg->get()->get_sdu_lcid()); @@ -168,8 +175,10 @@ bool demux::process_ce(sch_subh *subh) { timers_db->get(mac::TIME_ALIGNMENT)->run(); Debug("Set TimeAdvance Command %d\n", subh->get_ta_cmd()); break; + case sch_subh::PADDING: + break; default: - Error("MAC CE not supported\n"); + Error("MAC CE 0x%x not supported\n", subh->ce_type()); break; } return true; diff --git a/srsapps/ue/mac/src/dl_harq.cc b/srsapps/ue/mac/src/dl_harq.cc index 827aa8c95..0a0ca8614 100644 --- a/srsapps/ue/mac/src/dl_harq.cc +++ b/srsapps/ue/mac/src/dl_harq.cc @@ -43,16 +43,11 @@ namespace srslte { dl_harq_entity::dl_harq_entity() { - proc = new dl_harq_process[NOF_HARQ_PROC+1]; // BCCH process is separate for (uint32_t i=0;itti); pending_ul_buffer->generate_ack(pending_ack, &pending_ack_grant); } } @@ -142,18 +138,19 @@ void dl_harq_entity::dl_harq_process::receive_data(uint32_t tti, srslte::ue::dl_ if (dl_buffer->decode_data(&cur_grant, &softbuffer, payload)) { Info("Decoded OK\n"); // RX OK - Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit\n", cur_grant.get_tbs()/8); if (pid == HARQ_BCCH_PID) { - harq_entity->demux_unit->push_pdu_bcch(tti, payload, cur_grant.get_tbs()); + Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (BCCH)\n", cur_grant.get_tbs()/8); + harq_entity->demux_unit->push_pdu_bcch(payload, cur_grant.get_tbs()); is_first_tx = true; } else { if (is_first_decoded) { if (cur_grant.is_temp_rnti()) { - harq_entity->demux_unit->push_pdu_temp_crnti(tti, payload, cur_grant.get_tbs()); + Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (Temporal C-RNTI)\n", cur_grant.get_tbs()/8); + harq_entity->demux_unit->push_pdu_temp_crnti(payload, cur_grant.get_tbs()); } else { - harq_entity->demux_unit->push_pdu(tti, payload, cur_grant.get_tbs()); + Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit\n", cur_grant.get_tbs()/8); + harq_entity->demux_unit->push_pdu(payload, cur_grant.get_tbs()); } - is_first_decoded = false; } ack = true; } @@ -186,7 +183,7 @@ void dl_harq_entity::dl_harq_process::receive_data(uint32_t tti, srslte::ue::dl_ } } // Implement 5.3.2.2 -void dl_harq_entity::dl_harq_process::set_harq_info(uint32_t tti, srslte::ue::dl_sched_grant* new_grant) { +void dl_harq_entity::dl_harq_process::set_harq_info(srslte::ue::dl_sched_grant* new_grant) { bool is_new_transmission = false; if (new_grant->get_ndi() && !cur_grant.get_ndi() || is_first_tx) { is_new_transmission = true; diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc index a6c9d2188..aead0ff3a 100644 --- a/srsapps/ue/mac/src/mac.cc +++ b/srsapps/ue/mac/src/mac.cc @@ -55,7 +55,7 @@ bool mac::init(phy *phy_h_, tti_sync* ttisync_, log* log_h_) pthread_attr_t attr; struct sched_param param; - param.sched_priority = -20; + param.sched_priority = sched_get_priority_min(SCHED_FIFO) ; pthread_attr_init(&attr); pthread_attr_setschedpolicy(&attr, SCHED_FIFO); pthread_attr_setschedparam(&attr, ¶m); @@ -132,7 +132,7 @@ void mac::main_radio_loop() { // Init HARQ for this cell Info("Init UL/DL HARQ\n"); - ul_harq.init(cell, log_h, &timers_db, &mux_unit); + ul_harq.init(cell, ¶ms_db, log_h, &timers_db, &mux_unit); dl_harq.init(cell, 8*1024, log_h, &timers_db, &demux_unit); // Set the current PHY cell to the detected cell @@ -140,13 +140,15 @@ void mac::main_radio_loop() { if (phy_h->set_cell(cell)) { Info("Starting RX streaming\n"); if (phy_h->start_rxtx()) { + log_h->step(ttisync->wait()); + Info("Receiver synchronized\n"); // Send MIB to RRC mac_io_lch.get(mac_io::MAC_LCH_BCCH_DL)->send(bch_payload, SRSLTE_BCH_PAYLOAD_LEN); ttisync->resync(); - Info("Wait to sync\n"); + Info("Wait for AGC, CFO estimation, etc. \n"); for (int i=0;i<1000;i++) { tti = ttisync->wait(); } @@ -168,6 +170,7 @@ void mac::main_radio_loop() { /* Warning: Here order of invocation of procedures is important!! */ tti = ttisync->wait(); + log_h->step(tti); // Step all procedures ra_procedure.step(tti); @@ -181,18 +184,22 @@ void mac::main_radio_loop() { // Process DL grants always process_dl_grants(tti); + // Process UL grants if RA procedure is done and we have pending data or in contention resolution + if (ra_procedure.is_contention_resolution() || + ra_procedure.is_successful() && mux_unit.is_pending_sdu()) + { + process_ul_grants(tti); + } + // Send pending HARQ ACK, if any, and contention resolution is resolved if (dl_harq.is_ack_pending_resolution()) { - if (ra_procedure.is_successful()) { + ra_procedure.step(tti); + if (ra_procedure.is_successful() || ra_procedure.is_response_error()) { Info("Sending pending ACK for contention resolution\n"); dl_harq.send_pending_ack_contention_resolution(); } } - // Process UL grants if RA procedure is done or in contention resolution - if (ra_procedure.is_successful() || ra_procedure.is_contention_resolution()) { - process_ul_grants(tti); - } timers_db.step_all(); // Check if there is pending CCCH SDU in Multiplexing Unit @@ -300,13 +307,14 @@ void mac::process_dl_grants(uint32_t tti) { if (i == mac_params::RNTI_C && dl_harq.is_sps(harq_pid)) { ue_grant.set_ndi(true); } - dl_harq.set_harq_info(tti, harq_pid, &ue_grant); + Info("Processing DL grant TBS=%d, RNTI=%d, RV=%d\n", ue_grant.get_tbs(), ue_grant.get_rnti(), ue_grant.get_rv()); + dl_harq.set_harq_info(harq_pid, &ue_grant); dl_harq.receive_data(tti, harq_pid, dl_buffer, phy_h); } else { uint32_t harq_pid = get_harq_sps_pid(tti); if (ue_grant.get_ndi()) { ue_grant.set_ndi(false); - dl_harq.set_harq_info(tti, harq_pid, &ue_grant); + dl_harq.set_harq_info(harq_pid, &ue_grant); dl_harq.receive_data(tti, harq_pid, dl_buffer, phy_h); } else { if (ue_grant.is_sps_release()) { @@ -318,7 +326,7 @@ void mac::process_dl_grants(uint32_t tti) { } else { dl_sps_assig.reset(tti, &ue_grant); ue_grant.set_ndi(true); - dl_harq.set_harq_info(tti, harq_pid, &ue_grant); + dl_harq.set_harq_info(harq_pid, &ue_grant); } } } @@ -331,7 +339,7 @@ void mac::process_dl_grants(uint32_t tti) { Info("Processing SPS grant\n"); uint32_t harq_pid = get_harq_sps_pid(tti); sps_grant->set_ndi(true); - dl_harq.set_harq_info(tti, harq_pid, sps_grant); + dl_harq.set_harq_info(harq_pid, sps_grant); dl_harq.receive_data(tti, harq_pid, dl_buffer, phy_h); } @@ -355,7 +363,7 @@ void mac::process_dl_grants(uint32_t tti) { } si_grant.set_rv(((uint32_t) ceilf((float)1.5*k))%4); Info("DL grant found, sending to HARQ with RV: %d\n", si_grant.get_rv()); - dl_harq.set_harq_info(tti, dl_harq_entity::HARQ_BCCH_PID, &si_grant); + dl_harq.set_harq_info(dl_harq_entity::HARQ_BCCH_PID, &si_grant); dl_harq.receive_data(tti, dl_harq_entity::HARQ_BCCH_PID, dl_buffer, phy_h); params_db.set_param(mac_params::BCCH_SI_WINDOW_ST, 0); params_db.set_param(mac_params::BCCH_SI_WINDOW_LEN, 0); @@ -380,7 +388,7 @@ void mac::process_ul_grants(uint32_t tti) { ul_sched_grant ul_grant(rnti_type(i), params_db.get_param(i)); if (dl_buffer->get_ul_grant(&ul_grant)) { if (ul_grant.is_from_rar()) { - dl_buffer->release_pending_rar_grant(); + dl_buffer->discard_pending_rar_grant(); } if (ra_procedure.is_contention_resolution() && i == mac_params::RNTI_C) { ra_procedure.pdcch_to_crnti(true); @@ -389,11 +397,8 @@ void mac::process_ul_grants(uint32_t tti) { if (i == mac_params::RNTI_C && ul_harq.is_sps(tti)) { ul_grant.set_ndi(true); } + Info("Found UL Grant TBS=%d RNTI=%d is_from_rar=%d\n", ul_grant.get_tbs(), params_db.get_param(i), ul_grant.is_from_rar()); ul_harq.run_tti(tti, &ul_grant, phy_h); - if (i == mac_params::RNTI_TEMP) { - // Discard already processed RAR grant - dl_buffer->discard_pending_rar_grant(); - } return; } else if (i == mac_params::RNTI_SPS) { @@ -422,7 +427,7 @@ void mac::process_ul_grants(uint32_t tti) { return; } } - ul_harq.run_tti(tti, dl_buffer, phy_h); + ul_harq.run_tti(tti, phy_h); } diff --git a/srsapps/ue/mac/src/mux.cc b/srsapps/ue/mac/src/mux.cc index 52270f1e1..abb851a0f 100644 --- a/srsapps/ue/mac/src/mux.cc +++ b/srsapps/ue/mac/src/mux.cc @@ -41,6 +41,7 @@ mux::mux() : pdu_msg(20) pdu_buff.init(1, PDU_BUFF_SZ); bzero(nof_tx_pkts, sizeof(uint32_t) * mac_io::NOF_UL_LCH); pthread_mutex_init(&mutex, NULL); + msg3_has_been_transmitted = false; for (int i=0;i 0) { mac_io_h->get(IO_IDX(i))->release(); @@ -229,6 +228,7 @@ bool mux::assemble_pdu(uint32_t pdu_sz_nbits) { } } + Info("Assembled MAC PDU msg size %d bytes\n", pdu_msg.size()); /* Generate MAC PDU and save to buffer */ if (pdu_msg.write_packet(buff)) { pdu_buff.push(pdu_sz_nbits); @@ -270,15 +270,21 @@ bool mux::allocate_sdu(uint32_t lcid, sch_pdu *pdu_msg, uint32_t *sdu_sz) void mux::msg3_flush() { msg3_buff.flush(); + msg3_has_been_transmitted = false; } -bool mux::msg3_isempty() +void mux::msg3_transmitted() { - return msg3_buff.isempty(); + msg3_has_been_transmitted = true; +} + +bool mux::msg3_is_transmitted() +{ + return msg3_has_been_transmitted; } /* Returns a pointer to the Msg3 buffer */ -uint8_t* mux::msg3_pop(uint32_t tti, uint32_t TB_size) +uint8_t* mux::msg3_pop(uint32_t TB_size) { uint32_t len; uint8_t *msg3 = (uint8_t*) msg3_buff.pop(&len); @@ -294,12 +300,6 @@ uint8_t* mux::msg3_pop(uint32_t tti, uint32_t TB_size) return msg3; } -void mux::msg3_release() -{ - msg3_buff.release(); -} - - } } diff --git a/srsapps/ue/mac/src/pdu.cc b/srsapps/ue/mac/src/pdu.cc index 058efae63..54a703490 100644 --- a/srsapps/ue/mac/src/pdu.cc +++ b/srsapps/ue/mac/src/pdu.cc @@ -52,18 +52,39 @@ void sch_subh::fprint(FILE* stream) fprintf(stream, "C-RNTI CE: %d\n", get_c_rnti()); break; case CON_RES_ID: - fprintf(stream, "Contention Resolution ID CE: %d\n", get_con_res_id()); + fprintf(stream, "Contention Resolution ID CE: 0x%lx\n", get_con_res_id()); break; case TA_CMD: fprintf(stream, "Time Advance Command CE: %d\n", get_ta_cmd()); break; + case PADDING: + fprintf(stream, "PADDING\n"); } } } + +void sch_pdu::parse_packet(uint8_t *ptr) +{ + pdu::parse_packet(ptr); + + // Correct size for last SDU + if (nof_subheaders > 0) { + uint32_t read_len = 0; + for (int i=0;i= 0) { + subheaders[nof_subheaders-1].set_payload_size(pdu_len-read_len-1); + } else { + fprintf(stderr,"Reading MAC PDU: negative payload for last subheader\n"); + } + } +} // Section 6.1.2 bool sch_pdu::write_packet(uint8_t* ptr) { + uint8_t *init_ptr = ptr; // Add single or two-byte padding if required if (rem_len == 1 || rem_len == 2) { sch_subh padding; @@ -108,12 +129,16 @@ bool sch_pdu::write_packet(uint8_t* ptr) } // Set paddint to zeros (if any) bzero(ptr, rem_len*sizeof(uint8_t)*8); + } +uint32_t sch_pdu::size() +{ + return pdu_len - rem_len; +} - -uint32_t sch_pdu::size_plus_header_pdu(uint32_t nbytes) +uint32_t sch_pdu::size_plus_header_sdu(uint32_t nbytes) { if (nbytes < 128) { return nbytes + 2; @@ -131,7 +156,7 @@ bool sch_pdu::has_space_ce(uint32_t nbytes) } bool sch_pdu::has_space_sdu(uint32_t nbytes) { - if (rem_len >= size_plus_header_pdu(nbytes)) { + if (rem_len >= size_plus_header_sdu(nbytes)) { return true; } else { return false; @@ -146,7 +171,7 @@ bool sch_pdu::update_space_ce(uint32_t nbytes) bool sch_pdu::update_space_sdu(uint32_t nbytes) { if (has_space_sdu(nbytes)) { - rem_len -= size_plus_header_pdu(nbytes); + rem_len -= size_plus_header_sdu(nbytes); } } @@ -169,6 +194,18 @@ sch_subh::cetype sch_subh::ce_type() } } +void sch_subh::set_payload_size(uint32_t size) { + nof_bytes = size; +} + +uint32_t sch_subh::size_plus_header() { + if (is_sdu()) { + return sch_pdu::size_plus_header_sdu(nof_bytes); + } else { + return nof_bytes + 1; + } +} + uint32_t sch_subh::sizeof_ce(uint32_t lcid, bool is_ul) { if (is_ul) { @@ -221,7 +258,7 @@ uint32_t sch_subh::get_sdu_lcid() } uint32_t sch_subh::get_sdu_nbytes() { - return *((uint32_t*) ce_payload); + return nof_bytes; } uint8_t* sch_subh::get_sdu_ptr() { @@ -297,16 +334,18 @@ void sch_subh::write_subheader(uint8_t** ptr, bool is_last) if (is_sdu()) { // MAC SDU: R/R/E/LCID/F/L subheader srslte_bit_pack(0, ptr, 2); // R, R - srslte_bit_pack(is_last?1:0, ptr, 1); // E + srslte_bit_pack(is_last?0:1, ptr, 1); // E srslte_bit_pack(lcid, ptr, 5); // LCID // 2nd and 3rd octet - srslte_bit_pack(F_bit?1:0, ptr, 1); // F - srslte_bit_pack(nof_bytes, ptr, nof_bytes<128?7:15); // L + if (!is_last) { + srslte_bit_pack(F_bit?1:0, ptr, 1); // F + srslte_bit_pack(nof_bytes, ptr, nof_bytes<128?7:15); // L + } } else { // MAC CE: R/R/E/LCID MAC Subheader srslte_bit_pack(0, ptr, 2); // R, R - srslte_bit_pack(is_last?1:0, ptr, 1); // E + srslte_bit_pack(is_last?0:1, ptr, 1); // E srslte_bit_pack(lcid, ptr, 5); // LCID } } @@ -315,7 +354,9 @@ void sch_subh::write_payload(uint8_t** ptr) if (is_sdu()) { memcpy(*ptr, sdu_payload_ptr, nof_bytes*8*sizeof(uint8_t)); } else { - srslte_bit_pack_vector(ce_payload, *ptr, nof_bytes*8); + for (int i=0;iis_ul()); } @@ -337,10 +383,12 @@ void sch_subh::read_payload(uint8_t** ptr) { if (is_sdu()) { sdu_payload_ptr = *ptr; - } else { - srslte_bit_unpack_vector(ce_payload, *ptr, nof_bytes*8); + *ptr += nof_bytes*8; + } else { + for (int i=0;iget_param(mac_params::RA_POWERRAMPINGSTEP); preambleTransMax = params_db->get_param(mac_params::RA_PREAMBLETRANSMAX); iniReceivedTargetPower = params_db->get_param(mac_params::RA_INITRECEIVEDPOWER); - maxharq_msg3tx = params_db->get_param(mac_params::RA_MAXTXMSG3); contentionResolutionTimer = params_db->get_param(mac_params::RA_CONTENTIONTIMER); delta_preamble_db = delta_preamble_db_table[configIndex]; @@ -111,6 +110,10 @@ bool ra_proc::is_successful() { return state == COMPLETION; } +bool ra_proc::is_response_error() { + return state == RESPONSE_ERROR; +} + bool ra_proc::is_contention_resolution() { return state == CONTENTION_RESOLUTION; } @@ -145,7 +148,7 @@ const char* state_str[11] = {"Idle", // Process Timing Advance Command as defined in Section 5.2 -void ra_proc::process_timeadv_cmd(uint32_t tti, uint32_t ta) { +void ra_proc::process_timeadv_cmd(uint32_t ta) { if (preambleIndex > 0) { // Preamble not selected by UE MAC phy_h->set_timeadv_rar(ta); @@ -177,7 +180,6 @@ void* init_prach_thread(void *arg) { void ra_proc::step_initialization() { read_params(); pdcch_to_crnti_received = PDCCH_CRNTI_NOT_RECEIVED; - received_contention_id = 0; transmitted_contention_id = 0; preambleTransmissionCounter = 1; first_rar_received = true; @@ -274,7 +276,6 @@ void ra_proc::step_response_reception() { rar_pdu_msg.init(rar_grant.get_tbs()/8); rar_pdu_msg.parse_packet(rar_pdu_buffer); - rar_pdu_msg.fprint(stdout); // Set Backoff parameter if (rar_pdu_msg.has_backoff()) { @@ -287,7 +288,7 @@ void ra_proc::step_response_reception() { if (rar_pdu_msg.get()->get_rapid() == sel_preamble) { rInfo("Received RAPID=%d\n", sel_preamble); - process_timeadv_cmd(tti, rar_pdu_msg.get()->get_ta_cmd()); + process_timeadv_cmd(rar_pdu_msg.get()->get_ta_cmd()); // FIXME: Indicate received target power //phy_h->set_target_power_rar(iniReceivedTargetPower, (preambleTransmissionCounter-1)*powerRampingStep); @@ -323,7 +324,8 @@ void ra_proc::step_response_reception() { phy_h->get_dl_buffer(tti+2)->get_ul_grant(&msg3_grant); // Move MAC PDU from Multiplexing and assembly unit to Msg3 - mux_unit->pdu_move_to_msg3(tti, msg3_grant.get_tbs()); // 56 is the minimum grant provided + rInfo("Generating Msg3 for TBS=%d\n", msg3_grant.get_tbs()); + mux_unit->pdu_move_to_msg3(msg3_grant.get_tbs()); // 56 is the minimum grant provided } rDebug("Going to Contention Resolution state\n"); state = CONTENTION_RESOLUTION; @@ -348,7 +350,6 @@ void ra_proc::step_response_reception() { } void ra_proc::step_response_error() { - mux_unit->msg3_flush(); preambleTransmissionCounter++; if (preambleTransmissionCounter == preambleTransMax + 1) { @@ -379,7 +380,7 @@ void ra_proc::step_backoff_wait() { void ra_proc::step_contention_resolution() { // If Msg3 has been sent - if (mux_unit->msg3_isempty()) { + if (mux_unit->msg3_is_transmitted()) { msg3_transmitted = true; if (pdcch_to_crnti_received != PDCCH_CRNTI_NOT_RECEIVED) { @@ -396,23 +397,28 @@ void ra_proc::step_contention_resolution() { } else if (demux_unit->is_temp_crnti_pending()) { - // Random Access initiated by RRC by the transmission of CCCH SDU - received_contention_id = demux_unit->get_contention_resolution_id(); - if (received_contention_id) { - rInfo("Received UE Contention Resolution ID\n"); + rInfo("MAC PDU with Temporal C-RNTI has been decoded\n"); + // Random Access initiated by RRC by the transmission of CCCH SDU + if (demux_unit->is_contention_resolution_id_pending()) { + rInfo("MAC PDU Contains Contention Resolution ID CE\n"); // MAC PDU successfully decoded and contains MAC CE contention Id - if (transmitted_contention_id == received_contention_id) { - + uint64_t rx_contention_id = demux_unit->get_contention_resolution_id(); + timers_db->get(mac::CONTENTION_TIMER)->stop(); + if (transmitted_contention_id == rx_contention_id) { + rInfo("MAC PDU Contention Resolution ID matches the one transmitted in CCCH SDU\n"); // UE Contention Resolution ID included in MAC CE matches the CCCH SDU transmitted in Msg3 - timers_db->get(mac::CONTENTION_TIMER)->stop(); params_db->set_param(mac_params::RNTI_C, params_db->get_param(mac_params::RNTI_TEMP)); // finish the disassembly and demultiplexing of the MAC PDU - demux_unit->demultiplex_pending_pdu(tti); + demux_unit->demultiplex_pending_pdu(); state = COMPLETION; } else { - rInfo("Transmitted UE Contention Id differs from received Contention ID\n"); + rInfo("Transmitted UE Contention Id differs from received Contention ID (0x%lx != 0x%lx)\n", transmitted_contention_id, rx_contention_id); // Discard MAC PDU + demux_unit->discard_pending_pdu(); + + // Contention Resolution not successfully is like RAR not successful + // FIXME: Need to flush Msg3 HARQ buffer. Why? state = RESPONSE_ERROR; } params_db->set_param(mac_params::RNTI_TEMP, 0); diff --git a/srsapps/ue/mac/src/ul_harq.cc b/srsapps/ue/mac/src/ul_harq.cc index 1f7de273b..df69ef2f0 100644 --- a/srsapps/ue/mac/src/ul_harq.cc +++ b/srsapps/ue/mac/src/ul_harq.cc @@ -28,6 +28,7 @@ #include "srsapps/ue/phy/phy.h" #include "srsapps/common/log.h" +#include "srsapps/ue/mac/mac_params.h" #include "srsapps/ue/mac/mac.h" #include "srsapps/ue/mac/ul_harq.h" @@ -40,17 +41,11 @@ namespace srslte { * *********************************************************/ -ul_harq_entity::ul_harq_entity() { - proc = new ul_harq_process[NOF_HARQ_PROC]; // BCCH process is separate -} -ul_harq_entity::~ul_harq_entity() { -delete proc; -} -bool ul_harq_entity::init(srslte_cell_t cell, log *log_h_, timers *timers_db_, mux *mux_unit_) { +bool ul_harq_entity::init(srslte_cell_t cell, mac_params *params_db_, log *log_h_, timers *timers_db_, mux *mux_unit_) { log_h = log_h_; mux_unit = mux_unit_; + params_db = params_db_; timers_db = timers_db_; - for (uint32_t i=0;iget_dl_buffer(tti)->decode_ack(proc[pid_harq].get_grant())); + } + if (grant) { if ((grant->is_temp_rnti() && grant->get_ndi() != proc[pid].get_ndi()) || (grant->is_crnti() && !proc[pid].has_grant()) || grant->is_from_rar()) { // New transmission - uint8_t* msg3_ptr = (uint8_t*) mux_unit->msg3_pop(tti, grant->get_tbs()); + uint8_t* msg3_ptr = (uint8_t*) mux_unit->msg3_pop(grant->get_tbs()); // Uplink grant in a RAR - if (msg3_ptr && grant->is_from_rar()) { - proc[pid].generate_new_tx(msg3_ptr, true, grant, phy_h->get_ul_buffer(tti+4)); - mux_unit->msg3_release(); + if (grant->is_from_rar()) { + if (msg3_ptr) { + Info("Generating New Msg3 Transmission for PID=%d TTI=%d\n", pid, tti_tx); + proc[pid].generate_new_tx(tti_tx, msg3_ptr, true, grant, phy_h->get_ul_buffer(tti_tx)); + mux_unit->msg3_transmitted(); + } else { + Warning("UL RAR grant available but no Msg3 on buffer\n"); + } // Normal UL grant } else { // Request a MAC PDU from the Multiplexing & Assemble Unit - uint8_t* mac_pdu = mux_unit->pdu_pop(tti, grant->get_tbs()); + Info("Generating New Transmission for PID=%d TTI=%d\n", pid, tti_tx); + uint8_t* mac_pdu = mux_unit->pdu_pop(grant->get_tbs()); if (mac_pdu) { - proc[pid].generate_new_tx(mac_pdu, false, grant, phy_h->get_ul_buffer(tti+4)); + proc[pid].generate_new_tx(tti_tx, mac_pdu, false, grant, phy_h->get_ul_buffer(tti_tx)); mux_unit->pdu_release(); } else { Warning("Uplink grant with MAC PDU available in Multiplex Unit\n"); @@ -117,24 +124,15 @@ void ul_harq_entity::run_tti(uint32_t tti, ul_sched_grant *grant, phy *phy_h) } } else { // Adaptive Re-TX - proc[pid].generate_retx(grant, phy_h->get_ul_buffer(tti+4)); + Info("Generating Adaptive Retransmission for PID=%d RV=%d\n", pid, proc[pid].get_rv()); + proc[pid].generate_retx(tti_tx, grant, phy_h->get_ul_buffer(tti_tx)); } } else if (proc[pid].has_grant()) { // Non-Adaptive Re-Tx - proc[pid].generate_retx(phy_h->get_ul_buffer(tti+4)); + Info("Generating Non-adaptive Retransmission for PID=%d RV=%d\n", pid, proc[pid].get_rv()); + proc[pid].generate_retx(tti_tx, phy_h->get_ul_buffer(tti_tx)); } - // Receive and route HARQ feedbacks - for (uint32_t i=0;iget_dl_buffer(tti)->decode_ack(proc[pid].get_grant())); - } - } -} - -bool ul_harq_entity::is_last_retx_msg3() -{ - return last_retx_is_msg3; } @@ -153,11 +151,13 @@ ul_harq_entity::ul_harq_process::ul_harq_process() : cur_grant(0) { current_irv = 0; is_initiated = false; is_grant_configured = false; + tti_last_tx = 0; bzero(&cur_grant, sizeof(ul_sched_grant)); } void ul_harq_entity::ul_harq_process::reset() { current_tx_nb = 0; current_irv = 0; + tti_last_tx = 0; is_grant_configured = false; bzero(&cur_grant, sizeof(ul_sched_grant)); if (is_initiated) { @@ -175,6 +175,11 @@ bool ul_harq_entity::ul_harq_process::get_ndi() return ndi; } +uint32_t ul_harq_entity::ul_harq_process::get_rv() +{ + return rv_of_irv[current_irv%4]; +} + ul_sched_grant* ul_harq_entity::ul_harq_process::get_grant() { return &cur_grant; @@ -182,10 +187,13 @@ ul_sched_grant* ul_harq_entity::ul_harq_process::get_grant() void ul_harq_entity::ul_harq_process::set_harq_feedback(bool ack) { harq_feedback = ack; -} -void ul_harq_entity::ul_harq_process::set_maxHARQ_Tx(uint32_t maxHARQ_Tx_, uint32_t maxHARQ_Msg3Tx_) { - maxHARQ_Tx = maxHARQ_Tx_; - maxHARQ_Msg3Tx = maxHARQ_Msg3Tx_; + // UL packet successfully delivered + if (ack) { + Info("HARQ = ACK for UL transmission. Discarting TB.\n"); + reset(); + } else { + Info("HARQ = NACK for UL transmission\n"); + } } bool ul_harq_entity::ul_harq_process::init(srslte_cell_t cell, ul_harq_entity *parent) { @@ -196,23 +204,24 @@ bool ul_harq_entity::ul_harq_process::init(srslte_cell_t cell, ul_harq_entity *p is_initiated = true; harq_entity = parent; log_h = harq_entity->log_h; + return true; } } // Retransmission with or w/o grant (Section 5.4.2.2) -void ul_harq_entity::ul_harq_process::generate_retx(ul_sched_grant* grant, ul_buffer* ul) +void ul_harq_entity::ul_harq_process::generate_retx(uint32_t tti_tx, ul_sched_grant* grant, ul_buffer* ul) { - current_tx_nb++; + current_tx_nb++; if (grant) { // HARQ entity requests an adaptive transmission - memcpy(&cur_grant, grant, sizeof(grant)); + memcpy(&cur_grant, grant, sizeof(ul_sched_grant)); current_irv = irv_of_rv[grant->get_rv()%4]; harq_feedback = false; - generate_tx(NULL, ul); + generate_tx(tti_tx, NULL, ul); } else { // HARQ entity requests a non-adaptive transmission if (!harq_feedback) { - generate_tx(NULL, ul); + generate_tx(tti_tx, NULL, ul); } } @@ -222,47 +231,56 @@ void ul_harq_entity::ul_harq_process::generate_retx(ul_sched_grant* grant, ul_bu } } +void ul_harq_entity::ul_harq_process::generate_retx(uint32_t tti_tx, ul_buffer* ul) +{ + generate_retx(tti_tx, NULL, ul); +} + + // New transmission (Section 5.4.2.2) -void ul_harq_entity::ul_harq_process::generate_new_tx(uint8_t *pdu_payload, bool is_msg3_, ul_sched_grant* ul_grant, ul_buffer* ul) +void ul_harq_entity::ul_harq_process::generate_new_tx(uint32_t tti_tx, uint8_t *pdu_payload, bool is_msg3_, ul_sched_grant* ul_grant, ul_buffer* ul) { if (ul_grant && pdu_payload) { - current_tx_nb = 0; - current_irv = 0; srslte_softbuffer_tx_reset(&softbuffer); // Store the uplink grant memcpy(&cur_grant, ul_grant, sizeof(ul_sched_grant)); harq_feedback = false; - generate_tx(pdu_payload, ul); is_grant_configured = true; + current_tx_nb = 0; + current_irv = 0; is_msg3 = is_msg3_; - Info("New %s transmission PDU Len %d bytes\n", is_msg3_?"Msg3":"", cur_grant.get_tbs()); + generate_tx(tti_tx, pdu_payload, ul); } } -void ul_harq_entity::ul_harq_process::generate_retx(ul_buffer* ul) -{ - generate_retx(NULL, ul); -} - - // Transmission of pending frame (Section 5.4.2.2) -void ul_harq_entity::ul_harq_process::generate_tx(uint8_t *pdu_payload, ul_buffer* ul) +// Transmission of pending frame (Section 5.4.2.2) +void ul_harq_entity::ul_harq_process::generate_tx(uint32_t tti_tx, uint8_t *pdu_payload, ul_buffer* ul) { - cur_grant.set_rv(rv_of_irv[current_irv%4]); + cur_grant.set_rv(get_rv()); ul->set_current_tx_nb(current_tx_nb); ul->generate_data(&cur_grant, &softbuffer, pdu_payload); + current_irv = (current_irv+1)%4; - Info("UL transmission RV=%d, TBS=%d\n", cur_grant.get_rv(), cur_grant.get_tbs()); + tti_last_tx = tti_tx; if (is_msg3) { - if (current_tx_nb == maxHARQ_Msg3Tx) { + if (current_tx_nb == harq_entity->params_db->get_param(mac_params::HARQ_MAXMSG3TX)) { + Info("Maximum number of ReTX for Msg3 reached (%d). Discarting TB.\n", harq_entity->params_db->get_param(mac_params::HARQ_MAXMSG3TX)); reset(); } } else { - if (current_tx_nb == maxHARQ_Tx) { + if (current_tx_nb == harq_entity->params_db->get_param(mac_params::HARQ_MAXTX)) { + Info("Maximum number of ReTX reached (%d). Discarting TB.\n", harq_entity->params_db->get_param(mac_params::HARQ_MAXTX)); reset(); } } } +uint32_t ul_harq_entity::ul_harq_process::last_tx_tti() +{ + return tti_last_tx; +} + + } } \ No newline at end of file diff --git a/srsapps/ue/mac/test/mac_test.cc b/srsapps/ue/mac/test/mac_test.cc index 564d77ce3..87dbdf86b 100644 --- a/srsapps/ue/mac/test/mac_test.cc +++ b/srsapps/ue/mac/test/mac_test.cc @@ -45,19 +45,21 @@ typedef struct { float uhd_tx_freq; float uhd_rx_gain; float uhd_tx_gain; + int verbose; }prog_args_t; void args_default(prog_args_t *args) { args->uhd_rx_freq = -1.0; args->uhd_tx_freq = -1.0; - args->uhd_rx_gain = 60.0; - args->uhd_tx_gain = 60.0; + args->uhd_rx_gain = -1; // set to autogain + args->uhd_tx_gain = -1; + args->verbose = 0; } void usage(prog_args_t *args, char *prog) { printf("Usage: %s [gv] -f rx_frequency (in Hz) -F tx_frequency (in Hz)\n", prog); - printf("\t-g UHD RX gain [Default %.2f dB]\n", args->uhd_rx_gain); - printf("\t-g UHD RX gain [Default %.2f dB]\n", args->uhd_tx_gain); + printf("\t-g UHD RX gain [Default AGC]\n"); + printf("\t-G UHD TX gain [Default same as RX gain (AGC)]\n"); printf("\t-v [increase verbosity, default none]\n"); } @@ -79,7 +81,7 @@ void parse_args(prog_args_t *args, int argc, char **argv) { args->uhd_tx_freq = atof(argv[optind]); break; case 'v': - srslte_verbose++; + args->verbose++; break; default: usage(args, argv[0]); @@ -119,7 +121,7 @@ void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srslte::u liblte_rrc_ra_response_window_size_num[sib2->rr_config_common_sib.rach_cnfg.ra_resp_win_size]); mac->set_param(srslte::ue::mac_params::RA_CONTENTIONTIMER, liblte_rrc_mac_contention_resolution_timer_num[sib2->rr_config_common_sib.rach_cnfg.mac_con_res_timer]); - mac->set_param(srslte::ue::mac_params::RA_MAXTXMSG3, + mac->set_param(srslte::ue::mac_params::HARQ_MAXMSG3TX, sib2->rr_config_common_sib.rach_cnfg.max_harq_msg3_tx); printf("Set RACH ConfigCommon: NofPreambles=%d, ResponseWindow=%d, ContentionResolutionTimer=%d ms\n", @@ -195,6 +197,20 @@ void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srslte::u sib2->rr_config_common_sib.prach_cnfg.prach_cnfg_info.prach_config_index); } +void process_connsetup(LIBLTE_RRC_CONNECTION_SETUP_STRUCT *msg, srslte::ue::mac *mac, srslte::ue::phy *phy) { + mac->set_param(srslte::ue::mac_params::HARQ_MAXTX, + liblte_rrc_max_harq_tx_num[msg->rr_cnfg.mac_main_cnfg.explicit_value.ulsch_cnfg.max_harq_tx]); + + mac->set_param(srslte::ue::mac_params::SR_PUCCH_RESINDEX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_pucch_resource_idx); + mac->set_param(srslte::ue::mac_params::SR_CONFIG_INDEX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_cnfg_idx); + mac->set_param(srslte::ue::mac_params::SR_TRANS_MAX, liblte_rrc_dsr_trans_max_num[msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.dsr_trans_max]); + + phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_ACK, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_ack_idx); + phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_CQI, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_cqi_idx); + phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_RI, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_ri_idx); + +} + int main(int argc, char *argv[]) { prog_args_t prog_args; @@ -202,25 +218,39 @@ int main(int argc, char *argv[]) srslte::radio_uhd radio_uhd; srslte::ue::phy phy; srslte::ue::mac mac; - srslte::log_stdout log("MAC"); + srslte::log_stdout mac_log("MAC"), phy_log("PHY"); parse_args(&prog_args, argc, argv); - - // Init Radio - radio_uhd.init(); - - // Init PHY - phy.init(&radio_uhd, &ttisync); + switch (prog_args.verbose) { + case 1: + mac_log.set_level_info(); + phy_log.set_level_info(); + break; + case 2: + mac_log.set_level_debug(); + phy_log.set_level_debug(); + break; + } + +// Init Radio and PHY + if (prog_args.uhd_rx_gain > 0 && prog_args.uhd_tx_gain > 0) { + radio_uhd.init(); + radio_uhd.set_rx_gain(prog_args.uhd_rx_gain); + radio_uhd.set_tx_gain(prog_args.uhd_tx_gain); + phy.init(&radio_uhd, &ttisync, &phy_log); + } else { + radio_uhd.init_agc(); + radio_uhd.set_tx_rx_gain_offset(-10); + phy.init_agc(&radio_uhd, &ttisync, &phy_log); + } // Init MAC - mac.init(&phy, &ttisync, &log); + mac.init(&phy, &ttisync, &mac_log); - // Set RX freq and gain + // Set RX freq radio_uhd.set_rx_freq(prog_args.uhd_rx_freq); - radio_uhd.set_rx_gain(prog_args.uhd_rx_gain); radio_uhd.set_tx_freq(prog_args.uhd_tx_freq); - radio_uhd.set_tx_gain(prog_args.uhd_tx_gain); - + LIBLTE_BIT_MSG_STRUCT bit_msg; LIBLTE_RRC_MIB_STRUCT bch_msg; LIBLTE_RRC_BCCH_DLSCH_MSG_STRUCT dlsch_msg; @@ -252,8 +282,6 @@ int main(int argc, char *argv[]) sib2_period = liblte_rrc_si_periodicity_num[dlsch_msg.sibs[0].sib.sib1.sched_info[0].si_periodicity]; printf("SIB1 received %d bytes, CellID=%d, si_window=%d, sib2_period=%d\n", n/8, dlsch_msg.sibs[0].sib.sib1.cell_id&0xfff, si_window_len, sib2_period); - printf("Payload: "); - srslte_vec_fprint_hex(stdout, bit_msg.msg, n); state = SIB2; } else { tti = mac.get_tti(); @@ -268,8 +296,6 @@ int main(int argc, char *argv[]) bit_msg.N_bits = n; liblte_rrc_unpack_bcch_dlsch_msg(&bit_msg, &dlsch_msg); printf("SIB2 received %d bytes\n", n/8); - printf("Payload: "); - srslte_vec_fprint_hex(stdout, bit_msg.msg, n); setup_mac_phy_sib2(&dlsch_msg.sibs[0].sib.sib2, &mac, &phy); // Prepare ConnectionRequest packet @@ -278,10 +304,18 @@ int main(int argc, char *argv[]) ul_ccch_msg.msg.rrc_con_req.ue_id.random = 1000; ul_ccch_msg.msg.rrc_con_req.cause = LIBLTE_RRC_CON_REQ_EST_CAUSE_MO_DATA; liblte_rrc_pack_ul_ccch_msg(&ul_ccch_msg, &bit_msg); - - mac.set_param(srslte::ue::mac_params::CONTENTION_ID, ul_ccch_msg.msg.rrc_con_req.ue_id.random); + + uint64_t uecri=0; + uint8_t *ue_cri_ptr = (uint8_t*) &uecri; + uint32_t nbytes = bit_msg.N_bits/8; + uint8_t *ptr = bit_msg.msg; + for (int i=0;i #include "srslte/srslte.h" +#include "srsapps/common/log.h" #include "srsapps/ue/phy/sched_grant.h" #include "srsapps/ue/phy/dl_buffer.h" #include "srsapps/ue/phy/phy.h" @@ -39,8 +40,9 @@ namespace srslte { namespace ue { -bool dl_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_) +bool dl_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_, log *log_h_) { + log_h = log_h_; params_db = params_db_; cell = cell_; sf_symbols_and_ce_done = false; @@ -68,7 +70,6 @@ bool dl_buffer::recv_ue_sync(srslte_ue_sync_t *ue_sync, srslte_timestamp_t *rx_t { bool ret = false; if (signal_buffer) { - DEBUG("DL Buffer TTI %d: Receiving packet\n", tti); cf_t *sf_buffer = NULL; sf_symbols_and_ce_done = false; pdcch_llr_extracted = false; @@ -86,10 +87,6 @@ void dl_buffer::discard_pending_rar_grant() { pending_rar_grant = false; } -void dl_buffer::release_pending_rar_grant() { - pending_rar_grant = false; -} - bool dl_buffer::get_ul_grant(ul_sched_grant *grant) { if (signal_buffer) { @@ -124,29 +121,27 @@ void dl_buffer::set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN]) { pending_rar_grant = true; srslte_dci_rar_grant_unpack(&rar_grant, grant_payload); - srslte_dci_rar_grant_fprint(stdout, &rar_grant); } void dl_buffer::set_rar_grant(srslte_dci_rar_grant_t* rar_grant_) { pending_rar_grant = true; memcpy(&rar_grant, rar_grant_, sizeof(srslte_dci_rar_grant_t)); - srslte_dci_rar_grant_fprint(stdout, &rar_grant); } bool dl_buffer::get_dl_grant(dl_sched_grant *grant) { if (signal_buffer && is_ready()) { - DEBUG("DL Buffer TTI %d: Getting DL grant\n", tti); + Debug("DL Buffer TTI %d: Getting DL grant\n", tti); if (!sf_symbols_and_ce_done) { - DEBUG("DL Buffer TTI %d: Getting DL grant. Calling fft estimate\n", tti); + Debug("DL Buffer TTI %d: Getting DL grant. Calling fft estimate\n", tti); if (srslte_ue_dl_decode_fft_estimate(&ue_dl, signal_buffer, tti%10, &cfi) < 0) { return false; } sf_symbols_and_ce_done = true; } if (!pdcch_llr_extracted) { - DEBUG("DL Buffer TTI %d: Getting DL grant. extracting LLR\n", tti); + Debug("DL Buffer TTI %d: Getting DL grant. extracting LLR\n", tti); if (srslte_pdcch_extract_llr(&ue_dl.pdcch, ue_dl.sf_symbols, ue_dl.ce, 0, tti%10, cfi)) { return false; } @@ -196,9 +191,9 @@ bool dl_buffer::decode_data(dl_sched_grant *grant, uint8_t *payload) bool dl_buffer::decode_data(dl_sched_grant *grant, srslte_softbuffer_rx_t *softbuffer, uint8_t *payload) { if (signal_buffer && is_ready()) { - DEBUG("DL Buffer TTI %d: Decoding PDSCH\n", tti); + Debug("DL Buffer TTI %d: Decoding PDSCH\n", tti); if (!sf_symbols_and_ce_done) { - DEBUG("DL Buffer TTI %d: Decoding PDSCH. Calling fft estimate\n", tti); + Debug("DL Buffer TTI %d: Decoding PDSCH. Calling fft estimate\n", tti); if (srslte_ue_dl_decode_fft_estimate(&ue_dl, signal_buffer, tti%10, &cfi) < 0) { return false; } diff --git a/srsapps/ue/phy/src/phy.cc b/srsapps/ue/phy/src/phy.cc index 22ef60725..3b5646cc5 100644 --- a/srsapps/ue/phy/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -32,6 +32,7 @@ #include "srslte/srslte.h" +#include "srsapps/common/log.h" #include "srsapps/ue/phy/phy.h" #include "srsapps/ue/phy/prach.h" #include "srsapps/ue/phy/ul_buffer.h" @@ -39,15 +40,26 @@ namespace srslte { namespace ue { - -bool phy::init(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_) + +bool phy::init(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_, log *log_h) { + return init_(radio_handler_, ttisync_, log_h, false); +} + +bool phy::init_agc(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_, log *log_h) { + return init_(radio_handler_, ttisync_, log_h, true); +} + +bool phy::init_(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_, log *log_h_, bool do_agc_) { started = false; radio_is_streaming = false; ttisync = ttisync_; + log_h = log_h_; radio_handler = radio_handler_; ul_buffer_queue = new queue(6, sizeof(ul_buffer)); dl_buffer_queue = new queue(6, sizeof(dl_buffer)); + do_agc = do_agc_; + last_gain = 1e4; // Set default params params_db.set_param(phy_params::CELLSEARCH_TIMEOUT_PSS_NFRAMES, 100); @@ -56,7 +68,7 @@ bool phy::init(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_) pthread_attr_t attr; struct sched_param param; - param.sched_priority = -20; + param.sched_priority = sched_get_priority_min(SCHED_FIFO) ; pthread_attr_init(&attr); pthread_attr_setschedpolicy(&attr, SCHED_FIFO); pthread_attr_setschedparam(&attr, ¶m); @@ -93,13 +105,13 @@ radio* phy::get_radio() { void phy::set_timeadv_rar(uint32_t ta_cmd) { n_ta = srslte_N_ta_new_rar(ta_cmd); time_adv_sec = SRSLTE_TA_OFFSET+((float) n_ta)*SRSLTE_LTE_TS; - INFO("Set TA RAR: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, time_adv_sec*1e6); + Info("Set TA RAR: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, time_adv_sec*1e6); } void phy::set_timeadv(uint32_t ta_cmd) { n_ta = srslte_N_ta_new(n_ta, ta_cmd); time_adv_sec = SRSLTE_TA_OFFSET+((float) n_ta)*SRSLTE_LTE_TS; - INFO("Set TA: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, time_adv_sec*1e6); + Info("Set TA: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, time_adv_sec*1e6); } void phy::rar_ul_grant(srslte_dci_rar_grant_t *rar, ul_sched_grant *grant) @@ -153,10 +165,10 @@ bool phy::start_rxtx() phy_state = RXTX; return true; } else { - fprintf(stderr, "Can not change state to RXTX: cell is not set\n"); + Error("Can not change state to RXTX: cell is not set\n"); } } else { - fprintf(stderr, "Can not change state to RXTX: invalid state %d\n", phy_state); + Error("Can not change state to RXTX: invalid state %d\n", phy_state); } return false; } @@ -169,11 +181,16 @@ bool phy::stop_rxtx() phy_state = IDLE; return true; } else { - fprintf(stderr, "Can not change state to RXTX: invalid state %d\n", phy_state); + Error("Can not change state to RXTX: invalid state %d\n", phy_state); } return false; } +float phy::get_agc_gain() +{ + return 10*log10(srslte_agc_get_gain(&ue_sync.agc)); +} + bool phy::status_is_idle() { return phy_state == IDLE; } @@ -206,6 +223,11 @@ int radio_recv_wrapper_cs(void *h,void *data, uint32_t nsamples, srslte_timestam return n; } +double callback_set_rx_gain(void *h, double gain) { + radio *radio_handler = (radio*) h; + return radio_handler->set_rx_gain_th(gain); +} + bool phy::set_cell(srslte_cell_t cell_) { if (phy_state == IDLE) { cell_is_set = false; @@ -215,29 +237,33 @@ bool phy::set_cell(srslte_cell_t cell_) { if (!srslte_ue_sync_init(&ue_sync, cell, radio_recv_wrapper_cs, radio_handler)) { + if (do_agc) { + srslte_ue_sync_start_agc(&ue_sync, callback_set_rx_gain, last_gain); + } + srslte_ue_sync_set_cfo(&ue_sync, cellsearch_cfo); for(uint32_t i=0;i<6;i++) { - ((ul_buffer*) ul_buffer_queue->get(i))->init_cell(cell, ¶ms_db); - ((dl_buffer*) dl_buffer_queue->get(i))->init_cell(cell, ¶ms_db); + ((ul_buffer*) ul_buffer_queue->get(i))->init_cell(cell, ¶ms_db, log_h); + ((dl_buffer*) dl_buffer_queue->get(i))->init_cell(cell, ¶ms_db, log_h); ((dl_buffer*) dl_buffer_queue->get(i))->buffer_id = i; ((ul_buffer*) ul_buffer_queue->get(i))->ready(); ((dl_buffer*) dl_buffer_queue->get(i))->release(); } cell_is_set = true; } else { - fprintf(stderr, "Error setting cell: initiating ue_sync"); + Error("Error setting cell: initiating ue_sync"); } } else { - fprintf(stderr, "Error setting cell: initiating ue_mib\n"); + Error("Error setting cell: initiating ue_mib\n"); } } else { - fprintf(stderr, "Error setting cell: Invalid state %d\n", phy_state); + Error("Error setting cell: Invalid state %d\n", phy_state); } return cell_is_set; } bool phy::init_prach() { - return prach_buffer.init_cell(cell, ¶ms_db); + return prach_buffer.init_cell(cell, ¶ms_db, log_h); } ul_buffer* phy::get_ul_buffer(uint32_t tti) @@ -253,7 +279,7 @@ ul_buffer* phy::get_ul_buffer_adv(uint32_t tti) dl_buffer* phy::get_dl_buffer(uint32_t tti) { if (tti + 6 < get_current_tti()) { - printf("Warning access to PHY too late. Requested TTI=%d while PHY is in %d\n", tti, get_current_tti()); + Warning("Warning access to PHY too late. Requested TTI=%d while PHY is in %d\n", tti, get_current_tti()); } return (dl_buffer*) dl_buffer_queue->get(tti); } @@ -277,6 +303,11 @@ bool phy::decode_mib_N_id_2(int force_N_id_2, srslte_cell_t *cell_ptr, uint8_t b return false; } + if (do_agc) { + srslte_ue_sync_start_agc(&cs.ue_sync, callback_set_rx_gain, last_gain); + } + + srslte_ue_cellsearch_set_nof_frames_to_scan(&cs, params_db.get_param(phy_params::CELLSEARCH_TIMEOUT_PSS_NFRAMES)); srslte_ue_cellsearch_set_threshold(&cs, (float) params_db.get_param(phy_params::CELLSEARCH_TIMEOUT_PSS_CORRELATION_THRESHOLD)/10); @@ -294,23 +325,25 @@ bool phy::decode_mib_N_id_2(int force_N_id_2, srslte_cell_t *cell_ptr, uint8_t b ret = srslte_ue_cellsearch_scan(&cs, found_cells, &max_peak_cell); } + last_gain = srslte_agc_get_gain(&cs.ue_sync.agc); + radio_handler->stop_rx(); srslte_ue_cellsearch_free(&cs); if (ret < 0) { - fprintf(stderr, "Error decoding MIB: Error searching PSS\n"); + Error("Error decoding MIB: Error searching PSS\n"); return false; } else if (ret == 0) { - fprintf(stderr, "Error decoding MIB: Could not find any PSS in this frequency\n"); + Error("Error decoding MIB: Could not find any PSS in this frequency\n"); return false; } - + // Save result cell_ptr->id = found_cells[max_peak_cell].cell_id; cell_ptr->cp = found_cells[max_peak_cell].cp; cellsearch_cfo = found_cells[max_peak_cell].cfo; - INFO("\nFound CELL ID: %d CP: %s, CFO: %f\n", cell_ptr->id, srslte_cp_string(cell_ptr->cp), cellsearch_cfo); + Info("\nFound CELL ID: %d CP: %s, CFO: %f\n", cell_ptr->id, srslte_cp_string(cell_ptr->cp), cellsearch_cfo); srslte_ue_mib_sync_t ue_mib_sync; @@ -318,6 +351,10 @@ bool phy::decode_mib_N_id_2(int force_N_id_2, srslte_cell_t *cell_ptr, uint8_t b return false; } + if (do_agc) { + srslte_ue_sync_start_agc(&ue_mib_sync.ue_sync, callback_set_rx_gain, last_gain); + } + /* Find and decode MIB */ uint32_t sfn, sfn_offset; @@ -325,13 +362,15 @@ bool phy::decode_mib_N_id_2(int force_N_id_2, srslte_cell_t *cell_ptr, uint8_t b ret = srslte_ue_mib_sync_decode(&ue_mib_sync, params_db.get_param(phy_params::CELLSEARCH_TIMEOUT_MIB_NFRAMES), bch_payload, &cell_ptr->nof_ports, &sfn_offset); radio_handler->stop_rx(); + last_gain = srslte_agc_get_gain(&ue_mib_sync.ue_sync.agc); srslte_ue_mib_sync_free(&ue_mib_sync); + if (ret == 1) { srslte_pbch_mib_unpack(bch_payload, cell_ptr, NULL); return true; } else { - printf("Error decoding MIB: Error decoding PBCH\n"); + Warning("Error decoding MIB: Error decoding PBCH\n"); return false; } } @@ -346,7 +385,7 @@ int phy::sync_sfn(void) { srslte_ue_sync_decode_sss_on_track(&ue_sync, true); ret = srslte_ue_sync_get_buffer(&ue_sync, &sf_buffer); if (ret < 0) { - fprintf(stderr, "Error calling ue_sync_get_buffer"); + Error("Error calling ue_sync_get_buffer"); return -1; } @@ -356,7 +395,7 @@ int phy::sync_sfn(void) { srslte_pbch_decode_reset(&ue_mib.pbch); int n = srslte_ue_mib_decode(&ue_mib, sf_buffer, bch_payload, NULL, &sfn_offset); if (n < 0) { - fprintf(stderr, "Error decoding MIB while synchronising SFN"); + Error("Error decoding MIB while synchronising SFN"); return -1; } else if (n == SRSLTE_UE_MIB_FOUND) { uint32_t sfn; @@ -395,6 +434,7 @@ void phy::run_rx_tx_state() } } else { uint32_t current_tti = ttisync->get_producer_cntr(); + log_h->step(current_tti); float cfo = srslte_ue_sync_get_cfo(&ue_sync)/15000; // Prepare transmission for the next tti diff --git a/srsapps/ue/phy/src/prach.cc b/srsapps/ue/phy/src/prach.cc index 7e9e3a40e..309de3fe1 100644 --- a/srsapps/ue/phy/src/prach.cc +++ b/srsapps/ue/phy/src/prach.cc @@ -30,7 +30,7 @@ #include #include "srslte/srslte.h" -#include "srslte/cuhd/cuhd.h" +#include "srsapps/common/log.h" #include "srsapps/ue/phy/prach.h" #include "srsapps/ue/phy/phy.h" #include "srsapps/ue/phy/phy_params.h" @@ -55,9 +55,10 @@ void prach::free_cell() } } -bool prach::init_cell(srslte_cell_t cell_, phy_params *params_db_) +bool prach::init_cell(srslte_cell_t cell_, phy_params *params_db_, log *log_h_) { cell = cell_; + log_h = log_h_; params_db = params_db_; preamble_idx = -1; if (srslte_prach_init(&prach_obj, srslte_symbol_sz(cell.nof_prb), @@ -97,7 +98,7 @@ bool prach::prepare_to_send(uint32_t preamble_idx_, int allowed_subframe_, int t preamble_idx = preamble_idx_; allowed_subframe = allowed_subframe_; transmitted_tti = -1; - INFO("PRACH Buffer: Prepare to send preamble %d\n", preamble_idx); + Info("PRACH Buffer: Prepare to send preamble %d\n", preamble_idx); return true; } else { return false; @@ -122,14 +123,13 @@ bool prach::is_ready_to_send(uint32_t current_tti_) { if ((current_tti%10) == sf_config.sf[i] && allowed_subframe == -1 || ((current_tti%10) == sf_config.sf[i] && (current_tti%10) == allowed_subframe)) { - INFO("PRACH Buffer: Ready to send at tti: %d (now is %d)\n", current_tti, current_tti_); + Info("PRACH Buffer: Ready to send at tti: %d (now is %d)\n", current_tti, current_tti_); transmitted_tti = current_tti; return true; } } } } - DEBUG("PRACH Buffer: Not ready to send at tti: %d\n", current_tti_); return false; } @@ -149,13 +149,12 @@ bool prach::send(radio *radio_handler, float cfo, srslte_timestamp_t rx_time) srslte_timestamp_add(&tx_time, 0, 1e-3*tx_advance_sf); // Correct CFO before transmission - srslte_cfo_correct(&cfo_h, buffer[preamble_idx], signal_buffer, 1.5*cfo/srslte_symbol_sz(cell.nof_prb)); + srslte_cfo_correct(&cfo_h, buffer[preamble_idx], signal_buffer, cfo /srslte_symbol_sz(cell.nof_prb)); // transmit radio_handler->tx(signal_buffer, len, tx_time); - INFO("PRACH transmitted CFO: %f, preamble=%d, len=%d rx_time=%f, tx_time=%f\n", + Info("PRACH transmitted CFO: %f, preamble=%d, len=%d rx_time=%f, tx_time=%f\n", cfo*15000, preamble_idx, len, rx_time.frac_secs, tx_time.frac_secs); - //srslte_vec_save_file("prach", buffer, len*sizeof(cf_t)); preamble_idx = -1; } diff --git a/srsapps/ue/phy/src/ul_buffer.cc b/srsapps/ue/phy/src/ul_buffer.cc index f3f227f6c..67c975e07 100644 --- a/srsapps/ue/phy/src/ul_buffer.cc +++ b/srsapps/ue/phy/src/ul_buffer.cc @@ -32,6 +32,7 @@ #include "srslte/srslte.h" +#include "srsapps/common/log.h" #include "srsapps/ue/phy/sched_grant.h" #include "srsapps/ue/phy/ul_buffer.h" #include "srsapps/ue/phy/phy.h" @@ -40,8 +41,9 @@ namespace srslte { namespace ue { -bool ul_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_) { +bool ul_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_, log *log_h_) { cell = cell_; + log_h = log_h_; params_db = params_db_; current_tx_nb = 0; if (!srslte_ue_ul_init(&ue_ul, cell)) { @@ -142,7 +144,7 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *sof pucch_cfg.group_hopping_en = dmrs_cfg.group_hopping_en; pucch_cfg.N_cs = params_db->get_param(phy_params::PUCCH_CYCLIC_SHIFT); pucch_cfg.n_rb_2 = params_db->get_param(phy_params::PUCCH_N_RB_2); - + srslte_pucch_sched_t pucch_sched; bzero(&pucch_sched, sizeof(srslte_pucch_sched_t)); pucch_sched.n_cce = last_n_cce; @@ -164,12 +166,22 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *sof // Transmit on PUSCH if UL grant available, otherwise in PUCCH if (grant) { + INFO("Encoding PUSCH TBS=%d, rb_start=%d n_prb=%d, rv=%d, rnti=%d\n", + grant->get_tbs(), pusch_cfg.grant.L_prb, pusch_cfg.grant.n_prb[0], grant->get_rv(), grant->get_rnti()); + grant->to_pusch_cfg(tti%10, cell.cp, &pusch_cfg); n = srslte_ue_ul_pusch_encode_cfg(&ue_ul, &pusch_cfg, payload, uci_data, + softbuffer, grant->get_rnti(), signal_buffer); + + if (grant->get_rv() == 0) { + bzero(signal_buffer, 7680*sizeof(cf_t)); + } } else { + Info("Encoding PUCCH n_cce=%d, ack=%d\n", last_n_cce, uci_data.uci_ack); + n = srslte_ue_ul_pucch_encode(&ue_ul, uci_data, tti&10, signal_buffer); } // Reset UCI data @@ -196,8 +208,9 @@ bool ul_buffer::send(srslte::radio* radio_handler, float time_adv_sec, float cfo srslte_timestamp_add(&tx_time, 0, tx_advance_sf*1e-3 - time_adv_sec); // Compute peak - float max = -1; +#ifdef compute_peak if (SRSLTE_VERBOSE_ISINFO()) { + float max = 0; float *t = (float*) signal_buffer; for (int i=0;i<2*SRSLTE_SF_LEN_PRB(cell.nof_prb);i++) { if (fabsf(t[i]) > max) { @@ -205,15 +218,20 @@ bool ul_buffer::send(srslte::radio* radio_handler, float time_adv_sec, float cfo } } } - INFO("Send PUSCH TTI: %d, CFO: %f, len=%d, rx_time= %.6f tx_time = %.6f TA: %.1f us PeakAmplitude=%f\n", - tti, cfo*15000, SRSLTE_SF_LEN_PRB(cell.nof_prb), +#endif + + Info("TX CFO: %f, len=%d, rx_time= %.6f tx_time = %.6f TA: %.1f us\n", + cfo*15000, SRSLTE_SF_LEN_PRB(cell.nof_prb), srslte_timestamp_real(&rx_time), - srslte_timestamp_real(&tx_time), time_adv_sec*1000000, max); + srslte_timestamp_real(&tx_time), time_adv_sec*1000000); // Correct CFO before transmission - srslte_cfo_correct(&ue_ul.cfo, signal_buffer, signal_buffer, 1.5*cfo / srslte_symbol_sz(cell.nof_prb)); + srslte_cfo_correct(&ue_ul.cfo, signal_buffer, signal_buffer, cfo / srslte_symbol_sz(cell.nof_prb)); radio_handler->tx(signal_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb), tx_time); + + //srslte_vec_save_file("pucch_tx", signal_buffer, sizeof(cf_t)*SRSLTE_SF_LEN_PRB(cell.nof_prb)); + ready(); } diff --git a/srsapps/ue/phy/test/ue_itf_test_prach.cc b/srsapps/ue/phy/test/ue_itf_test_prach.cc index f1daabccf..88f6a0526 100644 --- a/srsapps/ue/phy/test/ue_itf_test_prach.cc +++ b/srsapps/ue/phy/test/ue_itf_test_prach.cc @@ -29,6 +29,7 @@ #include "srslte/utils/debug.h" #include "srsapps/ue/phy/phy.h" +#include "srsapps/common/log_stdout.h" #include "srsapps/common/tti_sync_cv.h" #include "srsapps/radio/radio_uhd.h" @@ -48,15 +49,15 @@ prog_args_t prog_args; void args_default(prog_args_t *args) { args->uhd_rx_freq = -1.0; args->uhd_tx_freq = -1.0; - args->uhd_rx_gain = 60.0; - args->uhd_tx_gain = 40.0; + args->uhd_rx_gain = -1; // set to autogain + args->uhd_tx_gain = -1; args->continous = false; } void usage(prog_args_t *args, char *prog) { printf("Usage: %s [gGcv] -f rx_frequency -F tx_frequency (in Hz)\n", prog); - printf("\t-g UHD RX gain [Default %.2f dB]\n", args->uhd_rx_gain); - printf("\t-G UHD TX gain [Default %.2f dB]\n", args->uhd_tx_gain); + printf("\t-g UHD RX gain [Default AGC]\n"); + printf("\t-G UHD TX gain [Default same as RX gain (AGC)]\n"); printf("\t-c Run continuously [Default only once]\n"); printf("\t-v [increase verbosity, default none]\n"); } @@ -208,7 +209,7 @@ void config_phy() { phy.set_param(srslte::ue::phy_params::PRACH_FREQ_OFFSET, 0); phy.set_param(srslte::ue::phy_params::PRACH_HIGH_SPEED_FLAG, 0); phy.set_param(srslte::ue::phy_params::PRACH_ROOT_SEQ_IDX, 0); - phy.set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, 4); + phy.set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, 1); phy.set_param(srslte::ue::phy_params::PUSCH_BETA, 10); phy.set_param(srslte::ue::phy_params::PUSCH_RS_GROUP_HOPPING_EN, 0); @@ -398,12 +399,15 @@ void run_tti(uint32_t tti) { state = RA; } } - + float gain = prog_args.uhd_rx_gain; + if (gain < 0) { + gain = phy.get_agc_gain(); + } if (srslte_verbose == SRSLTE_VERBOSE_NONE && prog_args.continous) { - printf("RECV RAR %2.1f \%% RECV ConnSetup %2.1f \%% (%5u/%5u) \r", + printf("RECV RAR %2.1f \%% RECV ConnSetup %2.1f \%% (%5u/%5u) Gain: %.1f dB\r", (float) 100*nof_rx_rar/nof_tx_ra, (float) 100*nof_rx_connsetup/nof_tx_ra, - nof_rx_connsetup, nof_tx_ra); + nof_rx_connsetup, nof_tx_ra, gain); } @@ -415,14 +419,21 @@ int main(int argc, char *argv[]) uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN]; srslte::ue::tti_sync_cv ttisync(10240); srslte::radio_uhd radio_uhd; + srslte::log_stdout log("PHY"); parse_args(&prog_args, argc, argv); - // Init Radio - radio_uhd.init(); - - // Init PHY - phy.init(&radio_uhd, &ttisync); + // Init Radio and PHY + if (prog_args.uhd_rx_gain > 0 && prog_args.uhd_tx_gain > 0) { + radio_uhd.init(); + radio_uhd.set_rx_gain(prog_args.uhd_rx_gain); + radio_uhd.set_tx_gain(prog_args.uhd_tx_gain); + phy.init(&radio_uhd, &ttisync, &log); + } else { + radio_uhd.init_agc(); + radio_uhd.set_tx_rx_gain_offset(-10); + phy.init_agc(&radio_uhd, &ttisync, &log); + } // Give it time to create thread sleep(1); @@ -430,11 +441,9 @@ int main(int argc, char *argv[]) // Setup PHY parameters config_phy(); - // Set RX freq and gain - phy.get_radio()->set_rx_freq(prog_args.uhd_rx_freq); - phy.get_radio()->set_tx_freq(prog_args.uhd_tx_freq); - phy.get_radio()->set_rx_gain(prog_args.uhd_rx_gain); - phy.get_radio()->set_tx_gain(prog_args.uhd_tx_gain); + // Set RX freq + radio_uhd.set_rx_freq(prog_args.uhd_rx_freq); + radio_uhd.set_tx_freq(prog_args.uhd_tx_freq); /* Instruct the PHY to decode BCH */ if (!phy.decode_mib_best(&cell, bch_payload)) { diff --git a/srsapps/ue/phy/test/ue_itf_test_sib1.cc b/srsapps/ue/phy/test/ue_itf_test_sib1.cc index 1debf2823..d77972d27 100644 --- a/srsapps/ue/phy/test/ue_itf_test_sib1.cc +++ b/srsapps/ue/phy/test/ue_itf_test_sib1.cc @@ -29,6 +29,7 @@ #include "srslte/utils/debug.h" #include "srsapps/ue/phy/phy.h" +#include "srsapps/common/log_stdout.h" #include "srsapps/common/tti_sync_cv.h" #include "srsapps/radio/radio_uhd.h" @@ -43,12 +44,12 @@ typedef struct { void args_default(prog_args_t *args) { args->uhd_freq = -1.0; - args->uhd_gain = 60.0; + args->uhd_gain = -1.0; } void usage(prog_args_t *args, char *prog) { printf("Usage: %s [gv] -f rx_frequency (in Hz)\n", prog); - printf("\t-g UHD RX gain [Default %.2f dB]\n", args->uhd_gain); + printf("\t-g UHD RX gain [Default AGC]\n"); printf("\t-v [increase verbosity, default none]\n"); } @@ -84,6 +85,7 @@ void parse_args(prog_args_t *args, int argc, char **argv) { srslte::ue::phy phy; +prog_args_t prog_args; uint32_t total_pkts=0; uint32_t total_dci=0; @@ -114,11 +116,15 @@ void run_tti(uint32_t tti) { } total_pkts++; } + float gain = prog_args.uhd_gain; + if (gain < 0) { + gain = phy.get_agc_gain(); + } if (srslte_verbose == SRSLTE_VERBOSE_NONE) { - printf("PDCCH BLER %.1f \%% PDSCH BLER %.1f \%% (total pkts: %5u) \r", + printf("PDCCH BLER %.1f \%% PDSCH BLER %.1f \%% (total pkts: %5u) Gain: %.1f dB\r", 100-(float) 100*total_dci/total_pkts, (float) 100*total_errors/total_pkts, - total_pkts); + total_pkts, gain); } } @@ -126,17 +132,21 @@ int main(int argc, char *argv[]) { srslte_cell_t cell; uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN]; - prog_args_t prog_args; srslte::ue::tti_sync_cv ttisync(10240); srslte::radio_uhd radio_uhd; + srslte::log_stdout log("PHY"); parse_args(&prog_args, argc, argv); - // Init Radio - radio_uhd.init(); - - // Init PHY - phy.init(&radio_uhd, &ttisync); + // Init Radio and PHY + if (prog_args.uhd_gain > 0) { + radio_uhd.init(); + radio_uhd.set_rx_gain(prog_args.uhd_gain); + phy.init(&radio_uhd, &ttisync, &log); + } else { + radio_uhd.init_agc(); + phy.init_agc(&radio_uhd, &ttisync, &log); + } // Give it time to create thread sleep(1); diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index 87266d824..693181fd7 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -267,14 +267,14 @@ int main(int argc, char **argv) { /* Set receiver gain */ if (prog_args.uhd_gain > 0) { printf("Opening UHD device...\n"); - if (cuhd_open_th(prog_args.uhd_args, &uhd)) { + if (cuhd_open(prog_args.uhd_args, &uhd)) { fprintf(stderr, "Error opening uhd\n"); exit(-1); } cuhd_set_rx_gain(uhd, prog_args.uhd_gain); } else { printf("Opening UHD device with threaded RX Gain control ...\n"); - if (cuhd_open_th(prog_args.uhd_args, &uhd)) { + if (cuhd_open_th(prog_args.uhd_args, &uhd, false)) { fprintf(stderr, "Error opening uhd\n"); exit(-1); } diff --git a/srslte/include/srslte/agc/agc.h b/srslte/include/srslte/agc/agc.h index 8f9d891ee..c0a549dd1 100644 --- a/srslte/include/srslte/agc/agc.h +++ b/srslte/include/srslte/agc/agc.h @@ -44,7 +44,7 @@ #include "srslte/config.h" #define SRSLTE_AGC_DEFAULT_TARGET 0.7 -#define SRSLTE_AGC_DEFAULT_BW (5e-2) +#define SRSLTE_AGC_DEFAULT_BW (5e-1) typedef enum SRSLTE_API { SRSLTE_AGC_MODE_ENERGY = 0, diff --git a/srslte/include/srslte/cuhd/cuhd.h b/srslte/include/srslte/cuhd/cuhd.h index 00eface40..1e4517181 100644 --- a/srslte/include/srslte/cuhd/cuhd.h +++ b/srslte/include/srslte/cuhd/cuhd.h @@ -39,7 +39,8 @@ SRSLTE_API int cuhd_open(char *args, void **handler); SRSLTE_API int cuhd_open_th(char *args, - void **handler); + void **handler, + bool tx_gain_same_rx); SRSLTE_API int cuhd_close(void *h); @@ -60,9 +61,11 @@ SRSLTE_API double cuhd_set_rx_srate(void *h, SRSLTE_API double cuhd_set_rx_gain(void *h, double gain); +SRSLTE_API void cuhd_set_tx_rx_gain_offset(void *h, + double offset); + SRSLTE_API double cuhd_set_rx_gain_th(void *h, double gain); - SRSLTE_API double cuhd_get_rx_gain(void *h); SRSLTE_API double cuhd_set_rx_freq(void *h, diff --git a/srslte/include/srslte/ue/ue_ul.h b/srslte/include/srslte/ue/ue_ul.h index 5f61fcc97..7a38b113e 100644 --- a/srslte/include/srslte/ue/ue_ul.h +++ b/srslte/include/srslte/ue/ue_ul.h @@ -140,6 +140,7 @@ SRSLTE_API int srslte_ue_ul_pusch_encode_cfg(srslte_ue_ul_t *q, srslte_pusch_cfg_t *cfg, uint8_t *data, srslte_uci_data_t uci_data, + srslte_softbuffer_tx_t *softbuffer, uint16_t rnti, cf_t *output_signal); diff --git a/srslte/lib/cuhd/src/cuhd_handler.hpp b/srslte/lib/cuhd/src/cuhd_handler.hpp index 256d164a8..c9c3fc2a5 100644 --- a/srslte/lib/cuhd/src/cuhd_handler.hpp +++ b/srslte/lib/cuhd/src/cuhd_handler.hpp @@ -42,5 +42,7 @@ public: pthread_mutex_t mutex; double cur_rx_gain; double new_rx_gain; + bool tx_gain_same_rx; + float tx_rx_gain_offset; uhd::gain_range_t rx_gain_range; }; diff --git a/srslte/lib/cuhd/src/cuhd_imp.cpp b/srslte/lib/cuhd/src/cuhd_imp.cpp index 8173f74a0..72fc457bf 100644 --- a/srslte/lib/cuhd/src/cuhd_imp.cpp +++ b/srslte/lib/cuhd/src/cuhd_imp.cpp @@ -121,7 +121,6 @@ int cuhd_start_rx_stream_nsamples(void *h, uint32_t nsamples) double cuhd_set_rx_gain_th(void *h, double gain) { cuhd_handler *handler = static_cast < cuhd_handler * >(h); - // round to avoid histeresis gain = handler->rx_gain_range.clip(gain); pthread_mutex_lock(&handler->mutex); handler->new_rx_gain = gain; @@ -130,6 +129,11 @@ double cuhd_set_rx_gain_th(void *h, double gain) return gain; } +void cuhd_set_tx_rx_gain_offset(void *h, double offset) { + cuhd_handler *handler = static_cast < cuhd_handler * >(h); + handler->tx_rx_gain_offset = offset; +} + /* This thread listens for set_rx_gain commands to the USRP */ static void* thread_gain_fcn(void *h) { cuhd_handler *handler = static_cast < cuhd_handler * >(h); @@ -141,11 +145,14 @@ static void* thread_gain_fcn(void *h) { handler->cur_rx_gain = handler->new_rx_gain; pthread_mutex_unlock(&handler->mutex); cuhd_set_rx_gain(h, handler->cur_rx_gain); + if (handler->tx_gain_same_rx) { + cuhd_set_tx_gain(h, handler->cur_rx_gain+handler->tx_rx_gain_offset); + } //printf("Set gain %.2f\n", handler->cur_rx_gain); } } -int cuhd_open_(char *args, void **h, bool create_thread_gain) +int cuhd_open_(char *args, void **h, bool create_thread_gain, bool tx_gain_same_rx) { cuhd_handler *handler = new cuhd_handler(); std::string _args = std::string(args); @@ -165,7 +172,8 @@ int cuhd_open_(char *args, void **h, bool create_thread_gain) handler->rx_stream = handler->usrp->get_rx_stream(stream_args); handler->tx_stream = handler->usrp->get_tx_stream(stream_args); - + handler->tx_gain_same_rx = tx_gain_same_rx; + handler->tx_rx_gain_offset = 0.0; handler->rx_gain_range = handler->usrp->get_rx_gain_range(); @@ -189,11 +197,11 @@ int cuhd_open_(char *args, void **h, bool create_thread_gain) } int cuhd_open(char *args, void **h) { - return cuhd_open_(args, h, false); + return cuhd_open_(args, h, false, false); } -int cuhd_open_th(char *args, void **h) { - return cuhd_open_(args, h, true); +int cuhd_open_th(char *args, void **h, bool tx_gain_same_rx) { + return cuhd_open_(args, h, true, tx_gain_same_rx); } diff --git a/srslte/lib/phch/src/prach.c b/srslte/lib/phch/src/prach.c index e44b379d0..e2dadc78e 100644 --- a/srslte/lib/phch/src/prach.c +++ b/srslte/lib/phch/src/prach.c @@ -347,8 +347,6 @@ int srslte_prach_init(srslte_prach_t *p, } } - printf("N_cs=%d, ZCZC=%d\n", p->N_cs, p->zczc); - // Set up containers p->prach_bins = srslte_vec_malloc(sizeof(cf_t)*p->N_zc); p->corr_spec = srslte_vec_malloc(sizeof(cf_t)*p->N_zc); @@ -425,7 +423,7 @@ int srslte_prach_gen(srslte_prach_t *p, uint32_t N_rb_ul = prach_get_rb_ul(p->N_ifft_ul); uint32_t k_0 = freq_offset*N_RB_SC - N_rb_ul*N_RB_SC/2 + p->N_ifft_ul/2; uint32_t K = DELTA_F/DELTA_F_RA; - uint32_t begin = PHI + (K*k_0) + (K/2); + uint32_t begin = PHI + (K*k_0) + (K/2) + 1; DEBUG("N_zc: %d, N_cp: %d, N_seq: %d, N_ifft_prach=%d begin: %d\n", p->N_zc, p->N_cp, p->N_seq, p->N_ifft_prach, begin); // Map dft-precoded sequence to ifft bins diff --git a/srslte/lib/phch/src/pucch.c b/srslte/lib/phch/src/pucch.c index abdfb36be..65cf298dc 100644 --- a/srslte/lib/phch/src/pucch.c +++ b/srslte/lib/phch/src/pucch.c @@ -150,6 +150,7 @@ uint32_t srslte_pucch_m(srslte_pucch_cfg_t *cfg, srslte_pucch_format_t format, u case SRSLTE_PUCCH_FORMAT_1A: case SRSLTE_PUCCH_FORMAT_1B: m = cfg->n_rb_2; + uint32_t c=SRSLTE_CP_ISNORM(cp)?3:2; if (n_pucch >= c*cfg->N_cs/cfg->delta_pucch_shift) { m = (n_pucch-c*cfg->N_cs/cfg->delta_pucch_shift)/(c*SRSLTE_NRE/cfg->delta_pucch_shift) @@ -495,8 +496,8 @@ int srslte_pucch_encode(srslte_pucch_t* q, srslte_pucch_format_t format, if (n_prime_ns%2) { S_ns = M_PI/2; } - DEBUG("PUCCH d_0: %.1f+%.1fi, alpha: %.1f, n_oc: %d, n_prime_ns: %d\n", - __real__ q->d[0], __imag__ q->d[0], alpha, n_oc, n_prime_ns); + DEBUG("PUCCH d_0: %.1f+%.1fi, alpha: %.1f, n_oc: %d, n_prime_ns: %d, n_rb_2=%d\n", + __real__ q->d[0], __imag__ q->d[0], alpha, n_oc, n_prime_ns, q->pucch_cfg.n_rb_2); for (uint32_t n=0;nz[(ns%2)*N_sf*SRSLTE_PUCCH_N_SEQ+m*SRSLTE_PUCCH_N_SEQ+n] = q->pucch_cfg.beta_pucch *q->d[0]*w_n_oc[n_oc%3][m]*cexpf(I*(q->tmp_arg[n]+alpha*n+S_ns)); diff --git a/srslte/lib/phch/src/ra.c b/srslte/lib/phch/src/ra.c index 09d215b8c..06479ea41 100644 --- a/srslte/lib/phch/src/ra.c +++ b/srslte/lib/phch/src/ra.c @@ -170,33 +170,39 @@ int srslte_ul_dci_to_grant_prb_allocation(srslte_ra_ul_dci_t *dci, srslte_ra_ul_ } static int ul_dci_to_grant_mcs(srslte_ra_ul_dci_t *dci, srslte_ra_ul_grant_t *grant) { + int tbs = -1; // 8.6.2 First paragraph if (dci->mcs_idx <= 28) { /* Table 8.6.1-1 on 36.213 */ if (dci->mcs_idx < 11) { grant->mcs.mod = SRSLTE_MOD_QPSK; - grant->mcs.tbs = srslte_ra_tbs_from_idx(dci->mcs_idx, grant->L_prb); + tbs = srslte_ra_tbs_from_idx(dci->mcs_idx, grant->L_prb); } else if (dci->mcs_idx < 21) { grant->mcs.mod = SRSLTE_MOD_16QAM; - grant->mcs.tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 1, grant->L_prb); + tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 1, grant->L_prb); } else if (dci->mcs_idx < 29) { grant->mcs.mod = SRSLTE_MOD_64QAM; - grant->mcs.tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 2, grant->L_prb); + tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 2, grant->L_prb); } else { fprintf(stderr, "Invalid MCS index %d\n", dci->mcs_idx); - return SRSLTE_ERROR; } } else if (dci->mcs_idx == 29 && dci->cqi_request && grant->L_prb <= 4) { // 8.6.1 and 8.6.2 36.213 second paragraph grant->mcs.mod = SRSLTE_MOD_QPSK; - grant->mcs.tbs = 0; + tbs = 0; } else if (dci->mcs_idx >= 29) { // Else use last TBS/Modulation and use mcs to obtain rv_idx - grant->mcs.tbs = 0; + tbs = 0; grant->mcs.mod = 0; dci->rv_idx = dci->mcs_idx - 28; } - return SRSLTE_SUCCESS; + if (tbs < 0) { + fprintf(stderr, "Error computing TBS\n"); + return SRSLTE_ERROR; + } else { + grant->mcs.tbs = (uint32_t) tbs; + return SRSLTE_SUCCESS; + } } /** Compute PRB allocation for Uplink as defined in 8.1 and 8.4 of 36.213 */ @@ -364,29 +370,28 @@ static int dl_dci_to_grant_prb_allocation(srslte_ra_dl_dci_t *dci, srslte_ra_dl_ /* Modulation order and transport block size determination 7.1.7 in 36.213 */ static int dl_dci_to_grant_mcs(srslte_ra_dl_dci_t *dci, srslte_ra_dl_grant_t *grant, bool crc_is_crnti) { uint32_t n_prb; + int tbs = -1; switch(dci->dci_format) { case SRSLTE_RA_DCI_FORMAT1: /* Table 7.1.7.1-1 on 36.213 */ if (dci->mcs_idx < 10) { grant->mcs.mod = SRSLTE_MOD_QPSK; - grant->mcs.tbs = srslte_ra_tbs_from_idx(dci->mcs_idx, grant->nof_prb); + tbs = srslte_ra_tbs_from_idx(dci->mcs_idx, grant->nof_prb); } else if (dci->mcs_idx < 17) { grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_16QAM; - grant->mcs.tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 1, grant->nof_prb); + tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 1, grant->nof_prb); } else if (dci->mcs_idx < 29) { grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_64QAM; - grant->mcs.tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 2, grant->nof_prb); + tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 2, grant->nof_prb); } else if (dci->mcs_idx == 29) { grant->mcs.mod = SRSLTE_MOD_QPSK; - grant->mcs.tbs = 0; + tbs = 0; } else if (dci->mcs_idx == 30) { grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_16QAM; - grant->mcs.tbs = 0; + tbs = 0; } else if (dci->mcs_idx == 31) { grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_64QAM; - grant->mcs.tbs = 0; - } else { - return SRSLTE_ERROR; + tbs = 0; } break; case SRSLTE_RA_DCI_FORMAT1A: @@ -397,23 +402,24 @@ static int dl_dci_to_grant_mcs(srslte_ra_dl_dci_t *dci, srslte_ra_dl_grant_t *gr n_prb = dci->type2_alloc.n_prb1a == SRSLTE_RA_TYPE2_NPRB1A_2 ? 2 : 3; } if (dci->mcs_idx < 27 && n_prb > 0 && n_prb <= SRSLTE_MAX_PRB) { - grant->mcs.tbs = tbs_table[dci->mcs_idx][n_prb - 1]; + tbs = tbs_table[dci->mcs_idx][n_prb - 1]; grant->mcs.mod = SRSLTE_MOD_QPSK; - } else { - return SRSLTE_ERROR; - } + } break; case SRSLTE_RA_DCI_FORMAT1C: /* Downlink Transport Block size for Format 1C as defined in 7.1.7.2.2-1 on 36.213 */ if (dci->mcs_idx < 32) { - grant->mcs.tbs = tbs_format1c_table[dci->mcs_idx]; + tbs = tbs_format1c_table[dci->mcs_idx]; grant->mcs.mod = SRSLTE_MOD_QPSK; - } else { - return SRSLTE_ERROR; } break; } - return SRSLTE_SUCCESS; + if (tbs < 0) { + return SRSLTE_ERROR; + } else { + grant->mcs.tbs = (uint32_t) tbs; + return SRSLTE_SUCCESS; + } } /** Obtains a DL grant from a DCI grant for PDSCH */ @@ -528,6 +534,7 @@ int srslte_ra_tbs_from_idx(uint32_t tbs_idx, uint32_t n_prb) { if (tbs_idx < 27 && n_prb > 0 && n_prb <= SRSLTE_MAX_PRB) { return tbs_table[tbs_idx][n_prb - 1]; } else { + fprintf(stderr, "Error computing TBS: Invalid TBS_idx=%d or n_prb=%d\n", tbs_idx, n_prb); return SRSLTE_ERROR; } } diff --git a/srslte/lib/phch/src/sch.c b/srslte/lib/phch/src/sch.c index 9822dea97..4416fe855 100644 --- a/srslte/lib/phch/src/sch.c +++ b/srslte/lib/phch/src/sch.c @@ -180,7 +180,7 @@ static int encode_tb(srslte_sch_t *q, if (cb_segm->C > 0) { gamma = Gp%cb_segm->C; } - + if (data) { /* Compute transport block CRC */ par = srslte_crc_checksum(&q->crc_tb, data, cb_segm->tbs); diff --git a/srslte/lib/phch/test/prach_test_mex.c b/srslte/lib/phch/test/prach_test_mex.c index bb0cda68d..b2b51d18f 100644 --- a/srslte/lib/phch/test/prach_test_mex.c +++ b/srslte/lib/phch/test/prach_test_mex.c @@ -102,7 +102,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) return; } - srslte_vec_sc_prod_cfc(signal, 1.0/sqrtf(N_ifft_ul), signal, prach.N_seq+prach.N_cp); + srslte_vec_sc_prod_cfc(signal, 1.0/sqrtf(N_ifft_ul), signal, nof_samples); if (nlhs >= 0) { mexutils_write_cf(signal, &plhs[0], nof_samples, 1); diff --git a/srslte/lib/ue/src/ue_ul.c b/srslte/lib/ue/src/ue_ul.c index 5f9151e1b..4dec31894 100644 --- a/srslte/lib/ue/src/ue_ul.c +++ b/srslte/lib/ue/src/ue_ul.c @@ -161,6 +161,7 @@ void srslte_ue_ul_set_cfg(srslte_ue_ul_t *q, srslte_pucch_sched_t *pucch_sched) { srslte_refsignal_ul_set_pusch_cfg(&q->dmrs, dmrs_cfg); + srslte_refsignal_ul_set_pucch_cfg(&q->dmrs, pucch_cfg); srslte_pusch_set_hopping_cfg(&q->pusch, pusch_hopping_cfg); srslte_pucch_set_cfg(&q->pucch, pucch_cfg); if (pucch_sched) { @@ -264,6 +265,7 @@ int srslte_ue_ul_pucch_encode(srslte_ue_ul_t *q, srslte_uci_data_t uci_data, } srslte_refsignal_dmrs_pucch_put(&q->dmrs, format, n_pucch, q->refsignal, q->sf_symbols); + srslte_ofdm_tx_sf(&q->fft, q->sf_symbols, output_signal); if (q->cfo_en) { @@ -274,7 +276,6 @@ int srslte_ue_ul_pucch_encode(srslte_ue_ul_t *q, srslte_uci_data_t uci_data, float norm_factor = (float) q->cell.nof_prb/10; srslte_vec_sc_prod_cfc(output_signal, norm_factor, output_signal, SRSLTE_SF_LEN_PRB(q->cell.nof_prb)); } - srslte_vec_save_file("pucch", output_signal, sizeof(cf_t)*SRSLTE_SF_LEN_PRB(q->cell.nof_prb)); ret = SRSLTE_SUCCESS; } @@ -325,13 +326,14 @@ int srslte_ue_ul_pusch_uci_encode_rnti(srslte_ue_ul_t *q, srslte_ra_ul_grant_t * q->pusch_cfg.cp = q->cell.cp; srslte_cbsegm(&q->pusch_cfg.cb_segm, grant->mcs.tbs); - return srslte_ue_ul_pusch_encode_cfg(q, &q->pusch_cfg, data, uci_data, rnti, output_signal); + return srslte_ue_ul_pusch_encode_cfg(q, &q->pusch_cfg, data, uci_data, &q->softbuffer, rnti, output_signal); } return ret; } int srslte_ue_ul_pusch_encode_cfg(srslte_ue_ul_t *q, srslte_pusch_cfg_t *cfg, uint8_t *data, srslte_uci_data_t uci_data, + srslte_softbuffer_tx_t *softbuffer, uint16_t rnti, cf_t *output_signal) { @@ -342,7 +344,7 @@ int srslte_ue_ul_pusch_encode_cfg(srslte_ue_ul_t *q, srslte_pusch_cfg_t *cfg, cfg != NULL && output_signal != NULL) { - if (srslte_pusch_encode_rnti(&q->pusch, cfg, &q->softbuffer, data, rnti, q->sf_symbols)) { + if (srslte_pusch_encode_rnti(&q->pusch, cfg, softbuffer, data, rnti, q->sf_symbols)) { fprintf(stderr, "Error encoding TB\n"); return ret; } From ae5316ae921905c58d27686745157b765926e3bb Mon Sep 17 00:00:00 2001 From: ismagom Date: Mon, 18 May 2015 09:44:58 +0200 Subject: [PATCH 10/19] Added Scheduling Request Procedure --- srsapps/ue/mac/include/srsapps/ue/mac/demux.h | 4 + srsapps/ue/mac/include/srsapps/ue/mac/mac.h | 7 +- .../mac/include/srsapps/ue/mac/mac_params.h | 1 + srsapps/ue/mac/include/srsapps/ue/mac/mux.h | 3 +- .../ue/mac/include/srsapps/ue/mac/proc_sr.h | 27 ++++-- .../mac/include/srsapps/ue/mac/sdu_handler.h | 39 ++++++++ srsapps/ue/mac/src/demux.cc | 14 +++ srsapps/ue/mac/src/mac.cc | 63 ++++++++++--- srsapps/ue/mac/src/mux.cc | 12 ++- srsapps/ue/mac/src/proc_sr.cc | 91 +++++++++++++++++++ srsapps/ue/mac/test/mac_test.cc | 9 +- srsapps/ue/phy/src/ul_buffer.cc | 1 + 12 files changed, 243 insertions(+), 28 deletions(-) create mode 100644 srsapps/ue/mac/include/srsapps/ue/mac/sdu_handler.h create mode 100644 srsapps/ue/mac/src/proc_sr.cc diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h index c498473d8..e5a168ce0 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/demux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/demux.h @@ -33,6 +33,7 @@ #include "srsapps/common/timers.h" #include "srsapps/ue/mac/mac_params.h" #include "srsapps/ue/mac/pdu.h" +#include "srsapps/ue/mac/sdu_handler.h" #ifndef DEMUX_H #define DEMUX_H @@ -48,6 +49,8 @@ public: demux(); void init(phy* phy_h_, log* log_h_, mac_io* mac_io_h_, timers* timers_db_); + void add_sdu_handler(sdu_handler *handler); + void push_pdu(uint8_t *mac_pdu, uint32_t nof_bits); void push_pdu_bcch(uint8_t *mac_pdu, uint32_t nof_bits); void push_pdu_temp_crnti(uint8_t *mac_pdu, uint32_t nof_bits); @@ -73,6 +76,7 @@ private: log *log_h; mac_io *mac_io_h; timers *timers_db; + sdu_handler *sdu_handler_; }; } } diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h index d591a7020..1c9427908 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h @@ -44,6 +44,7 @@ #include "srsapps/ue/mac/proc_phr.h" #include "srsapps/ue/mac/mux.h" #include "srsapps/ue/mac/demux.h" +#include "srsapps/ue/mac/sdu_handler.h" #ifndef UEMAC_H #define UEMAC_H @@ -62,10 +63,14 @@ public: int get_tti(); void main_radio_loop(); // called after thread creation + void add_sdu_handler(sdu_handler *handler); + + bool send_sdu(uint32_t lcid, uint8_t *sdu_payload, uint32_t nbytes); bool send_ccch_sdu(uint8_t *sdu_payload, uint32_t nbytes); bool send_dtch0_sdu(uint8_t *sdu_payload, uint32_t nbytes); // SRB0 bool send_dcch0_sdu(uint8_t *sdu_payload, uint32_t nbytes); // DRB0 + int recv_sdu(uint32_t lcid, uint8_t *sdu_payload, uint32_t nbytes); int recv_bcch_sdu(uint8_t *sdu_payload, uint32_t buffer_len_nbytes); int recv_ccch_sdu(uint8_t *sdu_payload, uint32_t buffer_len_nbytes); int recv_dtch0_sdu(uint8_t *sdu_payload, uint32_t buffer_len_nbytes); // SRB0 @@ -129,7 +134,7 @@ private: /* Other procedures */ void process_dl_grants(uint32_t tti); - void process_ul_grants(uint32_t tti); + bool process_ul_grants(uint32_t tti); void receive_pch(uint32_t tti); /* Functions for MAC Timers */ diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h index 226463f2c..b8e550fab 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h @@ -80,6 +80,7 @@ namespace ue { RA_INITRECEIVEDPOWER, RA_CONTENTIONTIMER, + SR_PUCCH_CONFIGURED, SR_PUCCH_RESINDEX, SR_CONFIG_INDEX, SR_TRANS_MAX, diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h index bc4ede63c..866475a0f 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mux.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mux.h @@ -48,7 +48,8 @@ public: void reset(); void init(log *log_h, mac_io *mac_io_h); - bool is_pending_sdu(); + bool is_pending_ccch_sdu(); + bool is_pending_any_sdu(); uint8_t* pdu_pop(uint32_t pdu_sz); bool pdu_move_to_msg3(uint32_t pdu_sz); diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h index d2cc3283b..8ae9a8a32 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_sr.h @@ -30,11 +30,13 @@ #include #include "srsapps/ue/mac/proc.h" +#include "srsapps/ue/phy/phy.h" +#include "srsapps/ue/mac/mac_params.h" #ifndef PROCSR_H #define PROCSR_H -/* Scheduling Request procedure */ +/* Scheduling Request procedure as defined in 5.4.4 of 36.321 */ namespace srslte { namespace ue { @@ -42,15 +44,20 @@ namespace ue { class sr_proc : public proc { public: - void step(uint32_t tti) { - if (is_running()) { - fprintf(stderr, "SR procedure not implemented\n"); - } - } - void reset() { - - } - + sr_proc(); + void init(log *log_h, mac_params *params_db, phy *phy_h); + void step(uint32_t tti); + void reset(); + void start(); + bool need_random_access(); +private: + uint32_t sr_counter; + uint32_t dsr_transmax; + bool is_pending_sr; + mac_params *params_db; + phy *phy_h; + log *log_h; + bool initiated; }; } } diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/sdu_handler.h b/srsapps/ue/mac/include/srsapps/ue/mac/sdu_handler.h new file mode 100644 index 000000000..6599280fa --- /dev/null +++ b/srsapps/ue/mac/include/srsapps/ue/mac/sdu_handler.h @@ -0,0 +1,39 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#ifndef SDUHANDLER_H +#define SDUHANDLER_H + +class sdu_handler +{ +public: + virtual void notify_new_sdu(uint32_t lcid) = 0; +}; + + +#endif + diff --git a/srsapps/ue/mac/src/demux.cc b/srsapps/ue/mac/src/demux.cc index 0a9590c0f..7db3178e1 100644 --- a/srsapps/ue/mac/src/demux.cc +++ b/srsapps/ue/mac/src/demux.cc @@ -37,6 +37,7 @@ demux::demux() : mac_msg(20),pending_mac_msg(20) contention_resolution_id = 0; pending_temp_rnti = false; has_pending_contention_resolution_id = false; + sdu_handler_ = NULL; } void demux::init(phy* phy_h_, log* log_h_, mac_io* mac_io_h_, timers* timers_db_) @@ -47,6 +48,10 @@ void demux::init(phy* phy_h_, log* log_h_, mac_io* mac_io_h_, timers* timers_db_ timers_db = timers_db_; } +void demux::add_sdu_handler(sdu_handler* handler) +{ + sdu_handler_ = handler; +} bool demux::is_temp_crnti_pending() { @@ -158,6 +163,15 @@ void demux::process_pdu(sch_pdu *pdu_msg) } } } + /* notify handler if registred */ + if (sdu_handler_) { + pdu_msg->reset(); + while(pdu_msg->next()) { + if (pdu_msg->get()->is_sdu()) { + sdu_handler_->notify_new_sdu(pdu_msg->get()->get_sdu_lcid()); + } + } + } } diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc index aead0ff3a..5cd56c256 100644 --- a/srsapps/ue/mac/src/mac.cc +++ b/srsapps/ue/mac/src/mac.cc @@ -50,7 +50,7 @@ bool mac::init(phy *phy_h_, tti_sync* ttisync_, log* log_h_) mux_unit.init(log_h, &mac_io_lch); demux_unit.init(phy_h, log_h, &mac_io_lch, &timers_db); ra_procedure.init(¶ms_db, phy_h, log_h, &timers_db, &mux_unit, &demux_unit); - + sr_procedure.init(log_h, ¶ms_db, phy_h); reset(); pthread_attr_t attr; @@ -168,16 +168,23 @@ void mac::main_radio_loop() { } if (is_synchronized) { /* Warning: Here order of invocation of procedures is important!! */ - + bool ul_resources_available; tti = ttisync->wait(); log_h->step(tti); // Step all procedures ra_procedure.step(tti); - sr_procedure.step(tti); + //sr_procedure.step(tti); bsr_procedure.step(tti); phr_procedure.step(tti); + // Check SR if we need to start RA + /* + if (sr_procedure.need_random_access()) { + ra_procedure.start_mac_order(); + } + */ + // Receive PCH, if requested receive_pch(tti); @@ -186,11 +193,11 @@ void mac::main_radio_loop() { // Process UL grants if RA procedure is done and we have pending data or in contention resolution if (ra_procedure.is_contention_resolution() || - ra_procedure.is_successful() && mux_unit.is_pending_sdu()) + ra_procedure.is_successful() && mux_unit.is_pending_ccch_sdu()) { - process_ul_grants(tti); + ul_resources_available = process_ul_grants(tti); } - + // Send pending HARQ ACK, if any, and contention resolution is resolved if (dl_harq.is_ack_pending_resolution()) { ra_procedure.step(tti); @@ -203,17 +210,27 @@ void mac::main_radio_loop() { timers_db.step_all(); // Check if there is pending CCCH SDU in Multiplexing Unit - if (mux_unit.is_pending_sdu()) { + if (mux_unit.is_pending_ccch_sdu()) { // Start RA procedure if (!ra_procedure.in_progress() && !ra_procedure.is_successful()) { Info("Starting RA procedure by RLC order\n"); ra_procedure.start_rlc_order(); } - } + } /*else if (mux_unit.is_pending_any_sdu()) { + // Sart SR if no PUSCH resources available for TTI+4 + if (!ul_resources_available) { + sr_procedure.start(); + Info("Starting Scheduling Request procedure\n"); + } + }*/ } } } +void mac::add_sdu_handler(sdu_handler *handler) { + demux_unit.add_sdu_handler(handler); +} + void mac::setup_timers() { if (params_db.get_param(mac_params::TIMER_TIMEALIGN) > 0) { @@ -376,7 +393,7 @@ void mac::process_dl_grants(uint32_t tti) { } /* UL Grant reception and processin as defined in Section 5.4.1 in 36.321 */ -void mac::process_ul_grants(uint32_t tti) { +bool mac::process_ul_grants(uint32_t tti) { // Get DL buffer for this TTI to look for DCI grants dl_buffer *dl_buffer = phy_h->get_dl_buffer(tti); @@ -399,7 +416,7 @@ void mac::process_ul_grants(uint32_t tti) { } Info("Found UL Grant TBS=%d RNTI=%d is_from_rar=%d\n", ul_grant.get_tbs(), params_db.get_param(i), ul_grant.is_from_rar()); ul_harq.run_tti(tti, &ul_grant, phy_h); - return; + return true; } else if (i == mac_params::RNTI_SPS) { if (ul_grant.get_ndi()) { @@ -412,7 +429,7 @@ void mac::process_ul_grants(uint32_t tti) { ul_sps_assig.reset(tti, &ul_grant); ul_grant.set_ndi(true); ul_harq.run_tti(tti, &ul_grant, phy_h); - return; + return true; } } } @@ -424,13 +441,24 @@ void mac::process_ul_grants(uint32_t tti) { if (sps_grant != NULL) { sps_grant->set_ndi(true); ul_harq.run_tti(tti, sps_grant, phy_h); - return; + return true; } } ul_harq.run_tti(tti, phy_h); + return false; } +int mac::recv_sdu(uint32_t lcid, uint8_t* sdu_payload, uint32_t nbytes) +{ + if (lcid <= mac_io::MAC_LCH_PCCH_DL) { + return mac_io_lch.get(lcid)->recv(sdu_payload, nbytes); + } else { + Error("Receiving SDU: Invalid lcid=%d\n", lcid); + return -1; + } +} + int mac::recv_bcch_sdu(uint8_t* sdu_payload, uint32_t buffer_len_nbytes) { return mac_io_lch.get(mac_io::MAC_LCH_BCCH_DL)->recv(sdu_payload, buffer_len_nbytes); @@ -452,6 +480,17 @@ int mac::recv_dcch0_sdu(uint8_t* sdu_payload, uint32_t buffer_len_nbytes) } +bool mac::send_sdu(uint32_t lcid, uint8_t* sdu_payload, uint32_t nbytes) +{ + lcid += mac_io::MAC_LCH_CCCH_UL; + if (lcid <= mac_io::MAC_LCH_DTCH2_UL) { + return mac_io_lch.get(lcid)->send(sdu_payload, nbytes); + } else { + Error("Receiving SDU: Invalid lcid=%d\n", lcid); + return -1; + } +} + bool mac::send_ccch_sdu(uint8_t* sdu_payload, uint32_t nbytes) { return mac_io_lch.get(mac_io::MAC_LCH_CCCH_UL)->send(sdu_payload, nbytes); diff --git a/srsapps/ue/mac/src/mux.cc b/srsapps/ue/mac/src/mux.cc index abb851a0f..fcda7d6ec 100644 --- a/srsapps/ue/mac/src/mux.cc +++ b/srsapps/ue/mac/src/mux.cc @@ -65,7 +65,17 @@ void mux::reset() } } -bool mux::is_pending_sdu() +bool mux::is_pending_any_sdu() +{ + for (int i=0;iget(i)->isempty()) { + return true; + } + } + return false; +} + +bool mux::is_pending_ccch_sdu() { return !mac_io_h->get(mac_io::MAC_LCH_CCCH_UL)->isempty(); } diff --git a/srsapps/ue/mac/src/proc_sr.cc b/srsapps/ue/mac/src/proc_sr.cc new file mode 100644 index 000000000..e31451ddc --- /dev/null +++ b/srsapps/ue/mac/src/proc_sr.cc @@ -0,0 +1,91 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include "srsapps/ue/mac/proc_sr.h" +#include "srsapps/ue/mac/mac_params.h" + + +namespace srslte { +namespace ue { + +sr_proc::sr_proc() { + initiated = false; +} + +void sr_proc::init(log* log_h_, mac_params* params_db_, phy* phy_h_) +{ + log_h = log_h_; + params_db = params_db_; + phy_h = phy_h_; + initiated = true; +} + +void sr_proc::reset() +{ + is_pending_sr = false; +} + +void sr_proc::step(uint32_t tti) +{ + if (initiated) { + if (is_pending_sr) { + if (sr_counter < dsr_transmax) { + sr_counter++; + phy_h->get_ul_buffer(tti+4)->generate_sr(); + } else { + reset(); + } + } + } +} + +bool sr_proc::need_random_access() { + if (initiated) { + if (sr_counter == dsr_transmax && dsr_transmax > 0 || + !params_db->get_param(mac_params::SR_PUCCH_CONFIGURED)) { + return true; + } else { + return false; + } + } +} + +void sr_proc::start() +{ + if (initiated) { + if (params_db->get_param(mac_params::SR_PUCCH_CONFIGURED)) { + if (!is_pending_sr) { + sr_counter = 0; + dsr_transmax = params_db->get_param(mac_params::SR_TRANS_MAX); + } + } + } +} + +} +} + diff --git a/srsapps/ue/mac/test/mac_test.cc b/srsapps/ue/mac/test/mac_test.cc index 87dbdf86b..b4238d45f 100644 --- a/srsapps/ue/mac/test/mac_test.cc +++ b/srsapps/ue/mac/test/mac_test.cc @@ -201,9 +201,12 @@ void process_connsetup(LIBLTE_RRC_CONNECTION_SETUP_STRUCT *msg, srslte::ue::mac mac->set_param(srslte::ue::mac_params::HARQ_MAXTX, liblte_rrc_max_harq_tx_num[msg->rr_cnfg.mac_main_cnfg.explicit_value.ulsch_cnfg.max_harq_tx]); - mac->set_param(srslte::ue::mac_params::SR_PUCCH_RESINDEX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_pucch_resource_idx); - mac->set_param(srslte::ue::mac_params::SR_CONFIG_INDEX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_cnfg_idx); - mac->set_param(srslte::ue::mac_params::SR_TRANS_MAX, liblte_rrc_dsr_trans_max_num[msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.dsr_trans_max]); + mac->set_param(srslte::ue::mac_params::SR_PUCCH_RESINDEX, + msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_pucch_resource_idx); + mac->set_param(srslte::ue::mac_params::SR_CONFIG_INDEX, + msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_cnfg_idx); + mac->set_param(srslte::ue::mac_params::SR_TRANS_MAX, + liblte_rrc_dsr_trans_max_num[msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.dsr_trans_max]); phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_ACK, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_ack_idx); phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_CQI, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_cqi_idx); diff --git a/srsapps/ue/phy/src/ul_buffer.cc b/srsapps/ue/phy/src/ul_buffer.cc index 67c975e07..1a61ca08c 100644 --- a/srsapps/ue/phy/src/ul_buffer.cc +++ b/srsapps/ue/phy/src/ul_buffer.cc @@ -96,6 +96,7 @@ bool ul_buffer::generate_cqi_report() bool ul_buffer::generate_sr() { uci_data.scheduling_request = true; uci_pending = true; + return true; } bool ul_buffer::uci_ready() { From eecc5257b5d12ee9b50d3561c450b896709bb828 Mon Sep 17 00:00:00 2001 From: ismagom Date: Mon, 18 May 2015 21:00:47 +0200 Subject: [PATCH 11/19] Redued graphics frame rate. Changed PDCCH decoding order. Set decoder iterations to 2. pdsch_ue RNTI argument passed as Hexadecimal --- srslte/examples/pdsch_enodeb.c | 2 +- srslte/examples/pdsch_ue.c | 201 ++++++++++++++++++++--------- srslte/include/srslte/phch/pdsch.h | 3 - srslte/include/srslte/phch/sch.h | 2 +- srslte/include/srslte/ue/ue_dl.h | 2 +- srslte/lib/phch/src/dci.c | 1 - srslte/lib/phch/src/pdcch.c | 2 +- srslte/lib/phch/src/ra.c | 83 ++++++------ srslte/lib/ue/src/ue_dl.c | 13 +- 9 files changed, 191 insertions(+), 118 deletions(-) diff --git a/srslte/examples/pdsch_enodeb.c b/srslte/examples/pdsch_enodeb.c index c317d2a32..80a37211b 100644 --- a/srslte/examples/pdsch_enodeb.c +++ b/srslte/examples/pdsch_enodeb.c @@ -254,7 +254,7 @@ void base_init() { exit(-1); } - srslte_pdsch_set_rnti(&pdsch, 1234); + srslte_pdsch_set_rnti(&pdsch, 4660); if (srslte_softbuffer_tx_init(&softbuffer, cell)) { fprintf(stderr, "Error initiating soft buffer\n"); diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index 693181fd7..366c22aee 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -64,12 +64,18 @@ sem_t plot_sem; uint32_t plot_sf_idx=0; #endif +#define PLOT_CHEST_ARGUMENT +#define PRINT_CHANGE_SCHEDULIGN + /********************************************************************** * Program arguments processing ***********************************************************************/ typedef struct { int nof_subframes; bool disable_plots; + bool disable_plots_except_constellation; + bool disable_cfo; + uint32_t time_offset; int force_N_id_2; uint16_t rnti; char *input_file_name; @@ -87,10 +93,14 @@ typedef struct { }prog_args_t; void args_default(prog_args_t *args) { + args->disable_plots = false; + args->disable_plots_except_constellation = false; args->nof_subframes = -1; args->rnti = SRSLTE_SIRNTI; args->force_N_id_2 = -1; // Pick the best args->input_file_name = NULL; + args->disable_cfo = false; + args->time_offset = 0; args->file_nof_prb = 6; args->file_nof_ports = 1; args->file_cell_id = 0; @@ -105,7 +115,7 @@ void args_default(prog_args_t *args) { } void usage(prog_args_t *args, char *prog) { - printf("Usage: %s [agpPcildnruv] -f rx_frequency (in Hz) | -i input_file\n", prog); + printf("Usage: %s [agpPcildDnruv] -f rx_frequency (in Hz) | -i input_file\n", prog); #ifndef DISABLE_UHD printf("\t-a UHD args [Default %s]\n", args->uhd_args); printf("\t-g UHD fix RX gain [Default AGC]\n"); @@ -117,10 +127,13 @@ void usage(prog_args_t *args, char *prog) { printf("\t-p nof_prb for input file [Default %d]\n", args->file_nof_prb); printf("\t-P nof_ports for input file [Default %d]\n", args->file_nof_ports); printf("\t-c cell_id for input file [Default %d]\n", args->file_cell_id); - printf("\t-r RNTI [Default 0x%x]\n",args->rnti); + printf("\t-r RNTI in Hex [Default 0x%x]\n",args->rnti); printf("\t-l Force N_id_2 [Default best]\n"); + printf("\t-C Disable CFO correction [Default %s]\n", args->disable_cfo?"Disabled":"Enabled"); + printf("\t-t Add time offset [Default %d]\n", args->time_offset); #ifndef DISABLE_GRAPHICS printf("\t-d disable plots [Default enabled]\n"); + printf("\t-D disable all but constellation plots [Default enabled]\n"); #else printf("\t plots are disabled. Graphics library not available\n"); #endif @@ -135,7 +148,7 @@ void usage(prog_args_t *args, char *prog) { void parse_args(prog_args_t *args, int argc, char **argv) { int opt; args_default(args); - while ((opt = getopt(argc, argv, "aoglipPcdnvrfuUsS")) != -1) { + while ((opt = getopt(argc, argv, "aoglipPcCtdDnvrfuUsS")) != -1) { switch (opt) { case 'i': args->input_file_name = argv[optind]; @@ -155,6 +168,12 @@ void parse_args(prog_args_t *args, int argc, char **argv) { case 'g': args->uhd_gain = atof(argv[optind]); break; + case 'C': + args->disable_cfo = true; + break; + case 't': + args->time_offset = atoi(argv[optind]); + break; case 'o': args->uhd_freq_offset = atof(argv[optind]); break; @@ -165,7 +184,7 @@ void parse_args(prog_args_t *args, int argc, char **argv) { args->nof_subframes = atoi(argv[optind]); break; case 'r': - args->rnti = atoi(argv[optind]); + args->rnti = strtol(argv[optind], NULL, 16); break; case 'l': args->force_N_id_2 = atoi(argv[optind]); @@ -185,6 +204,9 @@ void parse_args(prog_args_t *args, int argc, char **argv) { case 'd': args->disable_plots = true; break; + case 'D': + args->disable_plots_except_constellation = true; + break; case 'v': srslte_verbose++; break; @@ -373,7 +395,7 @@ int main(int argc, char **argv) { // Variables for measurements uint32_t nframes=0; float rsrp=0.0, rsrq=0.0, snr=0.0; - bool decode_pdsch; + bool decode_pdsch = false; int pdcch_tx=0; #ifndef DISABLE_UHD @@ -381,6 +403,19 @@ int main(int argc, char **argv) { srslte_ue_sync_start_agc(&ue_sync, cuhd_set_rx_gain_th, cell_detect_config.init_agc); } #endif +#ifdef PRINT_CHANGE_SCHEDULIGN + srslte_ra_dl_dci_t old_dl_dci; + bzero(&old_dl_dci, sizeof(srslte_ra_dl_dci_t)); +#endif + + ue_sync.correct_cfo = !prog_args.disable_cfo; + + /* Set high priority */ + struct sched_param param; + param.sched_priority = sched_get_priority_max(SCHED_FIFO); + if (sched_setscheduler(pthread_self(), SCHED_FIFO, ¶m)) { + perror("setscheduler"); + } INFO("\nEntering main loop...\n\n", 0); /* Main loop */ @@ -412,9 +447,13 @@ int main(int argc, char **argv) { break; case DECODE_PDSCH: if (prog_args.rnti != SRSLTE_SIRNTI) { - decode_pdsch = true; + if (srslte_ue_sync_get_sfidx(&ue_sync) != 5 && srslte_ue_sync_get_sfidx(&ue_sync) != 0) { + decode_pdsch = true; + } else { + decode_pdsch = false; + } } else { - /* We are looking for SIB1 Blocks, search only in appropiate places */ + /* We are looking for SIB1 Blocks, 2search only in appropiate places */ if ((srslte_ue_sync_get_sfidx(&ue_sync) == 5 && (sfn%2)==0)) { decode_pdsch = true; } else { @@ -423,9 +462,9 @@ int main(int argc, char **argv) { } if (decode_pdsch) { if (prog_args.rnti != SRSLTE_SIRNTI) { - n = srslte_ue_dl_decode(&ue_dl, sf_buffer, data_packed, srslte_ue_sync_get_sfidx(&ue_sync)); + n = srslte_ue_dl_decode(&ue_dl, &sf_buffer[prog_args.time_offset], data_packed, srslte_ue_sync_get_sfidx(&ue_sync)); } else { - n = srslte_ue_dl_decode_rnti_rv(&ue_dl, sf_buffer, data_packed, srslte_ue_sync_get_sfidx(&ue_sync), + n = srslte_ue_dl_decode_rnti_rv(&ue_dl, &sf_buffer[prog_args.time_offset], data_packed, srslte_ue_sync_get_sfidx(&ue_sync), SRSLTE_SIRNTI, ((int) ceilf((float)3*(((sfn)/2)%4)/2))%4); } if (n < 0) { @@ -436,7 +475,22 @@ int main(int argc, char **argv) { srslte_bit_unpack_vector(data_packed, data, n); srslte_netsink_write(&net_sink, data, 1+(n-1)/8); } + + #ifdef PRINT_CHANGE_SCHEDULIGN + if (ue_dl.dl_dci.mcs_idx != old_dl_dci.mcs_idx || + ue_dl.dl_dci.alloc_type != old_dl_dci.alloc_type || + ue_dl.dl_dci.type2_alloc.riv != ue_dl.dl_dci.type2_alloc.riv) + { + memcpy(&old_dl_dci, &ue_dl.dl_dci, sizeof(srslte_ra_dl_dci_t)); + fflush(stdout);printf("\nCFI:\t%d\n", ue_dl.cfi); + printf("Format: %s\n", srslte_dci_format_string(ue_dl.dci_format)); + srslte_ra_pdsch_fprint(stdout, &old_dl_dci, cell.nof_prb); + srslte_ra_dl_grant_fprint(stdout, &ue_dl.pdsch_cfg.grant); + } + #endif + } + nof_trials++; rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrq(&ue_dl.chest), rsrq, 0.05); @@ -507,8 +561,10 @@ int main(int argc, char **argv) { #ifndef DISABLE_GRAPHICS if (!prog_args.disable_plots) { - plot_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync); - sem_post(&plot_sem); + if ((sfn%10) == 0 && decode_pdsch) { + plot_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync); + sem_post(&plot_sem); + } } #endif } else if (ret == 0) { @@ -555,7 +611,7 @@ int main(int argc, char **argv) { //plot_waterfall_t poutfft; -plot_real_t p_sync, pce; +plot_real_t p_sync, pce, pce_arg; plot_scatter_t pscatequal, pscatequal_pdcch; float tmp_plot[SRSLTE_SLOT_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)]; @@ -566,38 +622,82 @@ void *plot_thread_run(void *arg) { int i; uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp); + + sdrgui_init(); + + //plot_waterfall_init(&poutfft, SRSLTE_NRE * ue_dl.cell.nof_prb, 1000); + //plot_waterfall_setTitle(&poutfft, "Output FFT - Magnitude"); + //plot_waterfall_setPlotYAxisScale(&poutfft, -40, 40); + + if (!prog_args.disable_plots_except_constellation) { + plot_real_init(&pce); + plot_real_setTitle(&pce, "Channel Response - Magnitude"); + plot_real_setLabels(&pce, "Index", "dB"); + plot_real_setYAxisScale(&pce, -40, 40); + + #ifdef PLOT_CHEST_ARGUMENT + plot_real_init(&pce_arg); + plot_real_setTitle(&pce_arg, "Channel Response - Argument"); + plot_real_setLabels(&pce_arg, "Index", "rad"); + plot_real_setYAxisScale(&pce_arg, -1.1*M_PI, 1.1*M_PI); + #endif + + plot_real_init(&p_sync); + plot_real_setTitle(&p_sync, "PSS Cross-Corr abs value"); + plot_real_setYAxisScale(&p_sync, 0, 1); + + plot_scatter_init(&pscatequal_pdcch); + plot_scatter_setTitle(&pscatequal_pdcch, "PDCCH - Equalized Symbols"); + plot_scatter_setXAxisScale(&pscatequal_pdcch, -4, 4); + plot_scatter_setYAxisScale(&pscatequal_pdcch, -4, 4); + } + + plot_scatter_init(&pscatequal); + plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols"); + plot_scatter_setXAxisScale(&pscatequal, -4, 4); + plot_scatter_setYAxisScale(&pscatequal, -4, 4); + + while(1) { sem_wait(&plot_sem); uint32_t nof_symbols = ue_dl.pdsch_cfg.grant.nof_re; - for (i = 0; i < nof_re; i++) { - tmp_plot[i] = 20 * log10f(cabsf(ue_dl.sf_symbols[i])); - if (isinf(tmp_plot[i])) { - tmp_plot[i] = -80; + if (!prog_args.disable_plots_except_constellation) { + for (i = 0; i < nof_re; i++) { + tmp_plot[i] = 20 * log10f(cabsf(ue_dl.sf_symbols[i])); + if (isinf(tmp_plot[i])) { + tmp_plot[i] = -80; + } } - } - for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) { - tmp_plot2[i] = 20 * log10f(cabsf(ue_dl.chest.pilot_estimates_average[0][i])); - if (isinf(tmp_plot2[i])) { - tmp_plot2[i] = -80; + for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) { + tmp_plot2[i] = 20 * log10f(cabsf(ue_dl.chest.pilot_estimates_average[0][i])); + if (isinf(tmp_plot2[i])) { + tmp_plot2[i] = -80; + } } - } - //for (i=0;i 0) { @@ -613,36 +713,17 @@ void *plot_thread_run(void *arg) { void init_plots() { - sdrgui_init(); - - //plot_waterfall_init(&poutfft, SRSLTE_NRE * ue_dl.cell.nof_prb, 1000); - //plot_waterfall_setTitle(&poutfft, "Output FFT - Magnitude"); - //plot_waterfall_setPlotYAxisScale(&poutfft, -40, 40); - - plot_real_init(&pce); - plot_real_setTitle(&pce, "Channel Response - Magnitude"); - plot_real_setLabels(&pce, "Index", "dB"); - plot_real_setYAxisScale(&pce, -40, 40); - - plot_real_init(&p_sync); - plot_real_setTitle(&p_sync, "PSS Cross-Corr abs value"); - plot_real_setYAxisScale(&p_sync, 0, 1); - - plot_scatter_init(&pscatequal); - plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols"); - plot_scatter_setXAxisScale(&pscatequal, -4, 4); - plot_scatter_setYAxisScale(&pscatequal, -4, 4); - - plot_scatter_init(&pscatequal_pdcch); - plot_scatter_setTitle(&pscatequal_pdcch, "PDCCH - Equalized Symbols"); - plot_scatter_setXAxisScale(&pscatequal_pdcch, -4, 4); - plot_scatter_setYAxisScale(&pscatequal_pdcch, -4, 4); - if (sem_init(&plot_sem, 0, 0)) { perror("sem_init"); exit(-1); } + pthread_attr_t attr; + struct sched_param param; + param.sched_priority = 0; + pthread_attr_init(&attr); + pthread_attr_setschedpolicy(&attr, SCHED_OTHER); + pthread_attr_setschedparam(&attr, ¶m); if (pthread_create(&plot_thread, NULL, plot_thread_run, NULL)) { perror("pthread_create"); exit(-1); diff --git a/srslte/include/srslte/phch/pdsch.h b/srslte/include/srslte/phch/pdsch.h index ec8ae4135..2d0a6227e 100644 --- a/srslte/include/srslte/phch/pdsch.h +++ b/srslte/include/srslte/phch/pdsch.h @@ -48,9 +48,6 @@ #include "srslte/phch/sch.h" #include "srslte/phch/pdsch_cfg.h" -#define SRSLTE_PDSCH_MAX_TDEC_ITERS 5 - - /* PDSCH object */ typedef struct SRSLTE_API { srslte_cell_t cell; diff --git a/srslte/include/srslte/phch/sch.h b/srslte/include/srslte/phch/sch.h index af3abde87..6bca0cccf 100644 --- a/srslte/include/srslte/phch/sch.h +++ b/srslte/include/srslte/phch/sch.h @@ -46,7 +46,7 @@ #include "srslte/phch/pusch_cfg.h" #include "srslte/phch/uci.h" -#define SRSLTE_PDSCH_MAX_TDEC_ITERS 5 +#define SRSLTE_PDSCH_MAX_TDEC_ITERS 2 #ifndef SRSLTE_RX_NULL diff --git a/srslte/include/srslte/ue/ue_dl.h b/srslte/include/srslte/ue/ue_dl.h index 1024e80ca..0093b5429 100644 --- a/srslte/include/srslte/ue/ue_dl.h +++ b/srslte/include/srslte/ue/ue_dl.h @@ -70,7 +70,7 @@ typedef struct SRSLTE_API { srslte_pdsch_cfg_t pdsch_cfg; srslte_softbuffer_rx_t softbuffer; - + srslte_ra_dl_dci_t dl_dci; srslte_cell_t cell; cf_t *sf_symbols; diff --git a/srslte/lib/phch/src/dci.c b/srslte/lib/phch/src/dci.c index 94071a709..cf357390e 100644 --- a/srslte/lib/phch/src/dci.c +++ b/srslte/lib/phch/src/dci.c @@ -680,7 +680,6 @@ int dci_format1As_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32 // rv version srslte_bit_pack(data->rv_idx, &y, 2); - if (crc_is_crnti) { // TPC not implemented y++; diff --git a/srslte/lib/phch/src/pdcch.c b/srslte/lib/phch/src/pdcch.c index 62d5f20a4..c8627ba21 100644 --- a/srslte/lib/phch/src/pdcch.c +++ b/srslte/lib/phch/src/pdcch.c @@ -204,7 +204,7 @@ uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t *q, srslte_dci_location_t *c, k = 0; // All aggregation levels from 8 to 1 - for (l = 3; l >= 0; l--) { + for (l = 0; l < 3; l++) { L = (1 << l); // For all possible ncce offset for (i = 0; i < SRSLTE_MIN(q->nof_cce / L, S[l]/PDCCH_FORMAT_NOF_CCE(l)); i++) { diff --git a/srslte/lib/phch/src/ra.c b/srslte/lib/phch/src/ra.c index 06479ea41..f4ab8e956 100644 --- a/srslte/lib/phch/src/ra.c +++ b/srslte/lib/phch/src/ra.c @@ -369,51 +369,47 @@ static int dl_dci_to_grant_prb_allocation(srslte_ra_dl_dci_t *dci, srslte_ra_dl_ /* Modulation order and transport block size determination 7.1.7 in 36.213 */ static int dl_dci_to_grant_mcs(srslte_ra_dl_dci_t *dci, srslte_ra_dl_grant_t *grant, bool crc_is_crnti) { - uint32_t n_prb; + uint32_t n_prb=0; int tbs = -1; - switch(dci->dci_format) { - case SRSLTE_RA_DCI_FORMAT1: - /* Table 7.1.7.1-1 on 36.213 */ - if (dci->mcs_idx < 10) { - grant->mcs.mod = SRSLTE_MOD_QPSK; - tbs = srslte_ra_tbs_from_idx(dci->mcs_idx, grant->nof_prb); - } else if (dci->mcs_idx < 17) { - grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_16QAM; - tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 1, grant->nof_prb); - } else if (dci->mcs_idx < 29) { - grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_64QAM; - tbs = srslte_ra_tbs_from_idx(dci->mcs_idx - 2, grant->nof_prb); - } else if (dci->mcs_idx == 29) { - grant->mcs.mod = SRSLTE_MOD_QPSK; - tbs = 0; - } else if (dci->mcs_idx == 30) { - grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_16QAM; - tbs = 0; - } else if (dci->mcs_idx == 31) { - grant->mcs.mod = !crc_is_crnti?SRSLTE_MOD_QPSK:SRSLTE_MOD_64QAM; - tbs = 0; - } - break; - case SRSLTE_RA_DCI_FORMAT1A: - /* Downlink Transport Block size determination as defined in 7.1.7.2 on 36.213 */ - if (crc_is_crnti) { - n_prb = grant->nof_prb; - } else { - n_prb = dci->type2_alloc.n_prb1a == SRSLTE_RA_TYPE2_NPRB1A_2 ? 2 : 3; - } - if (dci->mcs_idx < 27 && n_prb > 0 && n_prb <= SRSLTE_MAX_PRB) { - tbs = tbs_table[dci->mcs_idx][n_prb - 1]; - grant->mcs.mod = SRSLTE_MOD_QPSK; + uint32_t i_tbs = 0; + + if (!crc_is_crnti) { + if (dci->dci_format == SRSLTE_RA_DCI_FORMAT1A) { + n_prb = dci->type2_alloc.n_prb1a == SRSLTE_RA_TYPE2_NPRB1A_2 ? 2 : 3; + i_tbs = dci->mcs_idx; + } else { + if (dci->mcs_idx < 32) { + tbs = tbs_format1c_table[dci->mcs_idx]; } - break; - case SRSLTE_RA_DCI_FORMAT1C: - /* Downlink Transport Block size for Format 1C as defined in 7.1.7.2.2-1 on 36.213 */ - if (dci->mcs_idx < 32) { - tbs = tbs_format1c_table[dci->mcs_idx]; - grant->mcs.mod = SRSLTE_MOD_QPSK; - } - break; - } + } + grant->mcs.mod = SRSLTE_MOD_QPSK; + } else { + n_prb = grant->nof_prb; + if (dci->mcs_idx < 10) { + grant->mcs.mod = SRSLTE_MOD_QPSK; + i_tbs = dci->mcs_idx; + } else if (dci->mcs_idx < 17) { + grant->mcs.mod = SRSLTE_MOD_16QAM; + i_tbs = dci->mcs_idx-1; + } else if (dci->mcs_idx < 29) { + grant->mcs.mod = SRSLTE_MOD_64QAM; + i_tbs = dci->mcs_idx-2; + } else if (dci->mcs_idx == 29) { + grant->mcs.mod = SRSLTE_MOD_QPSK; + tbs = 0; + i_tbs = 0; + } else if (dci->mcs_idx == 30) { + grant->mcs.mod = SRSLTE_MOD_16QAM; + tbs = 0; + i_tbs = 0; + } else if (dci->mcs_idx == 31) { + grant->mcs.mod = SRSLTE_MOD_64QAM; + tbs = 0; + i_tbs = 0; + } + } + tbs = srslte_ra_tbs_from_idx(i_tbs, n_prb); + if (tbs < 0) { return SRSLTE_ERROR; } else { @@ -534,7 +530,6 @@ int srslte_ra_tbs_from_idx(uint32_t tbs_idx, uint32_t n_prb) { if (tbs_idx < 27 && n_prb > 0 && n_prb <= SRSLTE_MAX_PRB) { return tbs_table[tbs_idx][n_prb - 1]; } else { - fprintf(stderr, "Error computing TBS: Invalid TBS_idx=%d or n_prb=%d\n", tbs_idx, n_prb); return SRSLTE_ERROR; } } diff --git a/srslte/lib/ue/src/ue_dl.c b/srslte/lib/ue/src/ue_dl.c index 4b36522e8..2b2acad9b 100644 --- a/srslte/lib/ue/src/ue_dl.c +++ b/srslte/lib/ue/src/ue_dl.c @@ -150,7 +150,7 @@ void srslte_ue_dl_reset(srslte_ue_dl_t *q) { bzero(&q->pdsch_cfg, sizeof(srslte_pdsch_cfg_t)); } -srslte_dci_format_t ue_formats[] = {SRSLTE_DCI_FORMAT1,SRSLTE_DCI_FORMAT1A}; // SRSLTE_DCI_FORMAT1B should go here also +srslte_dci_format_t ue_formats[] = {SRSLTE_DCI_FORMAT1A, SRSLTE_DCI_FORMAT1}; // SRSLTE_DCI_FORMAT1B should go here also const uint32_t nof_ue_formats = 2; srslte_dci_format_t common_formats[] = {SRSLTE_DCI_FORMAT1A,SRSLTE_DCI_FORMAT1C}; @@ -208,10 +208,8 @@ int srslte_ue_dl_decode_rnti_rv_packet(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_ q->nof_detected++; - srslte_ra_dl_dci_t dl_dci; - - if (srslte_dci_msg_to_dl_grant(dci_msg, rnti, q->cell, cfi, sf_idx, &dl_dci, &q->pdsch_cfg.grant)) { - fprintf(stderr, "Error unpacking PDSCH scheduling DCI message\n"); + if (srslte_dci_msg_to_dl_grant(dci_msg, rnti, q->cell, cfi, sf_idx, &q->dl_dci, &q->pdsch_cfg.grant)) { + //fprintf(stderr, "Error unpacking PDSCH scheduling DCI message\n"); return SRSLTE_ERROR; } if (srslte_cbsegm(&q->pdsch_cfg.cb_segm, q->pdsch_cfg.grant.mcs.tbs)) { @@ -222,7 +220,10 @@ int srslte_ue_dl_decode_rnti_rv_packet(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_ if (rnti == SRSLTE_SIRNTI) { q->pdsch_cfg.rv = rvidx; } else { - q->pdsch_cfg.rv = dl_dci.rv_idx; + q->pdsch_cfg.rv = q->dl_dci.rv_idx; + } + if (q->pdsch_cfg.rv == 0) { + srslte_softbuffer_rx_reset(&q->softbuffer); } if (q->pdsch_cfg.grant.mcs.mod > 0 && q->pdsch_cfg.grant.mcs.tbs >= 0) { ret = srslte_pdsch_decode_rnti(&q->pdsch, &q->pdsch_cfg, &q->softbuffer, From 491a3c60f2bc3abf79fdea8af1ae135540072372 Mon Sep 17 00:00:00 2001 From: ismagom Date: Tue, 19 May 2015 16:45:30 +0100 Subject: [PATCH 12/19] Added BSR procedure. Demo working --- .../mac/include/srsapps/ue/mac/mac_params.h | 2 - .../ue/mac/include/srsapps/ue/mac/proc_bsr.h | 20 +++--- srsapps/ue/mac/src/proc_bsr.c | 65 +++++++++++++++++++ srsapps/ue/mac/src/proc_sr.cc | 3 +- srsapps/ue/mac/test/mac_test.cc | 10 +-- srsapps/ue/phy/include/srsapps/ue/phy/phy.h | 11 +++- .../phy/include/srsapps/ue/phy/phy_params.h | 3 + srsapps/ue/phy/src/phy.cc | 49 ++++++++++++++ srslte/examples/pdsch_ue.c | 6 +- srslte/lib/ue/src/ue_sync.c | 4 +- 10 files changed, 151 insertions(+), 22 deletions(-) create mode 100644 srsapps/ue/mac/src/proc_bsr.c diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h index b8e550fab..7edceb904 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h @@ -81,8 +81,6 @@ namespace ue { RA_CONTENTIONTIMER, SR_PUCCH_CONFIGURED, - SR_PUCCH_RESINDEX, - SR_CONFIG_INDEX, SR_TRANS_MAX, HARQ_MAXTX, diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h index 309a173cc..e01f1d5a8 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h @@ -30,6 +30,7 @@ #include #include "srsapps/ue/mac/proc.h" +#include "srsapps/ue/mac/mux.h" #ifndef PROCBSR_H #define PROCBSR_H @@ -42,14 +43,17 @@ namespace ue { class bsr_proc : public proc { public: - void step(uint32_t tti) { - if (is_running()) { - fprintf(stderr, "BSR procedure not implemented\n"); - } - } - void reset() { - - } + bsr_proc(); + void init(log *log_h, mac_params *params_db, mux *mux_unit_); + void step(uint32_t tti); + void reset(); + void start(); +private: + bool is_pending_sr; + mac_params *params_db; + mux *mux_unit; + log *log_h; + bool initiated; }; } diff --git a/srsapps/ue/mac/src/proc_bsr.c b/srsapps/ue/mac/src/proc_bsr.c new file mode 100644 index 000000000..e5adca60d --- /dev/null +++ b/srsapps/ue/mac/src/proc_bsr.c @@ -0,0 +1,65 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2015 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include "srsapps/ue/mac/proc_bsr.h" +#include "srsapps/ue/mac/mac_params.h" + +namespace srslte { + namespace ue { + +bsr_proc::bsr_proc() +{ + initiated = false; +} + + +void bsr_proc::init(log* log_h_, mac_params* params_db_, mux *mux_unit_) +{ + log_h = log_h; + params_db = params_db_; + mux_unit = mux_unit_; + initiated = true; +} + +void bsr_proc::reset() +{ + +} + +void bsr_proc::start() +{ + +} +void bsr_proc::step(uint32_t tti) +{ + if (!initiated) { + return; + } +} + + } +} diff --git a/srsapps/ue/mac/src/proc_sr.cc b/srsapps/ue/mac/src/proc_sr.cc index e31451ddc..c0723beb0 100644 --- a/srsapps/ue/mac/src/proc_sr.cc +++ b/srsapps/ue/mac/src/proc_sr.cc @@ -47,6 +47,7 @@ void sr_proc::init(log* log_h_, mac_params* params_db_, phy* phy_h_) void sr_proc::reset() { is_pending_sr = false; + phy_h->send_sr(false); } void sr_proc::step(uint32_t tti) @@ -55,7 +56,7 @@ void sr_proc::step(uint32_t tti) if (is_pending_sr) { if (sr_counter < dsr_transmax) { sr_counter++; - phy_h->get_ul_buffer(tti+4)->generate_sr(); + phy_h->send_sr(true); } else { reset(); } diff --git a/srsapps/ue/mac/test/mac_test.cc b/srsapps/ue/mac/test/mac_test.cc index b4238d45f..9e7edc475 100644 --- a/srsapps/ue/mac/test/mac_test.cc +++ b/srsapps/ue/mac/test/mac_test.cc @@ -200,14 +200,16 @@ void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srslte::u void process_connsetup(LIBLTE_RRC_CONNECTION_SETUP_STRUCT *msg, srslte::ue::mac *mac, srslte::ue::phy *phy) { mac->set_param(srslte::ue::mac_params::HARQ_MAXTX, liblte_rrc_max_harq_tx_num[msg->rr_cnfg.mac_main_cnfg.explicit_value.ulsch_cnfg.max_harq_tx]); - - mac->set_param(srslte::ue::mac_params::SR_PUCCH_RESINDEX, + + phy->set_param(srslte::ue::phy_params::SR_PUCCH_RESINDEX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_pucch_resource_idx); - mac->set_param(srslte::ue::mac_params::SR_CONFIG_INDEX, + phy->set_param(srslte::ue::phy_params::SR_CONFIG_INDEX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_cnfg_idx); + mac->set_param(srslte::ue::mac_params::SR_TRANS_MAX, liblte_rrc_dsr_trans_max_num[msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.dsr_trans_max]); - + mac->set_param(srslte::ue::mac_params::SR_PUCCH_CONFIGURED, 1); + phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_ACK, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_ack_idx); phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_CQI, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_cqi_idx); phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_RI, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_ri_idx); diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h index 8f9ca741e..53174b1ba 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h @@ -90,6 +90,9 @@ public: bool send_prach(uint32_t preamble_idx); bool send_prach(uint32_t preamble_idx, int allowed_subframe); bool send_prach(uint32_t preamble_idx, int allowed_subframe, int target_power_dbm); + + // Indicate the PHY to send SR as soon as possible or not + void send_sr(bool enable); // Returns TTI when PRACH was transmitted. -1 if not yet transmitted int get_prach_transmitted_tti(); @@ -149,12 +152,18 @@ private: float cellsearch_cfo; bool do_agc; double last_gain; + + uint32_t sr_N_offset; + uint32_t sr_periodicity; + bool sr_enabled; + uint32_t sr_n_pucch; + bool sr_is_ready_to_send(uint32_t tti); + bool init_(radio *radio_handler, tti_sync *ttisync, log *log_h, bool do_agc); static void *phy_thread_fnc(void *arg); bool decode_mib_N_id_2(int force_N_id_2, srslte_cell_t *cell, uint8_t payload[SRSLTE_BCH_PAYLOAD_LEN]); int sync_sfn(); void run_rx_tx_state(); - bool init_radio_handler(char *args); ul_buffer* get_ul_buffer_adv(uint32_t tti); }; diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h index 05cdcbfb4..44fa2402f 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h @@ -77,6 +77,9 @@ namespace ue { PUCCH_N_PUCCH_2, PUCCH_N_PUCCH_SR, + SR_PUCCH_RESINDEX, + SR_CONFIG_INDEX, + UCI_I_OFFSET_ACK, UCI_I_OFFSET_RI, UCI_I_OFFSET_CQI, diff --git a/srsapps/ue/phy/src/phy.cc b/srsapps/ue/phy/src/phy.cc index 3b5646cc5..6632684a2 100644 --- a/srsapps/ue/phy/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -140,6 +140,52 @@ bool phy::send_prach(uint32_t preamble_idx, int allowed_subframe, int target_pow return false; } +/* Send SR as soon as possible as defined in Section 10.2 of 36.213 */ +void phy::send_sr(bool enable) +{ + + if (enable) { + // Get sr_periodicity and sr_N_offset from table 10.1-5 + uint32_t I_sr = params_db.get_param(phy_params::SR_CONFIG_INDEX); + if (I_sr < 5) { + sr_periodicity = 5; + sr_N_offset = I_sr; + } else if (I_sr < 15) { + sr_periodicity = 10; + sr_N_offset = I_sr-5; + } else if (I_sr < 35) { + sr_periodicity = 20; + sr_N_offset = I_sr-15; + } else if (I_sr < 75) { + sr_periodicity = 40; + sr_N_offset = I_sr-35; + } else if (I_sr < 155) { + sr_periodicity = 80; + sr_N_offset = I_sr-75; + } else if (I_sr < 157) { + sr_periodicity = 2; + sr_N_offset = I_sr-155; + } else if (I_sr == 157) { + sr_periodicity = 1; + sr_N_offset = I_sr-157; + } else { + Error("Invalid I_sr=%d\n", I_sr); + return; + } + sr_n_pucch = params_db.get_param(phy_params::SR_PUCCH_RESINDEX); + } + sr_enabled = enable; +} + +bool phy::sr_is_ready_to_send(uint32_t tti_) { + if (sr_enabled) { + if ((10*tti_to_SFN(tti_)+tti_to_subf(tti_)-sr_N_offset)%sr_periodicity==0) { + return true; + } + } + return false; +} + int phy::get_prach_transmitted_tti() { return prach_buffer.get_transmitted_tti(); @@ -444,6 +490,9 @@ void phy::run_rx_tx_state() if (prach_buffer.is_ready_to_send(current_tti)) { prach_buffer.send(radio_handler, cfo, last_rx_time); } + if (sr_is_ready_to_send(current_tti+ul_buffer::tx_advance_sf)) { + get_ul_buffer_adv(current_tti)->generate_sr(); + } // send ul buffer if we have to if (get_ul_buffer_adv(current_tti)->is_released() || get_ul_buffer_adv(current_tti)->uci_ready()) { // Generate PUCCH if no UL grant diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index 366c22aee..5ab186236 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -561,7 +561,7 @@ int main(int argc, char **argv) { #ifndef DISABLE_GRAPHICS if (!prog_args.disable_plots) { - if ((sfn%10) == 0 && decode_pdsch) { + if ((sfn%4) == 0 && decode_pdsch) { plot_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync); sem_post(&plot_sem); } @@ -694,10 +694,10 @@ void *plot_thread_run(void *arg) { plot_real_setNewData(&pce_arg, tmp_plot2, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0)); #endif - plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce/2); + plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce); } - plot_scatter_setNewData(&pscatequal, ue_dl.pdsch.d, nof_symbols/2); + plot_scatter_setNewData(&pscatequal, ue_dl.pdsch.d, nof_symbols); if (plot_sf_idx == 1) { if (prog_args.net_port_signal > 0) { diff --git a/srslte/lib/ue/src/ue_sync.c b/srslte/lib/ue/src/ue_sync.c index c99cc086d..aac311c41 100644 --- a/srslte/lib/ue/src/ue_sync.c +++ b/srslte/lib/ue/src/ue_sync.c @@ -118,15 +118,13 @@ int srslte_ue_sync_init(srslte_ue_sync_t *q, q->sf_len = SRSLTE_SF_LEN(q->fft_size); q->file_mode = false; q->correct_cfo = true; + q->decode_sss_on_track = true; if (cell.id == 1000) { - /* If the cell is unkown, decode SSS on track state */ - q->decode_sss_on_track = true; /* If the cell is unkown, we search PSS/SSS in 5 ms */ q->nof_recv_sf = 5; } else { - q->decode_sss_on_track = false; /* If the cell is known, we work on a 1ms basis */ q->nof_recv_sf = 1; From a690c2a232a85afbd7fe16b78237c65e5cf75a8e Mon Sep 17 00:00:00 2001 From: ismagom Date: Tue, 19 May 2015 19:22:58 +0100 Subject: [PATCH 13/19] Tests with estimator --- .../common/include/srsapps/common/timers.h | 1 + srsapps/ue/mac/src/mac.cc | 4 +- .../ue/mac/src/{proc_bsr.c => proc_bsr.cc} | 1 - srsapps/ue/mac/src/proc_ra.cc | 3 +- srsapps/ue/phy/test/ue_itf_test_sib1.cc | 15 ++---- srslte/examples/cell_measurement.c | 2 +- srslte/examples/pdsch_ue.c | 47 ++++--------------- .../include/srslte/ch_estimation/chest_dl.h | 2 - srslte/include/srslte/cuhd/cuhd.h | 3 ++ srslte/lib/ch_estimation/src/chest_dl.c | 43 +++++++---------- .../ch_estimation/test/chest_test_dl_mex.c | 7 +-- srslte/lib/cuhd/src/cuhd_imp.cpp | 4 ++ 12 files changed, 46 insertions(+), 86 deletions(-) rename srsapps/ue/mac/src/{proc_bsr.c => proc_bsr.cc} (99%) diff --git a/srsapps/common/include/srsapps/common/timers.h b/srsapps/common/include/srsapps/common/timers.h index eed55c90d..07be42dfd 100644 --- a/srsapps/common/include/srsapps/common/timers.h +++ b/srsapps/common/include/srsapps/common/timers.h @@ -117,6 +117,7 @@ public: if (i < nof_timers) { return &timer_list[i]; } else { + printf("Error accessing invalid timer %d (Only %d timers available)\n", i, nof_timers); return NULL; } } diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc index 5cd56c256..6e2be8919 100644 --- a/srsapps/ue/mac/src/mac.cc +++ b/srsapps/ue/mac/src/mac.cc @@ -175,8 +175,8 @@ void mac::main_radio_loop() { // Step all procedures ra_procedure.step(tti); //sr_procedure.step(tti); - bsr_procedure.step(tti); - phr_procedure.step(tti); + //bsr_procedure.step(tti); + //phr_procedure.step(tti); // Check SR if we need to start RA /* diff --git a/srsapps/ue/mac/src/proc_bsr.c b/srsapps/ue/mac/src/proc_bsr.cc similarity index 99% rename from srsapps/ue/mac/src/proc_bsr.c rename to srsapps/ue/mac/src/proc_bsr.cc index e5adca60d..3583793b8 100644 --- a/srsapps/ue/mac/src/proc_bsr.c +++ b/srsapps/ue/mac/src/proc_bsr.cc @@ -36,7 +36,6 @@ bsr_proc::bsr_proc() initiated = false; } - void bsr_proc::init(log* log_h_, mac_params* params_db_, mux *mux_unit_) { log_h = log_h; diff --git a/srsapps/ue/mac/src/proc_ra.cc b/srsapps/ue/mac/src/proc_ra.cc index 8ca1103f3..343a72d29 100644 --- a/srsapps/ue/mac/src/proc_ra.cc +++ b/srsapps/ue/mac/src/proc_ra.cc @@ -93,7 +93,7 @@ void ra_proc::read_params() { iniReceivedTargetPower = params_db->get_param(mac_params::RA_INITRECEIVEDPOWER); contentionResolutionTimer = params_db->get_param(mac_params::RA_CONTENTIONTIMER); - delta_preamble_db = delta_preamble_db_table[configIndex]; + delta_preamble_db = delta_preamble_db_table[configIndex%5]; if (contentionResolutionTimer > 0) { timers_db->get(mac::CONTENTION_TIMER)->set(this, contentionResolutionTimer); @@ -170,6 +170,7 @@ void ra_proc::process_timeadv_cmd(uint32_t ta) { void* init_prach_thread(void *arg) { phy* phy_h = (phy*) arg; + printf("thread initiating prach\n"); if (phy_h->init_prach()) { return (void*) 0; } else { diff --git a/srsapps/ue/phy/test/ue_itf_test_sib1.cc b/srsapps/ue/phy/test/ue_itf_test_sib1.cc index d77972d27..2efb86804 100644 --- a/srsapps/ue/phy/test/ue_itf_test_sib1.cc +++ b/srsapps/ue/phy/test/ue_itf_test_sib1.cc @@ -148,19 +148,12 @@ int main(int argc, char *argv[]) phy.init_agc(&radio_uhd, &ttisync, &log); } - // Give it time to create thread - sleep(1); - - // Set default parameters - phy.set_param(srslte::ue::phy_params::PRACH_CONFIG_INDEX, 0); - phy.set_param(srslte::ue::phy_params::PRACH_ROOT_SEQ_IDX, 0); - phy.set_param(srslte::ue::phy_params::PRACH_HIGH_SPEED_FLAG, 0); - phy.set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, 1); - // Set RX freq and gain phy.get_radio()->set_rx_freq(prog_args.uhd_freq); - phy.get_radio()->set_rx_gain(prog_args.uhd_gain); - + + // Give it time to create thread + sleep(1); + /* Instruct the PHY to decode BCH */ if (!phy.decode_mib_best(&cell, bch_payload)) { exit(-1); diff --git a/srslte/examples/cell_measurement.c b/srslte/examples/cell_measurement.c index b528e2c8e..086ec7660 100644 --- a/srslte/examples/cell_measurement.c +++ b/srslte/examples/cell_measurement.c @@ -289,7 +289,7 @@ int main(int argc, char **argv) { rssi_utra = SRSLTE_VEC_CMA(srslte_chest_dl_get_rssi(&chest),rssi_utra,nframes); rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrq(&chest),rsrq,0.05); rsrp = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrp(&chest),rsrp,0.05); - snr = SRSLTE_VEC_EMA(srslte_chest_dl_get_snr(&chest),snr,0.05); + snr = SRSLTE_VEC_EMA(srslte_chest_dl_get_noise_estimate(&chest),snr,0.05); nframes++; } diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index 5ab186236..6c1e15bab 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -64,8 +64,8 @@ sem_t plot_sem; uint32_t plot_sf_idx=0; #endif -#define PLOT_CHEST_ARGUMENT -#define PRINT_CHANGE_SCHEDULIGN +//#define PLOT_CHEST_ARGUMENT +//#define PRINT_CHANGE_SCHEDULIGN /********************************************************************** * Program arguments processing @@ -394,9 +394,8 @@ int main(int argc, char **argv) { // Variables for measurements uint32_t nframes=0; - float rsrp=0.0, rsrq=0.0, snr=0.0; + float rsrp=0.0, rsrq=0.0, noise=0.0; bool decode_pdsch = false; - int pdcch_tx=0; #ifndef DISABLE_UHD if (prog_args.uhd_gain < 0) { @@ -495,45 +494,21 @@ int main(int argc, char **argv) { rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrq(&ue_dl.chest), rsrq, 0.05); rsrp = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrp(&ue_dl.chest), rsrp, 0.05); - snr = SRSLTE_VEC_EMA(srslte_chest_dl_get_snr(&ue_dl.chest), snr, 0.01); + noise = SRSLTE_VEC_EMA(srslte_chest_dl_get_noise_estimate(&ue_dl.chest), noise, 0.05); nframes++; if (isnan(rsrq)) { rsrq = 0; } - if (isnan(snr)) { - snr = 0; + if (isnan(noise)) { + noise = 0; } if (isnan(rsrp)) { rsrp = 0; - } - -#ifdef adjust_estimator - /* Adjust channel estimator based on SNR */ - if (10*log10(snr) < 5.0) { - float f_low_snr[5]={0.05, 0.15, 0.6, 0.15, 0.05}; - srslte_chest_dl_set_filter_freq(&ue_dl.chest, f_low_snr, 5); - } else if (10*log10(snr) < 10.0) { - float f_mid_snr[3]={0.1, 0.8, 0.1}; - srslte_chest_dl_set_filter_freq(&ue_dl.chest, f_mid_snr, 3); - } else { - float f_high_snr[3]={0.05, 0.9, 0.05}; - srslte_chest_dl_set_filter_freq(&ue_dl.chest, f_high_snr, 3); - } -#endif - - } - if (srslte_ue_sync_get_sfidx(&ue_sync) != 5 && srslte_ue_sync_get_sfidx(&ue_sync) != 0) { - pdcch_tx++; + } } - // Plot and Printf if (srslte_ue_sync_get_sfidx(&ue_sync) == 5) { -#ifdef STDOUT_COMPACT - printf("SFN: %4d, PDCCH-Miss: %5.2f%% (%d missed), PDSCH-BLER: %5.2f%% (%d errors)\r", - sfn, 100*(1-(float) ue_dl.nof_detected/nof_trials),pdcch_tx-ue_dl.nof_detected, - (float) 100*ue_dl.pkt_errors/ue_dl.pkts_total,ue_dl.pkt_errors); -#else float gain = prog_args.uhd_gain; if (gain < 0) { gain = 10*log10(srslte_agc_get_gain(&ue_sync.agc)); @@ -542,13 +517,11 @@ int main(int argc, char **argv) { "RSRP: %+5.1f dBm, SNR: %4.1f dB, " "PDCCH-Miss: %5.2f%%, PDSCH-BLER: %5.2f%% Peak: %.2f Gain: %.1f dB\r", srslte_ue_sync_get_cfo(&ue_sync)/1000, srslte_ue_sync_get_sfo(&ue_sync)/1000, - 10*log10(rsrp*1000)-gain, - 10*log10(snr), + 10*log10(rsrp*1000)-gain-cuhd_get_rx_gain_offset(uhd), + 10*log10(rsrp/noise), 100*(1-(float) ue_dl.nof_detected/nof_trials), (float) 100*ue_dl.pkt_errors/ue_dl.pkts_total, - srslte_agc_get_output_level(&ue_sync.agc), gain); - -#endif + srslte_agc_get_output_level(&ue_sync.agc), gain); } break; } diff --git a/srslte/include/srslte/ch_estimation/chest_dl.h b/srslte/include/srslte/ch_estimation/chest_dl.h index 30bda0213..14d42748d 100644 --- a/srslte/include/srslte/ch_estimation/chest_dl.h +++ b/srslte/include/srslte/ch_estimation/chest_dl.h @@ -103,8 +103,6 @@ SRSLTE_API int srslte_chest_dl_estimate_port(srslte_chest_dl_t *q, uint32_t sf_idx, uint32_t port_id); -SRSLTE_API float srslte_chest_dl_get_snr(srslte_chest_dl_t *q); - SRSLTE_API float srslte_chest_dl_get_noise_estimate(srslte_chest_dl_t *q); SRSLTE_API float srslte_chest_dl_get_rssi(srslte_chest_dl_t *q); diff --git a/srslte/include/srslte/cuhd/cuhd.h b/srslte/include/srslte/cuhd/cuhd.h index 1e4517181..a00cf7d33 100644 --- a/srslte/include/srslte/cuhd/cuhd.h +++ b/srslte/include/srslte/cuhd/cuhd.h @@ -66,6 +66,9 @@ SRSLTE_API void cuhd_set_tx_rx_gain_offset(void *h, SRSLTE_API double cuhd_set_rx_gain_th(void *h, double gain); + +SRSLTE_API float cuhd_get_rx_gain_offset(void *h); + SRSLTE_API double cuhd_get_rx_gain(void *h); SRSLTE_API double cuhd_set_rx_freq(void *h, diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/src/chest_dl.c index fb4c41f09..7309a343b 100644 --- a/srslte/lib/ch_estimation/src/chest_dl.c +++ b/srslte/lib/ch_estimation/src/chest_dl.c @@ -43,7 +43,7 @@ #define CHEST_RS_AVERAGE_TIME 2 #define CHEST_RS_AVERAGE_FREQ 3 -#define NOISE_POWER_USE_ESTIMATES +#define NOISE_POWER_METHOD 1 // 0: Difference between noisy received and noiseless; 1: power of empty subcarriers /** 3GPP LTE Downlink channel estimator and equalizer. @@ -123,11 +123,11 @@ int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell) } /* Set default time/freq filters */ - //float f[3]={0.2, 0.6, 0.2}; - //srslte_chest_dl_set_filter_freq(q, f, 3); + float f[3]={0.2, 0.6, 0.2}; + srslte_chest_dl_set_filter_freq(q, f, 3); - float f[5]={0.1, 0.2, 0.4, 0.2, 0.1}; - srslte_chest_dl_set_filter_freq(q, f, 5); + //float f[5]={0.1, 0.2, 0.4, 0.2, 0.1}; + //srslte_chest_dl_set_filter_freq(q, f, 5); float t[2]={0.5, 0.5}; srslte_chest_dl_set_filter_time(q, t, 0); @@ -205,7 +205,7 @@ int srslte_chest_dl_set_filter_time(srslte_chest_dl_t *q, float *filter, uint32_ -#ifdef NOISE_POWER_USE_ESTIMATES +#if NOISE_POWER_METHOD==0 /* Uses the difference between the averaged and non-averaged pilot estimates */ static float estimate_noise_port(srslte_chest_dl_t *q, uint32_t port_id, cf_t *avg_pilots) { @@ -215,11 +215,12 @@ static float estimate_noise_port(srslte_chest_dl_t *q, uint32_t port_id, cf_t *a return srslte_vec_avg_power_cf(q->tmp_noise, SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, port_id)); } +#endif -#else +#if NOISE_POWER_METHOD==1 /* Uses the 5 empty transmitted SC before and after the SSS and PSS sequences for noise estimation */ -static float estimate_noise_empty_sc(srslte_chest_dl_t *q, cf_t *input) { +static float estimate_noise_port(srslte_chest_dl_t *q, cf_t *input) { int k_sss = (SRSLTE_CP_NSYMB(q->cell.cp) - 2) * q->cell.nof_prb * SRSLTE_NRE + q->cell.nof_prb * SRSLTE_NRE / 2 - 31; float noise_power = 0; noise_power += srslte_vec_avg_power_cf(&input[k_sss-5], 5); // 5 empty SC before SSS @@ -258,7 +259,7 @@ static void average_pilots(srslte_chest_dl_t *q, uint32_t port_id) } } - #ifdef NOISE_POWER_USE_ESTIMATES + #if NOISE_POWER_METHOD==0 q->noise_estimate[port_id] = estimate_noise_port(q, port_id, q->tmp_freqavg); #endif @@ -343,7 +344,7 @@ float srslte_chest_dl_rssi(srslte_chest_dl_t *q, cf_t *input, uint32_t port_id) return rssi/nsymbols; } -//#define RSRP_FROM_ESTIMATES +#define RSRP_FROM_ESTIMATES float srslte_chest_dl_rsrp(srslte_chest_dl_t *q, uint32_t port_id) { #ifdef RSRP_FROM_ESTIMATES @@ -366,7 +367,11 @@ int srslte_chest_dl_estimate_port(srslte_chest_dl_t *q, cf_t *input, cf_t *ce, u /* Average pilot estimates */ average_pilots(q, port_id); - + + #if NOISE_POWER_METHOD==1 + q->noise_estimate[port_id] = estimate_noise_port(q, input); + #endif + /* Compute RSRP for the channel estimates in this port */ q->rsrp[port_id] = srslte_chest_dl_rsrp(q, port_id); if (port_id == 0) { @@ -379,9 +384,6 @@ int srslte_chest_dl_estimate_port(srslte_chest_dl_t *q, cf_t *input, cf_t *ce, u interpolate_pilots(q, ce, port_id); } -#ifndef NOISE_POWER_USE_ESTIMATES - q->noise_estimate[port_id] = estimate_noise_empty_sc(q, input); -#endif return 0; } @@ -396,18 +398,7 @@ int srslte_chest_dl_estimate(srslte_chest_dl_t *q, cf_t *input, cf_t *ce[SRSLTE_ } float srslte_chest_dl_get_noise_estimate(srslte_chest_dl_t *q) { - float noise = srslte_vec_acc_ff(q->noise_estimate, q->cell.nof_ports)/q->cell.nof_ports; -#ifdef NOISE_POWER_USE_ESTIMATES - return noise*sqrtf(srslte_symbol_sz(q->cell.nof_prb)); -#else - return noise; -#endif - -} - -float srslte_chest_dl_get_snr(srslte_chest_dl_t *q) { - // Uses RSRP as an estimation of the useful signal power - return srslte_chest_dl_get_rsrp(q)/srslte_chest_dl_get_noise_estimate(q)/sqrt(2)/q->cell.nof_ports; + return srslte_vec_acc_ff(q->noise_estimate, q->cell.nof_ports)/q->cell.nof_ports; } float srslte_chest_dl_get_rssi(srslte_chest_dl_t *q) { diff --git a/srslte/lib/ch_estimation/test/chest_test_dl_mex.c b/srslte/lib/ch_estimation/test/chest_test_dl_mex.c index e158be0b0..cfbed897c 100644 --- a/srslte/lib/ch_estimation/test/chest_test_dl_mex.c +++ b/srslte/lib/ch_estimation/test/chest_test_dl_mex.c @@ -244,13 +244,10 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) } if (nlhs >= 4) { - plhs[3] = mxCreateDoubleScalar(srslte_chest_dl_get_snr(&chest)); + plhs[3] = mxCreateDoubleScalar(srslte_chest_dl_get_noise_estimate(&chest)); } if (nlhs >= 5) { - plhs[4] = mxCreateDoubleScalar(srslte_chest_dl_get_noise_estimate(&chest)); - } - if (nlhs >= 6) { - plhs[5] = mxCreateDoubleScalar(srslte_chest_dl_get_rsrp(&chest)); + plhs[4] = mxCreateDoubleScalar(srslte_chest_dl_get_rsrp(&chest)); } srslte_chest_dl_free(&chest); diff --git a/srslte/lib/cuhd/src/cuhd_imp.cpp b/srslte/lib/cuhd/src/cuhd_imp.cpp index 72fc457bf..1dabb62dd 100644 --- a/srslte/lib/cuhd/src/cuhd_imp.cpp +++ b/srslte/lib/cuhd/src/cuhd_imp.cpp @@ -152,6 +152,10 @@ static void* thread_gain_fcn(void *h) { } } +float cuhd_get_rx_gain_offset(void *h) { + return 15; +} + int cuhd_open_(char *args, void **h, bool create_thread_gain, bool tx_gain_same_rx) { cuhd_handler *handler = new cuhd_handler(); From c257d4f94bc1f3b6b3b8eadad998b84031615cc2 Mon Sep 17 00:00:00 2001 From: ismagom Date: Tue, 19 May 2015 19:23:06 +0100 Subject: [PATCH 14/19] Tests with estimator --- srsapps/ue/phy/test/ue_itf_test_sib1.cc | 15 +++++++++++---- srslte/examples/pdsch_ue.c | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/srsapps/ue/phy/test/ue_itf_test_sib1.cc b/srsapps/ue/phy/test/ue_itf_test_sib1.cc index 2efb86804..d77972d27 100644 --- a/srsapps/ue/phy/test/ue_itf_test_sib1.cc +++ b/srsapps/ue/phy/test/ue_itf_test_sib1.cc @@ -148,12 +148,19 @@ int main(int argc, char *argv[]) phy.init_agc(&radio_uhd, &ttisync, &log); } - // Set RX freq and gain - phy.get_radio()->set_rx_freq(prog_args.uhd_freq); - // Give it time to create thread sleep(1); - + + // Set default parameters + phy.set_param(srslte::ue::phy_params::PRACH_CONFIG_INDEX, 0); + phy.set_param(srslte::ue::phy_params::PRACH_ROOT_SEQ_IDX, 0); + phy.set_param(srslte::ue::phy_params::PRACH_HIGH_SPEED_FLAG, 0); + phy.set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, 1); + + // Set RX freq and gain + phy.get_radio()->set_rx_freq(prog_args.uhd_freq); + phy.get_radio()->set_rx_gain(prog_args.uhd_gain); + /* Instruct the PHY to decode BCH */ if (!phy.decode_mib_best(&cell, bch_payload)) { exit(-1); diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index 6c1e15bab..e08f1443c 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -407,15 +407,17 @@ int main(int argc, char **argv) { bzero(&old_dl_dci, sizeof(srslte_ra_dl_dci_t)); #endif - ue_sync.correct_cfo = !prog_args.disable_cfo; + //ue_sync.correct_cfo = !prog_args.disable_cfo; /* Set high priority */ + /* struct sched_param param; param.sched_priority = sched_get_priority_max(SCHED_FIFO); if (sched_setscheduler(pthread_self(), SCHED_FIFO, ¶m)) { perror("setscheduler"); } - +*/ + INFO("\nEntering main loop...\n\n", 0); /* Main loop */ while (!go_exit && (sf_cnt < prog_args.nof_subframes || prog_args.nof_subframes == -1)) { From 04b8f00fe73c4f3778adea977b4e2cfe13c2871b Mon Sep 17 00:00:00 2001 From: ismagom Date: Tue, 19 May 2015 19:32:41 +0100 Subject: [PATCH 15/19] Fixed UE_SYNC can't do SSS on track --- srslte/lib/ue/src/ue_sync.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srslte/lib/ue/src/ue_sync.c b/srslte/lib/ue/src/ue_sync.c index aac311c41..5f52d387a 100644 --- a/srslte/lib/ue/src/ue_sync.c +++ b/srslte/lib/ue/src/ue_sync.c @@ -118,16 +118,20 @@ int srslte_ue_sync_init(srslte_ue_sync_t *q, q->sf_len = SRSLTE_SF_LEN(q->fft_size); q->file_mode = false; q->correct_cfo = true; - q->decode_sss_on_track = true; if (cell.id == 1000) { /* If the cell is unkown, we search PSS/SSS in 5 ms */ q->nof_recv_sf = 5; + + q->decode_sss_on_track = true; + } else { /* If the cell is known, we work on a 1ms basis */ q->nof_recv_sf = 1; + + q->decode_sss_on_track = false; } q->frame_len = q->nof_recv_sf*q->sf_len; From f47506903388e77b1ca6e14b6c7b02a619fd7e62 Mon Sep 17 00:00:00 2001 From: ismagom Date: Wed, 20 May 2015 09:57:16 +0100 Subject: [PATCH 16/19] Demo working --- srslte/examples/pdsch_ue.c | 11 +++++------ srslte/lib/ch_estimation/src/chest_dl.c | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index e08f1443c..434b2d57d 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -64,8 +64,8 @@ sem_t plot_sem; uint32_t plot_sf_idx=0; #endif -//#define PLOT_CHEST_ARGUMENT -//#define PRINT_CHANGE_SCHEDULIGN +#define PLOT_CHEST_ARGUMENT +#define PRINT_CHANGE_SCHEDULIGN /********************************************************************** * Program arguments processing @@ -407,16 +407,15 @@ int main(int argc, char **argv) { bzero(&old_dl_dci, sizeof(srslte_ra_dl_dci_t)); #endif - //ue_sync.correct_cfo = !prog_args.disable_cfo; + ue_sync.correct_cfo = !prog_args.disable_cfo; - /* Set high priority */ - /* + /* Set high priority */ struct sched_param param; param.sched_priority = sched_get_priority_max(SCHED_FIFO); if (sched_setscheduler(pthread_self(), SCHED_FIFO, ¶m)) { perror("setscheduler"); } -*/ + INFO("\nEntering main loop...\n\n", 0); /* Main loop */ diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/src/chest_dl.c index 7309a343b..1558d48f0 100644 --- a/srslte/lib/ch_estimation/src/chest_dl.c +++ b/srslte/lib/ch_estimation/src/chest_dl.c @@ -123,11 +123,11 @@ int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell) } /* Set default time/freq filters */ - float f[3]={0.2, 0.6, 0.2}; - srslte_chest_dl_set_filter_freq(q, f, 3); + //float f[3]={0.2, 0.6, 0.2}; + //srslte_chest_dl_set_filter_freq(q, f, 3); - //float f[5]={0.1, 0.2, 0.4, 0.2, 0.1}; - //srslte_chest_dl_set_filter_freq(q, f, 5); + float f[5]={0.1, 0.2, 0.4, 0.2, 0.1}; + srslte_chest_dl_set_filter_freq(q, f, 5); float t[2]={0.5, 0.5}; srslte_chest_dl_set_filter_time(q, t, 0); From 5d122ee44f5b69ac74d6cf4e1330850b792c741f Mon Sep 17 00:00:00 2001 From: ismagom Date: Wed, 20 May 2015 18:17:01 +0100 Subject: [PATCH 17/19] Added Time-domain EMA filter for channel estimation --- srslte/examples/pdsch_ue.c | 18 ++-- .../include/srslte/ch_estimation/chest_dl.h | 4 + srslte/include/srslte/utils/vector.h | 3 + srslte/lib/ch_estimation/src/chest_dl.c | 86 +++++++++++++------ srslte/lib/ue/src/ue_dl.c | 13 ++- srslte/lib/utils/src/vector.c | 6 ++ 6 files changed, 94 insertions(+), 36 deletions(-) diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index 434b2d57d..a300eb30d 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -478,8 +478,9 @@ int main(int argc, char **argv) { #ifdef PRINT_CHANGE_SCHEDULIGN if (ue_dl.dl_dci.mcs_idx != old_dl_dci.mcs_idx || - ue_dl.dl_dci.alloc_type != old_dl_dci.alloc_type || - ue_dl.dl_dci.type2_alloc.riv != ue_dl.dl_dci.type2_alloc.riv) + memcmp(&ue_dl.dl_dci.type0_alloc, &old_dl_dci.type0_alloc, sizeof(srslte_ra_type0_t)) || + memcmp(&ue_dl.dl_dci.type1_alloc, &old_dl_dci.type1_alloc, sizeof(srslte_ra_type1_t)) || + memcmp(&ue_dl.dl_dci.type2_alloc, &old_dl_dci.type2_alloc, sizeof(srslte_ra_type2_t))) { memcpy(&old_dl_dci, &ue_dl.dl_dci, sizeof(srslte_ra_dl_dci_t)); fflush(stdout);printf("\nCFI:\t%d\n", ue_dl.cfi); @@ -514,15 +515,14 @@ int main(int argc, char **argv) { if (gain < 0) { gain = 10*log10(srslte_agc_get_gain(&ue_sync.agc)); } - printf("CFO: %+6.2f KHz, SFO: %+6.2f Khz, " - "RSRP: %+5.1f dBm, SNR: %4.1f dB, " - "PDCCH-Miss: %5.2f%%, PDSCH-BLER: %5.2f%% Peak: %.2f Gain: %.1f dB\r", - srslte_ue_sync_get_cfo(&ue_sync)/1000, srslte_ue_sync_get_sfo(&ue_sync)/1000, - 10*log10(rsrp*1000)-gain-cuhd_get_rx_gain_offset(uhd), + printf("CFO: %+6.2f KHz, " + "SNR: %4.1f dB, " + "PDCCH-Miss: %5.2f%%, PDSCH-BLER: %5.2f%%\r", + + srslte_ue_sync_get_cfo(&ue_sync)/1000, 10*log10(rsrp/noise), 100*(1-(float) ue_dl.nof_detected/nof_trials), - (float) 100*ue_dl.pkt_errors/ue_dl.pkts_total, - srslte_agc_get_output_level(&ue_sync.agc), gain); + (float) 100*ue_dl.pkt_errors/ue_dl.pkts_total); } break; } diff --git a/srslte/include/srslte/ch_estimation/chest_dl.h b/srslte/include/srslte/ch_estimation/chest_dl.h index 14d42748d..36e9ab789 100644 --- a/srslte/include/srslte/ch_estimation/chest_dl.h +++ b/srslte/include/srslte/ch_estimation/chest_dl.h @@ -76,6 +76,7 @@ typedef struct { float rssi[SRSLTE_MAX_PORTS]; float rsrp[SRSLTE_MAX_PORTS]; float noise_estimate[SRSLTE_MAX_PORTS]; + float filter_time_ema; } srslte_chest_dl_t; @@ -92,6 +93,9 @@ SRSLTE_API int srslte_chest_dl_set_filter_time(srslte_chest_dl_t *q, float *filter, uint32_t filter_len); +SRSLTE_API void srslte_chest_dl_set_filter_time_ema(srslte_chest_dl_t *q, + float ema_coefficient); + SRSLTE_API int srslte_chest_dl_estimate(srslte_chest_dl_t *q, cf_t *input, cf_t *ce[SRSLTE_MAX_PORTS], diff --git a/srslte/include/srslte/utils/vector.h b/srslte/include/srslte/utils/vector.h index e098ce454..cf4a3c520 100644 --- a/srslte/include/srslte/utils/vector.h +++ b/srslte/include/srslte/utils/vector.h @@ -83,6 +83,9 @@ SRSLTE_API void srslte_vec_sum_ccc(cf_t *x, cf_t *y, cf_t *z, uint32_t len); SRSLTE_API void srslte_vec_sub_fff(float *x, float *y, float *z, uint32_t len); SRSLTE_API void srslte_vec_sub_ccc(cf_t *x, cf_t *y, cf_t *z, uint32_t len); +/* EMA filter: output=coeff*new_data + (1-coeff)*average */ +SRSLTE_API void srslte_vec_ema_filter(cf_t *new_data, cf_t *average, cf_t *output, float coeff, uint32_t len); + /* Square distance */ SRSLTE_API void srslte_vec_square_dist(cf_t symbol, cf_t *points, float *distance, uint32_t npoints); diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/src/chest_dl.c index 1558d48f0..9781ff334 100644 --- a/srslte/lib/ch_estimation/src/chest_dl.c +++ b/srslte/lib/ch_estimation/src/chest_dl.c @@ -126,11 +126,10 @@ int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell) //float f[3]={0.2, 0.6, 0.2}; //srslte_chest_dl_set_filter_freq(q, f, 3); - float f[5]={0.1, 0.2, 0.4, 0.2, 0.1}; - srslte_chest_dl_set_filter_freq(q, f, 5); + float f[9]={0.025, 0.075, 0.05, 0.15, 0.4, 0.15, 0.05, 0.075, 0.025}; + srslte_chest_dl_set_filter_freq(q, f, 9); - float t[2]={0.5, 0.5}; - srslte_chest_dl_set_filter_time(q, t, 0); + //srslte_chest_dl_set_filter_time_ema(q, 0.8); q->cell = cell; } @@ -191,6 +190,10 @@ int srslte_chest_dl_set_filter_freq(srslte_chest_dl_t *q, float *filter, uint32_ } } +void srslte_chest_dl_set_filter_time_ema(srslte_chest_dl_t *q, float ema_coefficient) { + q->filter_time_ema = ema_coefficient; +} + int srslte_chest_dl_set_filter_time(srslte_chest_dl_t *q, float *filter, uint32_t filter_len) { if (filter_len <= SRSLTE_CHEST_MAX_FILTER_TIME_LEN) { q->filter_time_len = filter_len; @@ -263,31 +266,62 @@ static void average_pilots(srslte_chest_dl_t *q, uint32_t port_id) q->noise_estimate[port_id] = estimate_noise_port(q, port_id, q->tmp_freqavg); #endif - for (l=0;lfilter_time_len > 0) { - /* Move last symbols */ - for (i=0;ifilter_time_len-1;i++) { - memcpy(q->tmp_timeavg[i], q->tmp_timeavg[i+1], nref*sizeof(cf_t)); - } - /* Save last symbol to buffer */ - memcpy(q->tmp_timeavg[q->filter_time_len-1], &pilot_tmp(0), nref*sizeof(cf_t)); - - /* Multiply all symbols by filter and add them */ - if (l > 0) { - bzero(&pilot_avg(0), nref * sizeof(cf_t)); - for (i=0;ifilter_time_len;i++) { - srslte_vec_sc_prod_cfc(q->tmp_timeavg[i], q->filter_time[i], q->tmp_timeavg_mult, nref); - srslte_vec_sum_ccc(q->tmp_timeavg_mult, &pilot_avg(0), &pilot_avg(0), nref); - } + +//#define EMA_VEC + + /* Filter with Exponential moving average (IIR) */ + if (q->filter_time_ema > 0) { +#ifdef EMA_VEC + srslte_vec_ema_filter(&q->tmp_freqavg[0], + &q->pilot_estimates_average[port_id][2*q->cell.nof_prb*srslte_refsignal_cs_nof_symbols(port_id)], + &q->pilot_estimates_average[port_id][0], + q->filter_time_ema, + nref); + for (l=1;ltmp_freqavg[2*q->cell.nof_prb*l], + &q->pilot_estimates_average[port_id][2*q->cell.nof_prb*(l-1)], + &q->pilot_estimates_average[port_id][2*q->cell.nof_prb*l], + q->filter_time_ema, + nref); + } +#else + for (i=0;ipilot_estimates_average[port_id][ + SRSLTE_REFSIGNAL_PILOT_IDX(i,srslte_refsignal_cs_nof_symbols(port_id),q->cell)], q->filter_time_ema); + for (l=1;lpilot_estimates_average[port_id][SRSLTE_REFSIGNAL_PILOT_IDX(i,l-1,q->cell)], q->filter_time_ema); + } + } +#endif + + } else { + /* Filter with FIR or don't filter */ + for (l=0;lfilter_time_len > 0) { + /* Move last symbols */ + for (i=0;ifilter_time_len-1;i++) { + memcpy(q->tmp_timeavg[i], q->tmp_timeavg[i+1], nref*sizeof(cf_t)); + } + /* Save last symbol to buffer */ + memcpy(q->tmp_timeavg[q->filter_time_len-1], &pilot_tmp(0), nref*sizeof(cf_t)); + + /* Multiply all symbols by filter and add them */ + if (l > 0) { + bzero(&pilot_avg(0), nref * sizeof(cf_t)); + for (i=0;ifilter_time_len;i++) { + srslte_vec_sc_prod_cfc(q->tmp_timeavg[i], q->filter_time[i], q->tmp_timeavg_mult, nref); + srslte_vec_sum_ccc(q->tmp_timeavg_mult, &pilot_avg(0), &pilot_avg(0), nref); + } + } else { + memcpy(&pilot_avg(0), &pilot_tmp(0), nref * sizeof(cf_t)); + } } else { - memcpy(&pilot_avg(0), &pilot_tmp(0), nref * sizeof(cf_t)); + memcpy(&pilot_avg(0), &pilot_tmp(0), nref * sizeof(cf_t)); } - } else { - memcpy(&pilot_avg(0), &pilot_tmp(0), nref * sizeof(cf_t)); - } + } } - } #define cesymb(i) ce[SRSLTE_RE_IDX(q->cell.nof_prb,i,0)] diff --git a/srslte/lib/ue/src/ue_dl.c b/srslte/lib/ue/src/ue_dl.c index 2b2acad9b..2a103be51 100644 --- a/srslte/lib/ue/src/ue_dl.c +++ b/srslte/lib/ue/src/ue_dl.c @@ -38,6 +38,8 @@ #define MAX_CANDIDATES 64 +#define PDSCH_DO_ZF + int srslte_ue_dl_init(srslte_ue_dl_t *q, srslte_cell_t cell) { @@ -225,9 +227,18 @@ int srslte_ue_dl_decode_rnti_rv_packet(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_ if (q->pdsch_cfg.rv == 0) { srslte_softbuffer_rx_reset(&q->softbuffer); } + +#ifdef PDSCH_DO_ZF + float noise_estimate = 0; +#else + float noise_estimate = srslte_chest_dl_get_noise_estimate(&q->chest); +#endif + if (q->pdsch_cfg.grant.mcs.mod > 0 && q->pdsch_cfg.grant.mcs.tbs >= 0) { ret = srslte_pdsch_decode_rnti(&q->pdsch, &q->pdsch_cfg, &q->softbuffer, - q->sf_symbols, q->ce, 0, rnti, data); + q->sf_symbols, q->ce, + noise_estimate, + rnti, data); if (ret == SRSLTE_ERROR) { q->pkt_errors++; diff --git a/srslte/lib/utils/src/vector.c b/srslte/lib/utils/src/vector.c index e7f2478a4..970317d87 100644 --- a/srslte/lib/utils/src/vector.c +++ b/srslte/lib/utils/src/vector.c @@ -62,6 +62,12 @@ float srslte_vec_acc_ff(float *x, uint32_t len) { #endif } +void srslte_vec_ema_filter(cf_t *new_data, cf_t *average, cf_t *output, float coeff, uint32_t len) { + srslte_vec_sc_prod_cfc(new_data, coeff, new_data, len); + srslte_vec_sc_prod_cfc(average, 1-coeff, output, len); + srslte_vec_sum_ccc(output, new_data, output, len); +} + cf_t srslte_vec_acc_cc(cf_t *x, uint32_t len) { int i; cf_t z=0; From 59cd1cd271af3d690753fbc361e7ffdd5abac443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismael=20G=C3=B3mez-Miguelez?= Date: Fri, 22 May 2015 12:47:26 +0200 Subject: [PATCH 18/19] Update COPYRIGHT --- COPYRIGHT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYRIGHT b/COPYRIGHT index 489a3a1de..8396c8d39 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright (C) 2013-2015 Ismael Gomez Miguelez , +Copyright (C) 2013-2015 Ismael Gomez Miguelez , Paul Sutton . All rights reserved. The following copyright notices are for libraries used within libLTE: From 486fd462347d69df51cb2a74ab22367940786d96 Mon Sep 17 00:00:00 2001 From: ismagom Date: Tue, 26 May 2015 11:48:04 +0200 Subject: [PATCH 19/19] Added MAC BSR. Channel estimation does averaging after interpolation --- matlab/tests/equalizer_test.m | 131 +++++----- .../common/include/srsapps/common/params_db.h | 11 +- srsapps/ue/mac/include/srsapps/ue/mac/mac.h | 5 +- .../mac/include/srsapps/ue/mac/mac_params.h | 3 + srsapps/ue/mac/include/srsapps/ue/mac/mux.h | 15 +- srsapps/ue/mac/include/srsapps/ue/mac/pdu.h | 5 +- .../ue/mac/include/srsapps/ue/mac/proc_bsr.h | 47 +++- srsapps/ue/mac/src/mac.cc | 39 ++- srsapps/ue/mac/src/mux.cc | 50 +++- srsapps/ue/mac/src/pdu.cc | 107 +++++++-- srsapps/ue/mac/src/proc_bsr.cc | 226 +++++++++++++++++- srsapps/ue/mac/test/CMakeLists.txt | 2 +- srsapps/ue/phy/include/srsapps/ue/phy/phy.h | 10 +- srsapps/ue/phy/src/phy.cc | 8 + srslte/examples/pdsch_ue.c | 13 +- .../include/srslte/ch_estimation/chest_dl.h | 4 +- srslte/include/srslte/utils/bit.h | 7 + srslte/lib/ch_estimation/src/chest_dl.c | 187 +++++---------- srslte/lib/ch_estimation/test/chest_test_dl.c | 2 +- .../ch_estimation/test/chest_test_dl_mex.c | 51 ++-- srslte/lib/utils/src/bit.c | 22 ++ srslte/lib/utils/src/convolution.c | 45 ++++ 22 files changed, 681 insertions(+), 309 deletions(-) diff --git a/matlab/tests/equalizer_test.m b/matlab/tests/equalizer_test.m index 80bd16960..ecc3c4cc2 100644 --- a/matlab/tests/equalizer_test.m +++ b/matlab/tests/equalizer_test.m @@ -6,7 +6,7 @@ clear plot_noise_estimation_only=false; -SNR_values_db=20;%linspace(0,30,8); +SNR_values_db=10;%linspace(0,30,8); Nrealizations=1 ; preEVM = zeros(length(SNR_values_db),Nrealizations); @@ -147,7 +147,7 @@ rxWaveform = rxWaveform(1+offset+2:end,:); rxGrid = lteOFDMDemodulate(enb,rxWaveform); rxGrid = rxGrid(:,1:140); -addpath('../../debug/srslte/lib/ch_estimation/test') +addpath('../../build/srslte/lib/ch_estimation/test') %% Channel Estimation [estChannel, noiseEst(snr_idx)] = lteDLChannelEstimate(enb,cec,rxGrid); @@ -156,68 +156,69 @@ snrest_srslte = zeros(10,1); noise_srslte = zeros(10,1); rsrp = zeros(1,10); -for i=0:9 - [d, a, out, snrest_srslte(i+1), noise_srslte(i+1), rsrp(i+1)] = srslte_chest(enb.NCellID,enb.CellRefP,rxGrid(:,i*14+1:(i+1)*14),[0.1 0.8 0.1],[0.1 0.9],i); - output = [output out]; +[d, ~, out] = srslte_chest(enb.NCellID,enb.CellRefP,rxGrid); +output = [output out]; +%RSRP = [RSRP rsrp]; +%meanRSRP(snr_idx)=mean(rsrp); +%SNR_srslte(snr_idx)=mean(snrest_srslte); +%noiseEst_srslte(snr_idx)=mean(noise_srslte); +d=reshape(d, size(estChannel)); +plot(1:288,real(reshape(estChannel(:,11:14),1,[])),'b-',... + 1:288,real(reshape(d(:,11:14),1,[])),'r-') + +% if ~plot_noise_estimation_only +% +% %% MMSE Equalization +% eqGrid_mmse = lteEqualizeMMSE(rxGrid, estChannel, noiseEst(snr_idx)); +% +% eqGrid_srslte = reshape(output,size(eqGrid_mmse)); +% +% % Analysis +% +% %Compute EVM across all input values EVM of pre-equalized receive signal +% preEqualisedEVM = lteEVM(txGrid,rxGrid); +% fprintf('%d-%d: Pre-EQ: %0.3f%%\n', ... +% snr_idx,nreal,preEqualisedEVM.RMS*100); +% +% +% %EVM of post-equalized receive signal +% postEqualisedEVM_mmse = lteEVM(txGrid,reshape(eqGrid_mmse,size(txGrid))); +% fprintf('%d-%d: MMSE: %0.3f%%\n', ... +% snr_idx,nreal,postEqualisedEVM_mmse.RMS*100); +% +% postEqualisedEVM_srslte = lteEVM(txGrid,reshape(eqGrid_srslte,size(txGrid))); +% fprintf('%d-%d: srslte: %0.3f%%\n', ... +% snr_idx,nreal,postEqualisedEVM_srslte.RMS*100); +% +% preEVM(snr_idx,nreal) = preEqualisedEVM.RMS; +% postEVM_mmse(snr_idx,nreal) = mean([postEqualisedEVM_mmse.RMS]); +% postEVM_srslte(snr_idx,nreal) = mean([postEqualisedEVM_srslte.RMS]); +% end end -RSRP = [RSRP rsrp]; -meanRSRP(snr_idx)=mean(rsrp); -SNR_srslte(snr_idx)=mean(snrest_srslte); -noiseEst_srslte(snr_idx)=mean(noise_srslte); - -if ~plot_noise_estimation_only - -%% MMSE Equalization - eqGrid_mmse = lteEqualizeMMSE(rxGrid, estChannel, noiseEst(snr_idx)); - - eqGrid_srslte = reshape(output,size(eqGrid_mmse)); - - % Analysis - - %Compute EVM across all input values EVM of pre-equalized receive signal - preEqualisedEVM = lteEVM(txGrid,rxGrid); - fprintf('%d-%d: Pre-EQ: %0.3f%%\n', ... - snr_idx,nreal,preEqualisedEVM.RMS*100); - - - %EVM of post-equalized receive signal - postEqualisedEVM_mmse = lteEVM(txGrid,reshape(eqGrid_mmse,size(txGrid))); - fprintf('%d-%d: MMSE: %0.3f%%\n', ... - snr_idx,nreal,postEqualisedEVM_mmse.RMS*100); - - postEqualisedEVM_srslte = lteEVM(txGrid,reshape(eqGrid_srslte,size(txGrid))); - fprintf('%d-%d: srslte: %0.3f%%\n', ... - snr_idx,nreal,postEqualisedEVM_srslte.RMS*100); - - preEVM(snr_idx,nreal) = preEqualisedEVM.RMS; - postEVM_mmse(snr_idx,nreal) = mean([postEqualisedEVM_mmse.RMS]); - postEVM_srslte(snr_idx,nreal) = mean([postEqualisedEVM_srslte.RMS]); -end -end -end - -% subplot(1,2,1) - -if ~plot_noise_estimation_only - plot(SNR_values_db, mean(preEVM,2), ... - SNR_values_db, mean(postEVM_mmse,2), ... - SNR_values_db, mean(postEVM_srslte,2)) - legend('No Eq','MMSE-lin','MMSE-srslte') - grid on -end - -% subplot(1,2,2) -if plot_noise_estimation_only - SNR_matlab = 1./(noiseEst*sqrt(2.0)*enb.CellRefP); - - subplot(1,3,1) - plot(SNR_values_db, SNR_values_db, SNR_values_db, 10*log10(SNR_srslte),SNR_values_db, 10*log10(SNR_matlab)) - legend('Theory','srsLTE','Matlab') - - subplot(1,3,2) - plot(SNR_values_db, 10*log10(noiseTx), SNR_values_db, 10*log10(noiseEst_srslte),SNR_values_db, 10*log10(noiseEst)) - legend('Theory','srsLTE','Matlab') - - subplot(1,3,3) - plot(1:10*length(SNR_values_db),RSRP,10*(1:length(SNR_values_db)),meanRSRP) end +% +% % subplot(1,2,1) +% +% if ~plot_noise_estimation_only +% plot(SNR_values_db, mean(preEVM,2), ... +% SNR_values_db, mean(postEVM_mmse,2), ... +% SNR_values_db, mean(postEVM_srslte,2)) +% legend('No Eq','MMSE-lin','MMSE-srslte') +% grid on +% end +% +% % subplot(1,2,2) +% if plot_noise_estimation_only +% SNR_matlab = 1./(noiseEst*sqrt(2.0)*enb.CellRefP); +% +% subplot(1,3,1) +% plot(SNR_values_db, SNR_values_db, SNR_values_db, 10*log10(SNR_srslte),SNR_values_db, 10*log10(SNR_matlab)) +% legend('Theory','srsLTE','Matlab') +% +% subplot(1,3,2) +% plot(SNR_values_db, 10*log10(noiseTx), SNR_values_db, 10*log10(noiseEst_srslte),SNR_values_db, 10*log10(noiseEst)) +% legend('Theory','srsLTE','Matlab') +% +% subplot(1,3,3) +% plot(1:10*length(SNR_values_db),RSRP,10*(1:length(SNR_values_db)),meanRSRP) +% end diff --git a/srsapps/common/include/srsapps/common/params_db.h b/srsapps/common/include/srsapps/common/params_db.h index bfeadff18..61af784a3 100644 --- a/srsapps/common/include/srsapps/common/params_db.h +++ b/srsapps/common/include/srsapps/common/params_db.h @@ -40,12 +40,13 @@ namespace ue { public: params_db(uint32_t nof_params_) { nof_params = nof_params_; - db = (int64_t*) calloc(sizeof(int64_t), nof_params); + db = new int64_t[nof_params]; + for (int i=0;i @@ -226,6 +228,7 @@ public: bool has_space_ce(uint32_t nbytes); bool has_space_sdu(uint32_t nbytes); uint32_t size(); + uint32_t rem_size(); static uint32_t size_plus_header_sdu(uint32_t nbytes); bool update_space_ce(uint32_t nbytes); bool update_space_sdu(uint32_t nbytes); diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h index e01f1d5a8..da4a0d7ae 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/proc_bsr.h @@ -29,8 +29,11 @@ #include +#include "srsapps/common/log.h" #include "srsapps/ue/mac/proc.h" -#include "srsapps/ue/mac/mux.h" +#include "srsapps/ue/mac/mac_params.h" +#include "srsapps/ue/mac/mac_io.h" +#include "srsapps/common/timers.h" #ifndef PROCBSR_H #define PROCBSR_H @@ -40,21 +43,53 @@ namespace srslte { namespace ue { -class bsr_proc : public proc +class bsr_proc : public proc, timer_callback { public: bsr_proc(); - void init(log *log_h, mac_params *params_db, mux *mux_unit_); + void init(log *log_h, timers *timers_db, mac_params *params_db, mac_io *mac_io_h); void step(uint32_t tti); void reset(); - void start(); + void setup_lcg(uint32_t lcid, uint32_t new_lcg); + void set_priority(uint32_t lcid, uint32_t priority); + void timer_expired(uint32_t timer_id); + + typedef enum { + LONG_BSR, + SHORT_BSR, + TRUNC_BSR + } bsr_format_t; + + typedef struct { + bsr_format_t format; + uint32_t buff_size[4]; + } bsr_t; + + bool need_to_send_bsr_on_ul_grant(uint32_t nof_grant_bytes, uint32_t nof_padding_bytes, bsr_t *bsr); + bool need_to_send_sr(); + private: + bool is_pending_sr; mac_params *params_db; - mux *mux_unit; + mac_io *mac_io_h; + timers *timers_db; log *log_h; bool initiated; - + const static int MAX_LCID = 20; + uint32_t lcg[MAX_LCID]; + uint32_t priorities[MAX_LCID]; + uint32_t find_max_priority_lcid(); + enum {NONE, REGULAR, PADDING, PERIODIC} triggered_bsr_type; + bool timer_periodic; + bool timer_retx; + + bsr_t pending_bsr; + bool sr_is_sent; + bool check_all_channels(); + bool check_highest_channel(); + void get_pending_bsr_format(uint32_t nof_padding_bytes); + }; } } diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc index 6e2be8919..9bcec72c9 100644 --- a/srsapps/ue/mac/src/mac.cc +++ b/srsapps/ue/mac/src/mac.cc @@ -47,7 +47,8 @@ bool mac::init(phy *phy_h_, tti_sync* ttisync_, log* log_h_) tti = 0; is_synchronized = false; - mux_unit.init(log_h, &mac_io_lch); + bsr_procedure.init(log_h, &timers_db, ¶ms_db, &mac_io_lch); + mux_unit.init(log_h, &mac_io_lch, &bsr_procedure); demux_unit.init(phy_h, log_h, &mac_io_lch, &timers_db); ra_procedure.init(¶ms_db, phy_h, log_h, &timers_db, &mux_unit, &demux_unit); sr_procedure.init(log_h, ¶ms_db, phy_h); @@ -173,17 +174,23 @@ void mac::main_radio_loop() { log_h->step(tti); // Step all procedures - ra_procedure.step(tti); - //sr_procedure.step(tti); - //bsr_procedure.step(tti); - //phr_procedure.step(tti); + bsr_procedure.step(tti); + + // Check if BSR procedure need to start SR + if (bsr_procedure.need_to_send_sr()) { + sr_procedure.start(); + } + sr_procedure.step(tti); // Check SR if we need to start RA - /* if (sr_procedure.need_random_access()) { ra_procedure.start_mac_order(); } - */ + + ra_procedure.step(tti); + + + //phr_procedure.step(tti); // Receive PCH, if requested receive_pch(tti); @@ -216,13 +223,7 @@ void mac::main_radio_loop() { Info("Starting RA procedure by RLC order\n"); ra_procedure.start_rlc_order(); } - } /*else if (mux_unit.is_pending_any_sdu()) { - // Sart SR if no PUSCH resources available for TTI+4 - if (!ul_resources_available) { - sr_procedure.start(); - Info("Starting Scheduling Request procedure\n"); - } - }*/ + } } } } @@ -511,13 +512,11 @@ void mac::set_param(mac_params::mac_param_t param, int64_t value) params_db.set_param((uint32_t) param, value); } -void mac::set_dcch0_priority(uint32_t priority, int PBR_x_tti, uint32_t BSD) -{ - mux_unit.set_priority(mac_io::MAC_LCH_DCCH0_UL - mac_io::MAC_LCH_CCCH_UL, priority, PBR_x_tti, BSD); -} -void mac::set_dtch0_priority(uint32_t priority, int PBR_x_tti, uint32_t BSD) +void mac::setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD) { - mux_unit.set_priority(mac_io::MAC_LCH_DTCH0_UL - mac_io::MAC_LCH_CCCH_UL, priority, PBR_x_tti, BSD); + mux_unit.set_priority(mac_io::MAC_LCH_CCCH_UL+lcid, priority, PBR_x_tti, BSD); + bsr_procedure.setup_lcg(lcid, lcg); + bsr_procedure.set_priority(lcid, priority); } diff --git a/srsapps/ue/mac/src/mux.cc b/srsapps/ue/mac/src/mux.cc index fcda7d6ec..bbab90c9a 100644 --- a/srsapps/ue/mac/src/mux.cc +++ b/srsapps/ue/mac/src/mux.cc @@ -52,10 +52,11 @@ mux::mux() : pdu_msg(20) } } -void mux::init(log *log_h_, mac_io *mac_io_h_) +void mux::init(log *log_h_, mac_io *mac_io_h_, bsr_proc *bsr_procedure_) { log_h = log_h_; mac_io_h = mac_io_h_; + bsr_procedure = bsr_procedure_; } void mux::reset() @@ -65,6 +66,11 @@ void mux::reset() } } +bool mux::is_pending_ccch_sdu() +{ + return is_pending_sdu(0); +} + bool mux::is_pending_any_sdu() { for (int i=0;iget(mac_io::MAC_LCH_CCCH_UL)->isempty(); +bool mux::is_pending_sdu(uint32_t lch_id) { + lch_id += (uint32_t) mac_io::MAC_LCH_CCCH_UL; + if (lch_id < mac_io::MAC_NOF_QUEUES) { + return !mac_io_h->get(lch_id)->isempty(); + } } void mux::set_priority(uint32_t lch_id, uint32_t set_priority, int set_PBR, uint32_t set_BSD) @@ -159,6 +167,18 @@ void mux::append_crnti_ce_next_tx(uint16_t crnti) { pending_crnti_ce = crnti; } +sch_subh::cetype bsr_format_convert(bsr_proc::bsr_format_t format) { + switch(format) { + case bsr_proc::LONG_BSR: + return sch_subh::LONG_BSR; + case bsr_proc::SHORT_BSR: + return sch_subh::SHORT_BSR; + case bsr_proc::TRUNC_BSR: + return sch_subh::TRUNC_BSR; + + } +} + bool mux::assemble_pdu(uint32_t pdu_sz_nbits) { uint8_t *buff = (uint8_t*) pdu_buff.request(); @@ -203,8 +223,15 @@ bool mux::assemble_pdu(uint32_t pdu_sz_nbits) { } pending_crnti_ce = 0; + bsr_proc::bsr_t bsr; + bool send_bsr_normal = bsr_procedure->need_to_send_bsr_on_ul_grant(pdu_sz_nbits/8, 0, &bsr); + // MAC control element for BSR, with exception of BSR included for padding; - // TODO + if (send_bsr_normal) { + pdu_msg.next(); + pdu_msg.get()->set_bsr(bsr.buff_size, bsr_format_convert(bsr.format)); + } + // MAC control element for PHR // TODO @@ -226,8 +253,12 @@ bool mux::assemble_pdu(uint32_t pdu_sz_nbits) { } // MAC control element for BSR included for padding. - // TODO - + bool send_bsr_padding = bsr_procedure->need_to_send_bsr_on_ul_grant(pdu_sz_nbits/8, pdu_msg.rem_size(), &bsr); + if (send_bsr_padding) { + pdu_msg.next(); + pdu_msg.get()->set_bsr(bsr.buff_size, bsr_format_convert(bsr.format)); + } + pthread_mutex_unlock(&mutex); /* Release all SDUs */ @@ -249,12 +280,10 @@ bool mux::assemble_pdu(uint32_t pdu_sz_nbits) { return true; } - bool mux::allocate_sdu(uint32_t lcid, sch_pdu *pdu_msg) { return allocate_sdu(lcid, pdu_msg, NULL); } - bool mux::allocate_sdu(uint32_t lcid, sch_pdu *pdu_msg, uint32_t *sdu_sz) { @@ -263,6 +292,9 @@ bool mux::allocate_sdu(uint32_t lcid, sch_pdu *pdu_msg, uint32_t *sdu_sz) uint8_t *buff_ptr = (uint8_t*) mac_io_h->get(mac_io::MAC_LCH_CCCH_UL + lcid)->pop(&buff_len, nof_tx_pkts[lcid]); if (buff_ptr) { // there is pending SDU to allocate + if (sdu_sz) { + *sdu_sz = buff_len; + } if (pdu_msg->new_subh()) { // there is space for a new subheader pdu_msg->next(); if (pdu_msg->get()->set_sdu(lcid, buff_ptr, buff_len/8)) { // new SDU could be added diff --git a/srsapps/ue/mac/src/pdu.cc b/srsapps/ue/mac/src/pdu.cc index 54a703490..80b15514c 100644 --- a/srsapps/ue/mac/src/pdu.cc +++ b/srsapps/ue/mac/src/pdu.cc @@ -132,6 +132,9 @@ bool sch_pdu::write_packet(uint8_t* ptr) } +uint32_t sch_pdu::rem_size() { + return rem_len; +} uint32_t sch_pdu::size() { @@ -175,8 +178,6 @@ bool sch_pdu::update_space_sdu(uint32_t nbytes) } } - - void sch_subh::init() { lcid = 0; @@ -242,19 +243,33 @@ bool sch_subh::is_sdu() } uint16_t sch_subh::get_c_rnti() { - return *((uint16_t*) ce_payload); + uint8_t *ptr = ce_payload; + uint16_t ret = (uint16_t) srslte_bit_unpack(&ptr, 16); + return ret; } uint64_t sch_subh::get_con_res_id() { - return *((uint64_t*) ce_payload); + uint8_t *ptr = ce_payload; + uint64_t ret = (uint64_t) srslte_bit_unpack_l(&ptr, 48); + return ret; } uint8_t sch_subh::get_phd() { - return *((uint8_t*) ce_payload); + uint8_t *ptr = ce_payload; + ptr += 2; + uint8_t ret = (uint8_t) srslte_bit_unpack(&ptr, 6); + return ret; +} +uint8_t sch_subh::get_ta_cmd() +{ + uint8_t *ptr = ce_payload; + ptr += 2; + uint8_t ret = (uint8_t) srslte_bit_unpack(&ptr, 6); + return ret; } uint32_t sch_subh::get_sdu_lcid() { - return *((uint32_t*) ce_payload); + return lcid; } uint32_t sch_subh::get_sdu_nbytes() { @@ -264,19 +279,46 @@ uint8_t* sch_subh::get_sdu_ptr() { return sdu_payload_ptr; } -uint8_t sch_subh::get_ta_cmd() -{ - return *((uint8_t*) ce_payload); -} void sch_subh::set_padding() { lcid = PADDING; } + +bool sch_subh::set_bsr(uint32_t buff_size[4], sch_subh::cetype format) +{ + uint32_t nonzero_lcg=0; + for (int i=0;i<4;i++) { + if (buff_size[i]) { + nonzero_lcg=i; + } + } + uint32_t ce_size = format==LONG_BSR?3:1; + if (((sch_pdu*)parent)->has_space_ce(ce_size)) { + uint8_t *ptr = ce_payload; + if (format==LONG_BSR) { + for (int i=0;i<4;i++) { + srslte_bit_pack(buff_size_table(buff_size[i]), &ptr, 6); + } + } else { + srslte_bit_pack(nonzero_lcg, &ptr, 2); + srslte_bit_pack(buff_size_table(buff_size[nonzero_lcg]), &ptr, 6); + } + lcid = format; + ((sch_pdu*)parent)->update_space_ce(ce_size); + return true; + } else { + return false; + } +} + bool sch_subh::set_c_rnti(uint16_t crnti) { if (((sch_pdu*)parent)->has_space_ce(2)) { + *((uint16_t*) ce_payload) = crnti; lcid = C_RNTI; + uint8_t *ptr = ce_payload; + srslte_bit_pack(crnti, &ptr, 16); ((sch_pdu*)parent)->update_space_ce(2); return true; } else { @@ -286,7 +328,8 @@ bool sch_subh::set_c_rnti(uint16_t crnti) bool sch_subh::set_con_res_id(uint64_t con_res_id) { if (((sch_pdu*)parent)->has_space_ce(6)) { - *((uint64_t*) ce_payload) = con_res_id; + uint8_t *ptr = ce_payload; + srslte_bit_pack_l(con_res_id, &ptr, 48); lcid = CON_RES_ID; ((sch_pdu*)parent)->update_space_ce(6); return true; @@ -297,7 +340,9 @@ bool sch_subh::set_con_res_id(uint64_t con_res_id) bool sch_subh::set_phd(uint8_t phd) { if (((sch_pdu*)parent)->has_space_ce(1)) { - *((uint8_t*) ce_payload) = phd; + uint8_t *ptr = ce_payload; + srslte_bit_pack(0, &ptr, 2); + srslte_bit_pack(phd, &ptr, 6); lcid = PHD_REPORT; ((sch_pdu*)parent)->update_space_ce(1); return true; @@ -320,7 +365,9 @@ bool sch_subh::set_sdu(uint32_t lcid_, uint8_t* ptr, uint32_t nof_bytes_) bool sch_subh::set_ta_cmd(uint8_t ta_cmd) { if (((sch_pdu*)parent)->has_space_ce(1)) { - *((uint8_t*) ce_payload) = ta_cmd; + uint8_t *ptr = ce_payload; + srslte_bit_pack(0, &ptr, 2); + srslte_bit_pack(ta_cmd, &ptr, 6); lcid = TA_CMD; ((sch_pdu*)parent)->update_space_ce(1); return true; @@ -351,13 +398,13 @@ void sch_subh::write_subheader(uint8_t** ptr, bool is_last) } void sch_subh::write_payload(uint8_t** ptr) { + uint8_t *src; if (is_sdu()) { - memcpy(*ptr, sdu_payload_ptr, nof_bytes*8*sizeof(uint8_t)); + src = sdu_payload_ptr; } else { - for (int i=0;i 150000) { + return 63; + } else { + for (int i=0;i<61;i++) { + if (buffer_size > btable[i]) { + return 1+i; + } + } + return 62; + } +} } diff --git a/srsapps/ue/mac/src/proc_bsr.cc b/srsapps/ue/mac/src/proc_bsr.cc index 3583793b8..8d379d1f9 100644 --- a/srsapps/ue/mac/src/proc_bsr.cc +++ b/srsapps/ue/mac/src/proc_bsr.cc @@ -27,6 +27,8 @@ #include "srsapps/ue/mac/proc_bsr.h" #include "srsapps/ue/mac/mac_params.h" +#include "srsapps/ue/mac/mac.h" +#include "srsapps/ue/mac/mux.h" namespace srslte { namespace ue { @@ -34,31 +36,245 @@ namespace srslte { bsr_proc::bsr_proc() { initiated = false; + timer_periodic = false; + timer_retx = false; + for (int i=0;iget(i)->pending_data(); + if (pending_data > 0) { + lcg_with_data = group; + } + } + } + } + + if (pending_data) { + // If no data is available belonging to any of the logical channels belonging to any other LCG + for (uint32_t group=0;group<4 && trigger_bsr;group++) { + if (group != lcg_with_data) { + for (int i=0;iget(i)->pending_data() && priorities[i] > min_priority_group[group]) { + trigger_bsr=false; + } + } + } + } + } + } + + return trigger_bsr; +} +bool bsr_proc::check_all_channels() { + bool ret = false; + bzero(&pending_bsr, sizeof(bsr_t)); + for (int i=0;iNOF_UL_LCH;i++) { + uint32_t n = mac_io_h->get(i)->pending_data(); + pending_bsr.buff_size[lcg[i]] += n; + if (n > 0) { + ret = true; + } + } + return ret; +} + +void bsr_proc::get_pending_bsr_format(uint32_t nof_padding_bytes) { + uint32_t nof_lcg=0; + for (int i=0;i<4;i++) { + if (pending_bsr.buff_size[i] > 0) { + nof_lcg++; + } + } + if (triggered_bsr_type == PADDING) { + if (nof_padding_bytes < 4) { + // If space only for short + if (nof_lcg > 1) { + pending_bsr.format = TRUNC_BSR; + uint32_t max_prio_ch = find_max_priority_lcid(); + for (int i=0;i<4;i++) { + if (lcg[max_prio_ch] != i) { + pending_bsr.buff_size[i] = 0; + } + } + } else { + pending_bsr.format = SHORT_BSR; + } + } else { + // If space for long BSR + pending_bsr.format = LONG_BSR; + } + } else { + pending_bsr.format = SHORT_BSR; + if (nof_lcg > 1) { + pending_bsr.format = LONG_BSR; + } + } } + +// Checks if Regular BSR must be assembled, as defined in 5.4.5 +// Padding BSR is assembled when called by mux_unit when UL grant is received +// Periodic BSR is triggered by the expiration of the timers void bsr_proc::step(uint32_t tti) { if (!initiated) { return; } + + if (!timer_periodic) { + if (params_db->get_param(mac_params::BSR_TIMER_PERIODIC)) { + timer_periodic = true; + timers_db->get(mac::BSR_TIMER_PERIODIC)->set(this, params_db->get_param(mac_params::BSR_TIMER_PERIODIC)); + } + } + + if (!timer_retx) { + if (params_db->get_param(mac_params::BSR_TIMER_RETX)) { + timer_retx = true; + timers_db->get(mac::BSR_TIMER_RETX)->set(this, params_db->get_param(mac_params::BSR_TIMER_RETX)); + } + } + + // Check condition 1 in Sec 5.4.5 + if (triggered_bsr_type == NONE) { + if (check_highest_channel()) { + triggered_bsr_type = REGULAR; + } + } } - + +bool bsr_proc::need_to_send_bsr_on_ul_grant(uint32_t nof_grant_bytes, uint32_t nof_padding_bytes, bsr_t *bsr) +{ + bool ret = false; + + if (triggered_bsr_type == NONE) { + // If enough space for at least truncated BSR + if (nof_padding_bytes >= 2) { + // Check condition 2 in Sec 5.4.5 + if (check_all_channels()) { + triggered_bsr_type = PADDING; + } + } + } + if (triggered_bsr_type != NONE) { + // If no more data is pending and there is no space for MAC CE + uint32_t nof_pending_bytes = 0; + for (int i=0;i<4;i++) { + nof_pending_bytes += pending_bsr.buff_size[i]; + } + // Do not include BSR CE if the UL grant can accomodate all pending data but is not sufficient + // to additionally accomodate the BSR MAC CE plus its header + uint32_t bsr_sz_plus_header = 1 + pending_bsr.format == LONG_BSR?3:1; + if (nof_pending_bytes + bsr_sz_plus_header == nof_grant_bytes) { + // if nof_pending_bytes + bsr_sz_plus_header > nof_grant_bytes, BSR has higher priority than data + return false; + } + + get_pending_bsr_format(nof_padding_bytes); + + // Instruct MUX unit to generate MAC CE + ret = true; + memcpy(bsr, &pending_bsr, sizeof(bsr_t)); + if (timer_periodic && pending_bsr.format != TRUNC_BSR) { + timers_db->get(mac::BSR_TIMER_PERIODIC)->reset(); + timers_db->get(mac::BSR_TIMER_PERIODIC)->run(); + } + // Cancel all triggered BSR + triggered_bsr_type = NONE; + } + + // Restart or Start ReTX timer + if (timer_retx) { + timers_db->get(mac::BSR_TIMER_RETX)->reset(); + timers_db->get(mac::BSR_TIMER_RETX)->run(); + } + return ret; +} + +bool bsr_proc::need_to_send_sr() { + if (!sr_is_sent && triggered_bsr_type == REGULAR) { + sr_is_sent = true; + return true; + } + return false; +} + +void bsr_proc::setup_lcg(uint32_t lcid, uint32_t new_lcg) +{ + if (lcid < MAX_LCID && new_lcg < 4) { + lcg[lcid] = new_lcg; + } +} + +void bsr_proc::set_priority(uint32_t lcid, uint32_t priority) { + if (lcid < MAX_LCID) { + priorities[lcid] = priority; } } + +uint32_t bsr_proc::find_max_priority_lcid() { + uint32_t max_prio = 0, max_idx = 0; + for (int i=0;i max_prio) { + max_prio = priorities[i]; + max_idx = i; + } + } + return max_idx; +} + +} +} diff --git a/srsapps/ue/mac/test/CMakeLists.txt b/srsapps/ue/mac/test/CMakeLists.txt index 9b3c92b00..ec65de6fc 100644 --- a/srsapps/ue/mac/test/CMakeLists.txt +++ b/srsapps/ue/mac/test/CMakeLists.txt @@ -24,5 +24,5 @@ FIND_PACKAGE(openLTE) IF(UHD_FOUND AND OPENLTE_FOUND) INCLUDE_DIRECTORIES(${OPENLTE_INCLUDE_DIRS}) ADD_EXECUTABLE(mac_test mac_test.cc) - TARGET_LINK_LIBRARIES(mac_test srsapps_ue_mac srsapps_ue_phy srsapps_common srsapps_radio srslte ${OPENLTE_LIBRARIES} srslte_uhd) + TARGET_LINK_LIBRARIES(mac_test srsapps_ue_mac srsapps_ue_phy srsapps_radio srslte ${OPENLTE_LIBRARIES} srslte_uhd) ENDIF(UHD_FOUND AND OPENLTE_FOUND) diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h index 53174b1ba..1f769a0a6 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h @@ -63,12 +63,8 @@ typedef _Complex float cf_t; class phy { public: - phy() { - started = false; - is_sfn_synched = false; - cell_is_set = false; - phy_state = IDLE; - } + phy(); + void set(); bool init(radio *radio_handler, tti_sync *ttisync, log *log_h); bool init_agc(radio *radio_handler, tti_sync *ttisync, log *log_h); void stop(); @@ -134,7 +130,7 @@ private: srslte_cell_t cell; bool cell_is_set; bool is_sfn_synched; - bool started; + volatile bool started; srslte_ue_sync_t ue_sync; srslte_ue_mib_t ue_mib; diff --git a/srsapps/ue/phy/src/phy.cc b/srsapps/ue/phy/src/phy.cc index 6632684a2..237e53326 100644 --- a/srsapps/ue/phy/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -41,6 +41,14 @@ namespace srslte { namespace ue { +phy::phy() +{ + started = false; + is_sfn_synched = false; + cell_is_set = false; + phy_state = IDLE; +} + bool phy::init(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_, log *log_h) { return init_(radio_handler_, ttisync_, log_h, false); } diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index a300eb30d..9f919a4a3 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -643,14 +643,15 @@ void *plot_thread_run(void *arg) { tmp_plot[i] = -80; } } - for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) { - tmp_plot2[i] = 20 * log10f(cabsf(ue_dl.chest.pilot_estimates_average[0][i])); + for (i = 0; i < 4*12*ue_dl.cell.nof_prb; i++) { + tmp_plot2[i] = 20 * log10f(cabsf(ue_dl.ce[0][i])); if (isinf(tmp_plot2[i])) { tmp_plot2[i] = -80; } } - plot_real_setNewData(&pce, tmp_plot2, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0)); + plot_real_setNewData(&pce, tmp_plot2, 4*12*ue_dl.cell.nof_prb); + if (!prog_args.input_file_name) { int max = srslte_vec_max_fi(ue_sync.strack.pss.conv_output_avg, ue_sync.strack.pss.frame_size+ue_sync.strack.pss.fft_size-1); srslte_vec_sc_prod_fff(ue_sync.strack.pss.conv_output_avg, @@ -662,10 +663,10 @@ void *plot_thread_run(void *arg) { } #ifdef PLOT_CHEST_ARGUMENT - for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) { - tmp_plot2[i] = cargf(ue_dl.chest.pilot_estimates_average[0][i]); + for (i = 0; i < 2*12*ue_dl.cell.nof_prb; i++) { + tmp_plot2[i] = cargf(ue_dl.ce[0][i]); } - plot_real_setNewData(&pce_arg, tmp_plot2, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0)); + plot_real_setNewData(&pce_arg, tmp_plot2, 2*12*ue_dl.cell.nof_prb); #endif plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce); diff --git a/srslte/include/srslte/ch_estimation/chest_dl.h b/srslte/include/srslte/ch_estimation/chest_dl.h index 36e9ab789..d6b0a9158 100644 --- a/srslte/include/srslte/ch_estimation/chest_dl.h +++ b/srslte/include/srslte/ch_estimation/chest_dl.h @@ -50,8 +50,8 @@ #include "srslte/ch_estimation/refsignal_dl.h" #include "srslte/common/phy_common.h" -#define SRSLTE_CHEST_MAX_FILTER_FREQ_LEN 10 -#define SRSLTE_CHEST_MAX_FILTER_TIME_LEN 4 +#define SRSLTE_CHEST_MAX_FILTER_FREQ_LEN 21 +#define SRSLTE_CHEST_MAX_FILTER_TIME_LEN 40 typedef struct { srslte_cell_t cell; diff --git a/srslte/include/srslte/utils/bit.h b/srslte/include/srslte/utils/bit.h index 713866b7e..78341da73 100644 --- a/srslte/include/srslte/utils/bit.h +++ b/srslte/include/srslte/utils/bit.h @@ -52,6 +52,13 @@ SRSLTE_API void srslte_bit_unpack_vector(uint8_t *bits_packed, SRSLTE_API uint32_t srslte_bit_unpack(uint8_t **bits, int nof_bits); +SRSLTE_API uint64_t srslte_bit_unpack_l(uint8_t **bits, + int nof_bits); + +SRSLTE_API void srslte_bit_pack_l(uint64_t value, + uint8_t **bits, + int nof_bits); + SRSLTE_API void srslte_bit_pack(uint32_t value, uint8_t **bits, int nof_bits); diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/src/chest_dl.c index 9781ff334..bc0fe130f 100644 --- a/srslte/lib/ch_estimation/src/chest_dl.c +++ b/srslte/lib/ch_estimation/src/chest_dl.c @@ -40,11 +40,32 @@ #include "srslte/utils/vector.h" #include "srslte/utils/convolution.h" -#define CHEST_RS_AVERAGE_TIME 2 -#define CHEST_RS_AVERAGE_FREQ 3 - #define NOISE_POWER_METHOD 1 // 0: Difference between noisy received and noiseless; 1: power of empty subcarriers +#define DEFAULT_FILTER_FREQ_LEN 11 // Must be odd +#define DEFAULT_FILTER_TIME_LEN 3 + +static void init_default_filters(srslte_chest_dl_t *q) { + + float f[DEFAULT_FILTER_FREQ_LEN]; + float t[DEFAULT_FILTER_TIME_LEN]; + + for (int i=0;itmp_freqavg = srslte_vec_malloc(sizeof(cf_t) * SRSLTE_REFSIGNAL_MAX_NUM_SF(cell.nof_prb)); + q->tmp_freqavg = srslte_vec_malloc(sizeof(cf_t) * SRSLTE_SF_LEN_RE(cell.nof_prb, cell.cp)); if (!q->tmp_freqavg) { perror("malloc"); goto clean_exit; } - q->tmp_noise = srslte_vec_malloc(sizeof(cf_t) * 2 * SRSLTE_REFSIGNAL_MAX_NUM_SF(cell.nof_prb)); + q->tmp_noise = srslte_vec_malloc(sizeof(cf_t) * SRSLTE_SF_LEN_RE(cell.nof_prb, cell.cp)); if (!q->tmp_noise) { perror("malloc"); goto clean_exit; } - for (int i=0;itmp_timeavg[i] = srslte_vec_malloc(sizeof(cf_t) * 2*cell.nof_prb); - if (!q->tmp_timeavg[i]) { - perror("malloc"); - goto clean_exit; - } - bzero(q->tmp_timeavg[i], sizeof(cf_t) * 2*cell.nof_prb); - } - q->tmp_timeavg_mult = srslte_vec_malloc(sizeof(cf_t) * 2*cell.nof_prb); + q->tmp_timeavg_mult = srslte_vec_malloc(sizeof(cf_t) * 12*cell.nof_prb); if (!q->tmp_timeavg_mult) { perror("malloc"); goto clean_exit; } for (int i=0;ipilot_estimates[i] = srslte_vec_malloc(sizeof(cf_t) * SRSLTE_REFSIGNAL_NUM_SF(cell.nof_prb, i)); + q->pilot_estimates[i] = srslte_vec_malloc(2*sizeof(cf_t) * SRSLTE_REFSIGNAL_NUM_SF(cell.nof_prb, i)); if (!q->pilot_estimates[i]) { perror("malloc"); goto clean_exit; } - // FIXME: There's an invalid read during rsrp estimation for this buffer - q->pilot_estimates_average[i] = srslte_vec_malloc(2 * sizeof(cf_t) * SRSLTE_REFSIGNAL_NUM_SF(cell.nof_prb, i)); - if (!q->pilot_estimates_average[i]) { - perror("malloc"); - goto clean_exit; - } q->pilot_recv_signal[i] = srslte_vec_malloc(sizeof(cf_t) * SRSLTE_REFSIGNAL_NUM_SF(cell.nof_prb, i)); if (!q->pilot_recv_signal[i]) { perror("malloc"); @@ -122,15 +129,7 @@ int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell) goto clean_exit; } - /* Set default time/freq filters */ - //float f[3]={0.2, 0.6, 0.2}; - //srslte_chest_dl_set_filter_freq(q, f, 3); - - float f[9]={0.025, 0.075, 0.05, 0.15, 0.4, 0.15, 0.05, 0.075, 0.025}; - srslte_chest_dl_set_filter_freq(q, f, 9); - - //srslte_chest_dl_set_filter_time_ema(q, 0.8); - + init_default_filters(q); q->cell = cell; } @@ -153,11 +152,6 @@ void srslte_chest_dl_free(srslte_chest_dl_t *q) if (q->tmp_noise) { free(q->tmp_noise); } - for (int i=0;itmp_timeavg[i]) { - free(q->tmp_timeavg[i]); - } - } if (q->tmp_timeavg_mult) { free(q->tmp_timeavg_mult); } @@ -168,9 +162,6 @@ void srslte_chest_dl_free(srslte_chest_dl_t *q) if (q->pilot_estimates[i]) { free(q->pilot_estimates[i]); } - if (q->pilot_estimates_average[i]) { - free(q->pilot_estimates_average[i]); - } if (q->pilot_recv_signal[i]) { free(q->pilot_recv_signal[i]); } @@ -209,14 +200,11 @@ int srslte_chest_dl_set_filter_time(srslte_chest_dl_t *q, float *filter, uint32_ #if NOISE_POWER_METHOD==0 - /* Uses the difference between the averaged and non-averaged pilot estimates */ -static float estimate_noise_port(srslte_chest_dl_t *q, uint32_t port_id, cf_t *avg_pilots) { +static float estimate_noise_port(srslte_chest_dl_t *q, cf_t *average, cf_t *ce, uint32_t len) { /* Use difference between averaged and noisy LS pilot estimates */ - srslte_vec_sub_ccc(avg_pilots, q->pilot_estimates[port_id], - q->tmp_noise, SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, port_id)); - - return srslte_vec_avg_power_cf(q->tmp_noise, SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, port_id)); + srslte_vec_sub_ccc(average, ce, q->tmp_noise, len); + return srslte_vec_avg_power_cf(q->tmp_noise, len); } #endif @@ -236,97 +224,52 @@ static float estimate_noise_port(srslte_chest_dl_t *q, cf_t *input) { } #endif -#define pilot_est(idx) q->pilot_estimates[port_id][SRSLTE_REFSIGNAL_PILOT_IDX(idx,l,q->cell)] -#define pilot_avg(idx) q->pilot_estimates_average[port_id][SRSLTE_REFSIGNAL_PILOT_IDX(idx,l,q->cell)] -#define pilot_tmp(idx) q->tmp_freqavg[SRSLTE_REFSIGNAL_PILOT_IDX(idx,l,q->cell)] -static void average_pilots(srslte_chest_dl_t *q, uint32_t port_id) +static void average_estimates(srslte_chest_dl_t *q, cf_t *ce, uint32_t port_id) { - int nref=2*q->cell.nof_prb; + int nref=12*q->cell.nof_prb; uint32_t l, i; /* For each symbol with pilots in a slot */ - for (l=0;lcell.cp);l++) { if (q->filter_freq_len > 0) { /* Filter pilot estimates in frequency */ - srslte_conv_same_cf(&pilot_est(0), q->filter_freq, &pilot_tmp(0), nref, q->filter_freq_len); - - /* Adjust extremes using linear interpolation */ - - pilot_tmp(0) += srslte_interp_linear_onesample(pilot_est(1), pilot_est(0)) - * q->filter_freq[q->filter_freq_len/2-1]*1.2; - pilot_tmp(nref-1) += srslte_interp_linear_onesample(pilot_est(nref-2), pilot_est(nref-1)) - * q->filter_freq[q->filter_freq_len/2+1]*1.2; + srslte_conv_same_cf(&ce[l*12*q->cell.nof_prb], q->filter_freq, &q->tmp_freqavg[l*12*q->cell.nof_prb], nref, q->filter_freq_len); } else { - memcpy(&pilot_tmp(0), &pilot_est(0), nref * sizeof(cf_t)); + memcpy(&q->tmp_freqavg[l*12*q->cell.nof_prb], &ce[l*12*q->cell.nof_prb], nref * sizeof(cf_t)); } } #if NOISE_POWER_METHOD==0 - q->noise_estimate[port_id] = estimate_noise_port(q, port_id, q->tmp_freqavg); + q->noise_estimate[port_id] = estimate_noise_port(q, q->tmp_freqavg, ce, + SRSLTE_SF_LEN_RE(q->cell.nof_prb, q->cell.cp)); #endif - -//#define EMA_VEC - - /* Filter with Exponential moving average (IIR) */ - if (q->filter_time_ema > 0) { -#ifdef EMA_VEC - srslte_vec_ema_filter(&q->tmp_freqavg[0], - &q->pilot_estimates_average[port_id][2*q->cell.nof_prb*srslte_refsignal_cs_nof_symbols(port_id)], - &q->pilot_estimates_average[port_id][0], - q->filter_time_ema, - nref); - for (l=1;ltmp_freqavg[2*q->cell.nof_prb*l], - &q->pilot_estimates_average[port_id][2*q->cell.nof_prb*(l-1)], - &q->pilot_estimates_average[port_id][2*q->cell.nof_prb*l], - q->filter_time_ema, - nref); - } -#else - for (i=0;ipilot_estimates_average[port_id][ - SRSLTE_REFSIGNAL_PILOT_IDX(i,srslte_refsignal_cs_nof_symbols(port_id),q->cell)], q->filter_time_ema); - for (l=1;lpilot_estimates_average[port_id][SRSLTE_REFSIGNAL_PILOT_IDX(i,l-1,q->cell)], q->filter_time_ema); - } - } -#endif - - } else { - /* Filter with FIR or don't filter */ - for (l=0;lfilter_time_len > 0) { - /* Move last symbols */ - for (i=0;ifilter_time_len-1;i++) { - memcpy(q->tmp_timeavg[i], q->tmp_timeavg[i+1], nref*sizeof(cf_t)); - } - /* Save last symbol to buffer */ - memcpy(q->tmp_timeavg[q->filter_time_len-1], &pilot_tmp(0), nref*sizeof(cf_t)); - - /* Multiply all symbols by filter and add them */ - if (l > 0) { - bzero(&pilot_avg(0), nref * sizeof(cf_t)); - for (i=0;ifilter_time_len;i++) { - srslte_vec_sc_prod_cfc(q->tmp_timeavg[i], q->filter_time[i], q->tmp_timeavg_mult, nref); - srslte_vec_sum_ccc(q->tmp_timeavg_mult, &pilot_avg(0), &pilot_avg(0), nref); - } + /* Filter with FIR or don't filter */ + for (l=0;lcell.cp);l++) { + /* Filter in time domain. */ + if (q->filter_time_len > 0) { + /* Multiply symbols by filter and add them */ + bzero(&ce[l*12*q->cell.nof_prb], nref * sizeof(cf_t)); + for (i=0;ifilter_time_len;i++) { + if (l+i-q->filter_time_len/2 < SRSLTE_CP_NSYMB(q->cell.cp) && l+i-q->filter_time_len/2 > 0) { + srslte_vec_sc_prod_cfc(&q->tmp_freqavg[(l+i-q->filter_time_len/2)*12*q->cell.nof_prb], q->filter_time[i], q->tmp_timeavg_mult, nref); + srslte_vec_sum_ccc(q->tmp_timeavg_mult, &ce[l*12*q->cell.nof_prb], &ce[l*12*q->cell.nof_prb], nref); } else { - memcpy(&pilot_avg(0), &pilot_tmp(0), nref * sizeof(cf_t)); + srslte_vec_sc_prod_cfc(&q->tmp_freqavg[l*12*q->cell.nof_prb], q->filter_time[i], q->tmp_timeavg_mult, nref); + srslte_vec_sum_ccc(q->tmp_timeavg_mult, &ce[l*12*q->cell.nof_prb], &ce[l*12*q->cell.nof_prb], nref); } - } else { - memcpy(&pilot_avg(0), &pilot_tmp(0), nref * sizeof(cf_t)); - } - } + } + } else { + memcpy(&ce[l*12*q->cell.nof_prb], &q->tmp_freqavg[l*12*q->cell.nof_prb], nref * sizeof(cf_t)); + } } } + #define cesymb(i) ce[SRSLTE_RE_IDX(q->cell.nof_prb,i,0)] -static void interpolate_pilots(srslte_chest_dl_t *q, cf_t *ce, uint32_t port_id) +static void interpolate_pilots(srslte_chest_dl_t *q, cf_t *pilot_estimates, cf_t *ce, uint32_t port_id) { /* interpolate the symbols with references in the freq domain */ uint32_t l; @@ -335,7 +278,7 @@ static void interpolate_pilots(srslte_chest_dl_t *q, cf_t *ce, uint32_t port_id) /* Interpolate in the frequency domain */ for (l=0;lcell, l, port_id, 0); - srslte_interp_linear_offset(&q->srslte_interp_lin, &pilot_avg(0), + srslte_interp_linear_offset(&q->srslte_interp_lin, &pilot_estimates[2*q->cell.nof_prb*l], &ce[srslte_refsignal_cs_nsymbol(l,q->cell.cp, port_id) * q->cell.nof_prb * SRSLTE_NRE], fidx_offset, SRSLTE_NRE/2-fidx_offset); } @@ -399,8 +342,13 @@ int srslte_chest_dl_estimate_port(srslte_chest_dl_t *q, cf_t *input, cf_t *ce, u srslte_vec_prod_conj_ccc(q->pilot_recv_signal[port_id], q->csr_signal.pilots[port_id/2][sf_idx], q->pilot_estimates[port_id], SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, port_id)); - /* Average pilot estimates */ - average_pilots(q, port_id); + if (ce != NULL) { + /* Interpolate to create channel estimates for all resource grid */ + interpolate_pilots(q, q->pilot_estimates[port_id], ce, port_id); + + /* Average channel estimates */ + average_estimates(q, ce, port_id); + } #if NOISE_POWER_METHOD==1 q->noise_estimate[port_id] = estimate_noise_port(q, input); @@ -413,11 +361,6 @@ int srslte_chest_dl_estimate_port(srslte_chest_dl_t *q, cf_t *input, cf_t *ce, u q->rssi[port_id] = srslte_chest_dl_rssi(q, input, port_id); } - /* Interpolate to create channel estimates for all resource grid */ - if (ce != NULL) { - interpolate_pilots(q, ce, port_id); - } - return 0; } diff --git a/srslte/lib/ch_estimation/test/chest_test_dl.c b/srslte/lib/ch_estimation/test/chest_test_dl.c index efbc6b213..71d10b739 100644 --- a/srslte/lib/ch_estimation/test/chest_test_dl.c +++ b/srslte/lib/ch_estimation/test/chest_test_dl.c @@ -201,7 +201,7 @@ int main(int argc, char **argv) { mse /= num_re; printf("MSE: %f\n", mse); - if (mse > 1.7) { + if (mse > 2.0) { goto do_exit; } diff --git a/srslte/lib/ch_estimation/test/chest_test_dl_mex.c b/srslte/lib/ch_estimation/test/chest_test_dl_mex.c index cfbed897c..7383359f2 100644 --- a/srslte/lib/ch_estimation/test/chest_test_dl_mex.c +++ b/srslte/lib/ch_estimation/test/chest_test_dl_mex.c @@ -72,11 +72,6 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) double *outr1=NULL, *outi1=NULL; double *outr2=NULL, *outi2=NULL; - if (nrhs < NOF_INPUTS) { - help(); - return; - } - if (!mxIsDouble(CELLID) && mxGetN(CELLID) != 1 && !mxIsDouble(PORTS) && mxGetN(PORTS) != 1 && mxGetM(CELLID) != 1) { @@ -117,34 +112,30 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) return; } sf_idx = (uint32_t) *((double*) mxGetPr(SFIDX)); - } else { - if (nrhs != NOF_INPUTS) { - help(); - return; - } - } - - uint32_t filter_len = 0; - float *filter; - double *f; + } - filter_len = mxGetNumberOfElements(FREQ_FILTER); - filter = malloc(sizeof(float) * filter_len); - f = (double*) mxGetPr(FREQ_FILTER); - for (i=0;i 5) { + uint32_t filter_len = 0; + float *filter; + double *f; + + filter_len = mxGetNumberOfElements(FREQ_FILTER); + filter = malloc(sizeof(float) * filter_len); + f = (double*) mxGetPr(FREQ_FILTER); + for (i=0;i> (nof_bits-i-1)) & 0x1; + } + *bits += nof_bits; +} + void srslte_bit_pack(uint32_t value, uint8_t **bits, int nof_bits) { int i; @@ -77,6 +87,18 @@ uint32_t srslte_bit_unpack(uint8_t **bits, int nof_bits) return value; } +uint64_t srslte_bit_unpack_l(uint8_t **bits, int nof_bits) +{ + int i; + uint64_t value=0; + + for(i=0; i=M-1) { + last[i] = (2+i-M/2)*input[N-1]-(1+i-M/2)*input[N-2]; + } else { + last[i] = input[N-M+i+1]; + } + } + + for (i=0;i