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 *******************************************************************************/
23 /* header include files (.h) */
24 #include "envopt.h" /* environment options */
25 #include "envdep.h" /* environment dependent */
26 #include "envind.h" /* environment independent */
27 #include "gen.h" /* general */
28 #include "ssi.h" /* system services */
29 #include "cm_tkns.h" /* Common Token Defines */
30 #include "cm_llist.h" /* Common Link List Defines */
31 #include "cm_hash.h" /* Common Hash List Defines */
32 #include "cm_lte.h" /* Common LTE Defines */
33 #include "cm_mblk.h" /* Common LTE Defines */
34 #include "rgu.h" /* RGU interface includes*/
35 #include "tfu.h" /* TFU Interface defines */
37 #include "du_app_mac_inf.h"
38 #include "mac_sch_interface.h"
40 /* header/extern include files (.x) */
41 #include "gen.x" /* general */
42 #include "ssi.x" /* system services */
43 #include "cm_tkns.x" /* Common Token Definitions */
44 #include "cm_llist.x" /* Common Link List Definitions */
45 #include "cm_lib.x" /* Common Library Definitions */
46 #include "cm_hash.x" /* Common Hash List Definitions */
47 #include "cm_lte.x" /* Common LTE Defines */
48 #include "cm_mblk.x" /* Common LTE Defines */
50 #include "tfu.x" /* RGU Interface includes */
53 #define MAX_SLOT_SUPPORTED 10 /* numerology 0 15Khz */
54 #define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */
55 #define SI_RNTI 0xFFFF
59 #define MAX_CRI_SIZE 6
60 #define MAX_MAC_DL_PDU 10
62 #define MAC_LCID_CCCH 0
63 #define MAC_DEDLC_MIN_LCID 1
64 #define MAC_DEDLC_MAX_LCID 32
65 #define MAC_LCID_RESERVED_MIN 33
66 #define MAC_LCID_RESERVED_MAX 51
67 #define MAC_LCID_CCCH_48BIT 52
68 #define MAC_LCID_BIT_RATE_QUERY 53
69 #define MAC_LCID_MULT_PHR_FOUR_OCT 54
70 #define MAC_LCID_CFG_GRANT_CFM 55
71 #define MAC_LCID_MULT_PHR_ONE_OCT 56
72 #define MAC_LCID_SINGLE_PHR 57
73 #define MAC_LCID_CRNTI 58
74 #define MAC_LCID_SHORT_TRUNC_BSR 59
75 #define MAC_LCID_LONG_TRUNC_BSR 60
76 #define MAC_LCID_SHORT_BSR 61
77 #define MAC_LCID_LONG_BSR 62
78 #define MAC_LCID_CRI 62
79 #define MAC_LCID_PADDING 63
81 typedef struct macDlSlot
86 typedef struct macUlSlot
91 typedef struct macCbInfo
95 uint8_t msg3Pdu[6]; /* used as CRI value during muxing */
96 uint8_t *msg4Pdu; /* storing DL-CCCH Ind Pdu */
97 uint16_t msg4PduLen; /* storing DL-CCCH Ind Pdu Len */
98 uint8_t *msg4TxPdu; /* muxed Pdu used for re-transmission */
99 uint16_t msg4TbSize; /* size required for msg4TxPdu */
105 uint8_t macCeValue[6];
108 typedef struct macCeInfo
111 MacCe macCe[MAX_MAC_CE];
114 typedef struct macDlInfo
121 typedef struct macDlData
124 MacDlInfo pduInfo[MAX_MAC_DL_PDU];
127 typedef struct macCellCb
130 MacRaCbInfo macRaCb[MAX_UE];
131 MacDlSlot dlSlot[MAX_SLOT_SUPPORTED];
132 MacUlSlot ulSlot[MAX_SLOT_SUPPORTED];
141 /* global variable */
143 void fillMacToSchPst(Pst *pst);
144 void fillRarPdu(RarInfo *rarInfo);
145 void createMacRaCb(uint16_t cellId, uint16_t crnti);
146 void fillMsg4DlData(MacDlData *dlData);
147 void fillMacCe(MacCeInfo *macCeData);
148 void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint16_t tbSize);
149 int unpackRxData(RxDataIndPdu *rxDataIndPdu);
152 /**********************************************************************
154 **********************************************************************/