diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index 988a69fd7..48186756c 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -273,8 +273,17 @@ public: virtual void reset() = 0; /* Manages UE configuration context */ - virtual int ue_cfg(uint16_t rnti, sched_interface::ue_cfg_t* cfg) = 0; - virtual int ue_rem(uint16_t rnti) = 0; + virtual int ue_cfg(uint16_t rnti, sched_interface::ue_cfg_t* cfg) = 0; + virtual int ue_rem(uint16_t rnti) = 0; + + /** + * Called after Msg3 reception to set the UE C-RNTI, resolve contention, and alter the UE's configuration in the + * scheduler and phy. + * + * @param temp_crnti temporary C-RNTI of the UE + * @param crnti chosen C-RNTI for the UE + * @param cfg new UE scheduler configuration + */ virtual int ue_set_crnti(uint16_t temp_crnti, uint16_t crnti, sched_interface::ue_cfg_t* cfg) = 0; /* Manages UE bearers and associated configuration */ @@ -284,7 +293,10 @@ public: virtual void write_mcch(asn1::rrc::sib_type2_s* sib2, asn1::rrc::sib_type13_r9_s* sib13, asn1::rrc::mcch_msg_s* mcch) = 0; - /* Allocation of C-RNTI during HO */ + /** + * Allocate a C-RNTI for a new user, without adding it to the phy layer and scheduler yet + * @return value of the allocated C-RNTI + */ virtual uint16_t allocate_rnti() = 0; }; diff --git a/lib/include/srslte/interfaces/sched_interface.h b/lib/include/srslte/interfaces/sched_interface.h index 66b783fa6..ab05e5d25 100644 --- a/lib/include/srslte/interfaces/sched_interface.h +++ b/lib/include/srslte/interfaces/sched_interface.h @@ -254,9 +254,27 @@ public: virtual uint32_t get_dl_buffer(uint16_t rnti) = 0; /******************* Scheduling Interface ***********************/ - /* DL buffer status report */ + + /** + * Update the current RLC buffer state for a given user and bearer. + * + * @param rnti user rnti + * @param lc_id logical channel id for which the buffer update is concerned + * @param tx_queue number of pending bytes for new DL RLC transmissions + * @param retx_queue number of pending bytes concerning RLC retransmissions + * @return error code + */ virtual int dl_rlc_buffer_state(uint16_t rnti, uint32_t lc_id, uint32_t tx_queue, uint32_t retx_queue) = 0; - virtual int dl_mac_buffer_state(uint16_t rnti, uint32_t ce_code, uint32_t nof_cmds) = 0; + + /** + * Enqueue MAC CEs for DL transmission + * + * @param rnti user rnti + * @param ce_code lcid of the MAC CE + * @param nof_cmds how many repetitions of the same MAC CE should be scheduled + * @return error code + */ + virtual int dl_mac_buffer_state(uint16_t rnti, uint32_t ce_code, uint32_t nof_cmds) = 0; /* DL information */ virtual int dl_ack_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t tb_idx, bool ack) = 0; diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index bbc302f74..99e9e4fb8 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -1643,6 +1643,7 @@ void rrc::ue::send_connection_setup(bool is_setup) // Configure MAC if (is_setup) { + // In case of RRC Connection Setup message (Msg4), we need to resolve the contention by sending a ConRes CE parent->mac->ue_set_crnti(rnti, rnti, ¤t_sched_ue_cfg); } else { parent->mac->ue_cfg(rnti, ¤t_sched_ue_cfg);