NR specific mac_rlc_data_req function

This commit is contained in:
francescomani
2025-04-01 11:46:58 +02:00
parent 4321a2710a
commit 5a1d7a75dc
7 changed files with 41 additions and 68 deletions
+7 -12
View File
@@ -37,7 +37,7 @@
#include "NR_MAC_COMMON/nr_mac.h"
#include "LAYER2/NR_MAC_UE/mac_proto.h"
#include <executables/softmodem-common.h>
#include "openair2/LAYER2/RLC/rlc.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
int16_t get_prach_tx_power(NR_UE_MAC_INST_t *mac)
{
@@ -1105,17 +1105,12 @@ static uint8_t *fill_msg3_pdu_from_rlc(NR_UE_MAC_INST_t *mac, uint8_t *pdu, int
// regular Msg3/MsgA_PUSCH with PDU coming from higher layers
*(NR_MAC_SUBHEADER_FIXED *)pdu = (NR_MAC_SUBHEADER_FIXED){.LCID = UL_SCH_LCID_CCCH_48_BITS};
pdu += sizeof(NR_MAC_SUBHEADER_FIXED);
tbs_size_t len = mac_rlc_data_req(mac->ue_id,
mac->ue_id,
0,
0,
ENB_FLAG_NO,
MBMS_FLAG_NO,
0, // SRB0 for messages sent in MSG3
TBS_max - sizeof(NR_MAC_SUBHEADER_FIXED), /* size of mac_ce above */
(char *)pdu,
0,
0);
tbs_size_t len = nr_mac_rlc_data_req(mac->ue_id,
mac->ue_id,
false,
0, // SRB0 for messages sent in MSG3
TBS_max - sizeof(NR_MAC_SUBHEADER_FIXED), /* size of mac_ce above */
(char *)pdu);
AssertFatal(len > 0, "no data for Msg3/MsgA_PUSCH\n");
// UE Contention Resolution Identity
// Store the first 48 bits belonging to the uplink CCCH SDU within Msg3 to determine whether or not the
+7 -11
View File
@@ -48,6 +48,7 @@
#include <executables/softmodem-common.h>
#include "LAYER2/RLC/rlc.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "RRC/NR_UE/L2_interface_ue.h"
//#define SRS_DEBUG
@@ -2589,17 +2590,12 @@ static bool fill_mac_sdu(NR_UE_MAC_INST_t *mac,
&target);
header_sz = bytes_requested < 256 ? sizeof(NR_MAC_SUBHEADER_SHORT) : sizeof(NR_MAC_SUBHEADER_LONG);
uint16_t sdu_length = mac_rlc_data_req(mac->ue_id,
mac->ue_id,
gNB_index,
frame,
ENB_FLAG_NO,
MBMS_FLAG_NO,
lcid,
bytes_requested,
(char *)mac_ce_p->cur_ptr + header_sz,
0,
0);
uint16_t sdu_length = nr_mac_rlc_data_req(mac->ue_id,
mac->ue_id,
false,
lcid,
bytes_requested,
(char *)mac_ce_p->cur_ptr + header_sz);
AssertFatal(bytes_requested >= sdu_length,
"LCID = 0x%02x RLC has segmented %d bytes but MAC has max %li remaining bytes\n",
@@ -35,17 +35,12 @@ void nr_mac_rrc_ra_ind(const module_id_t mod_id, bool success)
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti, bool prepare_payload)
{
}
tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
const rnti_t rntiP,
const eNB_index_t eNB_index,
const frame_t frameP,
const eNB_flag_t enb_flagP,
const MBMS_flag_t MBMS_flagP,
const logical_chan_id_t channel_idP,
const tb_size_t tb_sizeP,
char *buffer_pP,
const uint32_t sourceL2Id,
const uint32_t destinationL2Id)
tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP,
const uint16_t ue_id,
const bool gnb_flagP,
const logical_chan_id_t channel_idP,
const tb_size_t tb_sizeP,
char *buffer_pP)
{
return 0;
}
+1 -11
View File
@@ -2051,17 +2051,7 @@ static void nr_generate_Msg4_MsgB(module_id_t module_idP,
uint8_t buffer[CCCH_SDU_SIZE];
uint8_t mac_subheader_len = sizeof(NR_MAC_SUBHEADER_SHORT);
// Get RLC data on the SRB (RRCSetup, RRCReestablishment)
mac_sdu_length = mac_rlc_data_req(module_idP,
ra->rnti,
module_idP,
frameP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
CCCH_SDU_SIZE,
(char *)buffer,
0,
0);
mac_sdu_length = nr_mac_rlc_data_req(module_idP, ra->rnti, true, lcid, CCCH_SDU_SIZE, (char *)buffer);
if (mac_sdu_length < 256) {
((NR_MAC_SUBHEADER_SHORT *)&buf[mac_pdu_length])->R = 0;
@@ -34,6 +34,7 @@
#include "NR_MAC_COMMON/nr_mac.h"
#include "NR_MAC_gNB/nr_mac_gNB.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "LAYER2/RLC/rlc.h"
/*TAG*/
@@ -1300,17 +1301,12 @@ void nr_schedule_ue_spec(module_id_t module_id,
* such that TBS is full */
const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer,
bufEnd-buf-sizeof(NR_MAC_SUBHEADER_LONG));
tbs_size_t len = mac_rlc_data_req(module_id,
rnti,
module_id,
frame,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
ndata,
(char *)buf+sizeof(NR_MAC_SUBHEADER_LONG),
0,
0);
tbs_size_t len = nr_mac_rlc_data_req(module_id,
rnti,
true,
lcid,
ndata,
(char *)buf+sizeof(NR_MAC_SUBHEADER_LONG));
LOG_D(NR_MAC,
"%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %ld)\n",
frame,
+7 -12
View File
@@ -192,17 +192,12 @@ void nr_mac_rlc_data_ind(const module_id_t module_idP,
nr_rlc_manager_unlock(nr_rlc_ue_manager);
}
tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
const uint16_t ue_id,
const eNB_index_t eNB_index,
const frame_t frameP,
const eNB_flag_t enb_flagP,
const MBMS_flag_t MBMS_flagP,
const logical_chan_id_t channel_idP,
const tb_size_t tb_sizeP,
char *buffer_pP,
const uint32_t sourceL2Id,
const uint32_t destinationL2Id)
tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP,
const uint16_t ue_id,
const bool gnb_flagP,
const logical_chan_id_t channel_idP,
const tb_size_t tb_sizeP,
char *buffer_pP)
{
int ret;
int maxsize;
@@ -223,7 +218,7 @@ tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
nr_rlc_manager_unlock(nr_rlc_ue_manager);
if (enb_flagP)
if (gnb_flagP)
T(T_ENB_RLC_MAC_DL, T_INT(module_idP), T_INT(ue_id),
T_INT(channel_idP), T_INT(ret));
+6
View File
@@ -47,6 +47,12 @@ void nr_mac_rlc_data_ind(const module_id_t module_idP,
const logical_chan_id_t channel_idP,
char *buffer_pP,
const tb_size_t tb_sizeP);
tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP,
const uint16_t ue_id,
const bool gnb_flagP,
const logical_chan_id_t channel_idP,
const tb_size_t tb_sizeP,
char *buffer_pP);
void nr_rlc_add_srb(int ue_id, int srb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
void nr_rlc_add_drb(int ue_id, int drb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);