Skip to content

Commit

Permalink
Merge branch 'next' into agpl_next
Browse files Browse the repository at this point in the history
  • Loading branch information
srs-codebot committed Apr 29, 2022
2 parents dd59dfa + ec4914b commit 9211ad7
Show file tree
Hide file tree
Showing 49 changed files with 247 additions and 155 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ jobs:
sudo apt update
sudo apt install -y build-essential cmake libfftw3-dev libmbedtls-dev libpcsclite-dev libboost-program-options-dev libconfig++-dev libsctp-dev colordiff ninja-build valgrind
mkdir build && cd build && cmake -DRF_FOUND=True -GNinja .. && ninja && ctest
x86_ubuntu16_build:
name: Build and test on x86 Ubuntu 16.04
strategy:
matrix:
compiler: [gcc, clang]
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- name: Build srsRAN on x86 Ubuntu 16.04
run: |
sudo apt update
sudo apt install -y build-essential cmake libfftw3-dev libmbedtls-dev libpcsclite-dev libboost-program-options-dev libconfig++-dev libsctp-dev colordiff ninja-build valgrind
mkdir build && cd build && cmake -DRF_FOUND=True -GNinja .. && ninja && ctest
aarch64_ubuntu18_build:
runs-on: ubuntu-18.04
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change Log for Releases
=======================

## 22.04
* Added baseline 5G-SA support to srsUE and srsENB
* Added dynamic loading of RF libraries
* Added RRC Redirect to srsUE
* Added support for A5 measurement events to srsENB
* Added Crest Factor Reduction (CFR) for srsENB downlink and srsUE uplink (4G only)
* Raise C++ standard to C++14
* Other bug-fixes and improved stability and performance in all parts

