Merge remote-tracking branch 'origin/nr_ue_tti_cleanup' into integration_2020_wk48
Conflicts: openair1/PHY/NR_UE_TRANSPORT/dci_nr.c openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
This commit is contained in:
@@ -96,7 +96,8 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
@param module_id_t mod_id module ID
|
||||
@param int cc_id CC ID
|
||||
@param frame_t frame frame number
|
||||
@param int slot reference number */
|
||||
@param int slot reference number
|
||||
@param UE_nr_rxtx_proc_t *proc pointer to process context */
|
||||
void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
|
||||
fapi_nr_dl_config_request_t *dl_config,
|
||||
fapi_nr_ul_config_request_t *ul_config,
|
||||
@@ -104,7 +105,8 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
|
||||
module_id_t mod_id,
|
||||
int cc_id,
|
||||
frame_t frame,
|
||||
int slot);
|
||||
int slot,
|
||||
int thread_id);
|
||||
|
||||
/* \brief Get SR payload (0,1) from UE MAC
|
||||
@param Mod_id Instance id of UE in machine
|
||||
@@ -211,9 +213,10 @@ and fills the PRACH PDU per each FD occasion.
|
||||
@param module_idP Index of UE instance
|
||||
@param frameP Frame index
|
||||
@param slotP Slot index
|
||||
@param thread_id RX/TX Thread ID
|
||||
@returns void
|
||||
*/
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int thread_id);
|
||||
|
||||
/* \brief This function schedules the Msg3 transmission
|
||||
@param
|
||||
@@ -264,7 +267,7 @@ andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4
|
||||
@param CC_id Component Carrier Index
|
||||
@param frame
|
||||
@param gNB_id gNB index
|
||||
@param nr_tti_tx slot for PRACH transmission
|
||||
@param nr_slot_tx slot for PRACH transmission
|
||||
@returns indication to generate PRACH to phy */
|
||||
uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
fapi_nr_ul_config_prach_pdu *prach_pdu,
|
||||
@@ -273,7 +276,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
UE_MODE_t UE_mode,
|
||||
frame_t frame,
|
||||
uint8_t gNB_id,
|
||||
int nr_tti_tx);
|
||||
int nr_slot_tx);
|
||||
|
||||
/* \brief Function implementing the routine for the selection of Random Access resources (5.1.2 TS 38.321).
|
||||
@param module_idP Index of UE instance
|
||||
|
||||
@@ -401,7 +401,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
UE_MODE_t UE_mode,
|
||||
frame_t frame,
|
||||
uint8_t gNB_id,
|
||||
int nr_tti_tx){
|
||||
int nr_slot_tx){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES];
|
||||
@@ -489,9 +489,9 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
}
|
||||
|
||||
//mac->RA_tx_frame = frame;
|
||||
//mac->RA_tx_subframe = nr_tti_tx;
|
||||
//mac->RA_tx_slot = nr_slot_tx;
|
||||
//mac->RA_backoff_frame = frame;
|
||||
//mac->RA_backoff_subframe = nr_tti_tx;
|
||||
//mac->RA_backoff_slot = nr_slot_tx;
|
||||
|
||||
if (size_sdu > 0) {
|
||||
|
||||
@@ -510,7 +510,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (mac->generate_nr_prach == 1)
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_slot_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
offset = nr_generate_ulsch_pdu((uint8_t *) mac_sdus, // sdus buffer
|
||||
(uint8_t *) payload, // UL MAC pdu pointer
|
||||
@@ -544,7 +544,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
// - handle backoff and raResponseWindow params
|
||||
|
||||
// LOG_D(MAC, "[MAC][UE %d][RAPROC] frame %d, subframe %d: RA Active, window cnt %d (RA_tx_frame %d, RA_tx_subframe %d)\n",
|
||||
// mod_id, frame, nr_tti_tx, mac->RA_window_cnt, mac->RA_tx_frame, mac->RA_tx_subframe);
|
||||
// mod_id, frame, nr_slot_tx, mac->RA_window_cnt, mac->RA_tx_frame, mac->RA_tx_subframe);
|
||||
|
||||
if (mac->RA_BI_found){
|
||||
prach_resources->RA_PREAMBLE_BACKOFF = prach_resources->RA_SCALING_FACTOR_BI * mac->RA_backoff_indicator;
|
||||
@@ -564,7 +564,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
} else if (mac->RA_window_cnt == 0 && !mac->RA_RAPID_found) {
|
||||
|
||||
LOG_I(MAC, "[MAC][UE %d][RAPROC] Frame %d: nr_tti_tx %d: RAR reception failed \n", mod_id, frame, nr_tti_tx);
|
||||
LOG_I(MAC, "[MAC][UE %d][RAPROC] Frame %d: nr_slot_tx %d: RAR reception failed \n", mod_id, frame, nr_slot_tx);
|
||||
|
||||
mac->ra_state = RA_UE_IDLE;
|
||||
mac->RA_PREAMBLE_TRANSMISSION_COUNTER++;
|
||||
@@ -622,22 +622,22 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
// frame_diff = (sframe_t) frame - mac->RA_backoff_frame;
|
||||
// if (frame_diff < 0) frame_diff = -frame_diff;
|
||||
// mac->RA_backoff_frame = frame;
|
||||
// mac->RA_backoff_subframe = nr_tti_tx;
|
||||
// mac->RA_backoff_slot = nr_slot_tx;
|
||||
// }
|
||||
// compute RA window parameters
|
||||
// if (mac->RA_window_cnt > 0){
|
||||
// frame_diff = (frame_t) frame - mac->RA_tx_frame;
|
||||
// if (frame_diff < 0) frame_diff = -frame_diff;
|
||||
// mac->RA_window_cnt -= ((10 * frame_diff) + (nr_tti_tx - mac->RA_tx_subframe));
|
||||
// LOG_D(MAC, "[MAC][UE %d][RAPROC] Frame %d, subframe %d: RA Active, adjusted window cnt %d\n", mod_id, frame, nr_tti_tx, mac->RA_window_cnt);
|
||||
// mac->RA_window_cnt -= ((10 * frame_diff) + (nr_slot_tx - mac->RA_tx_subframe));
|
||||
// LOG_D(MAC, "[MAC][UE %d][RAPROC] Frame %d, subframe %d: RA Active, adjusted window cnt %d\n", mod_id, frame, nr_slot_tx, mac->RA_window_cnt);
|
||||
// }
|
||||
|
||||
// mac->RA_tx_frame = frame;
|
||||
// mac->RA_tx_subframe = nr_tti_tx;
|
||||
// mac->RA_tx_slot = nr_slot_tx;
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (mac->generate_nr_prach == 1)
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_slot_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -646,12 +646,12 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
LOG_D(MAC, "[MAC][UE %d][RAPROC][%d.%d]: RAR not received yet (RA window count %d) \n",
|
||||
mod_id,
|
||||
frame,
|
||||
nr_tti_tx,
|
||||
nr_slot_tx,
|
||||
mac->RA_window_cnt);
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (mac->generate_nr_prach == 1)
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_slot_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,7 +775,8 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
|
||||
module_id_t mod_id,
|
||||
int cc_id,
|
||||
frame_t frame,
|
||||
int slot){
|
||||
int slot,
|
||||
int thread_id){
|
||||
|
||||
scheduled_response->dl_config = dl_config;
|
||||
scheduled_response->ul_config = ul_config;
|
||||
@@ -784,7 +785,7 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
|
||||
scheduled_response->CC_id = cc_id;
|
||||
scheduled_response->frame = frame;
|
||||
scheduled_response->slot = slot;
|
||||
|
||||
scheduled_response->thread_id = thread_id;
|
||||
}
|
||||
|
||||
uint32_t get_ssb_slot(uint32_t ssb_index){
|
||||
@@ -1471,7 +1472,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
*/
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
|
||||
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot);
|
||||
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
@@ -1485,7 +1486,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
dcireq.dl_config_req.number_pdus = 0;
|
||||
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
|
||||
|
||||
fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot);
|
||||
fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
@@ -1649,7 +1650,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
}
|
||||
}
|
||||
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config_req, &tx_req, mod_id, cc_id, rx_frame, rx_slot);
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config_req, &tx_req, mod_id, cc_id, rx_frame, rx_slot, ul_info->thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
@@ -1718,7 +1719,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
ul_config_list->pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
||||
ul_config->number_pdus++;
|
||||
// scheduled_response
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, ul_info->module_id, ul_info->cc_id, ul_info->frame_rx, ul_info->slot_rx);
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, ul_info->module_id, ul_info->cc_id, ul_info->frame_rx, ul_info->slot_rx, ul_info->thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
@@ -1773,7 +1774,7 @@ void nr_ue_msg3_scheduler(NR_UE_MAC_INST_t *mac,
|
||||
// PRACH formats 9, 10, 11 are corresponding to dual PRACH format configurations A1/B1, A2/B2, A3/B3.
|
||||
// - todo:
|
||||
// - Partial configuration is actually already stored in (fapi_nr_prach_config_t) &mac->phy_config.config_req->prach_config
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) {
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int thread_id) {
|
||||
|
||||
uint16_t format, format0, format1, ncs;
|
||||
int is_nr_prach_slot;
|
||||
@@ -1901,7 +1902,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
|
||||
} // if format1
|
||||
} // is_nr_prach_slot
|
||||
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP);
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
} // if is_nr_UL_slot
|
||||
@@ -1967,7 +1968,7 @@ uint16_t nr_dci_format_size (PHY_VARS_NR_UE *ue,
|
||||
csi_MeasConfig_t csi_MeasConfig = ue->csi_MeasConfig;
|
||||
PUSCH_ServingCellConfig_t PUSCH_ServingCellConfig= ue->PUSCH_ServingCellConfig;
|
||||
PDSCH_ServingCellConfig_t PDSCH_ServingCellConfig= ue->PDSCH_ServingCellConfig;
|
||||
NR_UE_PDCCH *pdcch_vars2 = ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id];
|
||||
NR_UE_PDCCH *pdcch_vars2 = ue->pdcch_vars[proc->thread_id][eNB_id];
|
||||
// 1 CARRIER_IN
|
||||
// crossCarrierSchedulingConfig from higher layers, variable crossCarrierSchedulingConfig indicates if 'cross carrier scheduling' is enabled or not:
|
||||
// if No cross carrier scheduling: number of bits for CARRIER_IND is 0
|
||||
|
||||
@@ -110,7 +110,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
|
||||
ret = nr_ue_scheduler(NULL, ul_info);
|
||||
|
||||
if (is_nr_UL_slot(mac->scc, ul_info->slot_tx) && get_softmodem_params()->do_ra)
|
||||
nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx);
|
||||
nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
|
||||
|
||||
switch(ret){
|
||||
case UE_CONNECTION_OK:
|
||||
@@ -157,7 +157,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
|
||||
if (ret >= 0) {
|
||||
AssertFatal( nr_ue_if_module_inst[module_id] != NULL, "IF module is NULL!\n" );
|
||||
AssertFatal( nr_ue_if_module_inst[module_id]->scheduled_response != NULL, "scheduled_response is NULL!\n" );
|
||||
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot);
|
||||
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id);
|
||||
nr_ue_if_module_inst[module_id]->scheduled_response(&scheduled_response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ typedef struct {
|
||||
frame_t frame;
|
||||
/// slot
|
||||
int slot;
|
||||
/// proc is needed to signal back decoded frame number to PHY. However, this is not really FAPI procedure and should be done differently
|
||||
UE_nr_rxtx_proc_t * proc;
|
||||
/// index of the current UE RX/TX thread
|
||||
int thread_id;
|
||||
|
||||
/// NR UE FAPI-like P7 message, direction: L1 to L2
|
||||
/// data reception indication structure
|
||||
@@ -95,6 +95,9 @@ typedef struct {
|
||||
frame_t frame_tx;
|
||||
/// slot tx
|
||||
uint32_t slot_tx;
|
||||
/// index of the current UE RX/TX thread
|
||||
int thread_id;
|
||||
|
||||
/// dci reception indication structure
|
||||
fapi_nr_dci_indication_t *dci_ind;
|
||||
} nr_uplink_indication_t;
|
||||
@@ -111,6 +114,8 @@ typedef struct {
|
||||
frame_t frame;
|
||||
/// slot
|
||||
int slot;
|
||||
/// index of the current UE RX/TX thread
|
||||
int thread_id;
|
||||
|
||||
/// NR UE FAPI-like P7 message, direction: L2 to L1
|
||||
/// downlink transmission configuration request structure
|
||||
|
||||
Reference in New Issue
Block a user