X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_upr_inf.h;h=38d41e70755aee1c4bcd414b696feb8e8aa1e4c7;hb=ba78fa13b01e0729fe0a6a7a18cbf1d52cdcda1c;hp=0666ba2bfa1ae6ff19f30ce8a83bb842b32adc10;hpb=45d134510deb6902b870b4a0fb574b6075fba601;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_upr_inf.h b/src/5gnrmac/lwr_mac_upr_inf.h index 0666ba2bf..38d41e707 100644 --- a/src/5gnrmac/lwr_mac_upr_inf.h +++ b/src/5gnrmac/lwr_mac_upr_inf.h @@ -26,13 +26,33 @@ #define MAX_CRCS_PER_SLOT 1 #define MAX_CB_PER_TTI_IN_BYTES 1 #define MAX_ULSCH_PDUS_PER_TTI 1 - -/* events */ -#define EVENT_RACH_IND_TO_MAC 0 -#define EVENT_CRC_IND_TO_MAC 1 -#define EVENT_RX_DATA_IND_TO_MAC 2 -#define EVENT_STOP_IND_TO_MAC 3 -#define EVENT_SLOT_IND_TO_MAC 4 +#define MAX_ULCCH_PDUS_PER_TTI 1 +#define MAX_NUM_HARQS_PER_TTI 1 +#define MAX_HARQ_INFO_IN_BYTES 1 +#define MAX_CSI_PART1_DATA_IN_BYTES 1 +#define MAX_CSI_PART2_DATA_IN_BYTES 1 +#define MAX_UCI_PDUS_PER_TTI 1 +#define MAX_UCI_BIT_PER_TTI_IN_BYTES 2 +#define UCI_IND_PUSCH 0 /* UCI Indication carried on PUSCH */ +#define UCI_IND_PUCCH_F0F1 1 /* UCI Indication carried on PUCCH Format 0, 1 */ +#define UCI_IND_PUCCH_F2F3F4 2 /* UCI Indication carried on PUCCH Format 2, 3, 4 */ +#define SR_PDU_BITMASK 1 /* Bit Mask for SR_PDU */ +#define HARQ_PDU_BITMASK 2 /* Bit Mask for HARQ PDU */ +#define SR_NOT_DETECTED 0 /* SR not detected */ +#define SR_DETECTED 1 /* SR detected */ +#define CONFDC_LEVEL_GOOD 0 /* Confidence Level HARQ/SR */ +#define CONFDC_LEVEL_BAD 1 +#define HARQ_PASS 0 +#define HARQ_FAIL 1 +#define HARQ_NOT_PRESENT 3 + +/* Events */ +#define EVENT_RACH_IND_TO_MAC 1 +#define EVENT_CRC_IND_TO_MAC 2 +#define EVENT_RX_DATA_IND_TO_MAC 3 +#define EVENT_STOP_IND_TO_MAC 4 +#define EVENT_SLOT_IND_TO_MAC 5 +#define EVENT_UCI_IND_TO_MAC 6 typedef struct rachPreamInfo { @@ -99,28 +119,126 @@ typedef struct RxDataIndPdu pdus[MAX_ULSCH_PDUS_PER_TTI]; }RxDataInd; -typedef uint8_t (*packSlotIndMsg)(Pst *pst, SlotIndInfo *slotInd); -uint8_t packLcSlotInd (Pst *pst, SlotIndInfo *slotInd); -uint8_t packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd); +/* UCI Indication Structure */ +typedef struct +{ + uint8_t harqCrc; + uint16_t harqBitLen; + uint8_t harqPayload[MAX_HARQ_INFO_IN_BYTES]; +}PuschHarqInfo; -uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd); +typedef struct +{ + uint8_t csiPart1Crc; + uint16_t csiPart1BitLen; + uint8_t csiPart1Payload[MAX_CSI_PART1_DATA_IN_BYTES]; +}PuschCsiPart1Info; + +typedef struct +{ + uint8_t csiPart2Crc; + uint16_t csiPart2BitLen; + uint8_t csiPart2Payload[MAX_CSI_PART2_DATA_IN_BYTES]; +}PuschCsiPart2Info; -typedef uint8_t (*packRachIndMsg)(Pst *pst, RachInd *rachInd); +typedef struct +{ + uint32_t handle; + uint8_t pduBitmap; + uint8_t ul_cqi; + uint16_t crnti; + uint16_t timingAdvance; + uint16_t rssi; + PuschHarqInfo harqInfo; + PuschCsiPart1Info csiPart1Info; + PuschCsiPart2Info csiPart2Info; +}UciPusch; + +typedef struct +{ + uint8_t srIndPres; + uint8_t srConfdcLevel; +}SrInfoF0F1; + +typedef struct +{ + uint8_t numHarq; + uint8_t harqConfdcLevel; + uint8_t harqValue[MAX_NUM_HARQS_PER_TTI]; +}HarqInfoF0F1; + +typedef struct +{ + uint32_t handle; + uint8_t pduBitmap; + uint8_t pucchFormat; + uint8_t ul_cqi; + uint16_t crnti; + uint16_t timingAdvance; + uint16_t rssi; + SrInfoF0F1 srInfo; + HarqInfoF0F1 harqInfo; +}UciPucchF0F1; + +typedef struct +{ + uint32_t handle; + uint8_t pduBitmap; + uint8_t pucchFormat; + uint8_t ul_cqi; + uint16_t crnti; + uint16_t timingAdvance; + uint16_t rssi; + uint16_t num_uci_bits; + uint8_t uciBits[MAX_UCI_BIT_PER_TTI_IN_BYTES]; +}UciPucchF2F3F4; + +typedef struct +{ + uint16_t pduType; + uint16_t pduSize; + union + { + UciPusch uciPusch; /*TODO: UCI Ind for PUSCH to be handled separately */ + UciPucchF0F1 uciPucchF0F1; + UciPucchF2F3F4 uciPucchF2F3F4; + }uci; +}UciIndPduInfo; + +typedef struct +{ + uint16_t cellId; + SlotIndInfo slotInd; + uint16_t numUcis; + UciIndPduInfo pdus[MAX_UCI_PDUS_PER_TTI]; +}UciInd; + +typedef uint8_t (*SlotIndFunc)(Pst *pst, SlotIndInfo *slotInd); +typedef uint8_t (*RachIndFunc)(Pst *pst, RachInd *rachInd); +typedef uint8_t (*CrcIndFunc)(Pst *pst, CrcInd *crcInd); +typedef uint8_t (*RxDataIndFunc)(Pst *pst, RxDataInd *rxDataInd); +typedef uint8_t (*StopIndFunc)(Pst *pst, uint16_t *cellId); +typedef uint8_t (*UciIndFunc)(Pst *pst, UciInd *uciInd); + +uint8_t packSlotInd (Pst *pst, SlotIndInfo *slotInd); +uint8_t unpackSlotInd(SlotIndFunc func, Pst *pst, Buffer *mBuf); +uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd); uint8_t packRachInd(Pst *pst, RachInd *rachInd); +uint8_t unpackRachInd(RachIndFunc func, Pst *pst, Buffer *mBuf); uint8_t fapiMacRachInd(Pst *pst, RachInd *rachInd); - -typedef uint8_t (*packCrcIndMsg)(Pst *pst, CrcInd *crcInd); uint8_t packCrcInd(Pst *pst, CrcInd *crcInd); +uint8_t unpackCrcInd(CrcIndFunc func, Pst *pst, Buffer *mBuf); uint8_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd); - - -typedef uint8_t (*packRxDataIndMsg)(Pst *pst, RxDataInd *rxDataInd); uint8_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd); +uint8_t unpackRxDataInd(RxDataIndFunc func, Pst *pst, Buffer *mBuf); uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd); +uint8_t packStopInd(Pst *pst, uint16_t *cellId); +uint8_t unpackStopInd(StopIndFunc func, Pst *pst, Buffer *mBuf); +uint8_t fapiMacStopInd(Pst *pst, uint16_t *cellId); +uint8_t packUciInd(Pst *pst, UciInd *uciInd); +uint8_t unpackUciInd(UciIndFunc func, Pst *pst, Buffer *mBuf); +uint8_t FapiMacUciInd(Pst *pst, UciInd *uciInd); -typedef uint8_t (*packStopIndMsg)(Pst *pst, uint16_t cellId); -uint8_t packStopInd(Pst *pst, uint16_t cellId); -uint8_t fapiMacStopInd(Pst *pst, uint16_t cellId); #endif /********************************************************************** End of file