diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index e9b050532..eaa0fdb2f 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -194,7 +194,7 @@ public: const static int MAX_FOUND_PLMNS = 16; - virtual void write_sdu(uint32_t lcid, srslte::byte_buffer_t *sdu) = 0; + virtual void write_sdu(srslte::byte_buffer_t *sdu) = 0; virtual uint16_t get_mcc() = 0; virtual uint16_t get_mnc() = 0; virtual void enable_capabilities() = 0; diff --git a/srsue/hdr/upper/rrc.h b/srsue/hdr/upper/rrc.h index 1b8f08e34..1a965c3cf 100644 --- a/srsue/hdr/upper/rrc.h +++ b/srsue/hdr/upper/rrc.h @@ -290,7 +290,7 @@ public: bool mbms_service_start(uint32_t serv, uint32_t port); // NAS interface - void write_sdu(uint32_t lcid, byte_buffer_t *sdu); + void write_sdu(byte_buffer_t *sdu); void enable_capabilities(); uint16_t get_mcc(); uint16_t get_mnc(); @@ -603,7 +603,7 @@ private: void send_con_restablish_request(LIBLTE_RRC_CON_REEST_REQ_CAUSE_ENUM cause); void send_con_restablish_complete(); void send_con_setup_complete(byte_buffer_t *nas_msg); - void send_ul_info_transfer(uint32_t lcid, byte_buffer_t *nas_msg); + void send_ul_info_transfer(byte_buffer_t *nas_msg); void send_security_mode_complete(); void send_rrc_con_reconfig_complete(); void send_rrc_ue_cap_info(); diff --git a/srsue/src/upper/nas.cc b/srsue/src/upper/nas.cc index 422b79743..f94951993 100644 --- a/srsue/src/upper/nas.cc +++ b/srsue/src/upper/nas.cc @@ -833,7 +833,7 @@ void nas::parse_attach_accept(uint32_t lcid, byte_buffer_t *pdu) { rrc->enable_capabilities(); nas_log->info("Sending Attach Complete\n"); - rrc->write_sdu(lcid, pdu); + rrc->write_sdu(pdu); ctxt.tx_count++; } else { nas_log->info("Not handling attach type %u\n", attach_accept.eps_attach_result); @@ -1045,7 +1045,7 @@ void nas::parse_security_mode_command(uint32_t lcid, byte_buffer_t *pdu) nas_log->info("Sending Security Mode Complete nas_current_ctxt.tx_count=%d, RB=%s\n", ctxt.tx_count, rrc->get_rb_name(lcid).c_str()); - rrc->write_sdu(lcid, pdu); + rrc->write_sdu(pdu); ctxt.tx_count++; } @@ -1306,7 +1306,7 @@ void nas::send_security_mode_reject(uint8_t cause) { pcap->write_nas(msg->msg, msg->N_bytes); } nas_log->info("Sending security mode reject\n"); - rrc->write_sdu(cfg.lcid, msg); + rrc->write_sdu(msg); } void nas::send_detach_request(bool switch_off) @@ -1371,7 +1371,7 @@ void nas::send_detach_request(bool switch_off) nas_log->info("Sending detach request\n"); if (rrc->is_connected()) { - rrc->write_sdu(cfg.lcid, pdu); + rrc->write_sdu(pdu); } else { rrc->connection_request(LIBLTE_RRC_CON_REQ_EST_CAUSE_MO_SIGNALLING, pdu); } @@ -1410,7 +1410,7 @@ void nas::send_detach_accept() } nas_log->info("Sending detach accept\n"); - rrc->write_sdu(cfg.lcid, pdu); + rrc->write_sdu(pdu); } @@ -1445,7 +1445,7 @@ void nas::send_authentication_response(const uint8_t* res, const size_t res_len, } nas_log->info("Sending Authentication Response\n"); - rrc->write_sdu(cfg.lcid, pdu); + rrc->write_sdu(pdu); } @@ -1471,7 +1471,7 @@ void nas::send_authentication_failure(const uint8_t cause, const uint8_t* auth_f pcap->write_nas(msg->msg, msg->N_bytes); } nas_log->info("Sending authentication failure.\n"); - rrc->write_sdu(cfg.lcid, msg); + rrc->write_sdu(msg); } @@ -1506,7 +1506,7 @@ void nas::send_identity_response(uint32_t lcid, uint8 id_type) pcap->write_nas(pdu->msg, pdu->N_bytes); } - rrc->write_sdu(lcid, pdu); + rrc->write_sdu(pdu); ctxt.tx_count++; } @@ -1542,7 +1542,7 @@ void nas::send_service_request() { } nas_log->info("Sending service request\n"); - rrc->write_sdu(cfg.lcid, msg); + rrc->write_sdu(msg); ctxt.tx_count++; } @@ -1675,7 +1675,7 @@ void nas::send_esm_information_response(const uint8 proc_transaction_id) { } nas_log->info_hex(pdu->msg, pdu->N_bytes, "Sending ESM information response\n"); - rrc->write_sdu(cfg.lcid, pdu); + rrc->write_sdu(pdu); ctxt.tx_count++; chap_id++; diff --git a/srsue/src/upper/rrc.cc b/srsue/src/upper/rrc.cc index 808ef8213..7a23f956a 100644 --- a/srsue/src/upper/rrc.cc +++ b/srsue/src/upper/rrc.cc @@ -1395,9 +1395,11 @@ void rrc::send_con_setup_complete(byte_buffer_t *nas_msg) { send_ul_dcch_msg(RB_ID_SRB1); } -void rrc::send_ul_info_transfer(uint32_t lcid, byte_buffer_t *nas_msg) { +void rrc::send_ul_info_transfer(byte_buffer_t *nas_msg) { bzero(&ul_dcch_msg, sizeof(LIBLTE_RRC_UL_DCCH_MSG_STRUCT)); + uint32_t lcid = rlc->has_bearer(RB_ID_SRB2) ? RB_ID_SRB2 : RB_ID_SRB1; + rrc_log->debug("%s Preparing UL Info Transfer\n", get_rb_name(lcid).c_str()); // Prepare RX INFO packet @@ -1408,7 +1410,7 @@ void rrc::send_ul_info_transfer(uint32_t lcid, byte_buffer_t *nas_msg) { pool->deallocate(nas_msg); - send_ul_dcch_msg(rlc->has_bearer(RB_ID_SRB2) ? RB_ID_SRB2 : RB_ID_SRB1); + send_ul_dcch_msg(lcid); } void rrc::send_security_mode_complete() { @@ -1929,14 +1931,14 @@ void rrc::send_ul_dcch_msg(uint32_t lcid) } } -void rrc::write_sdu(uint32_t lcid, byte_buffer_t *sdu) { +void rrc::write_sdu(byte_buffer_t *sdu) { if (state == RRC_STATE_IDLE) { rrc_log->warning("Received ULInformationTransfer SDU when in IDLE\n"); return; } - rrc_log->info_hex(sdu->msg, sdu->N_bytes, "TX %s SDU", get_rb_name(lcid).c_str()); - send_ul_info_transfer(lcid, sdu); + rrc_log->info_hex(sdu->msg, sdu->N_bytes, "TX SDU"); + send_ul_info_transfer(sdu); } void rrc::write_pdu(uint32_t lcid, byte_buffer_t *pdu) { diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index 73728e2c2..1089c83df 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -92,7 +92,7 @@ public: plmns.plmn_id.mnc = mnc; plmns.tac = 0xffff; } - void write_sdu(uint32_t lcid, byte_buffer_t *sdu) + void write_sdu(byte_buffer_t *sdu) { last_sdu_len = sdu->N_bytes; //printf("NAS generated SDU (len=%d):\n", sdu->N_bytes);