uci.h 7.96 KB
Newer Older
ghaddab's avatar
ghaddab committed
1
/*******************************************************************************
2
    OpenAirInterface
ghaddab's avatar
ghaddab committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16
    Copyright(c) 1999 - 2014 Eurecom

    OpenAirInterface is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.


    OpenAirInterface is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
17 18
    along with OpenAirInterface.The full GNU General Public License is
   included in this distribution in the file called "COPYING". If not,
ghaddab's avatar
ghaddab committed
19 20 21 22 23
   see <http://www.gnu.org/licenses/>.

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
24
  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
25

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
ghaddab's avatar
ghaddab committed
27 28

 *******************************************************************************/
29 30 31 32 33 34 35 36 37 38 39 40
#include "PHY/types.h"



typedef enum {
  ue_selected,
  wideband_cqi_rank1_2A, //wideband_cqi_rank1_2A,
  wideband_cqi_rank2_2A, //wideband_cqi_rank2_2A,
  HLC_subband_cqi_nopmi, //HLC_subband_cqi_nopmi,
  HLC_subband_cqi_rank1_2A, //HLC_subband_cqi_rank1_2A,
  HLC_subband_cqi_rank2_2A, //HLC_subband_cqi_rank2_2A,
  HLC_subband_cqi_modes123, //HLC_subband_cqi_modes123
41
  HLC_subband_cqi_mcs_CBA, // MCS and RNTI, for contention-based acces
42
  unknown_cqi//
43 44
} UCI_format_t;

45
// **********************************************1.5 MHz***************************************************************************
46 47
typedef struct __attribute__((packed))
{
48
  uint32_t padding:16;
49
  uint32_t pmi:12;
50
  uint32_t cqi1:4;
51 52
}
wideband_cqi_rank1_2A_1_5MHz ;
53 54
#define sizeof_wideband_cqi_rank1_2A_1_5MHz 16

55 56
typedef struct __attribute__((packed))
{
57
  uint16_t padding:2;
58
  uint16_t pmi:6;
59 60
  uint16_t cqi2:4;
  uint16_t cqi1:4;
61 62
}
wideband_cqi_rank2_2A_1_5MHz ;
63 64
#define sizeof_wideband_cqi_rank2_2A_1_5MHz 14

65 66
typedef struct __attribute__((packed))
{
67 68 69
  uint32_t padding:16;
  uint32_t diffcqi1:12;
  uint32_t cqi1:4;
70 71
}
HLC_subband_cqi_nopmi_1_5MHz;
72 73
#define sizeof_HLC_subband_cqi_nopmi_1_5MHz 16

74 75
typedef struct __attribute__((packed))
{
76 77
  uint32_t padding:14;
  uint32_t pmi:2;
78
  uint32_t diffcqi1:12;
79
  uint32_t cqi1:4;
80 81
}
HLC_subband_cqi_rank1_2A_1_5MHz;
82 83
#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz 18

84 85
typedef struct __attribute__((packed))
{
86 87
  uint64_t padding:31;
  uint64_t pmi:1;
88
  uint64_t diffcqi2:12;
89
  uint64_t cqi2:4;
90
  uint64_t diffcqi1:12;
91
  uint64_t cqi1:4;
92 93
}
HLC_subband_cqi_rank2_2A_1_5MHz;
94 95
#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz 33

96 97
typedef struct __attribute__((packed))
{
98
  uint32_t padding:16;
99
  uint32_t diffcqi1:12;
100
  uint32_t cqi1:4;
101 102
}
HLC_subband_cqi_modes123_1_5MHz;
103 104
#define sizeof_HLC_subband_cqi_modes123_1_5MHz 16

105 106
typedef struct __attribute__((packed))
{
107
  uint32_t padding:11;
108
  uint32_t crnti:16;
109
  uint32_t mcs:5;
110 111
}
HLC_subband_cqi_mcs_CBA_1_5MHz;
112
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz 21
113 114 115


