Commit 270c540c authored by luis_pereira87's avatar luis_pereira87

Minor clean up in function mac_rrc_nr_data_req

parent 3c4ba502
......@@ -253,44 +253,41 @@ uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
buffer_pP[2]);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
return (3);
return 3;
}
// TODO BCCH SIB1 SIBs
if ((Srb_id & RAB_OFFSET ) == BCCH) {
memcpy(&buffer_pP[0],
RC.nrrrc[Mod_idP]->carrier.SIB1,
RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1);
if ((Srb_id & RAB_OFFSET) == BCCH) {
memcpy(&buffer_pP[0], RC.nrrrc[Mod_idP]->carrier.SIB1, RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1);
return RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1;
}
// CCCH
if( (Srb_id & RAB_OFFSET ) == CCCH) {
if ((Srb_id & RAB_OFFSET) == CCCH) {
LOG_D(NR_RRC,"[gNB %d] Frame %d CCCH request (Srb_id %ld)\n", Mod_idP, frameP, Srb_id);
char *payload_pP;
uint16_t Sdu_size = 0;
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[Mod_idP], rnti);
LOG_D(NR_RRC,"[gNB %d] Frame %d CCCH request (Srb_id %ld)\n", Mod_idP, frameP, Srb_id);
if (ue_context_p == NULL) {
LOG_E(NR_RRC,"[gNB %d] Frame %d CCCH request but no ue_context\n", Mod_idP, frameP);
return 0;
}
AssertFatal(ue_context_p!=NULL,"failed to get ue_context, rnti %x\n",rnti);
uint16_t payload_size = ue_context_p->ue_context.Srb0.Tx_buffer.payload_size;
// check if data is there for MAC
if (payload_size > 0) {
payload_pP = ue_context_p->ue_context.Srb0.Tx_buffer.Payload;
LOG_D(NR_RRC,"[gNB %d] CCCH has %d bytes (dest: %p, src %p)\n", Mod_idP, payload_size, buffer_pP, payload_pP);
// Fill buffer
memcpy((void *)buffer_pP, (void*)payload_pP, payload_size);
Sdu_size = payload_size;
ue_context_p->ue_context.Srb0.Tx_buffer.payload_size = 0;
}
return Sdu_size;
return payload_size;
}
return(0);
return 0;
}
int8_t nr_mac_rrc_bwp_switch_req(const module_id_t module_idP,
......
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