Commit 74a092f7 authored by Mahesh's avatar Mahesh

Documentation update, UL transmission

parent 02f3fecf
...@@ -100,14 +100,30 @@ if (Sched_INFO->TX_req->Number_of_PDUs > 0) ...@@ -100,14 +100,30 @@ if (Sched_INFO->TX_req->Number_of_PDUs > 0)
``` ```
```mermaid
graph TD
pselect[VNF socket pselect] -- timed out : end of slot --> call_sched[Call Scheduler NR_UL_indication] -- oai_nfapi_***_req sends the DL p7 msg--> slot_inc[Increment sfn/slot];
pselect[VNF socket pselect] -- UL p7 xyz msg recvd --> msg_recvd[Read message vnf_nr_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Handle Message vnf_handle_nr_xyz] --> fill_ul_info[Fill UL info struct with fn pointer vnf_p7->_public.nr_rx_xyz];
fill_ul_info -- update pselect_timeout: next_slot_start - time_xyz_msg_recvd-->pselect;
slot_inc -- next slot --> pselect
```
## P7 DL Reception at PNF ## P7 DL Reception at PNF
Through the infinite loop [while(pnf_p7->terminate == 0)] running in pnf_nr_p7_message_pump(), the PNF receives and unpacks the downlink P7 message received on its socket. Based on the unpacked message, the appropriate message structures are filled in the PNF, and these are used further down the pipeline for processing. Through the infinite loop [while(pnf_p7->terminate == 0)] running in pnf_nr_p7_message_pump(), the PNF receives and unpacks the downlink P7 message received on its socket. Based on the unpacked message, the appropriate message structures are filled in the PNF, and these are used further down the pipeline for processing.
While receiving the DL P7 message, we check whether the message was received within a timing window from which it was sent. The duration of the window can be set by the user (set as a parameter for xnf in the p5 messages). A point to note is that the DL information must be received by the PNF within a timing window at least lesser than the duration of slot_ahead variable (timing_window <= slot_ahead * slot_duration). Ideally, it should be received within a duration significantly lesser than slot_ahead so that there is adequate time for PHY processing. While receiving the DL P7 message, we check whether the message was received within a timing window from which it was sent. The duration of the window can be set by the user (set as a parameter for xnf in the p5 messages). A point to note is that the DL information must be received by the PNF within a timing window at least lesser than the duration of slot_ahead variable (timing_window <= slot_ahead * slot_duration). Ideally, it should be received within a duration significantly lesser than slot_ahead so that there is adequate time for PHY processing.
```mermaid
graph TB
pselect[PNF socket pselect] -- timed out : end of slot --> slot_inc[Increment sfn/slot];
pselect[PNF socket pselect] -- DL p7 xyz msg recvd --> msg_recvd[Read message pnf_nr_nfapi_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Unpack Message pnf_handle_nr_xyz] --> fill_pnf_p7[Fill pnf_p7 global structure pnf_handle_nr_xyz] --Data from pnf_p7 struct copied to fapi structures using pnf_phy_***_req. Called every slot from oai_slot_ind-->pselect;
slot_inc -- next slot --> pselect
```
......
...@@ -1240,9 +1240,8 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, ...@@ -1240,9 +1240,8 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) { if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) {
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu=&dl_tti_pdu_list[i]; nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu=&dl_tti_pdu_list[i];
memcpy(dl_tti_pdu,&dl_tti_pdu_list[i],sizeof(nfapi_nr_dl_tti_request_pdu_t)); memcpy(dl_tti_pdu,&dl_tti_pdu_list[i],sizeof(nfapi_nr_dl_tti_request_pdu_t));
int SFN=sfn+2;
//if(!&dl_tti_pdu->pdcch_pdu) //if(!&dl_tti_pdu->pdcch_pdu)
handle_nfapi_nr_pdcch_pdu(gNB, SFN, slot, &dl_tti_pdu->pdcch_pdu); handle_nfapi_nr_pdcch_pdu(gNB, sfn, slot, &dl_tti_pdu->pdcch_pdu);
//dl_tti_pdu_list[i].pdcch_pdu.pdcch_pdu_rel15.numDlDci++; // ? //dl_tti_pdu_list[i].pdcch_pdu.pdcch_pdu_rel15.numDlDci++; // ?
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci); // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci);
} else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) { } else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) {
......
...@@ -53,53 +53,70 @@ extern uint16_t sf_ahead; ...@@ -53,53 +53,70 @@ extern uint16_t sf_ahead;
extern uint16_t sl_ahead; extern uint16_t sl_ahead;
void handle_nr_rach(NR_UL_IND_t *UL_info) { void handle_nr_rach(NR_UL_IND_t *UL_info) {
if(NFAPI_MODE == NFAPI_MODE_PNF) {
if (UL_info->rach_ind.number_of_pdus>0) { if (UL_info->rach_ind.number_of_pdus>0) {
LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",UL_info->frame,UL_info->slot, UL_info->rach_ind.sfn,UL_info->rach_ind.slot); //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
int npdus = UL_info->rach_ind.number_of_pdus; oai_nfapi_nr_rach_indication(&UL_info->rach_ind);
for(int i = 0; i < npdus; i++) { UL_info->rach_ind.number_of_pdus = 0;
UL_info->rach_ind.number_of_pdus--; }
if (UL_info->rach_ind.pdu_list[i].num_preamble>0) }
AssertFatal(UL_info->rach_ind.pdu_list[i].num_preamble==1, else{
"More than 1 preamble not supported\n"); if (UL_info->rach_ind.number_of_pdus>0) {
LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",UL_info->frame,UL_info->slot, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
nr_initiate_ra_proc(UL_info->module_id, int npdus = UL_info->rach_ind.number_of_pdus;
UL_info->CC_id, for(int i = 0; i < npdus; i++) {
UL_info->rach_ind.sfn, UL_info->rach_ind.number_of_pdus--;
UL_info->rach_ind.slot, if (UL_info->rach_ind.pdu_list[i].num_preamble>0)
UL_info->rach_ind.pdu_list[i].preamble_list[0].preamble_index, AssertFatal(UL_info->rach_ind.pdu_list[i].num_preamble==1,
UL_info->rach_ind.pdu_list[i].freq_index, "More than 1 preamble not supported\n");
UL_info->rach_ind.pdu_list[i].symbol_index,
UL_info->rach_ind.pdu_list[i].preamble_list[0].timing_advance); nr_initiate_ra_proc(UL_info->module_id,
UL_info->CC_id,
UL_info->rach_ind.sfn,
UL_info->rach_ind.slot,
UL_info->rach_ind.pdu_list[i].preamble_list[0].preamble_index,
UL_info->rach_ind.pdu_list[i].freq_index,
UL_info->rach_ind.pdu_list[i].symbol_index,
UL_info->rach_ind.pdu_list[i].preamble_list[0].timing_advance);
}
} }
} }
} }
void handle_nr_uci(NR_UL_IND_t *UL_info) void handle_nr_uci(NR_UL_IND_t *UL_info)
{ {
const module_id_t mod_id = UL_info->module_id; if(NFAPI_MODE == NFAPI_MODE_PNF) {
const frame_t frame = UL_info->frame; if (UL_info->uci_ind.num_ucis>0) {
const sub_frame_t slot = UL_info->slot; //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
int num_ucis = UL_info->uci_ind.num_ucis; oai_nfapi_nr_uci_indication(&UL_info->uci_ind);
nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list; UL_info->uci_ind.num_ucis = 0;
}
}
else{
const module_id_t mod_id = UL_info->module_id;
const frame_t frame = UL_info->frame;
const sub_frame_t slot = UL_info->slot;
int num_ucis = UL_info->uci_ind.num_ucis;
nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list;
for (int i = 0; i < num_ucis; i++) { for (int i = 0; i < num_ucis; i++) {
switch (uci_list[i].pdu_type) { switch (uci_list[i].pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE: case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
LOG_E(MAC, "%s(): unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE\n", __func__); LOG_E(MAC, "%s(): unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE\n", __func__);
break; break;
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1; const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu); handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu);
break; break;
} }
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &uci_list[i].pucch_pdu_format_2_3_4; const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &uci_list[i].pucch_pdu_format_2_3_4;
handle_nr_uci_pucch_2_3_4(mod_id, frame, slot, uci_pdu); handle_nr_uci_pucch_2_3_4(mod_id, frame, slot, uci_pdu);
break; break;
}
} }
} }
} }
...@@ -109,60 +126,75 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) ...@@ -109,60 +126,75 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
void handle_nr_ulsch(NR_UL_IND_t *UL_info) void handle_nr_ulsch(NR_UL_IND_t *UL_info)
{ {
if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) { if(NFAPI_MODE == NFAPI_MODE_PNF) {
for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) { if (UL_info->crc_ind.number_crcs>0) {
for (int j = 0; j < UL_info->crc_ind.number_crcs; j++) { //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
// find crc_indication j corresponding rx_indication i oai_nfapi_nr_crc_indication(&UL_info->crc_ind);
const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i]; UL_info->crc_ind.number_crcs = 0;
const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[j]; }
LOG_D(PHY,
"UL_info->crc_ind.pdu_list[%d].rnti:%04x "
"UL_info->rx_ind.pdu_list[%d].rnti:%04x\n",
j,
crc->rnti,
i,
rx->rnti);
if (crc->rnti != rx->rnti) if (UL_info->rx_ind.number_of_pdus>0) {
continue; //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
oai_nfapi_nr_rx_data_indication(&UL_info->rx_ind);
UL_info->rx_ind.number_of_pdus = 0;
}
}
else{
if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) {
for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) {
for (int j = 0; j < UL_info->crc_ind.number_crcs; j++) {
// find crc_indication j corresponding rx_indication i
const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i];
const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[j];
LOG_D(PHY,
"UL_info->crc_ind.pdu_list[%d].rnti:%04x "
"UL_info->rx_ind.pdu_list[%d].rnti:%04x\n",
j,
crc->rnti,
i,
rx->rnti);
if (crc->rnti != rx->rnti)
continue;
LOG_D(MAC, LOG_D(MAC,
"%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n", "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
UL_info->frame, UL_info->frame,
UL_info->slot, UL_info->slot,
crc->tb_crc_status ? "error" : "ok", crc->tb_crc_status ? "error" : "ok",
crc->tb_crc_status); crc->tb_crc_status);
/* if CRC passes, pass PDU, otherwise pass NULL as error indication */ /* if CRC passes, pass PDU, otherwise pass NULL as error indication */
nr_rx_sdu(UL_info->module_id, nr_rx_sdu(UL_info->module_id,
UL_info->CC_id, UL_info->CC_id,
UL_info->rx_ind.sfn, UL_info->rx_ind.sfn,
UL_info->rx_ind.slot, UL_info->rx_ind.slot,
rx->rnti, rx->rnti,
crc->tb_crc_status ? NULL : rx->pdu, crc->tb_crc_status ? NULL : rx->pdu,
rx->pdu_length, rx->pdu_length,
rx->timing_advance, rx->timing_advance,
rx->ul_cqi, rx->ul_cqi,
rx->rssi); rx->rssi);
handle_nr_ul_harq(UL_info->module_id, UL_info->frame, UL_info->slot, crc); handle_nr_ul_harq(UL_info->module_id, UL_info->frame, UL_info->slot, crc);
break; break;
} // for (j=0;j<UL_info->crc_ind.number_crcs;j++) } // for (j=0;j<UL_info->crc_ind.number_crcs;j++)
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) } // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
UL_info->crc_ind.number_crcs = 0; UL_info->crc_ind.number_crcs = 0;
UL_info->rx_ind.number_of_pdus = 0; UL_info->rx_ind.number_of_pdus = 0;
} else if (UL_info->rx_ind.number_of_pdus != 0 } else if (UL_info->rx_ind.number_of_pdus != 0
|| UL_info->crc_ind.number_crcs != 0) { || UL_info->crc_ind.number_crcs != 0) {
LOG_E(PHY, LOG_E(PHY,
"hoping not to have mis-match between CRC ind and RX ind - " "hoping not to have mis-match between CRC ind and RX ind - "
"hopefully the missing message is coming shortly " "hopefully the missing message is coming shortly "
"rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n", "rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n",
UL_info->rx_ind.number_of_pdus, UL_info->rx_ind.number_of_pdus,
UL_info->rx_ind.sfn, UL_info->rx_ind.sfn,
UL_info->rx_ind.slot, UL_info->rx_ind.slot,
UL_info->crc_ind.number_crcs, UL_info->crc_ind.number_crcs,
UL_info->rx_ind.sfn, UL_info->rx_ind.sfn,
UL_info->rx_ind.slot); UL_info->rx_ind.slot);
}
} }
} }
......
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