// **********************************************5 MHz***************************************************************************
116 117
typedef struct __attribute__((packed))
{
118
  uint32_t padding:14;
119
  uint32_t pmi:14;
120
  uint32_t cqi1:4;
121 122
}
wideband_cqi_rank1_2A_5MHz ;
123 124
#define sizeof_wideband_cqi_rank1_2A_5MHz 18

125 126
typedef struct __attribute__((packed))
{
127
  uint16_t padding:1;
128
  uint16_t pmi:7;
129 130
  uint16_t cqi2:4;
  uint16_t cqi1:4;
131 132
}
wideband_cqi_rank2_2A_5MHz ;
133 134
#define sizeof_wideband_cqi_rank2_2A_5MHz 15

135 136
typedef struct __attribute__((packed))
{
137 138 139
  uint32_t padding:14;
  uint32_t diffcqi1:14;
  uint32_t cqi1:4;
140 141
}
HLC_subband_cqi_nopmi_5MHz;
142 143
#define sizeof_HLC_subband_cqi_nopmi_5MHz 18

144 145
typedef struct __attribute__((packed))
{
146 147
  uint32_t padding:12;
  uint32_t pmi:2;
148
  uint32_t diffcqi1:14;
149
  uint32_t cqi1:4;
150 151
}
HLC_subband_cqi_rank1_2A_5MHz;
152 153
#define sizeof_HLC_subband_cqi_rank1_2A_5MHz 20

154 155
typedef struct __attribute__((packed))
{
156 157
  uint64_t padding:27;
  uint64_t pmi:1;
158
  uint64_t diffcqi2:14;
159
  uint64_t cqi2:4;
160
  uint64_t diffcqi1:14;
161
  uint64_t cqi1:4;
162 163
}
HLC_subband_cqi_rank2_2A_5MHz;
164 165
#define sizeof_HLC_subband_cqi_rank2_2A_5MHz 37

166 167
typedef struct __attribute__((packed))
{
168
  uint32_t padding:14;
169
  uint32_t diffcqi1:14;
170
  uint32_t cqi1:4;
171 172
}
HLC_subband_cqi_modes123_5MHz;
173 174
#define sizeof_HLC_subband_cqi_modes123_5MHz 18

175 176
typedef struct __attribute__((packed))
{
177
  uint32_t padding:11;
178
  uint32_t crnti:16;
179
  uint32_t mcs:5;
180 181
}
HLC_subband_cqi_mcs_CBA_5MHz;
182
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz 21
183

184
// **********************************************10 MHz***************************************************************************
185 186
typedef struct __attribute__((packed))
{
187
  uint32_t padding:10;
188
  uint32_t pmi:18;
189
  uint32_t cqi1:4;
190 191
}
wideband_cqi_rank1_2A_10MHz ;
192 193
#define sizeof_wideband_cqi_rank1_2A_10MHz 22

194 195
typedef struct __attribute__((packed))
{
196
  uint32_t padding:15;
197
  uint32_t pmi:9;
198 199
  uint32_t cqi2:4;
  uint32_t cqi1:4;
200 201
}
wideband_cqi_rank2_2A_10MHz ;
202 203
#define sizeof_wideband_cqi_rank2_2A_10MHz 17

204 205
typedef struct __attribute__((packed))
{
206 207 208
  uint32_t padding:10;
  uint32_t diffcqi1:18;
  uint32_t cqi1:4;
209 210
}
HLC_subband_cqi_nopmi_10MHz;
211 212
#define sizeof_HLC_subband_cqi_nopmi_10MHz 22

213 214
typedef struct __attribute__((packed))
{
215 216
  uint32_t padding:8;
  uint32_t pmi:2;
217
  uint32_t diffcqi1:18;
218
  uint32_t cqi1:4;
219 220
}
HLC_subband_cqi_rank1_2A_10MHz;
221 222
#define sizeof_HLC_subband_cqi_rank1_2A_10MHz 24