## 21.10
* Add initial 5G NSA support to srsENB (tested with OnePlus 5G Nord)
* Improved interoperability of srsUE in NSA mode
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Files: *
Copyright: 2013-2021, Software Radio Systems Limited.
Copyright: 2013-2022, Software Radio Systems Limited.
License:


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ srsRAN is a 4G/5G software radio suite developed by [SRS](http://www.srs.io).
See the [srsRAN project pages](https://www.srsran.com) for information, guides and project news.

The srsRAN suite includes:
* srsUE - a full-stack SDR 4G/5G-NSA UE application (5G-SA coming soon)
* srsENB - a full-stack SDR 4G/5G-NSA eNodeB application (5G-SA coming soon)
* srsUE - a full-stack SDR 4G/5G UE application
* srsENB - a full-stack SDR 4G/5G e(g)NodeB application
* srsEPC - a light-weight 4G core network implementation with MME, HSS and S/P-GW

For application features, build instructions and user guides see the [srsRAN documentation](https://docs.srsran.com).
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/SRSRANVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# and at http://www.gnu.org/licenses/.
#

SET(SRSRAN_VERSION_MAJOR 21)
SET(SRSRAN_VERSION_MINOR 10)
SET(SRSRAN_VERSION_MAJOR 22)
SET(SRSRAN_VERSION_MINOR 04)
SET(SRSRAN_VERSION_PATCH 0)
SET(SRSRAN_VERSION_STRING "${SRSRAN_VERSION_MAJOR}.${SRSRAN_VERSION_MINOR}.${SRSRAN_VERSION_PATCH}")
SET(SRSRAN_SOVERSION 0)
2 changes: 2 additions & 0 deletions lib/include/srsran/asn1/liblte_mme.h
Original file line number Diff line number Diff line change
Expand Up @@ -3649,6 +3649,8 @@ typedef struct {
// Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_request_msg(
LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* deact_eps_bearer_context_req,
uint8 sec_hdr_type,
uint32 count,
LIBLTE_BYTE_MSG_STRUCT* msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_request_msg(
LIBLTE_BYTE_MSG_STRUCT* msg,
Expand Down
1 change: 0 additions & 1 deletion lib/include/srsran/asn1/nas_5g_ies.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ class eps_nas_message_container_t
class dnn_t
{
public:
uint32_t length;
std::vector<uint8_t> dnn_value;

SRSASN_CODE pack(asn1::bit_ref& bref);
Expand Down
2 changes: 1 addition & 1 deletion lib/include/srsran/interfaces/rrc_interface_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ inline uint16_t enum_to_number(const pmch_info_t::mch_sched_period_t& mch_period

struct mcch_msg_t {
uint32_t nof_common_sf_alloc = 0;
mbsfn_sf_cfg_t common_sf_alloc[8];
mbsfn_sf_cfg_t common_sf_alloc[8] = {};
enum class common_sf_alloc_period_t { rf4, rf8, rf16, rf32, rf64, rf128, rf256, nulltype } common_sf_alloc_period;
uint32_t nof_pmch_info;
pmch_info_t pmch_info_list[15];
Expand Down
6 changes: 3 additions & 3 deletions lib/include/srsran/mac/mac_sch_pdu_nr.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ class mac_sch_subpdu_nr
/// internal buffer, useful for storing very short SDUs.
class sdu_buffer
{
static const uint8_t mac_ce_payload_len = 8 + 1; // Long BSR has max. 9 octets (see sizeof_ce() too)
std::array<uint8_t, mac_ce_payload_len> ce_write_buffer; // Buffer for CE payload
uint8_t* sdu = nullptr;
static const uint8_t mac_ce_payload_len = 8 + 1; // Long BSR has max. 9 octets (see sizeof_ce() too)
std::array<uint8_t, mac_ce_payload_len> ce_write_buffer = {}; // Buffer for CE payload
uint8_t* sdu = nullptr;

public:
sdu_buffer() = default;
Expand Down
4 changes: 2 additions & 2 deletions lib/include/srsran/radio/radio_dummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ class radio_dummy : public srsran::radio_base, public srsran::radio_interface_ph
}

// Create receiver ring buffers
rx_ring_buffers.resize(args_.nof_carriers * args_.nof_antennas);
rx_ring_buffers.resize(args_.nof_carriers * (size_t)args_.nof_antennas);
for (auto& rb : rx_ring_buffers) {
if (srsran_ringbuffer_init(&rb, (int)sizeof(cf_t) * TEMP_BUFFER_SZ) != SRSRAN_SUCCESS) {
perror("init softbuffer");
}
}

// Create transmitter ring buffers
tx_ring_buffers.resize(args_.nof_carriers * args_.nof_antennas);
tx_ring_buffers.resize(args_.nof_carriers * (size_t)args_.nof_antennas);
for (auto& rb : tx_ring_buffers) {
if (srsran_ringbuffer_init(&rb, (int)sizeof(cf_t) * TEMP_BUFFER_SZ) != SRSRAN_SUCCESS) {
perror("init softbuffer");
Expand Down
2 changes: 1 addition & 1 deletion lib/include/srsran/rlc/rlc_am_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ class rlc_am : public rlc_common
virtual void get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue) = 0;
virtual void reestablish() = 0;
virtual void empty_queue() = 0;
virtual bool sdu_queue_is_full() = 0;
virtual bool has_data() = 0;
virtual void stop() = 0;

void set_bsr_callback(bsr_callback_t callback);

int write_sdu(unique_byte_buffer_t sdu);
bool sdu_queue_is_full();
virtual void discard_sdu(uint32_t pdcp_sn);
virtual uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) = 0;

Expand Down
1 change: 0 additions & 1 deletion lib/include/srsran/rlc/rlc_am_lte.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class rlc_am_lte_tx : public rlc_am::rlc_am_base_tx, timer_callback
void stop();

uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes);
bool sdu_queue_is_full();

bool has_data();
uint32_t get_buffer_state();
Expand Down
2 changes: 1 addition & 1 deletion lib/include/srsran/rlc/rlc_am_lte_packing.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct rlc_sn_info_t {
struct rlc_amd_rx_pdu {
rlc_amd_pdu_header_t header;
unique_byte_buffer_t buf;
uint32_t rlc_sn;
uint32_t rlc_sn = 0;

rlc_amd_rx_pdu() = default;
explicit rlc_amd_rx_pdu(uint32_t rlc_sn_) : rlc_sn(rlc_sn_) {}
Expand Down
1 change: 0 additions & 1 deletion lib/include/srsran/rlc/rlc_am_nr.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class rlc_am_nr_tx : public rlc_am::rlc_am_base_tx
uint32_t read_pdu(uint8_t* payload, uint32_t nof_bytes) final;
void handle_control_pdu(uint8_t* payload, uint32_t nof_bytes) final;

bool sdu_queue_is_full() final;
void reestablish() final;
void stop() final;

Expand Down
2 changes: 1 addition & 1 deletion lib/include/srsran/system/sys_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct sys_metrics_t {
float process_cpu_usage = 0.f;
float system_mem = 0.f;
uint32_t cpu_count = 0;
std::array<float, metrics_max_supported_cpu> cpu_load;
std::array<float, metrics_max_supported_cpu> cpu_load = {};
};

} // namespace srsran
Expand Down
15 changes: 15 additions & 0 deletions lib/src/asn1/liblte_mme.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9018,12 +9018,27 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_accept_msg(
*********************************************************************/
LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_request_msg(
LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* deact_eps_bearer_context_req,
uint8 sec_hdr_type,
uint32 count,
LIBLTE_BYTE_MSG_STRUCT* msg)
{
LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS;
uint8* msg_ptr = msg->msg;

if (deact_eps_bearer_context_req != NULL && msg != NULL) {
if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) {
// Protocol Discriminator and Security Header Type
*msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT);
msg_ptr++;

// MAC will be filled in later
msg_ptr += 4;

// Sequence Number
*msg_ptr = count & 0xFF;
msg_ptr++;
}

// Protocol Discriminator and EPS Bearer ID
*msg_ptr = (deact_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT);
msg_ptr++;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/asn1/rrc_nr_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ bool make_phy_pusch_scaling(const uci_on_pusch_s& uci_on_pusch, float* in_scalin
bool make_phy_zp_csi_rs_resource(const asn1::rrc_nr::zp_csi_rs_res_s& zp_csi_rs_res,
srsran_csi_rs_zp_resource_t* out_zp_csi_rs_resource)
{
srsran_csi_rs_zp_resource_t zp_csi_rs_resource;
srsran_csi_rs_zp_resource_t zp_csi_rs_resource = {};
zp_csi_rs_resource.id = zp_csi_rs_res.zp_csi_rs_res_id;
switch (zp_csi_rs_res.res_map.freq_domain_alloc.type()) {
case csi_rs_res_map_s::freq_domain_alloc_c_::types_opts::options::row1:
Expand Down Expand Up @@ -1321,7 +1321,7 @@ bool make_phy_zp_csi_rs_resource(const asn1::rrc_nr::zp_csi_rs_res_s& zp_csi_rs_
bool make_phy_nzp_csi_rs_resource(const asn1::rrc_nr::nzp_csi_rs_res_s& asn1_nzp_csi_rs_res,
srsran_csi_rs_nzp_resource_t* out_csi_rs_nzp_resource)
{
srsran_csi_rs_nzp_resource_t csi_rs_nzp_resource;
srsran_csi_rs_nzp_resource_t csi_rs_nzp_resource = {};
csi_rs_nzp_resource.id = asn1_nzp_csi_rs_res.nzp_csi_rs_res_id;
switch (asn1_nzp_csi_rs_res.res_map.freq_domain_alloc.type()) {
case csi_rs_res_map_s::freq_domain_alloc_c_::types_opts::options::row1:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/mac/mac_sch_pdu_nr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ mac_sch_subpdu_nr::lbsr_t mac_sch_subpdu_nr::get_lbsr() const

mac_sch_subpdu_nr::ue_con_res_id_t mac_sch_subpdu_nr::get_ue_con_res_id_ce()
{
mac_sch_subpdu_nr::ue_con_res_id_t id;
mac_sch_subpdu_nr::ue_con_res_id_t id = {};
if (!parent->is_ulsch() && lcid == CON_RES_ID) {
const uint8_t* ptr = sdu.ptr();
memcpy(id.data(), ptr, id.size());
Expand Down
2 changes: 1 addition & 1 deletion lib/src/phy/ch_estimation/dmrs_pdcch.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ int srsran_dmrs_pdcch_get_measure(const srsran_dmrs_pdcch_estimator_t* q,
// For each CORESET symbol
for (uint32_t l = 0; l < q->coreset.duration; l++) {
// Temporal least square estimates
cf_t tmp[DMRS_PDCCH_MAX_NOF_PILOTS_CANDIDATE];
cf_t tmp[DMRS_PDCCH_MAX_NOF_PILOTS_CANDIDATE] = {};
uint32_t nof_pilots = 0;

// For each RB in the CORESET
Expand Down
2 changes: 2 additions & 0 deletions lib/src/phy/ch_estimation/test/csi_rs_pattern_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static int test_row1()
}
m.nof_ports = 1;
m.first_symbol_idx = 0;
m.first_symbol_idx2 = 0;
m.cdm = srsran_csi_rs_cdm_nocdm;
m.density = srsran_csi_rs_resource_mapping_density_three;
m.freq_band.start_rb = carrier.start;
Expand Down Expand Up @@ -78,6 +79,7 @@ static int test_row2()
}
m.nof_ports = 1;
m.first_symbol_idx = 0;
m.first_symbol_idx2 = 0;
m.cdm = srsran_csi_rs_cdm_nocdm;
m.density = density;
m.freq_band.start_rb = carrier.start;
Expand Down
3 changes: 2 additions & 1 deletion lib/src/phy/phch/test/pmch_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ int main(int argc, char** argv)
srsran_chest_dl_res_t chest_dl_res;
srsran_pmch_t pmch;
srsran_pmch_cfg_t pmch_cfg;
srsran_ofdm_t ifft_mbsfn[SRSRAN_MAX_PORTS], fft_mbsfn[SRSRAN_MAX_PORTS];
srsran_ofdm_t ifft_mbsfn[SRSRAN_MAX_PORTS] = {};
srsran_ofdm_t fft_mbsfn[SRSRAN_MAX_PORTS] = {};

parse_args(argc, argv);
/* Initialise to zeros */
Expand Down
12 changes: 6 additions & 6 deletions lib/src/phy/phch/test/pusch_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ void parse_args(int argc, char** argv)
int main(int argc, char** argv)
{
srsran_random_t random_h = srsran_random_init(0);
srsran_chest_ul_res_t chest_res;
srsran_pusch_t pusch_tx;
srsran_pusch_t pusch_rx;
srsran_chest_ul_res_t chest_res = {};
srsran_pusch_t pusch_tx = {};
srsran_pusch_t pusch_rx = {};
uint8_t* data = NULL;
uint8_t* data_rx = NULL;
cf_t* sf_symbols = NULL;
int ret = -1;
struct timeval t[3];
srsran_pusch_cfg_t cfg;
srsran_softbuffer_tx_t softbuffer_tx;
srsran_softbuffer_rx_t softbuffer_rx;
srsran_pusch_cfg_t cfg = {};
srsran_softbuffer_tx_t softbuffer_tx = {};
srsran_softbuffer_rx_t softbuffer_rx = {};
srsran_crc_t crc_tb;

ZERO_OBJECT(uci_data_tx);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/phy/rf/rf_file_imp_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static int _rf_file_tx_baseband(rf_file_tx_t* q, cf_t* buffer, uint32_t nsamples
size_t ret = fwrite(buf, (size_t)sample_sz, (size_t)nsamples, q->file);
if (ret < (size_t)nsamples) {
rf_file_error(q->id,
"[file] Error: transmitter expected %d bytes and sent %d. %s.\n",
"[file] Error: transmitter expected %d bytes and sent %zd. %s.\n",
NSAMPLES2NBYTES(nsamples),
ret,
strerror(errno));
Expand Down
4 changes: 2 additions & 2 deletions lib/src/phy/ue/ue_dl_nbiot.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ void srsran_nbiot_ue_dl_decode_sib1(srsran_nbiot_ue_dl_t* q, uint32_t current_sf
// activate SIB1 grant and configure NPDSCH
INFO(
"%d.x: Activated SIB1 decoding in sfn=%d\n", current_sfn, srsran_nbiot_ue_dl_get_next_sib1_start(q, current_sfn));
srsran_ra_nbiot_dl_grant_t grant;
srsran_ra_nbiot_dl_grant_t grant = {};
srsran_nbiot_ue_dl_get_sib1_grant(q, current_sfn, &grant);
srsran_nbiot_ue_dl_set_grant(q, &grant);
}
Expand All @@ -419,7 +419,7 @@ void srsran_nbiot_ue_dl_decode_sib(srsran_nbiot_ue_dl_t* q,
if (type == SRSRAN_NBIOT_SI_TYPE_SIB2) {
assert(params.n == 1);
// calculate SIB2 params
srsran_ra_nbiot_dl_grant_t grant;
srsran_ra_nbiot_dl_grant_t grant = {};
srsran_nbiot_ue_dl_get_sib_grant(q, hfn, sfn, params, &grant);
srsran_nbiot_ue_dl_set_grant(q, &grant);
INFO("%d.x: Activated SIB2 reception in hfn=%d, sfn=%d",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/radio/radio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ bool radio::open_dev(const uint32_t &device_idx, FILE** rx_files, FILE** tx_file
{
srsran_rf_t* rf_device = &rf_devices[device_idx];

srsran::console("Opening %d channels in RF device abstraction\n");
srsran::console("Opening channels idx %d in RF device abstraction\n", device_idx);

if (srsran_rf_open_file(rf_device, rx_files, tx_files, nof_channels, base_srate)) {
logger.error("Error opening RF device abstraction");
Expand Down
5 changes: 5 additions & 0 deletions lib/src/rlc/rlc_am_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ void rlc_am::rlc_am_base_tx::discard_sdu(uint32_t discard_sn)
RlcInfo("%s PDU with PDCP_SN=%d", discarded ? "Discarding" : "Couldn't discard", discard_sn);
}

bool rlc_am::rlc_am_base_tx::sdu_queue_is_full()
{
return tx_sdu_queue.is_full();
}

void rlc_am::rlc_am_base_tx::set_bsr_callback(bsr_callback_t callback)
{
bsr_callback = callback;
Expand Down
5 changes: 0 additions & 5 deletions lib/src/rlc/rlc_am_lte.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,6 @@ void rlc_am_lte_tx::get_buffer_state_nolock(uint32_t& n_bytes_newtx, uint32_t& n
}
}

bool rlc_am_lte_tx::sdu_queue_is_full()
{
return tx_sdu_queue.is_full();
}

uint32_t rlc_am_lte_tx::read_pdu(uint8_t* payload, uint32_t nof_bytes)
{
std::lock_guard<std::mutex> lock(mutex);
Expand Down
Loading

0 comments on commit 9211ad7

Please sign in to comment.