1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /* header include files -- defines (.h) */
21 #ifndef __LWR_MAC_UPR_INF_H__
22 #define __LWR_MAC_UPR_INF_H__
24 #define MAX_PREAMBLE_PER_SLOT 1 /* Max number of preamble per slot */
25 #define MAX_RACH_PDU_PER_SLOT 1 /* Max number of rach pdu per slot */
26 #define MAX_CRCS_PER_SLOT 1
27 #define MAX_CB_PER_TTI_IN_BYTES 1
28 #define MAX_ULSCH_PDUS_PER_TTI 1
29 #define MAX_ULCCH_PDUS_PER_TTI 1
30 #define MAX_NUM_HARQS_PER_TTI 1
31 #define MAX_HARQ_INFO_IN_BYTES 1
32 #define MAX_CSI_PART1_DATA_IN_BYTES 1
33 #define MAX_CSI_PART2_DATA_IN_BYTES 1
34 #define MAX_UCI_PDUS_PER_TTI 1
35 #define MAX_UCI_BIT_PER_TTI_IN_BYTES 2
36 #define UCI_IND_PUSCH 0 /* UCI Indication carried on PUSCH */
37 #define UCI_IND_PUCCH_F0F1 1 /* UCI Indication carried on PUCCH Format 0, 1 */
38 #define UCI_IND_PUCCH_F2F3F4 2 /* UCI Indication carried on PUCCH Format 2, 3, 4 */
39 #define SR_PDU_BITMASK 1 /* Bit Mask for SR_PDU */
40 #define HARQ_PDU_BITMASK 2 /* Bit Mask for HARQ PDU */
41 #define SR_NOT_DETECTED 0 /* SR not detected */
42 #define SR_DETECTED 1 /* SR detected */
43 #define CONFDC_LEVEL_GOOD 0 /* Confidence Level HARQ/SR */
44 #define CONFDC_LEVEL_BAD 1
47 #define HARQ_NOT_PRESENT 3
50 #define EVENT_RACH_IND_TO_MAC 0
51 #define EVENT_CRC_IND_TO_MAC 1
52 #define EVENT_RX_DATA_IND_TO_MAC 2
53 #define EVENT_STOP_IND_TO_MAC 3
54 #define EVENT_SLOT_IND_TO_MAC 4
55 #define EVENT_UCI_IND_TO_MAC 5
57 typedef struct rachPreamInfo
63 typedef struct rachPduInfo
70 RachPreamInfo preamInfo[MAX_PREAMBLE_PER_SLOT];
73 typedef struct rachInd
76 SlotIndInfo timingInfo;
78 RachPduInfo rachPdu[MAX_RACH_PDU_PER_SLOT];
81 typedef struct crcInfo
88 uint8_t cbCrcStatus[MAX_CB_PER_TTI_IN_BYTES];
90 uint16_t timingAdvance;
97 SlotIndInfo timingInfo;
99 CrcInfo crcInfo[MAX_CRCS_PER_SLOT];
109 uint16_t timingAdvance;
117 SlotIndInfo timingInfo;
119 RxDataIndPdu pdus[MAX_ULSCH_PDUS_PER_TTI];
122 /* UCI Indication Structure */
127 uint8_t harqPayload[MAX_HARQ_INFO_IN_BYTES];
133 uint16_t csiPart1BitLen;
134 uint8_t csiPart1Payload[MAX_CSI_PART1_DATA_IN_BYTES];
140 uint16_t csiPart2BitLen;
141 uint8_t csiPart2Payload[MAX_CSI_PART2_DATA_IN_BYTES];
150 uint16_t timingAdvance;
152 PuschHarqInfo harqInfo;
153 PuschCsiPart1Info csiPart1Info;
154 PuschCsiPart2Info csiPart2Info;
160 uint8_t srConfdcLevel;
166 uint8_t harqConfdcLevel;
167 uint8_t harqValue[MAX_NUM_HARQS_PER_TTI];
177 uint16_t timingAdvance;
179 uint8_t uciBits[MAX_UCI_BIT_PER_TTI_IN_BYTES];
181 HarqInfoF0F1 harqInfo;
191 uint16_t timingAdvance;
193 uint16_t num_uci_bits;
194 uint8_t uciBits[MAX_UCI_BIT_PER_TTI_IN_BYTES];
203 UciPusch uciPusch; /*TODO: UCI Ind for PUSCH to be handled separately */
204 UciPucchF0F1 uciPucchF0F1;
205 UciPucchF2F3F4 uciPucchF2F3F4;
214 UciIndPduInfo pdus[MAX_UCI_PDUS_PER_TTI];
217 typedef uint8_t (*packSlotIndMsg)(Pst *pst, SlotIndInfo *slotInd);
218 typedef uint8_t (*packRachIndMsg)(Pst *pst, RachInd *rachInd);
219 typedef uint8_t (*packCrcIndMsg)(Pst *pst, CrcInd *crcInd);
220 typedef uint8_t (*packRxDataIndMsg)(Pst *pst, RxDataInd *rxDataInd);
221 typedef uint8_t (*packStopIndMsg)(Pst *pst, uint16_t cellId);
222 typedef uint8_t (*packMacUciIndMsg)(Pst *pst, UciInd *uciInd);
224 uint8_t packLcSlotInd (Pst *pst, SlotIndInfo *slotInd);
225 uint8_t packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd);
226 uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd);
227 uint8_t packRachInd(Pst *pst, RachInd *rachInd);
228 uint8_t fapiMacRachInd(Pst *pst, RachInd *rachInd);
229 uint8_t packCrcInd(Pst *pst, CrcInd *crcInd);
230 uint8_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd);
231 uint8_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd);
232 uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd);
233 uint8_t packStopInd(Pst *pst, uint16_t cellId);
234 uint8_t fapiMacStopInd(Pst *pst, uint16_t cellId);
235 uint8_t packMacUciInd(Pst *pst, UciInd *uciInd);
236 uint8_t FapiMacUciInd(Pst *pst, UciInd *uciInd);
239 /**********************************************************************
241 **********************************************************************/