223 224
typedef struct __attribute__((packed))
{
225 226
  uint64_t padding:19;
  uint64_t pmi:1;
227
  uint64_t diffcqi2:18;
228
  uint64_t cqi2:4;
229
  uint64_t diffcqi1:18;
230
  uint64_t cqi1:4;
231 232
}
HLC_subband_cqi_rank2_2A_10MHz;
233 234
#define sizeof_HLC_subband_cqi_rank2_2A_10MHz 45

235 236
typedef struct __attribute__((packed))
{
237
  uint32_t padding:10;
238
  uint32_t diffcqi1:18;
239
  uint32_t cqi1:4;
240 241
}
HLC_subband_cqi_modes123_10MHz;
242 243
#define sizeof_HLC_subband_cqi_modes123_10MHz 22

244 245
typedef struct __attribute__((packed))
{
246
  uint32_t padding:11;
247
  uint32_t crnti:16;
248
  uint32_t mcs:5;
249 250
}
HLC_subband_cqi_mcs_CBA_10MHz;
251
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz 21
252 253

// **********************************************20 MHz***************************************************************************
254 255
typedef struct __attribute__((packed))
{
256
  uint32_t padding:2;
257
  uint32_t pmi:26;
258
  uint32_t cqi1:4;
259 260
}
wideband_cqi_rank1_2A_20MHz ;
261 262
#define sizeof_wideband_cqi_rank1_2A_20MHz 20

263 264
typedef struct __attribute__((packed))
{
265
  uint32_t padding:11;
266
  uint32_t pmi:13;
267 268
  uint32_t cqi2:4;
  uint32_t cqi1:4;
269 270
}
wideband_cqi_rank2_2A_20MHz ;
271 272
#define sizeof_wideband_cqi_rank2_2A_20MHz 21

273 274
typedef struct __attribute__((packed))
{
275 276 277
  uint32_t padding:2;
  uint32_t diffcqi1:26;
  uint32_t cqi1:4;
278 279
}
HLC_subband_cqi_nopmi_20MHz;
280 281
#define sizeof_HLC_subband_cqi_nopmi_20MHz 30

282 283
typedef struct __attribute__((packed))
{
284 285
  //  uint32_t padding:12;
  uint32_t pmi:2;
286
  uint32_t diffcqi1:26;
287
  uint32_t cqi1:4;
288 289
}
HLC_subband_cqi_rank1_2A_20MHz;
290 291
#define sizeof_HLC_subband_cqi_rank1_2A_20MHz 32

292 293
typedef struct __attribute__((packed))
{
294 295
  uint64_t padding:3;
  uint64_t pmi:1;
296
  uint64_t diffcqi2:26;
297
  uint64_t cqi2:4;
298
  uint64_t diffcqi1:26;
299
  uint64_t cqi1:4;
300 301
}
HLC_subband_cqi_rank2_2A_20MHz;
302 303
#define sizeof_HLC_subband_cqi_rank2_2A_20MHz 61

304 305
typedef struct __attribute__((packed))
{
306
  uint32_t padding:2;
307
  uint32_t diffcqi1:26;
308
  uint32_t cqi1:4;
309 310
}
HLC_subband_cqi_modes123_20MHz;
311 312
#define sizeof_HLC_subband_cqi_modes123_20MHz 30

313 314
typedef struct __attribute__((packed))
{
315
  uint32_t padding:11;
316
  uint32_t crnti:16;
317
  uint32_t mcs:5;
318 319
}
HLC_subband_cqi_mcs_CBA_20MHz;
320
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz 21
321 322


323 324 325
#define MAX_CQI_PAYLOAD (sizeof(HLC_subband_cqi_rank2_2A_20MHz)*8*20)
#define MAX_CQI_BITS (sizeof(HLC_subband_cqi_rank2_2A_20MHz)*8)
#define MAX_CQI_BYTES (sizeof(HLC_subband_cqi_rank2_2A_20MHz))
326 327
#define MAX_ACK_PAYLOAD 18
#define MAX_RI_PAYLOAD 6