mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Merge remote-tracking branch 'origin/fapi-spatial-stream-mapping' into integration_2026_w22 (!3827)
Antenna port indexing of txdataF using FAPI spatial stream indices This MR implements the FAPI's spatial stream indexing to pass antenna port indices to L1 for MU-MIMO. Closes #1022. Additional details in commit message. Reviewed-By: Francesco Mani <email@francescomani.it> Reviewed-By: Robert Schmidt <robert.schmidt@openairinterface.org> Reviewed-By: Teodora Vladić <teodora.vladic@openairinterface.org> Tested-By: Teodora Vladić <teodora.vladic@openairinterface.org>
This commit is contained in:
@@ -52,7 +52,7 @@ uint32_t pullarray32(uint8_t **values_to_pull,
|
||||
uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t len, uint8_t *end);
|
||||
|
||||
uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end);
|
||||
uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end);
|
||||
uint32_t pusharray16(const uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end);
|
||||
uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end);
|
||||
uint32_t pusharray32(const uint32_t *values_to_push,
|
||||
uint32_t max_num_values_to_push,
|
||||
|
||||
@@ -381,7 +381,7 @@ uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t le
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end)
|
||||
uint32_t pusharray16(const uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end)
|
||||
{
|
||||
if (len == 0)
|
||||
return 1;
|
||||
|
||||
@@ -268,6 +268,17 @@ static uint8_t pack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppWritePa
|
||||
if(!pack_nr_tx_beamforming_pdu(&value->precodingAndBeamforming,ppWritePackedMsg, end)) {
|
||||
return 0;
|
||||
}
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!push8(value->param_v4.numSpatialStreamIndices, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
if (!pusharray8(value->param_v4.spatialStreamIndices,
|
||||
MAX_NUM_SPATIAL_STREAMS,
|
||||
value->param_v4.numSpatialStreamIndices,
|
||||
ppWritePackedMsg,
|
||||
end))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -307,6 +318,31 @@ static uint8_t pack_dl_tti_pdcch_pdu_rel15_value(void *tlv, uint8_t **ppWritePac
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ENABLE_AERIAL
|
||||
// Spatial steam indices for MU-MIMO
|
||||
const nfapi_v4_pdcch_pdu_parameters_t *p = &value->param_v4;
|
||||
if (!push16(p->numSpatialStreams, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
for (uint_fast16_t i = 0; i < p->numSpatialStreams; i++)
|
||||
if (!(push16(p->dci_spatialStreamIndices[i].dci_index, ppWritePackedMsg, end)
|
||||
&& push16(p->dci_spatialStreamIndices[i].spatial_stream_index, ppWritePackedMsg, end)))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline uint8_t pack_spatial_stream_indices(const nfapi_nr_spatial_stream_index_t *ss,
|
||||
uint8_t **ppWritePackedMsg,
|
||||
uint8_t *end)
|
||||
{
|
||||
if (!push8(ss->numSpatialStreamIndices, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
if (!pusharray16(ss->spatialStreamIndices, MAX_NUM_SPATIAL_STREAMS, ss->numSpatialStreamIndices, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -369,6 +405,14 @@ static uint8_t pack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppWritePac
|
||||
if (!push8(value->maintenance_parms_v3.ldpcBaseGraph, ppWritePackedMsg, end)
|
||||
|| !push32(value->maintenance_parms_v3.tbSizeLbrmBytes, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
// PDSCH parameter in FAPI v4 for MU-MIMO spatial stream indexing
|
||||
if (!push8(value->param_v4.numberCodewords, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
for (uint_fast8_t c = 0; c < value->param_v4.numberCodewords; c++)
|
||||
if (!pack_spatial_stream_indices(value->param_v4.spatialStreamsCw + c, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
@@ -390,6 +434,11 @@ static uint8_t pack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppWritePacke
|
||||
if(!pack_nr_tx_beamforming_pdu(&value->precoding_and_beamforming,ppWritePackedMsg, end)) {
|
||||
return 0;
|
||||
}
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!(push8(value->param_v4.spatialStreamIndexPresent, ppWritePackedMsg, end)
|
||||
&& push16(value->param_v4.spatialStreamIndex, ppWritePackedMsg, end)))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -517,6 +566,30 @@ static uint8_t unpack_dl_tti_pdcch_pdu_rel15_value(void *tlv, uint8_t **ppReadPa
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ENABLE_AERIAL
|
||||
// Spatial steam indices for MU-MIMO
|
||||
nfapi_v4_pdcch_pdu_parameters_t *p = &value->param_v4;
|
||||
if (!pull16(ppReadPackedMsg, &p->numSpatialStreams, end))
|
||||
return 0;
|
||||
|
||||
for (uint_fast16_t i = 0; i < p->numSpatialStreams; i++) {
|
||||
if (!(pull16(ppReadPackedMsg, &p->dci_spatialStreamIndices[i].dci_index, end)
|
||||
&& pull16(ppReadPackedMsg, &p->dci_spatialStreamIndices[i].spatial_stream_index, end)))
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline uint8_t unpack_spatial_stream_indices(nfapi_nr_spatial_stream_index_t *ss, uint8_t **ppReadPackedMsg, uint8_t *end)
|
||||
{
|
||||
if (!pull8(ppReadPackedMsg, &ss->numSpatialStreamIndices, end))
|
||||
return 0;
|
||||
|
||||
if (!pullarray16(ppReadPackedMsg, ss->spatialStreamIndices, MAX_NUM_SPATIAL_STREAMS, ss->numSpatialStreamIndices, end))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -579,6 +652,14 @@ static uint8_t unpack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppReadPa
|
||||
if (!pull8(ppReadPackedMsg, &value->maintenance_parms_v3.ldpcBaseGraph, end)
|
||||
|| !pull32(ppReadPackedMsg, &value->maintenance_parms_v3.tbSizeLbrmBytes, end))
|
||||
return 0;
|
||||
|
||||
// PDSCH parameter in FAPI v4 for MU-MIMO spatial stream indexing
|
||||
if (!pull8(ppReadPackedMsg, &value->param_v4.numberCodewords, end))
|
||||
return 0;
|
||||
|
||||
for (uint_fast8_t c = 0; c < value->param_v4.numberCodewords; c++)
|
||||
if (!unpack_spatial_stream_indices(value->param_v4.spatialStreamsCw + c, ppReadPackedMsg, end))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
@@ -602,6 +683,17 @@ static uint8_t unpack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppReadP
|
||||
if(!unpack_nr_tx_beamforming_pdu(&value->precodingAndBeamforming, ppReadPackedMsg, end)) {
|
||||
return 0;
|
||||
}
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!pull8(ppReadPackedMsg, &value->param_v4.numSpatialStreamIndices, end))
|
||||
return 0;
|
||||
|
||||
if (!pullarray8(ppReadPackedMsg,
|
||||
value->param_v4.spatialStreamIndices,
|
||||
MAX_NUM_SPATIAL_STREAMS,
|
||||
value->param_v4.numSpatialStreamIndices,
|
||||
end))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -626,6 +718,11 @@ static uint8_t unpack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppReadPack
|
||||
if(!unpack_nr_tx_beamforming_pdu(&value->precoding_and_beamforming, ppReadPackedMsg, end)) {
|
||||
return 0;
|
||||
}
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!(pull8(ppReadPackedMsg, &value->param_v4.spatialStreamIndexPresent, end)
|
||||
&& pull16(ppReadPackedMsg, &value->param_v4.spatialStreamIndex, end)))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -725,7 +822,14 @@ static uint8_t pack_ul_tti_request_prach_pdu(const nfapi_nr_prach_pdu_t *prach_p
|
||||
return 0;
|
||||
}
|
||||
|
||||
return pack_nr_rx_beamforming_pdu(&prach_pdu->beamforming, ppWritePackedMsg, end);
|
||||
if (!pack_nr_rx_beamforming_pdu(&prach_pdu->beamforming, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
const nfapi_nr_spatial_stream_index_t *p = &prach_pdu->param_v4;
|
||||
if (!pack_spatial_stream_indices(p, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end)
|
||||
@@ -817,7 +921,8 @@ static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ui
|
||||
}
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!(push8(pusch_pdu->maintenance_parms_v3.ldpcBaseGraph, ppWritePackedMsg, end)
|
||||
&& push32(pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes, ppWritePackedMsg, end)))
|
||||
&& push32(pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes, ppWritePackedMsg, end)
|
||||
&& pack_spatial_stream_indices(&pusch_pdu->param_v4, ppWritePackedMsg, end)))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
@@ -845,7 +950,15 @@ static uint8_t pack_ul_tti_request_pucch_pdu(const nfapi_nr_pucch_pdu_t *pucch_p
|
||||
return 0;
|
||||
}
|
||||
|
||||
return pack_nr_rx_beamforming_pdu(&pucch_pdu->beamforming, ppWritePackedMsg, end);
|
||||
if (!pack_nr_rx_beamforming_pdu(&pucch_pdu->beamforming, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!pack_spatial_stream_indices(&pucch_pdu->param_v4, ppWritePackedMsg, end))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint8_t pack_ul_tti_request_srs_parameters_v4(nfapi_v4_srs_parameters_t *srsParameters,
|
||||
@@ -1050,7 +1163,14 @@ static uint8_t unpack_ul_tti_request_prach_pdu(nfapi_nr_prach_pdu_t *prach_pdu,
|
||||
return 0;
|
||||
}
|
||||
|
||||
return unpack_nr_rx_beamforming_pdu(&prach_pdu->beamforming, ppReadPackedMsg, end);
|
||||
if (!unpack_nr_rx_beamforming_pdu(&prach_pdu->beamforming, ppReadPackedMsg, end))
|
||||
return 0;
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!unpack_spatial_stream_indices(&prach_pdu->param_v4, ppReadPackedMsg, end))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint8_t unpack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, uint8_t **ppReadPackedMsg, uint8_t *end)
|
||||
@@ -1139,7 +1259,8 @@ static uint8_t unpack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
}
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!(pull8(ppReadPackedMsg, &pusch_pdu->maintenance_parms_v3.ldpcBaseGraph, end)
|
||||
&& pull32(ppReadPackedMsg, &pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes, end)))
|
||||
&& pull32(ppReadPackedMsg, &pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes, end)
|
||||
&& unpack_spatial_stream_indices(&pusch_pdu->param_v4, ppReadPackedMsg, end)))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
@@ -1166,7 +1287,14 @@ static uint8_t unpack_ul_tti_request_pucch_pdu(nfapi_nr_pucch_pdu_t *pucch_pdu,
|
||||
&& pull16(ppReadPackedMsg, &pucch_pdu->bit_len_csi_part2, end))) {
|
||||
return 0;
|
||||
}
|
||||
return unpack_nr_rx_beamforming_pdu(&pucch_pdu->beamforming, ppReadPackedMsg, end);
|
||||
if (!unpack_nr_rx_beamforming_pdu(&pucch_pdu->beamforming, ppReadPackedMsg, end))
|
||||
return 0;
|
||||
|
||||
#ifndef ENABLE_AERIAL
|
||||
if (!unpack_spatial_stream_indices(&pucch_pdu->param_v4, ppReadPackedMsg, end))
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint8_t unpack_ul_tti_request_srs_parameters_v4(nfapi_v4_srs_parameters_t *srsParameters,
|
||||
|
||||
@@ -983,126 +983,76 @@ static void copy_dl_tti_beamforming(const nfapi_nr_tx_precoding_and_beamforming_
|
||||
}
|
||||
}
|
||||
|
||||
// Macro to get size from start to a member (exclusive)
|
||||
#define SIZE_UPTO(type, member) offsetof(type, member)
|
||||
|
||||
// Macro to get size from start to a member (inclusive)
|
||||
#define SIZE_INCLUDING(type, member) (offsetof(type, member) + sizeof(((type *)0)->member))
|
||||
|
||||
// Macro to copy partial struct
|
||||
#define PARTIAL_COPY(dst, src, type, last_member) memcpy((dst), (src), SIZE_INCLUDING(type, last_member))
|
||||
|
||||
// Macro to copy partial struct
|
||||
#define PARTIAL_COPY_RANGE(dst, src, type, first_member, last_member) \
|
||||
memcpy(((uint8_t *)(dst)) + SIZE_UPTO(type, first_member), \
|
||||
((uint8_t *)(src)) + SIZE_UPTO(type, first_member), \
|
||||
SIZE_INCLUDING(type, last_member) - SIZE_UPTO(type, first_member))
|
||||
|
||||
// Macro to copy array
|
||||
#define COPY_STRUCT_ARRAY(dst, src, data_member, count_member) \
|
||||
do { \
|
||||
size_t _len = (src)->count_member * sizeof((src)->data_member[0]); \
|
||||
if (_len > sizeof((dst)->data_member)) \
|
||||
_len = sizeof((dst)->data_member); \
|
||||
(dst)->count_member = (src)->count_member; \
|
||||
memcpy((dst)->data_member, (src)->data_member, _len); \
|
||||
} while (0)
|
||||
|
||||
static void copy_dl_tti_request_pdcch_pdu(const nfapi_nr_dl_tti_pdcch_pdu_rel15_t *src, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *dst)
|
||||
{
|
||||
dst->BWPSize = src->BWPSize;
|
||||
dst->BWPStart = src->BWPStart;
|
||||
dst->SubcarrierSpacing = src->SubcarrierSpacing;
|
||||
dst->CyclicPrefix = src->CyclicPrefix;
|
||||
dst->StartSymbolIndex = src->StartSymbolIndex;
|
||||
dst->DurationSymbols = src->DurationSymbols;
|
||||
for (int fdr_idx = 0; fdr_idx < 6; ++fdr_idx) {
|
||||
dst->FreqDomainResource[fdr_idx] = src->FreqDomainResource[fdr_idx];
|
||||
}
|
||||
dst->CceRegMappingType = src->CceRegMappingType;
|
||||
dst->RegBundleSize = src->RegBundleSize;
|
||||
dst->InterleaverSize = src->InterleaverSize;
|
||||
dst->CoreSetType = src->CoreSetType;
|
||||
dst->ShiftIndex = src->ShiftIndex;
|
||||
dst->precoderGranularity = src->precoderGranularity;
|
||||
dst->numDlDci = src->numDlDci;
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_dl_tti_pdcch_pdu_rel15_t, numDlDci);
|
||||
size_t partial_size = offsetof(nfapi_nr_dl_tti_pdcch_pdu_rel15_t, dci_pdu);
|
||||
memcpy(dst, src, partial_size);
|
||||
for (int dl_dci = 0; dl_dci < dst->numDlDci; ++dl_dci) {
|
||||
nfapi_nr_dl_dci_pdu_t *dst_dci_pdu = &dst->dci_pdu[dl_dci];
|
||||
const nfapi_nr_dl_dci_pdu_t *src_dci_pdu = &src->dci_pdu[dl_dci];
|
||||
dst_dci_pdu->RNTI = src_dci_pdu->RNTI;
|
||||
dst_dci_pdu->ScramblingId = src_dci_pdu->ScramblingId;
|
||||
dst_dci_pdu->ScramblingRNTI = src_dci_pdu->ScramblingRNTI;
|
||||
dst_dci_pdu->CceIndex = src_dci_pdu->CceIndex;
|
||||
dst_dci_pdu->AggregationLevel = src_dci_pdu->AggregationLevel;
|
||||
PARTIAL_COPY(dst_dci_pdu, src_dci_pdu, nfapi_nr_dl_dci_pdu_t, AggregationLevel);
|
||||
copy_dl_tti_beamforming(&src_dci_pdu->precodingAndBeamforming, &dst_dci_pdu->precodingAndBeamforming);
|
||||
dst_dci_pdu->beta_PDCCH_1_0 = src_dci_pdu->beta_PDCCH_1_0;
|
||||
dst_dci_pdu->powerControlOffsetSS = src_dci_pdu->powerControlOffsetSS;
|
||||
dst_dci_pdu->PayloadSizeBits = src_dci_pdu->PayloadSizeBits;
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
dst_dci_pdu->Payload[i] = src_dci_pdu->Payload[i];
|
||||
}
|
||||
PARTIAL_COPY_RANGE(dst_dci_pdu, src_dci_pdu, nfapi_nr_dl_dci_pdu_t, beta_PDCCH_1_0, Payload);
|
||||
}
|
||||
dst->param_v4.numSpatialStreams = src->param_v4.numSpatialStreams;
|
||||
for (uint_fast16_t i = 0; i < dst->param_v4.numSpatialStreams; i++) {
|
||||
dst->param_v4.dci_spatialStreamIndices[i] = src->param_v4.dci_spatialStreamIndices[i];
|
||||
}
|
||||
}
|
||||
|
||||
static void copy_dl_tti_request_pdsch_pdu(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *src, nfapi_nr_dl_tti_pdsch_pdu_rel15_t *dst)
|
||||
{
|
||||
dst->pduBitmap = src->pduBitmap;
|
||||
dst->rnti = src->rnti;
|
||||
dst->pduIndex = src->pduIndex;
|
||||
dst->BWPSize = src->BWPSize;
|
||||
dst->BWPStart = src->BWPStart;
|
||||
dst->SubcarrierSpacing = src->SubcarrierSpacing;
|
||||
dst->CyclicPrefix = src->CyclicPrefix;
|
||||
dst->NrOfCodewords = src->NrOfCodewords;
|
||||
for (int cw = 0; cw < dst->NrOfCodewords; ++cw) {
|
||||
dst->targetCodeRate[cw] = src->targetCodeRate[cw];
|
||||
dst->qamModOrder[cw] = src->qamModOrder[cw];
|
||||
dst->mcsIndex[cw] = src->mcsIndex[cw];
|
||||
dst->mcsTable[cw] = src->mcsTable[cw];
|
||||
dst->rvIndex[cw] = src->rvIndex[cw];
|
||||
dst->TBSize[cw] = src->TBSize[cw];
|
||||
}
|
||||
dst->dataScramblingId = src->dataScramblingId;
|
||||
dst->nrOfLayers = src->nrOfLayers;
|
||||
dst->transmissionScheme = src->transmissionScheme;
|
||||
dst->refPoint = src->refPoint;
|
||||
dst->dlDmrsSymbPos = src->dlDmrsSymbPos;
|
||||
dst->dmrsConfigType = src->dmrsConfigType;
|
||||
dst->dlDmrsScramblingId = src->dlDmrsScramblingId;
|
||||
dst->SCID = src->SCID;
|
||||
dst->numDmrsCdmGrpsNoData = src->numDmrsCdmGrpsNoData;
|
||||
dst->dmrsPorts = src->dmrsPorts;
|
||||
dst->resourceAlloc = src->resourceAlloc;
|
||||
for (int i = 0; i < 36; ++i) {
|
||||
dst->rbBitmap[i] = src->rbBitmap[i];
|
||||
}
|
||||
dst->rbStart = src->rbStart;
|
||||
dst->rbSize = src->rbSize;
|
||||
dst->VRBtoPRBMapping = src->VRBtoPRBMapping;
|
||||
dst->StartSymbolIndex = src->StartSymbolIndex;
|
||||
dst->NrOfSymbols = src->NrOfSymbols;
|
||||
dst->PTRSPortIndex = src->PTRSPortIndex;
|
||||
dst->PTRSTimeDensity = src->PTRSTimeDensity;
|
||||
dst->PTRSFreqDensity = src->PTRSFreqDensity;
|
||||
dst->PTRSReOffset = src->PTRSReOffset;
|
||||
dst->nEpreRatioOfPDSCHToPTRS = src->nEpreRatioOfPDSCHToPTRS;
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_dl_tti_pdsch_pdu_rel15_t, nEpreRatioOfPDSCHToPTRS);
|
||||
copy_dl_tti_beamforming(&src->precodingAndBeamforming, &dst->precodingAndBeamforming);
|
||||
dst->powerControlOffset = src->powerControlOffset;
|
||||
dst->powerControlOffsetSS = src->powerControlOffsetSS;
|
||||
dst->isLastCbPresent = src->isLastCbPresent;
|
||||
dst->isInlineTbCrc = src->isInlineTbCrc;
|
||||
dst->dlTbCrc = src->dlTbCrc;
|
||||
dst->maintenance_parms_v3.ldpcBaseGraph = src->maintenance_parms_v3.ldpcBaseGraph;
|
||||
dst->maintenance_parms_v3.tbSizeLbrmBytes = src->maintenance_parms_v3.tbSizeLbrmBytes;
|
||||
PARTIAL_COPY_RANGE(dst, src, nfapi_nr_dl_tti_pdsch_pdu_rel15_t, powerControlOffset, maintenance_parms_v3);
|
||||
dst->param_v4.numberCodewords = src->param_v4.numberCodewords;
|
||||
for (uint_fast8_t i = 0; i < dst->param_v4.numberCodewords; i++) {
|
||||
const nfapi_nr_spatial_stream_index_t *s = src->param_v4.spatialStreamsCw + i;
|
||||
nfapi_nr_spatial_stream_index_t *d = dst->param_v4.spatialStreamsCw + i;
|
||||
COPY_STRUCT_ARRAY(d, s, spatialStreamIndices, numSpatialStreamIndices);
|
||||
}
|
||||
}
|
||||
|
||||
static void copy_dl_tti_request_csi_rs_pdu(const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *src, nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *dst)
|
||||
{
|
||||
dst->bwp_size = src->bwp_size;
|
||||
dst->bwp_start = src->bwp_start;
|
||||
dst->subcarrier_spacing = src->subcarrier_spacing;
|
||||
dst->cyclic_prefix = src->cyclic_prefix;
|
||||
dst->start_rb = src->start_rb;
|
||||
dst->nr_of_rbs = src->nr_of_rbs;
|
||||
dst->csi_type = src->csi_type;
|
||||
dst->row = src->row;
|
||||
dst->freq_domain = src->freq_domain;
|
||||
dst->symb_l0 = src->symb_l0;
|
||||
dst->symb_l1 = src->symb_l1;
|
||||
dst->cdm_type = src->cdm_type;
|
||||
dst->freq_density = src->freq_density;
|
||||
dst->scramb_id = src->scramb_id;
|
||||
dst->power_control_offset = src->power_control_offset;
|
||||
dst->power_control_offset_ss = src->power_control_offset_ss;
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_dl_tti_csi_rs_pdu_rel15_t, power_control_offset_ss);
|
||||
copy_dl_tti_beamforming(&src->precodingAndBeamforming, &dst->precodingAndBeamforming);
|
||||
const struct nfapi_nr_csi_spatial_stream_index *s = &src->param_v4;
|
||||
struct nfapi_nr_csi_spatial_stream_index *d = &dst->param_v4;
|
||||
COPY_STRUCT_ARRAY(d, s, spatialStreamIndices, numSpatialStreamIndices);
|
||||
}
|
||||
|
||||
static void copy_dl_tti_request_ssb_pdu(const nfapi_nr_dl_tti_ssb_pdu_rel15_t *src, nfapi_nr_dl_tti_ssb_pdu_rel15_t *dst)
|
||||
{
|
||||
dst->PhysCellId = src->PhysCellId;
|
||||
dst->BetaPss = src->BetaPss;
|
||||
dst->SsbBlockIndex = src->SsbBlockIndex;
|
||||
dst->SsbSubcarrierOffset = src->SsbSubcarrierOffset;
|
||||
dst->ssbOffsetPointA = src->ssbOffsetPointA;
|
||||
dst->bchPayloadFlag = src->bchPayloadFlag;
|
||||
dst->bchPayload = src->bchPayload;
|
||||
dst->ssbRsrp = src->ssbRsrp;
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_dl_tti_ssb_pdu_rel15_t, ssbRsrp);
|
||||
copy_dl_tti_beamforming(&src->precoding_and_beamforming, &dst->precoding_and_beamforming);
|
||||
dst->param_v4 = src->param_v4;
|
||||
}
|
||||
|
||||
static void copy_dl_tti_request_pdu(const nfapi_nr_dl_tti_request_pdu_t *src, nfapi_nr_dl_tti_request_pdu_t *dst)
|
||||
@@ -1175,73 +1125,25 @@ static void copy_ul_tti_beamforming(const nfapi_nr_ul_beamforming_t *src, nfapi_
|
||||
|
||||
static void copy_ul_tti_request_prach_pdu(const nfapi_nr_prach_pdu_t *src, nfapi_nr_prach_pdu_t *dst)
|
||||
{
|
||||
dst->phys_cell_id = src->phys_cell_id;
|
||||
dst->num_prach_ocas = src->num_prach_ocas;
|
||||
dst->prach_format = src->prach_format;
|
||||
dst->num_ra = src->num_ra;
|
||||
dst->prach_start_symbol = src->prach_start_symbol;
|
||||
dst->num_cs = src->num_cs;
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_prach_pdu_t, num_cs);
|
||||
copy_ul_tti_beamforming(&src->beamforming, &dst->beamforming);
|
||||
const nfapi_nr_spatial_stream_index_t *s = &src->param_v4;
|
||||
nfapi_nr_spatial_stream_index_t *d = &dst->param_v4;
|
||||
COPY_STRUCT_ARRAY(d, s, spatialStreamIndices, numSpatialStreamIndices);
|
||||
}
|
||||
|
||||
static void copy_ul_tti_request_pusch_pdu(const nfapi_nr_pusch_pdu_t *src, nfapi_nr_pusch_pdu_t *dst)
|
||||
{
|
||||
dst->pdu_bit_map = src->pdu_bit_map;
|
||||
dst->rnti = src->rnti;
|
||||
dst->handle = src->handle;
|
||||
dst->bwp_size = src->bwp_size;
|
||||
dst->bwp_start = src->bwp_start;
|
||||
dst->subcarrier_spacing = src->subcarrier_spacing;
|
||||
dst->cyclic_prefix = src->cyclic_prefix;
|
||||
dst->target_code_rate = src->target_code_rate;
|
||||
dst->qam_mod_order = src->qam_mod_order;
|
||||
dst->mcs_index = src->mcs_index;
|
||||
dst->mcs_table = src->mcs_table;
|
||||
dst->transform_precoding = src->transform_precoding;
|
||||
dst->data_scrambling_id = src->data_scrambling_id;
|
||||
dst->nrOfLayers = src->nrOfLayers;
|
||||
dst->ul_dmrs_symb_pos = src->ul_dmrs_symb_pos;
|
||||
dst->dmrs_config_type = src->dmrs_config_type;
|
||||
dst->ul_dmrs_scrambling_id = src->ul_dmrs_scrambling_id;
|
||||
dst->pusch_identity = src->pusch_identity;
|
||||
dst->scid = src->scid;
|
||||
dst->num_dmrs_cdm_grps_no_data = src->num_dmrs_cdm_grps_no_data;
|
||||
dst->dmrs_ports = src->dmrs_ports;
|
||||
dst->resource_alloc = src->resource_alloc;
|
||||
for (int i = 0; i < 36; ++i) {
|
||||
dst->rb_bitmap[i] = src->rb_bitmap[i];
|
||||
}
|
||||
dst->rb_start = src->rb_start;
|
||||
dst->rb_size = src->rb_size;
|
||||
dst->vrb_to_prb_mapping = src->vrb_to_prb_mapping;
|
||||
dst->frequency_hopping = src->frequency_hopping;
|
||||
dst->tx_direct_current_location = src->tx_direct_current_location;
|
||||
dst->uplink_frequency_shift_7p5khz = src->uplink_frequency_shift_7p5khz;
|
||||
dst->start_symbol_index = src->start_symbol_index;
|
||||
dst->nr_of_symbols = src->nr_of_symbols;
|
||||
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_pusch_pdu_t, nr_of_symbols);
|
||||
if (dst->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_DATA) {
|
||||
const nfapi_nr_pusch_data_t *src_pusch_data = &src->pusch_data;
|
||||
nfapi_nr_pusch_data_t *dst_pusch_data = &dst->pusch_data;
|
||||
dst_pusch_data->rv_index = src_pusch_data->rv_index;
|
||||
dst_pusch_data->harq_process_id = src_pusch_data->harq_process_id;
|
||||
dst_pusch_data->new_data_indicator = src_pusch_data->new_data_indicator;
|
||||
dst_pusch_data->tb_size = src_pusch_data->tb_size;
|
||||
dst_pusch_data->num_cb = src_pusch_data->num_cb;
|
||||
for (int i = 0; i < (src_pusch_data->num_cb + 7) / 8; ++i) {
|
||||
dst_pusch_data->cb_present_and_position[i] = src_pusch_data->cb_present_and_position[i];
|
||||
}
|
||||
*dst_pusch_data = *src_pusch_data;
|
||||
}
|
||||
if (src->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_UCI) {
|
||||
const nfapi_nr_pusch_uci_t *src_pusch_uci = &src->pusch_uci;
|
||||
nfapi_nr_pusch_uci_t *dst_pusch_uci = &dst->pusch_uci;
|
||||
dst_pusch_uci->harq_ack_bit_length = src_pusch_uci->harq_ack_bit_length;
|
||||
dst_pusch_uci->csi_part1_bit_length = src_pusch_uci->csi_part1_bit_length;
|
||||
dst_pusch_uci->csi_part2_bit_length = src_pusch_uci->csi_part2_bit_length;
|
||||
dst_pusch_uci->alpha_scaling = src_pusch_uci->alpha_scaling;
|
||||
dst_pusch_uci->beta_offset_harq_ack = src_pusch_uci->beta_offset_harq_ack;
|
||||
dst_pusch_uci->beta_offset_csi1 = src_pusch_uci->beta_offset_csi1;
|
||||
dst_pusch_uci->beta_offset_csi2 = src_pusch_uci->beta_offset_csi2;
|
||||
*dst_pusch_uci = *src_pusch_uci;
|
||||
}
|
||||
if (src->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
const nfapi_nr_pusch_ptrs_t *src_pusch_ptrs = &src->pusch_ptrs;
|
||||
@@ -1252,10 +1154,7 @@ static void copy_ul_tti_request_pusch_pdu(const nfapi_nr_pusch_pdu_t *src, nfapi
|
||||
for (int i = 0; i < src_pusch_ptrs->num_ptrs_ports; ++i) {
|
||||
const nfapi_nr_ptrs_ports_t *src_ptrs_port = &src_pusch_ptrs->ptrs_ports_list[i];
|
||||
nfapi_nr_ptrs_ports_t *dst_ptrs_port = &dst_pusch_ptrs->ptrs_ports_list[i];
|
||||
|
||||
dst_ptrs_port->ptrs_port_index = src_ptrs_port->ptrs_port_index;
|
||||
dst_ptrs_port->ptrs_dmrs_port = src_ptrs_port->ptrs_dmrs_port;
|
||||
dst_ptrs_port->ptrs_re_offset = src_ptrs_port->ptrs_re_offset;
|
||||
*dst_ptrs_port = *src_ptrs_port;
|
||||
}
|
||||
|
||||
dst_pusch_ptrs->ptrs_time_density = src_pusch_ptrs->ptrs_time_density;
|
||||
@@ -1265,50 +1164,23 @@ static void copy_ul_tti_request_pusch_pdu(const nfapi_nr_pusch_pdu_t *src, nfapi
|
||||
if (src->pdu_bit_map & PUSCH_PDU_BITMAP_DFTS_OFDM) {
|
||||
const nfapi_nr_dfts_ofdm_t *src_dfts_ofdm = &src->dfts_ofdm;
|
||||
nfapi_nr_dfts_ofdm_t *dst_dfts_ofdm = &dst->dfts_ofdm;
|
||||
|
||||
dst_dfts_ofdm->low_papr_group_number = src_dfts_ofdm->low_papr_group_number;
|
||||
dst_dfts_ofdm->low_papr_sequence_number = src_dfts_ofdm->low_papr_sequence_number;
|
||||
dst_dfts_ofdm->ul_ptrs_sample_density = src_dfts_ofdm->ul_ptrs_sample_density;
|
||||
dst_dfts_ofdm->ul_ptrs_time_density_transform_precoding = src_dfts_ofdm->ul_ptrs_time_density_transform_precoding;
|
||||
*dst_dfts_ofdm = *src_dfts_ofdm;
|
||||
}
|
||||
copy_ul_tti_beamforming(&src->beamforming, &dst->beamforming);
|
||||
dst->maintenance_parms_v3.ldpcBaseGraph = src->maintenance_parms_v3.ldpcBaseGraph;
|
||||
dst->maintenance_parms_v3.tbSizeLbrmBytes = src->maintenance_parms_v3.tbSizeLbrmBytes;
|
||||
const nfapi_nr_spatial_stream_index_t *s = &src->param_v4;
|
||||
nfapi_nr_spatial_stream_index_t *d = &dst->param_v4;
|
||||
COPY_STRUCT_ARRAY(d, s, spatialStreamIndices, numSpatialStreamIndices);
|
||||
}
|
||||
|
||||
static void copy_ul_tti_request_pucch_pdu(const nfapi_nr_pucch_pdu_t *src, nfapi_nr_pucch_pdu_t *dst)
|
||||
{
|
||||
dst->rnti = src->rnti;
|
||||
dst->handle = src->handle;
|
||||
dst->bwp_size = src->bwp_size;
|
||||
dst->bwp_start = src->bwp_start;
|
||||
dst->subcarrier_spacing = src->subcarrier_spacing;
|
||||
dst->cyclic_prefix = src->cyclic_prefix;
|
||||
dst->format_type = src->format_type;
|
||||
dst->multi_slot_tx_indicator = src->multi_slot_tx_indicator;
|
||||
dst->pi_2bpsk = src->pi_2bpsk;
|
||||
dst->prb_start = src->prb_start;
|
||||
dst->prb_size = src->prb_size;
|
||||
dst->start_symbol_index = src->start_symbol_index;
|
||||
dst->nr_of_symbols = src->nr_of_symbols;
|
||||
dst->freq_hop_flag = src->freq_hop_flag;
|
||||
dst->second_hop_prb = src->second_hop_prb;
|
||||
dst->group_hop_flag = src->group_hop_flag;
|
||||
dst->sequence_hop_flag = src->sequence_hop_flag;
|
||||
dst->hopping_id = src->hopping_id;
|
||||
dst->initial_cyclic_shift = src->initial_cyclic_shift;
|
||||
dst->data_scrambling_id = src->data_scrambling_id;
|
||||
dst->time_domain_occ_idx = src->time_domain_occ_idx;
|
||||
dst->pre_dft_occ_idx = src->pre_dft_occ_idx;
|
||||
dst->pre_dft_occ_len = src->pre_dft_occ_len;
|
||||
dst->add_dmrs_flag = src->add_dmrs_flag;
|
||||
dst->dmrs_scrambling_id = src->dmrs_scrambling_id;
|
||||
dst->dmrs_cyclic_shift = src->dmrs_cyclic_shift;
|
||||
dst->sr_flag = src->sr_flag;
|
||||
dst->bit_len_harq = src->bit_len_harq;
|
||||
dst->bit_len_csi_part1 = src->bit_len_csi_part1;
|
||||
dst->bit_len_csi_part2 = src->bit_len_csi_part2;
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_pucch_pdu_t, bit_len_csi_part2);
|
||||
copy_ul_tti_beamforming(&src->beamforming, &dst->beamforming);
|
||||
const nfapi_nr_spatial_stream_index_t *s = &src->param_v4;
|
||||
nfapi_nr_spatial_stream_index_t *d = &dst->param_v4;
|
||||
COPY_STRUCT_ARRAY(d, s, spatialStreamIndices, numSpatialStreamIndices);
|
||||
}
|
||||
|
||||
static void copy_ul_tti_request_srs_parameters(const nfapi_v4_srs_parameters_t *src,
|
||||
@@ -1316,24 +1188,20 @@ static void copy_ul_tti_request_srs_parameters(const nfapi_v4_srs_parameters_t *
|
||||
nfapi_v4_srs_parameters_t *dst)
|
||||
{
|
||||
dst->srs_bandwidth_size = src->srs_bandwidth_size;
|
||||
for (int symbol_idx = 0; symbol_idx < num_symbols; ++symbol_idx) {
|
||||
nfapi_v4_srs_parameters_symbols_t *dst_symbol = &dst->symbol_list[symbol_idx];
|
||||
const nfapi_v4_srs_parameters_symbols_t *src_symbol = &src->symbol_list[symbol_idx];
|
||||
dst_symbol->srs_bandwidth_start = src_symbol->srs_bandwidth_start;
|
||||
dst_symbol->sequence_group = src_symbol->sequence_group;
|
||||
dst_symbol->sequence_number = src_symbol->sequence_number;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
// For Aerial, we always process the 4 reported symbols, not only the ones indicated by num_symbols
|
||||
for (int symbol_idx = num_symbols; symbol_idx < 4; ++symbol_idx) {
|
||||
const uint8_t symbols_to_fill = 4;
|
||||
(void)num_symbols; // To supress unused warning
|
||||
#else
|
||||
const uint8_t symbols_to_fill = num_symbols;
|
||||
#endif // ENABLE_AERIAL
|
||||
for (uint_fast8_t symbol_idx = 0; symbol_idx < symbols_to_fill; ++symbol_idx) {
|
||||
nfapi_v4_srs_parameters_symbols_t *dst_symbol = &dst->symbol_list[symbol_idx];
|
||||
const nfapi_v4_srs_parameters_symbols_t *src_symbol = &src->symbol_list[symbol_idx];
|
||||
dst_symbol->srs_bandwidth_start = src_symbol->srs_bandwidth_start;
|
||||
dst_symbol->sequence_group = src_symbol->sequence_group;
|
||||
dst_symbol->sequence_number = src_symbol->sequence_number;
|
||||
}
|
||||
#endif // ENABLE_AERIAL
|
||||
dst->usage = src->usage;
|
||||
const uint8_t nUsage = __builtin_popcount(dst->usage);
|
||||
for (int idx = 0; idx < nUsage; ++idx) {
|
||||
@@ -1346,37 +1214,12 @@ static void copy_ul_tti_request_srs_parameters(const nfapi_v4_srs_parameters_t *
|
||||
dst->ue_antennas_in_this_srs_resource_set = src->ue_antennas_in_this_srs_resource_set;
|
||||
dst->sampled_ue_antennas = src->sampled_ue_antennas;
|
||||
dst->report_scope = src->report_scope;
|
||||
dst->num_ul_spatial_streams_ports = src->num_ul_spatial_streams_ports;
|
||||
for (int idx = 0; idx < dst->num_ul_spatial_streams_ports; ++idx) {
|
||||
dst->Ul_spatial_stream_ports[idx] = src->Ul_spatial_stream_ports[idx];
|
||||
}
|
||||
COPY_STRUCT_ARRAY(dst, src, Ul_spatial_stream_ports, num_ul_spatial_streams_ports);
|
||||
}
|
||||
|
||||
static void copy_ul_tti_request_srs_pdu(const nfapi_nr_srs_pdu_t *src, nfapi_nr_srs_pdu_t *dst)
|
||||
{
|
||||
dst->rnti = src->rnti;
|
||||
dst->handle = src->handle;
|
||||
dst->bwp_size = src->bwp_size;
|
||||
dst->bwp_start = src->bwp_start;
|
||||
dst->subcarrier_spacing = src->subcarrier_spacing;
|
||||
dst->cyclic_prefix = src->cyclic_prefix;
|
||||
dst->num_ant_ports = src->num_ant_ports;
|
||||
dst->num_symbols = src->num_symbols;
|
||||
dst->num_repetitions = src->num_repetitions;
|
||||
dst->time_start_position = src->time_start_position;
|
||||
dst->config_index = src->config_index;
|
||||
dst->sequence_id = src->sequence_id;
|
||||
dst->bandwidth_index = src->bandwidth_index;
|
||||
dst->comb_size = src->comb_size;
|
||||
dst->comb_offset = src->comb_offset;
|
||||
dst->cyclic_shift = src->cyclic_shift;
|
||||
dst->frequency_position = src->frequency_position;
|
||||
dst->frequency_shift = src->frequency_shift;
|
||||
dst->frequency_hopping = src->frequency_hopping;
|
||||
dst->group_or_sequence_hopping = src->group_or_sequence_hopping;
|
||||
dst->resource_type = src->resource_type;
|
||||
dst->t_srs = src->t_srs;
|
||||
dst->t_offset = src->t_offset;
|
||||
PARTIAL_COPY(dst, src, nfapi_nr_srs_pdu_t, t_offset);
|
||||
copy_ul_tti_beamforming(&src->beamforming, &dst->beamforming);
|
||||
copy_ul_tti_request_srs_parameters(&src->srs_parameters_v4, 1 << src->num_symbols, &dst->srs_parameters_v4);
|
||||
}
|
||||
|
||||
@@ -853,6 +853,21 @@ typedef struct {
|
||||
|
||||
} nfapi_nr_dl_dci_pdu_t;
|
||||
|
||||
// The maximum number of spatial streams to be mapped depends on TLV 0x16E and
|
||||
// the number of streams could be same as number of layers or number of antenna
|
||||
// ports or number of baseband ports. Hence we set this to be the maximum number
|
||||
// of baseband ports
|
||||
#define MAX_NUM_SPATIAL_STREAMS 16
|
||||
|
||||
typedef struct {
|
||||
uint16_t dci_index;
|
||||
uint16_t spatial_stream_index;
|
||||
} nfapi_v4_dci_spatial_stream_index_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t numSpatialStreams;
|
||||
nfapi_v4_dci_spatial_stream_index_t dci_spatialStreamIndices[MAX_NUM_SPATIAL_STREAMS];
|
||||
} nfapi_v4_pdcch_pdu_parameters_t;
|
||||
|
||||
typedef struct {
|
||||
///Bandwidth part size [TS38.213 sec12]. Number of contiguous PRBs allocated to the BWP,Value: 1->275
|
||||
@@ -885,13 +900,32 @@ typedef struct {
|
||||
uint16_t numDlDci;
|
||||
///DL DCI PDU
|
||||
nfapi_nr_dl_dci_pdu_t dci_pdu[MAX_DCI_CORESET];
|
||||
} nfapi_nr_dl_tti_pdcch_pdu_rel15_t;
|
||||
/// Spatial stream indexing for MU-MIMO
|
||||
nfapi_v4_pdcch_pdu_parameters_t param_v4;
|
||||
} nfapi_nr_dl_tti_pdcch_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t ldpcBaseGraph;
|
||||
uint32_t tbSizeLbrmBytes;
|
||||
}nfapi_v3_pdsch_maintenance_parameters_t;
|
||||
|
||||
typedef struct {
|
||||
/// Number of spatial streams used in the index array
|
||||
uint8_t numSpatialStreamIndices;
|
||||
/// Spatial stream index array
|
||||
uint16_t spatialStreamIndices[MAX_NUM_SPATIAL_STREAMS];
|
||||
} nfapi_nr_spatial_stream_index_t;
|
||||
|
||||
#define MAX_NUM_CODEWORDS 2
|
||||
|
||||
typedef struct {
|
||||
// MU-MIMO support in FAPIv4
|
||||
/// Number of codewords with spatial stream indices
|
||||
uint8_t numberCodewords;
|
||||
/// Spatial stream indexing for codeworeds
|
||||
nfapi_nr_spatial_stream_index_t spatialStreamsCw[MAX_NUM_CODEWORDS];
|
||||
} nfapi_v4_pdsch_parameters_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t pduBitmap;
|
||||
uint16_t rnti;
|
||||
@@ -984,8 +1018,9 @@ typedef struct {
|
||||
uint32_t dlTbCrc;
|
||||
|
||||
nfapi_v3_pdsch_maintenance_parameters_t maintenance_parms_v3;
|
||||
}nfapi_nr_dl_tti_pdsch_pdu_rel15_t;
|
||||
|
||||
/// PDSCH parameters FAPI v4. used only for spatial stream indexing in MU-MIMO
|
||||
nfapi_v4_pdsch_parameters_t param_v4;
|
||||
} nfapi_nr_dl_tti_pdsch_pdu_rel15_t;
|
||||
|
||||
//for pdsch_pdu:
|
||||
/*
|
||||
@@ -1069,9 +1104,15 @@ typedef struct
|
||||
uint8_t power_control_offset; // Ratio of PDSCH EPRE to NZP CSI-RSEPRE [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->23 representing -8 to 15 dB in 1dB steps; 255: L1 is configured with ProfileSSS
|
||||
uint8_t power_control_offset_ss; // Ratio of NZP CSI-RS EPRE to SSB/PBCH block EPRE [3GPP TS 38.214, sec 5.2.2.3.1], Values: 0: -3dB; 1: 0dB; 2: 3dB; 3: 6dB; 255: L1 is configured with ProfileSSS
|
||||
nfapi_nr_tx_precoding_and_beamforming_t precodingAndBeamforming;
|
||||
/// Spatial stream indexing for MU-MIMO
|
||||
struct nfapi_nr_csi_spatial_stream_index {
|
||||
/// Number of spatial streams used in the index array
|
||||
uint8_t numSpatialStreamIndices;
|
||||
/// Spatial stream index array
|
||||
uint8_t spatialStreamIndices[MAX_NUM_SPATIAL_STREAMS];
|
||||
} param_v4;
|
||||
} nfapi_nr_dl_tti_csi_rs_pdu_rel15_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t bch_payload;//BCH payload. The valid bits are indicated in the PARAM/CONFIG TLVs. If PARAM/CONFIG TLVs indicate MAC generates full bchPayload then the payload length is 31 bits with the 8 LSB bits being. Otherwise timing PBCH bits are generated by the PHY. And for bchPayload the 24 LSB are used.
|
||||
@@ -1112,6 +1153,11 @@ typedef struct {
|
||||
/// A value indicating the channel quality between the gNB and nrUE. Value: 0->255 dBM
|
||||
uint8_t ssbRsrp;
|
||||
nfapi_nr_tx_precoding_and_beamforming_t precoding_and_beamforming;
|
||||
/// Spatial stream indexing
|
||||
struct nfapi_v4_ssb_param {
|
||||
uint8_t spatialStreamIndexPresent;
|
||||
uint16_t spatialStreamIndex;
|
||||
} param_v4;
|
||||
} nfapi_nr_dl_tti_ssb_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -1279,7 +1325,7 @@ typedef struct
|
||||
uint8_t prach_start_symbol;
|
||||
uint16_t num_cs;
|
||||
nfapi_nr_ul_beamforming_t beamforming;
|
||||
|
||||
nfapi_nr_spatial_stream_index_t param_v4;
|
||||
} nfapi_nr_prach_pdu_t;
|
||||
|
||||
//for pusch_pdu:
|
||||
@@ -1392,6 +1438,8 @@ typedef struct
|
||||
//beamforming
|
||||
nfapi_nr_ul_beamforming_t beamforming;
|
||||
nfapi_v3_pdsch_maintenance_parameters_t maintenance_parms_v3;
|
||||
// Spatial stream indexing for MU-MIMO
|
||||
nfapi_nr_spatial_stream_index_t param_v4;
|
||||
} nfapi_nr_pusch_pdu_t;
|
||||
|
||||
//for pucch_pdu:
|
||||
@@ -1437,7 +1485,7 @@ typedef struct
|
||||
uint16_t bit_len_csi_part2;
|
||||
|
||||
nfapi_nr_ul_beamforming_t beamforming;
|
||||
|
||||
nfapi_nr_spatial_stream_index_t param_v4;
|
||||
} nfapi_nr_pucch_pdu_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
20
nfapi/tests/p7/nr_fapi_common_util_test.h
Normal file
20
nfapi/tests/p7/nr_fapi_common_util_test.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
#ifndef OPENAIRINTERFACE_NR_FAPI_COMMON_UTIL_TEST_H
|
||||
#define OPENAIRINTERFACE_NR_FAPI_COMMON_UTIL_TEST_H
|
||||
#include "nfapi/tests/nr_fapi_test.h"
|
||||
|
||||
static uint8_t get_num_spatial_streams(void)
|
||||
{
|
||||
const uint16_t max_logical_ant_ports = MAX_NUM_SPATIAL_STREAMS;
|
||||
return rand8_range(0, max_logical_ant_ports);
|
||||
}
|
||||
|
||||
static void fill_spatial_streams(const uint8_t num_s, uint16_t s[MAX_NUM_SPATIAL_STREAMS])
|
||||
{
|
||||
for (int n = 0; n < num_s; n++)
|
||||
s[n] = rand16_range(0, num_s - 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "dci_payload_utils.h"
|
||||
#include "nr_fapi_p7.h"
|
||||
#include "nr_fapi_p7_utils.h"
|
||||
#include "nr_fapi_common_util_test.h"
|
||||
|
||||
static void fill_dl_tti_request_beamforming(nfapi_nr_tx_precoding_and_beamforming_t *precodingAndBeamforming)
|
||||
{
|
||||
@@ -48,6 +49,11 @@ static void fill_dl_tti_request_pdcch_pdu(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdu
|
||||
pdu->dci_pdu[dl_dci].PayloadSizeBits = rand16_range(0, DCI_PAYLOAD_BYTE_LEN * 8);
|
||||
generate_payload(pdu->dci_pdu[dl_dci].PayloadSizeBits, pdu->dci_pdu[dl_dci].Payload);
|
||||
}
|
||||
pdu->param_v4.numSpatialStreams = get_num_spatial_streams();
|
||||
for (int n = 0; n < pdu->param_v4.numSpatialStreams; n++) {
|
||||
pdu->param_v4.dci_spatialStreamIndices[n].dci_index = rand16();
|
||||
pdu->param_v4.dci_spatialStreamIndices[n].spatial_stream_index = rand16_range(0, pdu->param_v4.numSpatialStreams - 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void fill_dl_tti_request_pdsch_pdu(nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdu)
|
||||
@@ -109,6 +115,12 @@ static void fill_dl_tti_request_pdsch_pdu(nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdu
|
||||
}
|
||||
pdu->maintenance_parms_v3.ldpcBaseGraph = rand8();
|
||||
pdu->maintenance_parms_v3.tbSizeLbrmBytes = rand32();
|
||||
pdu->param_v4.numberCodewords = rand8_range(0, MAX_NUM_CODEWORDS);
|
||||
for (int c = 0; c < pdu->param_v4.numberCodewords; c++) {
|
||||
pdu->param_v4.spatialStreamsCw[c].numSpatialStreamIndices = get_num_spatial_streams();
|
||||
fill_spatial_streams(pdu->param_v4.spatialStreamsCw[c].numSpatialStreamIndices,
|
||||
pdu->param_v4.spatialStreamsCw[c].spatialStreamIndices);
|
||||
}
|
||||
}
|
||||
|
||||
static void fill_dl_tti_request_csi_rs_pdu(nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *pdu)
|
||||
@@ -147,6 +159,9 @@ static void fill_dl_tti_request_csi_rs_pdu(nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *p
|
||||
pdu->power_control_offset = rand8_range(0, 23);
|
||||
pdu->power_control_offset_ss = rand8_range(0, 3);
|
||||
fill_dl_tti_request_beamforming(&pdu->precodingAndBeamforming);
|
||||
pdu->param_v4.numSpatialStreamIndices = get_num_spatial_streams();
|
||||
for (int n = 0; n < pdu->param_v4.numSpatialStreamIndices; n++)
|
||||
pdu->param_v4.spatialStreamIndices[n] = rand8_range(0, pdu->param_v4.numSpatialStreamIndices - 1);
|
||||
}
|
||||
|
||||
static void fill_dl_tti_request_ssb_pdu(nfapi_nr_dl_tti_ssb_pdu_rel15_t *pdu)
|
||||
@@ -159,6 +174,8 @@ static void fill_dl_tti_request_ssb_pdu(nfapi_nr_dl_tti_ssb_pdu_rel15_t *pdu)
|
||||
pdu->bchPayloadFlag = rand8_range(0, 2);
|
||||
pdu->bchPayload = rand24();
|
||||
fill_dl_tti_request_beamforming(&pdu->precoding_and_beamforming);
|
||||
pdu->param_v4.spatialStreamIndexPresent = rand8(0, 1);
|
||||
pdu->param_v4.spatialStreamIndex = rand16_range(0, MAX_NUM_SPATIAL_STREAMS);
|
||||
}
|
||||
|
||||
static void fill_dl_tti_request(nfapi_nr_dl_tti_request_t *msg)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "dci_payload_utils.h"
|
||||
#include "nr_fapi_p7.h"
|
||||
#include "nr_fapi_p7_utils.h"
|
||||
#include "nr_fapi_common_util_test.h"
|
||||
|
||||
static void fill_ul_tti_request_beamforming(nfapi_nr_ul_beamforming_t *beamforming_pdu)
|
||||
{
|
||||
@@ -28,6 +29,8 @@ static void fill_ul_tti_request_prach_pdu(nfapi_nr_prach_pdu_t *pdu)
|
||||
pdu->prach_start_symbol = rand8_range(0, 13);
|
||||
pdu->num_cs = rand16_range(0, 419);
|
||||
fill_ul_tti_request_beamforming(&pdu->beamforming);
|
||||
pdu->param_v4.numSpatialStreamIndices = get_num_spatial_streams();
|
||||
fill_spatial_streams(pdu->param_v4.numSpatialStreamIndices, pdu->param_v4.spatialStreamIndices);
|
||||
}
|
||||
|
||||
static void fill_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pdu)
|
||||
@@ -133,6 +136,8 @@ static void fill_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pdu)
|
||||
fill_ul_tti_request_beamforming(&pdu->beamforming);
|
||||
pdu->maintenance_parms_v3.ldpcBaseGraph = rand8();
|
||||
pdu->maintenance_parms_v3.tbSizeLbrmBytes = rand32();
|
||||
pdu->param_v4.numSpatialStreamIndices = get_num_spatial_streams();
|
||||
fill_spatial_streams(pdu->param_v4.numSpatialStreamIndices, pdu->param_v4.spatialStreamIndices);
|
||||
}
|
||||
|
||||
static void fill_ul_tti_request_pucch_pdu(nfapi_nr_pucch_pdu_t *pdu)
|
||||
@@ -247,6 +252,8 @@ static void fill_ul_tti_request_pucch_pdu(nfapi_nr_pucch_pdu_t *pdu)
|
||||
}
|
||||
|
||||
fill_ul_tti_request_beamforming(&pdu->beamforming);
|
||||
pdu->param_v4.numSpatialStreamIndices = get_num_spatial_streams();
|
||||
fill_spatial_streams(pdu->param_v4.numSpatialStreamIndices, pdu->param_v4.spatialStreamIndices);
|
||||
}
|
||||
|
||||
static void fill_ul_tti_request_srs_parameters(nfapi_v4_srs_parameters_t *params, const uint8_t num_symbols){
|
||||
|
||||
Reference in New Issue
Block a user