uci.h 8.01 KB
Newer Older
ghaddab's avatar
ghaddab committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*******************************************************************************
    OpenAirInterface 
    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
    along with OpenAirInterface.The full GNU General Public License is 
   included in this distribution in the file called "COPYING". If not, 
   see <http://www.gnu.org/licenses/>.

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
  OpenAirInterface Dev  : openair4g-devel@eurecom.fr
  
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 41 42 43 44
#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
  HLC_subband_cqi_mcs_CBA,
  unknown_cqi// 
} UCI_format_t;

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
// **********************************************1.5 MHz***************************************************************************
typedef struct __attribute__((packed)) {
  uint32_t padding:16;
  uint32_t pmi:12; 
  uint32_t cqi1:4;
} wideband_cqi_rank1_2A_1_5MHz ; 
#define sizeof_wideband_cqi_rank1_2A_1_5MHz 16

typedef struct __attribute__((packed)) {
  uint16_t padding:2;
  uint16_t pmi:6; 
  uint16_t cqi2:4;
  uint16_t cqi1:4;
} wideband_cqi_rank2_2A_1_5MHz ; 
#define sizeof_wideband_cqi_rank2_2A_1_5MHz 14

typedef struct __attribute__((packed)) { 
  uint32_t padding:16;
  uint32_t diffcqi1:12;
  uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_1_5MHz;
#define sizeof_HLC_subband_cqi_nopmi_1_5MHz 16

typedef struct __attribute__((packed)) { 
  uint32_t padding:14;
  uint32_t pmi:2;
  uint32_t diffcqi1:12;   
  uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_1_5MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz 18

typedef struct __attribute__((packed)) { 
  uint64_t padding:31;
  uint64_t pmi:1;
  uint64_t diffcqi2:12;   
  uint64_t cqi2:4;
  uint64_t diffcqi1:12;   
  uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_1_5MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz 33

typedef struct __attribute__((packed)) { 
  uint32_t padding:16;
  uint32_t diffcqi1:12;   
  uint32_t cqi1:4;
} HLC_subband_cqi_modes123_1_5MHz;
#define sizeof_HLC_subband_cqi_modes123_1_5MHz 16

typedef struct __attribute__((packed)) { 
  uint32_t padding:12;
  uint32_t crnti:16;   
  uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_1_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz 20


// **********************************************5 MHz***************************************************************************
102
typedef struct __attribute__((packed)) {
103 104 105
  uint32_t padding:14;
  uint32_t pmi:14; 
  uint32_t cqi1:4;
106 107 108 109
} wideband_cqi_rank1_2A_5MHz ; 
#define sizeof_wideband_cqi_rank1_2A_5MHz 18

typedef struct __attribute__((packed)) {
110 111 112 113
  uint16_t padding:1;
  uint16_t pmi:7; 
  uint16_t cqi2:4;
  uint16_t cqi1:4;
114 115 116 117
} wideband_cqi_rank2_2A_5MHz ; 
#define sizeof_wideband_cqi_rank2_2A_5MHz 15

typedef struct __attribute__((packed)) { 
118 119 120
  uint32_t padding:14;
  uint32_t diffcqi1:14;
  uint32_t cqi1:4;
121 122 123 124
} HLC_subband_cqi_nopmi_5MHz;
#define sizeof_HLC_subband_cqi_nopmi_5MHz 18

typedef struct __attribute__((packed)) { 
125 126 127 128
  uint32_t padding:12;
  uint32_t pmi:2;
  uint32_t diffcqi1:14;   
  uint32_t cqi1:4;
129 130 131 132
} HLC_subband_cqi_rank1_2A_5MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_5MHz 20

typedef struct __attribute__((packed)) { 
133 134 135 136 137 138
  uint64_t padding:27;
  uint64_t pmi:1;
  uint64_t diffcqi2:14;   
  uint64_t cqi2:4;
  uint64_t diffcqi1:14;   
  uint64_t cqi1:4;
139 140 141 142
} HLC_subband_cqi_rank2_2A_5MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_5MHz 37

typedef struct __attribute__((packed)) { 
143 144 145
  uint32_t padding:14;
  uint32_t diffcqi1:14;   
  uint32_t cqi1:4;
146 147 148 149
} HLC_subband_cqi_modes123_5MHz;
#define sizeof_HLC_subband_cqi_modes123_5MHz 18

typedef struct __attribute__((packed)) { 
150 151 152
  uint32_t padding:12;
  uint32_t crnti:16;   
  uint32_t mcs:4;
153 154 155
} HLC_subband_cqi_mcs_CBA_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz 20

156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
// **********************************************10 MHz***************************************************************************
typedef struct __attribute__((packed)) {
  uint32_t padding:10;
  uint32_t pmi:18; 
  uint32_t cqi1:4;
} wideband_cqi_rank1_2A_10MHz ; 
#define sizeof_wideband_cqi_rank1_2A_10MHz 22

typedef struct __attribute__((packed)) {
  uint32_t padding:15;
  uint32_t pmi:9; 
  uint32_t cqi2:4;
  uint32_t cqi1:4;
} wideband_cqi_rank2_2A_10MHz ; 
#define sizeof_wideband_cqi_rank2_2A_10MHz 17

typedef struct __attribute__((packed)) { 
  uint32_t padding:10;
  uint32_t diffcqi1:18;
  uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_10MHz;
#define sizeof_HLC_subband_cqi_nopmi_10MHz 22

typedef struct __attribute__((packed)) { 
  uint32_t padding:8;
  uint32_t pmi:2;
  uint32_t diffcqi1:18;   
  uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_10MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_10MHz 24

typedef struct __attribute__((packed)) { 
  uint64_t padding:19;
  uint64_t pmi:1;
  uint64_t diffcqi2:18;   
  uint64_t cqi2:4;
  uint64_t diffcqi1:18;   
  uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_10MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_10MHz 45

typedef struct __attribute__((packed)) { 
  uint32_t padding:10;
  uint32_t diffcqi1:18;   
  uint32_t cqi1:4;
} HLC_subband_cqi_modes123_10MHz;
#define sizeof_HLC_subband_cqi_modes123_10MHz 22

typedef struct __attribute__((packed)) { 
  uint32_t padding:12;
  uint32_t crnti:16;   
  uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_10MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz 20

// **********************************************20 MHz***************************************************************************
typedef struct __attribute__((packed)) {
  uint32_t padding:2;
  uint32_t pmi:26; 
  uint32_t cqi1:4;
} wideband_cqi_rank1_2A_20MHz ; 
#define sizeof_wideband_cqi_rank1_2A_20MHz 20

typedef struct __attribute__((packed)) {
  uint32_t padding:11;
  uint32_t pmi:13; 
  uint32_t cqi2:4;
  uint32_t cqi1:4;
} wideband_cqi_rank2_2A_20MHz ; 
#define sizeof_wideband_cqi_rank2_2A_20MHz 21

typedef struct __attribute__((packed)) { 
  uint32_t padding:2;
  uint32_t diffcqi1:26;
  uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_20MHz;
#define sizeof_HLC_subband_cqi_nopmi_20MHz 30

typedef struct __attribute__((packed)) { 
  //  uint32_t padding:12;
  uint32_t pmi:2;
  uint32_t diffcqi1:26;   
  uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_20MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_20MHz 32

typedef struct __attribute__((packed)) { 
  uint64_t padding:3;
  uint64_t pmi:1;
  uint64_t diffcqi2:26;   
  uint64_t cqi2:4;
  uint64_t diffcqi1:26;   
  uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_20MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_20MHz 61

typedef struct __attribute__((packed)) { 
  uint32_t padding:2;
  uint32_t diffcqi1:26;   
  uint32_t cqi1:4;
} HLC_subband_cqi_modes123_20MHz;
#define sizeof_HLC_subband_cqi_modes123_20MHz 30

typedef struct __attribute__((packed)) { 
  uint32_t padding:12;
  uint32_t crnti:16;   
  uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_20MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz 20
265 266


267 268 269
#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))
270 271
#define MAX_ACK_PAYLOAD 18
#define MAX_RI_PAYLOAD 6