Commit be9b84c0 authored by Robert Schmidt's avatar Robert Schmidt Committed by francescomani

Refactor interface SRB0: no gNB MAC

parent bba14188
......@@ -2908,10 +2908,10 @@ void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCom
}
}
void send_initial_ul_rrc_message(gNB_MAC_INST *mac, int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *rawUE)
void send_initial_ul_rrc_message(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data)
{
NR_UE_info_t *UE = (NR_UE_info_t *)rawUE;
gNB_MAC_INST *mac = RC.nrmac[0];
NR_UE_info_t *UE = (NR_UE_info_t *)data;
NR_SCHED_ENSURE_LOCKED(&mac->sched_lock);
uint8_t du2cu[1024];
......@@ -2945,7 +2945,7 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE)
process_CellGroup(cellGroupConfig, UE);
/* activate SRB0 */
nr_rlc_activate_srb0(UE->rnti, mac, UE, send_initial_ul_rrc_message);
nr_rlc_activate_srb0(UE->rnti, UE, send_initial_ul_rrc_message);
/* the cellGroup sent to CU specifies there is SRB1, so create it */
DevAssert(cellGroupConfig->rlc_BearerToAddModList->list.count == 1);
......
......@@ -435,7 +435,7 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_info_t *UE);
void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE);
void send_initial_ul_rrc_message(gNB_MAC_INST *mac, int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *rawUE);
void send_initial_ul_rrc_message(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data);
void abort_nr_dl_harq(NR_UE_info_t* UE, int8_t harq_pid);
......
......@@ -963,31 +963,27 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
}
struct srb0_data {
struct gNB_MAC_INST_s *mac;
int rnti;
void *rawUE;
void (*send_initial_ul_rrc_message)(struct gNB_MAC_INST_s *mac,
int rnti,
void *data;
void (*send_initial_ul_rrc_message)(int rnti,
const uint8_t *sdu,
sdu_size_t sdu_len,
void *rawUE);
void *data);
};
void deliver_sdu_srb0(void *deliver_sdu_data, struct nr_rlc_entity_t *entity,
char *buf, int size)
{
struct srb0_data *s0 = (struct srb0_data *)deliver_sdu_data;
s0->send_initial_ul_rrc_message(s0->mac, s0->rnti, (unsigned char *)buf,
size, s0->rawUE);
s0->send_initial_ul_rrc_message(s0->rnti, (unsigned char *)buf, size, s0->data);
}
void nr_rlc_activate_srb0(int rnti, struct gNB_MAC_INST_s *mac, void *rawUE,
void nr_rlc_activate_srb0(int rnti, void *data,
void (*send_initial_ul_rrc_message)(
struct gNB_MAC_INST_s *mac,
int rnti,
const uint8_t *sdu,
sdu_size_t sdu_len,
void *rawUE))
void *data))
{
nr_rlc_entity_t *nr_rlc_tm;
nr_rlc_ue_t *ue;
......@@ -996,9 +992,8 @@ void nr_rlc_activate_srb0(int rnti, struct gNB_MAC_INST_s *mac, void *rawUE,
srb0_data = calloc(1, sizeof(struct srb0_data));
AssertFatal(srb0_data != NULL, "out of memory\n");
srb0_data->mac = mac;
srb0_data->rnti = rnti;
srb0_data->rawUE = rawUE;
srb0_data->data = data;
srb0_data->send_initial_ul_rrc_message = send_initial_ul_rrc_message;
nr_rlc_manager_lock(nr_rlc_ue_manager);
......
......@@ -66,13 +66,11 @@ void nr_rlc_activate_avg_time_to_tx(
void nr_rlc_srb_recv_sdu(const int rnti, const logical_chan_id_t channel_id, unsigned char *buf, int size);
struct gNB_MAC_INST_s;
void nr_rlc_activate_srb0(int rnti, struct gNB_MAC_INST_s *mac, void *rawUE,
void nr_rlc_activate_srb0(int rnti, void *data,
void (*send_initial_ul_rrc_message)(
struct gNB_MAC_INST_s *mac,
int rnti,
const uint8_t *sdu,
sdu_size_t sdu_len,
void *rawUE));
void *data));
bool nr_rlc_get_statistics(int rnti, int srb_flag, int rb_id, nr_rlc_statistics_t *out);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment