separate RRC to MAC message to trigger SIB scheduling
This commit is contained in:
@@ -955,7 +955,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
//Configure UE
|
//Configure UE
|
||||||
NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc);
|
NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc);
|
||||||
nr_rrc_mac_config_req_mib(0, 0, mib->message.choice.mib, false, false);
|
nr_rrc_mac_config_req_mib(0, 0, mib->message.choice.mib, false);
|
||||||
nr_rrc_mac_config_req_cg(0, 0, UE_CellGroup, UE_Capability_nr);
|
nr_rrc_mac_config_req_cg(0, 0, UE_CellGroup, UE_Capability_nr);
|
||||||
|
|
||||||
asn1cFreeStruc(asn_DEF_NR_CellGroupConfig, UE_CellGroup);
|
asn1cFreeStruc(asn_DEF_NR_CellGroupConfig, UE_CellGroup);
|
||||||
|
|||||||
@@ -478,7 +478,6 @@ typedef struct {
|
|||||||
} nr_mac_rrc_config_cg_t;
|
} nr_mac_rrc_config_cg_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NR_BCCH_BCH_Message_t *bcch;
|
NR_BCCH_BCH_Message_t *bcch;
|
||||||
int get_sib;
|
|
||||||
bool access_barred;
|
bool access_barred;
|
||||||
} nr_mac_rrc_config_mib_t;
|
} nr_mac_rrc_config_mib_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -489,6 +488,10 @@ typedef struct {
|
|||||||
NR_SIB19_r17_t *sib19;
|
NR_SIB19_r17_t *sib19;
|
||||||
bool can_start_ra;
|
bool can_start_ra;
|
||||||
} nr_mac_rrc_config_other_sib_t;
|
} nr_mac_rrc_config_other_sib_t;
|
||||||
|
typedef struct {
|
||||||
|
int get_sib;
|
||||||
|
} nr_mac_rrc_sched_sib_t;
|
||||||
|
|
||||||
|
|
||||||
enum payload_type {
|
enum payload_type {
|
||||||
NR_MAC_RRC_CONFIG_RESET,
|
NR_MAC_RRC_CONFIG_RESET,
|
||||||
@@ -496,6 +499,7 @@ enum payload_type {
|
|||||||
NR_MAC_RRC_CONFIG_MIB,
|
NR_MAC_RRC_CONFIG_MIB,
|
||||||
NR_MAC_RRC_CONFIG_SIB1,
|
NR_MAC_RRC_CONFIG_SIB1,
|
||||||
NR_MAC_RRC_CONFIG_OTHER_SIB,
|
NR_MAC_RRC_CONFIG_OTHER_SIB,
|
||||||
|
NR_MAC_RRC_SCHED_SIB,
|
||||||
NR_MAC_RRC_RESUME_RB
|
NR_MAC_RRC_RESUME_RB
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -506,6 +510,7 @@ typedef struct {
|
|||||||
nr_mac_rrc_config_cg_t config_cg;
|
nr_mac_rrc_config_cg_t config_cg;
|
||||||
nr_mac_rrc_config_mib_t config_mib;
|
nr_mac_rrc_config_mib_t config_mib;
|
||||||
nr_mac_rrc_config_sib1_t config_sib1;
|
nr_mac_rrc_config_sib1_t config_sib1;
|
||||||
|
nr_mac_rrc_sched_sib_t sched_sib;
|
||||||
nr_mac_rrc_config_other_sib_t config_other_sib;
|
nr_mac_rrc_config_other_sib_t config_other_sib;
|
||||||
nr_mac_rrc_resume_rb_t resume_rb;
|
nr_mac_rrc_resume_rb_t resume_rb;
|
||||||
} payload;
|
} payload;
|
||||||
|
|||||||
@@ -1024,7 +1024,21 @@ static bool is_cset0_present(frequency_range_t const fr, uint8_t const kssb)
|
|||||||
return (fr == FR1) ? (kssb < 24) : (kssb < 12);
|
return (fr == FR1) ? (kssb < 24) : (kssb < 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_mib(module_id_t module_id, int cc_idP, NR_MIB_t *mib, int sched_sib, bool barred)
|
void nr_rrc_mac_sched_sib(module_id_t module_id, int sched_sib)
|
||||||
|
{
|
||||||
|
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||||
|
if (sched_sib == 1) {
|
||||||
|
bool const is_c0 = is_cset0_present(mac->frequency_range, mac->ssb_subcarrier_offset);
|
||||||
|
mac->get_sib1 = is_c0;
|
||||||
|
AssertFatal(is_c0, "RRC scheduling SIB1 reception but MIB indicates no SIB1 present in current cell\n");
|
||||||
|
} else if (sched_sib > 1)
|
||||||
|
mac->get_otherSI[sched_sib - 2] = true;
|
||||||
|
|
||||||
|
if (mac->state == UE_NOT_SYNC && mac->get_sib1)
|
||||||
|
mac->state = UE_RECEIVING_SIB;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nr_rrc_mac_config_req_mib(module_id_t module_id, int cc_idP, NR_MIB_t *mib, bool barred)
|
||||||
{
|
{
|
||||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||||
int ret = pthread_mutex_lock(&mac->if_mutex);
|
int ret = pthread_mutex_lock(&mac->if_mutex);
|
||||||
@@ -1044,22 +1058,10 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id, int cc_idP, NR_MIB_t *mib,
|
|||||||
mac->phy_config.CC_id = cc_idP;
|
mac->phy_config.CC_id = cc_idP;
|
||||||
|
|
||||||
nr_ue_decode_mib(mac, cc_idP);
|
nr_ue_decode_mib(mac, cc_idP);
|
||||||
|
|
||||||
if (sched_sib == 1) {
|
|
||||||
bool const is_c0 = is_cset0_present(mac->frequency_range, mac->ssb_subcarrier_offset);
|
|
||||||
mac->get_sib1 = is_c0;
|
|
||||||
AssertFatal(is_c0, "RRC scheduling SIB1 reception but MIB indicates no SIB1 present in current cell\n");
|
|
||||||
} else if (sched_sib > 1)
|
|
||||||
mac->get_otherSI[sched_sib - 2] = true;
|
|
||||||
|
|
||||||
if (get_softmodem_params()->phy_test)
|
if (get_softmodem_params()->phy_test)
|
||||||
mac->state = UE_CONNECTED;
|
mac->state = UE_CONNECTED;
|
||||||
else if (mac->state == UE_NOT_SYNC) {
|
else if (mac->state == UE_NOT_SYNC && !IS_SA_MODE(get_softmodem_params()))
|
||||||
if (IS_SA_MODE(get_softmodem_params()) && mac->get_sib1)
|
mac->state = UE_PERFORMING_RA;
|
||||||
mac->state = UE_RECEIVING_SIB;
|
|
||||||
else
|
|
||||||
mac->state = UE_PERFORMING_RA;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = pthread_mutex_unlock(&mac->if_mutex);
|
ret = pthread_mutex_unlock(&mac->if_mutex);
|
||||||
AssertFatal(!ret, "mutex failed %d\n", ret);
|
AssertFatal(!ret, "mutex failed %d\n", ret);
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id,
|
|||||||
NR_CellGroupConfig_t *cell_group_config,
|
NR_CellGroupConfig_t *cell_group_config,
|
||||||
NR_UE_NR_Capability_t *ue_Capability);
|
NR_UE_NR_Capability_t *ue_Capability);
|
||||||
|
|
||||||
void nr_rrc_mac_config_req_mib(module_id_t module_id, int cc_idP, NR_MIB_t *mibP, int sched_sib1, bool barred);
|
void nr_rrc_mac_config_req_mib(module_id_t module_id, int cc_idP, NR_MIB_t *mibP, bool barred);
|
||||||
|
void nr_rrc_mac_sched_sib(module_id_t module_id, int sched_sib);
|
||||||
void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *sib1, bool can_start_ra);
|
void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *sib1, bool can_start_ra);
|
||||||
|
|
||||||
struct position; /* forward declaration */
|
struct position; /* forward declaration */
|
||||||
|
|||||||
@@ -146,7 +146,6 @@ void process_msg_rcc_to_mac(nr_mac_rrc_message_t *msg, int instance_id)
|
|||||||
nr_rrc_mac_config_req_mib(instance_id,
|
nr_rrc_mac_config_req_mib(instance_id,
|
||||||
0,
|
0,
|
||||||
msg->payload.config_mib.bcch->message.choice.mib,
|
msg->payload.config_mib.bcch->message.choice.mib,
|
||||||
msg->payload.config_mib.get_sib,
|
|
||||||
msg->payload.config_mib.access_barred);
|
msg->payload.config_mib.access_barred);
|
||||||
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, msg->payload.config_mib.bcch);
|
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, msg->payload.config_mib.bcch);
|
||||||
break;
|
break;
|
||||||
@@ -160,6 +159,9 @@ void process_msg_rcc_to_mac(nr_mac_rrc_message_t *msg, int instance_id)
|
|||||||
bool can_start_ra = msg->payload.config_other_sib.can_start_ra;
|
bool can_start_ra = msg->payload.config_other_sib.can_start_ra;
|
||||||
nr_rrc_mac_config_other_sib(instance_id, msg->payload.config_other_sib.sib19, can_start_ra);
|
nr_rrc_mac_config_other_sib(instance_id, msg->payload.config_other_sib.sib19, can_start_ra);
|
||||||
} break;
|
} break;
|
||||||
|
case NR_MAC_RRC_SCHED_SIB:
|
||||||
|
nr_rrc_mac_sched_sib(instance_id, msg->payload.sched_sib.get_sib);
|
||||||
|
break;
|
||||||
case NR_MAC_RRC_RESUME_RB:
|
case NR_MAC_RRC_RESUME_RB:
|
||||||
nr_rrc_mac_resume_rb(instance_id, msg->payload.resume_rb.is_srb, msg->payload.resume_rb.rb_id);
|
nr_rrc_mac_resume_rb(instance_id, msg->payload.resume_rb.is_srb, msg->payload.resume_rb.rb_id);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1507,17 +1507,21 @@ static void nr_rrc_ue_decode_NR_BCCH_BCH_Message(NR_UE_RRC_INST_t *rrc,
|
|||||||
&& rrc->nrRrcState != RRC_STATE_DETACH_NR) {
|
&& rrc->nrRrcState != RRC_STATE_DETACH_NR) {
|
||||||
// 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);
|
||||||
if (get_sib)
|
|
||||||
SI_info->sib_pending = true;
|
|
||||||
}
|
}
|
||||||
if (bcch_message->message.present == NR_BCCH_BCH_MessageType_PR_mib) {
|
if (bcch_message->message.present == NR_BCCH_BCH_MessageType_PR_mib) {
|
||||||
nr_mac_rrc_message_t rrc_msg = {0};
|
nr_mac_rrc_message_t rrc_msg = {0};
|
||||||
rrc_msg.payload_type = NR_MAC_RRC_CONFIG_MIB;
|
rrc_msg.payload_type = NR_MAC_RRC_CONFIG_MIB;
|
||||||
nr_mac_rrc_config_mib_t *config_mib = &rrc_msg.payload.config_mib;
|
nr_mac_rrc_config_mib_t *config_mib = &rrc_msg.payload.config_mib;
|
||||||
config_mib->bcch = bcch_message;
|
config_mib->bcch = bcch_message;
|
||||||
config_mib->get_sib = get_sib;
|
|
||||||
config_mib->access_barred = barred;
|
config_mib->access_barred = barred;
|
||||||
nr_rrc_send_msg_to_mac(rrc, &rrc_msg);
|
nr_rrc_send_msg_to_mac(rrc, &rrc_msg);
|
||||||
|
if (get_sib) {
|
||||||
|
SI_info->sib_pending = true;
|
||||||
|
nr_mac_rrc_message_t sib_msg = {0};
|
||||||
|
sib_msg.payload_type = NR_MAC_RRC_SCHED_SIB;
|
||||||
|
sib_msg.payload.sched_sib.get_sib = get_sib;
|
||||||
|
nr_rrc_send_msg_to_mac(rrc, &sib_msg);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_E(NR_RRC, "RRC-received BCCH message is not a MIB\n");
|
LOG_E(NR_RRC, "RRC-received BCCH message is not a MIB\n");
|
||||||
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, bcch_message);
|
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, bcch_message);
|
||||||
|
|||||||
Reference in New Issue
Block a user