Commit c0efb21c authored by Florian Kaltenberger's avatar Florian Kaltenberger

unpacking SRS ind FAPI 10.02

parent 90e63e86
...@@ -777,7 +777,21 @@ int aerial_phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind) ...@@ -777,7 +777,21 @@ int aerial_phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind)
gNB->UL_INFO.srs_ind.pdu_list = malloc(sizeof(nfapi_nr_srs_indication_pdu_t) * ind->number_of_pdus); gNB->UL_INFO.srs_ind.pdu_list = malloc(sizeof(nfapi_nr_srs_indication_pdu_t) * ind->number_of_pdus);
for (int i = 0; i < ind->number_of_pdus; i++) { for (int i = 0; i < ind->number_of_pdus; i++) {
memcpy(&gNB->UL_INFO.srs_ind.pdu_list[i], &ind->pdu_list[i], sizeof(ind->pdu_list[0])); //copy PDU
gNB->UL_INFO.srs_ind.pdu_list[i].timing_advance = ind->pdu_list[i].timing_advance;
gNB->UL_INFO.srs_ind.pdu_list[i].num_symbols = ind->pdu_list[i].num_symbols;
gNB->UL_INFO.srs_ind.pdu_list[i].wideband_snr = ind->pdu_list[i].wideband_snr;
gNB->UL_INFO.srs_ind.pdu_list[i].num_reported_symbols = ind->pdu_list[i].num_reported_symbols;
gNB->UL_INFO.srs_ind.pdu_list[i].reported_symbols = calloc(gNB->UL_INFO.srs_ind.pdu_list[i].num_reported_symbols, sizeof(nfapi_srs_report_reported_symbol_t));
for (int j = 0; j < gNB->UL_INFO.srs_ind.pdu_list[i].num_reported_symbols; ++j) {
gNB->UL_INFO.srs_ind.pdu_list[i].reported_symbols[j].num_rbs = ind->pdu_list[i].reported_symbols[j].num_rbs;
gNB->UL_INFO.srs_ind.pdu_list[i].reported_symbols[j].rbSNR = calloc(gNB->UL_INFO.srs_ind.pdu_list[i].reported_symbols[j].num_rbs, sizeof(uint8_t));
for (int k = 0; k < gNB->UL_INFO.srs_ind.pdu_list[i].reported_symbols[j].num_rbs; ++k) {
gNB->UL_INFO.srs_ind.pdu_list[i].reported_symbols[j].rbSNR[k] = ind->pdu_list[i].reported_symbols[j].rbSNR[k];
}
}
//memcpy(&gNB->UL_INFO.srs_ind.pdu_list[i], &ind->pdu_list[i], sizeof(ind->pdu_list[0]));
LOG_D(MAC, LOG_D(MAC,
"%s() NFAPI SFN/Slot:%d.%d SRS_IND:number_of_pdus:%d UL_INFO:pdus:%d\n", "%s() NFAPI SFN/Slot:%d.%d SRS_IND:number_of_pdus:%d UL_INFO:pdus:%d\n",
...@@ -976,9 +990,45 @@ uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, ...@@ -976,9 +990,45 @@ uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end,
return unpack_nr_uci_indication(ppReadPackedMsg, end, msg, config); return unpack_nr_uci_indication(ppReadPackedMsg, end, msg, config);
} }
static uint8_t aerial_unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) {
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
pull8(ppReadPackedMsg, &value->num_symbols, end) &&
pull8(ppReadPackedMsg, &value->wideband_snr, end) &&
pull8(ppReadPackedMsg, &value->num_reported_symbols, end))) {
return 0;
}
value->reported_symbols = calloc(value->num_reported_symbols, sizeof(nfapi_srs_report_reported_symbol_t));
for (int i = 0; i < value->num_reported_symbols; ++i) {
pull16(ppReadPackedMsg, &value->reported_symbols[i].num_rbs, end);
value->reported_symbols[i].rbSNR = calloc(value->reported_symbols[i].num_rbs, sizeof(uint8_t));
for (int j = 0; j < value->reported_symbols[i].num_rbs; ++j) {
pull8(ppReadPackedMsg, &value->reported_symbols[i].rbSNR[j], end);
}
}
return 1;
}
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
{ {
return unpack_nr_srs_indication(ppReadPackedMsg, end, msg, config); //Aerial supports SRS.indication in accordance to version 10.02 of SCF222
nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t *)msg;
if (!(pull16(ppReadPackedMsg,&pNfapiMsg->sfn, end) &&
pull16(ppReadPackedMsg,&pNfapiMsg->slot, end) &&
pull8(ppReadPackedMsg,&pNfapiMsg->number_of_pdus, end))) {
return 0;
}
for(int i=0; i<pNfapiMsg->number_of_pdus; i++) {
if (!aerial_unpack_nr_srs_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end)) {
return 0;
}
}
return 1;
} }
uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg,
......
...@@ -1721,6 +1721,11 @@ typedef struct { ...@@ -1721,6 +1721,11 @@ typedef struct {
uint32_t value[16384]; // tag=0: Only the most significant bytes of the size indicated by ‘length’ field are valid. Remaining bytes are zero padded to the nearest 32-bit bit boundary; Tag=2 Offset from the end of the control portion of the message to the payload is in the value field. Occupies 32-bits. uint32_t value[16384]; // tag=0: Only the most significant bytes of the size indicated by ‘length’ field are valid. Remaining bytes are zero padded to the nearest 32-bit bit boundary; Tag=2 Offset from the end of the control portion of the message to the payload is in the value field. Occupies 32-bits.
} nfapi_srs_report_tlv_t; } nfapi_srs_report_tlv_t;
typedef struct {
uint16_t num_rbs;
uint8_t* rbSNR;
}nfapi_srs_report_reported_symbol_t;
typedef struct { typedef struct {
uint32_t handle; // The handle passed to the PHY in the the UL_TTI.request SRS PDU. uint32_t handle; // The handle passed to the PHY in the the UL_TTI.request SRS PDU.
uint16_t rnti; // The RNTI passed to the PHY in the UL_TTI.request SRS PDU. Value: 1 -> 65535. uint16_t rnti; // The RNTI passed to the PHY in the UL_TTI.request SRS PDU. Value: 1 -> 65535.
...@@ -1729,6 +1734,13 @@ typedef struct { ...@@ -1729,6 +1734,13 @@ typedef struct {
uint8_t srs_usage; // 0 – beamManagement; 1 – codebook; 2 – nonCodebook; 3 – antennaSwitching; 4 – 255: reserved; Note: This field matches the SRS usage field of the SRS PDU to which this report is linked. uint8_t srs_usage; // 0 – beamManagement; 1 – codebook; 2 – nonCodebook; 3 – antennaSwitching; 4 – 255: reserved; Note: This field matches the SRS usage field of the SRS PDU to which this report is linked.
uint8_t report_type; // The type of report included in or pointed to by Report TLV depends on the SRS usage: Beam management (1: Beamforming report); Codebook (1: Normalized Channel I/Q Matrix); nonCodebook (1: Normalized Channel I/Q Matrix); antennaSwitch (1: Channel SVD Representation); all (0: null report) uint8_t report_type; // The type of report included in or pointed to by Report TLV depends on the SRS usage: Beam management (1: Beamforming report); Codebook (1: Normalized Channel I/Q Matrix); nonCodebook (1: Normalized Channel I/Q Matrix); antennaSwitch (1: Channel SVD Representation); all (0: null report)
nfapi_srs_report_tlv_t report_tlv; nfapi_srs_report_tlv_t report_tlv;
//Members to allow compatibility with SCF222 10.02
uint16_t timing_advance;
uint8_t num_symbols;
uint8_t wideband_snr;
uint8_t num_reported_symbols;
nfapi_srs_report_reported_symbol_t* reported_symbols;
} nfapi_nr_srs_indication_pdu_t; } nfapi_nr_srs_indication_pdu_t;
typedef struct { typedef struct {
......
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