Commit 96e0e7a3 authored by Laurent THOMAS's avatar Laurent THOMAS

create-rrc-to-mac-thread-queue

parent bba14188
...@@ -599,6 +599,7 @@ nr_phy_data_t UE_dl_preprocessing(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) ...@@ -599,6 +599,7 @@ nr_phy_data_t UE_dl_preprocessing(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc)
UE->target_Nid_cell = -1; UE->target_Nid_cell = -1;
} }
nr_mac_process_rrc_msg(0);
/* send tick to RLC and PDCP every ms */ /* send tick to RLC and PDCP every ms */
if (proc->nr_slot_rx % UE->frame_parms.slots_per_subframe == 0) { if (proc->nr_slot_rx % UE->frame_parms.slots_per_subframe == 0) {
void nr_rlc_tick(int frame, int subframe); void nr_rlc_tick(int frame, int subframe);
......
...@@ -76,7 +76,10 @@ MESSAGE_DEF(NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, NasConnRelea ...@@ -76,7 +76,10 @@ MESSAGE_DEF(NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, NasConnRelea
MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, NasUlDataCnf, nas_ul_data_cnf) MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, NasUlDataCnf, nas_ul_data_cnf)
MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_data_ind) MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_data_ind)
// eNB: realtime -> RRC messages // NR UE: RRC -> NAS messages
MESSAGE_DEF(MAC_MIB_REQ, MESSAGE_PRIORITY_MED, mac_mib_req_t, macMibReq)
// xNB: realtime -> RRC messages
MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeProcess, rrc_subframe_process) MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeProcess, rrc_subframe_process)
MESSAGE_DEF(NRRRC_FRAME_PROCESS, MESSAGE_PRIORITY_MED, NRRrcFrameProcess, nr_rrc_frame_process) MESSAGE_DEF(NRRRC_FRAME_PROCESS, MESSAGE_PRIORITY_MED, NRRrcFrameProcess, nr_rrc_frame_process)
......
...@@ -459,4 +459,11 @@ typedef struct rlc_sdu_indication_s { ...@@ -459,4 +459,11 @@ typedef struct rlc_sdu_indication_s {
int message_id; int message_id;
} RlcSduIndication; } RlcSduIndication;
typedef struct {
instance_t module_id;
int cc_idP;
void *mib;
int sched_sib;
} mac_mib_req_t;
#endif /* RRC_MESSAGES_TYPES_H_ */ #endif /* RRC_MESSAGES_TYPES_H_ */
...@@ -416,5 +416,6 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -416,5 +416,6 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
RAR_grant_t *rar_grant, RAR_grant_t *rar_grant,
uint16_t rnti, uint16_t rnti,
const nr_dci_format_t *dci_format); const nr_dci_format_t *dci_format);
void nr_mac_process_rrc_msg(instance_t instance);
#endif #endif
/** @}*/ /** @}*/
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "rrc_vars.h" #include "rrc_vars.h"
#include "MAC/mac.h" #include "MAC/mac.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac.h" #include "LAYER2/NR_MAC_COMMON/nr_mac.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
typedef uint32_t channel_t; typedef uint32_t channel_t;
...@@ -155,6 +156,36 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP, ...@@ -155,6 +156,36 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
return 0; return 0;
} }
void nr_mac_process_rrc_msg(instance_t instance)
{
MessageDef *msg;
do {
// Checks if a message has been sent to MAC sub-task
itti_poll_msg(TASK_MAC_UE, &msg);
if (!msg)
return;
LOG_I(NR_MAC,
"Received %s from %s: instance %ld\n",
ITTI_MSG_NAME(msg),
ITTI_MSG_ORIGIN_NAME(msg),
ITTI_MSG_DESTINATION_INSTANCE(msg));
switch (ITTI_MSG_ID(msg)) {
case MAC_MIB_REQ: {
mac_mib_req_t *req = &msg->ittiMsg.macMibReq;
nr_rrc_mac_config_req_mib(req->module_id, req->cc_idP, req->mib, req->sched_sib);
} break;
default:
LOG_E(NR_MAC, "Received unexpected message %s\n", ITTI_MSG_NAME(msg));
break;
}
int result = itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} while (msg != NULL);
}
void nr_mac_rrc_ra_ind(const module_id_t mod_id, int frame, bool success) void nr_mac_rrc_ra_ind(const module_id_t mod_id, int frame, bool success)
{ {
MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_RA_IND); MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_RA_IND);
......
...@@ -351,21 +351,6 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi ...@@ -351,21 +351,6 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi
return NR_UE_rrc_inst; return NR_UE_rrc_inst;
} }
int8_t nr_ue_process_secondary_cell_list(NR_CellGroupConfig_t *cell_group_config){
return 0;
}
int8_t nr_ue_process_mac_cell_group_config(NR_MAC_CellGroupConfig_t *mac_cell_group_config){
return 0;
}
int8_t nr_ue_process_physical_cell_group_config(NR_PhysicalCellGroupConfig_t *phy_cell_group_config){
return 0;
}
bool check_si_validity(NR_UE_RRC_SI_INFO *SI_info, int si_type) bool check_si_validity(NR_UE_RRC_SI_INFO *SI_info, int si_type)
{ {
switch (si_type) { switch (si_type) {
...@@ -478,7 +463,17 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const u ...@@ -478,7 +463,17 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const u
// to schedule MAC to get SI if required // to schedule MAC to get SI if required
get_sib = check_si_status(SI_info); get_sib = check_si_status(SI_info);
} }
nr_rrc_mac_config_req_mib(module_id, 0, NR_UE_rrc_inst[module_id].mib, get_sib); NR_BCCH_BCH_Message_t *reDecode = NULL;
uper_decode_complete(NULL, &asn_DEF_NR_BCCH_BCH_Message, (void **)&reDecode, (const void *)bufferP, buffer_len);
MessageDef *msg = itti_alloc_new_message(TASK_RRC_NRUE, 0, MAC_MIB_REQ);
mac_mib_req_t *req = &msg->ittiMsg.macMibReq;
req->module_id = module_id;
req->cc_idP = 0;
req->mib = reDecode->message.choice.mib;
req->sched_sib = get_sib;
itti_send_msg_to_task(TASK_MAC_UE, module_id, msg);
reDecode->message.choice.mib = NULL;
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, reDecode);
ret = 0; ret = 0;
} }
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, bcch_message); ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, bcch_message);
......
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