transport_common.h 6.17 KB
Newer Older
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
102
103
104
105
106
107
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

/*! \file PHY/LTE_TRANSPORT/transport_commont.h
* \brief data structures for PDSCH/DLSCH/PUSCH/ULSCH physical and transport channel descriptors (TX/RX) common to both eNB/UE
* \author R. Knopp
* \date 2011
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, oscar.tonelli@yahoo.it
* \note
* \warning
*/
#ifndef __TRANSPORT_COMMON__H__
#define __TRANSPORT_COMMON__H__
#include "PHY/defs_common.h"
#include "PHY/impl_defs_lte.h"
#include "dci.h"
#include "mdci.h"
//#include "uci.h"
#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h"
#endif

#define MOD_TABLE_QPSK_OFFSET 1
#define MOD_TABLE_16QAM_OFFSET 5
#define MOD_TABLE_64QAM_OFFSET 21
#define MOD_TABLE_PSS_OFFSET 85

// structures below implement 36-211 and 36-212

/** @addtogroup _PHY_TRANSPORT_
 * @{
 */



#define NSOFT 1827072
#define LTE_NULL 2

// maximum of 3 segments before each coding block if data length exceeds 6144 bits.

#define MAX_NUM_DLSCH_SEGMENTS 16
#define MAX_NUM_ULSCH_SEGMENTS MAX_NUM_DLSCH_SEGMENTS
#define MAX_DLSCH_PAYLOAD_BYTES (MAX_NUM_DLSCH_SEGMENTS*768)
#define MAX_ULSCH_PAYLOAD_BYTES (MAX_NUM_ULSCH_SEGMENTS*768)

#define MAX_NUM_CHANNEL_BITS (14*1200*6)  // 14 symbols, 1200 REs, 12 bits/RE
#define MAX_NUM_RE (14*1200)

#if !defined(SI_RNTI)
#define SI_RNTI  (rnti_t)0xffff
#endif
#if !defined(M_RNTI)
#define M_RNTI   (rnti_t)0xfffd
#endif
#if !defined(P_RNTI)
#define P_RNTI   (rnti_t)0xfffe
#endif
#if !defined(CBA_RNTI)
#define CBA_RNTI (rnti_t)0xfff4
#endif
#if !defined(C_RNTI)
#define C_RNTI   (rnti_t)0x1234
#endif
// These are the codebook indexes according to Table 6.3.4.2.3-1 of 36.211
//1 layer
#define PMI_2A_11  0
#define PMI_2A_1m1 1
#define PMI_2A_1j  2
#define PMI_2A_1mj 3
//2 layers
#define PMI_2A_R1_10 0
#define PMI_2A_R1_11 1
#define PMI_2A_R1_1j 2

typedef enum { SEARCH_EXIST=0,
	       SEARCH_EXIST_OR_FREE} find_type_t;

typedef enum {
  SCH_IDLE=0,
  ACTIVE,
  CBA_ACTIVE,
  DISABLED
} SCH_status_t;




108
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
typedef enum {
  CEmodeA = 0,
  CEmodeB = 1
} CEmode_t;
#endif

#define PUSCH_x 2
#define PUSCH_y 3

typedef enum {
  pucch_format1=0,
  pucch_format1a,
  pucch_format1b,
  pucch_format1b_csA2,
  pucch_format1b_csA3,
  pucch_format1b_csA4,
  pucch_format2,
  pucch_format2a,
  pucch_format2b,
  pucch_format3    // PUCCH format3
} PUCCH_FMT_t;

typedef enum {
  SR,
  HARQ,
  CQI,
  HARQ_SR,
  HARQ_CQI,
  SR_CQI,
  HARQ_SR_CQI  
} UCI_type_t;

141
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
typedef enum {
  NOCE,
  CEMODEA,
  CEMODEB
} UE_type_t;
#endif





typedef enum {
  SI_PDSCH=0,
  RA_PDSCH,
  P_PDSCH,
  PDSCH,
  PDSCH1,
  PMCH
} PDSCH_t;

typedef enum {
  rx_standard=0,
  rx_IC_single_stream,
  rx_IC_dual_stream,
  rx_SIC_dual_stream
} RX_type_t;


typedef enum {
  DCI_COMMON_SPACE,
  DCI_UE_SPACE
} dci_space_t;

175
176
177
178
179
180
181
182
183
184
typedef struct {
  uint8_t f_ra;
  uint8_t t0_ra;
  uint8_t t1_ra;
  uint8_t t2_ra;
} PRACH_TDD_PREAMBLE_MAP_elem;
typedef struct {
  uint8_t num_prach;
  PRACH_TDD_PREAMBLE_MAP_elem map[6];
} PRACH_TDD_PREAMBLE_MAP;
185

186
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280

typedef struct {
  uint16_t slss_id;
  uint8_t *slmib;
} SLSS_t;

typedef struct {
  // SL Configuration
  /// Number of SL resource blocks (1-100)
  uint32_t N_SL_RB;
  /// prb-start (0-99)
  uint32_t prb_Start;
  /// prb-End (0-99)
  uint32_t prb_End;
  /// SL-OffsetIndicator (0-10239)
  uint32_t SL_OffsetIndicator;
  /// PSCCH subframe bitmap, first 64-bits (up to 40 bits for Rel 12)
  uint64_t bitmap1;
  /// PSCCH subframe bitmap, 2nd 64-bits (up to 100 bits for Rel 14)
  uint64_t bitmap2;

  // SCI parameters
  /// npscch resource index
  uint32_t n_pscch;
  /// format of SCI (0,1)
  uint32_t format;
  /// SCI0 frequency hopping flag
  uint32_t freq_hopping_flag;
  /// SCI0 Resource Block Coding
  uint32_t resource_block_coding;
  /// SCI0 Time Resource Pattern for SLSCH
  uint32_t time_resource_pattern;
  /// SCI0 MCS for SLSCH
  uint32_t mcs;
  /// SCI0 Timing advance indication for SLSCH
  uint32_t timing_advance_indication;
  /// SCI0 Group Destination ID for SLSCH
  uint32_t group_destination_id;

  // SLSCH Parameters
  /// Number of Subbands (36.213 14.1.1.2)
  uint32_t Nsb;
  /// N_RB_HO (36.213 14.1.1.2)
  uint32_t N_RB_HO;
  /// n_ss_PSSCH (36.211 9.2.4)
  uint32_t n_ss_PSSCH;
  /// n_ssf_PSSCH
  uint32_t n_ssf_PSSCH;
  /// cinit (36.331 hoppingParameter-r12)
  uint32_t cinit;
  /// redundancy version
  uint32_t rvidx;
  /// n_prime_VRB (36.213 14.1.1.2.1)
  uint32_t n_prime_VRB;
  /// M_RB_PSSCH_RP (36.213 14.1.3
  uint32_t M_RB_PSSCH_RP;
  /// n_prime_PRB (36.213 14.1.1.4
  uint32_t n_prime_PRB;
  /// m_nprime_PRB_PSSCH (36.213 14.1.3)
  uint32_t m_nprime_PRB_PSCCH;
  /// payload length
  int payload_length;
  /// pointer to payload
  uint8_t *payload;
} SLSCH_t;

typedef struct {
  /// payload length
  int payload_length;
	uint8_t payload[100];
} SLDCH_t;

#define TTI_SYNC 0
#define SLSS 1
#define SLDCH 2
#define SLSCH 3

typedef struct UE_tport_header_s {
  int packet_type;
  uint16_t absSF;
} UE_tport_header_t;

typedef struct UE_tport_s {
  UE_tport_header_t header;
  union {
    SLSS_t slss;
    SLDCH_t sldch;
    SLSCH_t slsch;
  };
  uint8_t payload[1500];
} UE_tport_t;

#endif

281
282
/**@}*/
#endif