openair_rrc_L2_interface.c 7.71 KB
Newer Older
1
/*******************************************************************************
nikaeinn's avatar
nikaeinn committed
2
3
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom
4

nikaeinn's avatar
nikaeinn committed
5
6
7
8
    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.
9
10


nikaeinn's avatar
nikaeinn committed
11
12
13
14
    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.
15

nikaeinn's avatar
nikaeinn committed
16
17
18
19
    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/>.
20
21

  Contact Information
nikaeinn's avatar
nikaeinn committed
22
23
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
24
  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
nikaeinn's avatar
nikaeinn committed
25

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

*******************************************************************************/

/*! \file l2_interface.c
31
* \brief layer 2 interface
nikaeinn's avatar
nikaeinn committed
32
* \author Navid Nikaein and Raymond Knopp
33
* \date 2011
34
* \version 1.0
35
* \company Eurecom
36
37
* \email: navid.nikaein@eurecom.fr
*/
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

#ifdef USER_MODE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>

#else //USER_MODE

#include <asm/io.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <asm/segment.h>
#include <asm/page.h>
#include <asm/delay.h>

#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <linux/mman.h>

#include <linux/slab.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/fs.h>

#include <linux/errno.h>


#ifdef KERNEL2_6

#include <linux/slab.h>
#endif

#ifdef KERNEL2_4
#include <linux/malloc.h>
#include <linux/wrapper.h>
#endif
#endif //USER_MODE

gauthier's avatar
gauthier committed
78
#include "platform_types.h"
79
80
81
82
83
84
85
86
87
#include "openair_defs.h"

#ifdef CELLULAR
#include "rrc_L2_proto.h"
#else
#include "RRC/LITE/defs.h"
#endif //CELLULAR
#include "COMMON/mac_rrc_primitives.h"
#include "openair_rrc_L2_interface.h"
88

89
90
91
92
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_req(
  const module_id_t module_idP,
93
  const int         CC_idP,
94
95
96
  const frame_t     frameP,
  const rb_id_t     srb_idP,
  const uint8_t     nb_tbP,
97
  uint8_t* const    buffer_pP,
98
99
100
101
102
  const eNB_flag_t  eNB_flagP,
  const uint8_t     eNB_indexP,
  const uint8_t     mbsfn_sync_areaP
)
//------------------------------------------------------------------------------
103
{
104
105
  return(mac_rrc_lite_data_req(
           module_idP,
106
           CC_idP,
107
108
109
110
111
112
113
114
           frameP,
           srb_idP,
           nb_tbP,
           buffer_pP,
           eNB_flagP,
           eNB_indexP,
           mbsfn_sync_areaP)
        );
115
}
116

117
118
119
120
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_ind(
  const module_id_t     module_idP,
121
  const int             CC_idP,
122
  const frame_t         frameP,
gauthier's avatar
gauthier committed
123
  const sub_frame_t     subframeP,
124
125
126
127
128
129
130
131
132
  const rnti_t          rntiP,
  const rb_id_t         srb_idP,
  const uint8_t        *sduP,
  const sdu_size_t      sdu_lenP,
  const eNB_flag_t      eNB_flagP,
  const mac_enb_index_t eNB_indexP,
  const uint8_t         mbsfn_sync_area
)
//------------------------------------------------------------------------------
133
{
134
135
  return(mac_rrc_lite_data_ind(
           module_idP,
136
           CC_idP,
gauthier's avatar
gauthier committed
137
           frameP,subframeP,
138
139
140
141
142
143
144
145
           rntiP,
           srb_idP,
           sduP,
           sdu_lenP,
           eNB_flagP,
           eNB_indexP,
           mbsfn_sync_area)
        );
146
147
}

148
149
150
151
152
153
154
155
156
//------------------------------------------------------------------------------
void
rlcrrc_data_ind(
  const protocol_ctxt_t* const ctxt_pP,
  const rb_id_t                srb_idP,
  const sdu_size_t             sdu_lenP,
  const uint8_t  * const       buffer_pP
)
//------------------------------------------------------------------------------
157
{
158
159
160
161
  rrc_data_ind(ctxt_pP,
	       srb_idP,
	       sdu_lenP,
	       buffer_pP);
162
163
}

164
165
166
167
168
169
170
171
172
173
174
175
//------------------------------------------------------------------------------
uint8_t
pdcp_rrc_data_req(
  const protocol_ctxt_t* const ctxt_pP,
  const rb_id_t                rb_idP,
  const mui_t                  muiP,
  const confirm_t              confirmP,
  const sdu_size_t             sdu_buffer_sizeP,
  uint8_t* const               sdu_buffer_pP,
  const pdcp_transmission_mode_t modeP
)
//------------------------------------------------------------------------------
176
{
177
178
179
180
181
182
183
184
  return rrc_lite_data_req (
           ctxt_pP,
           rb_idP,
           muiP,
           confirmP,
           sdu_buffer_sizeP,
           sdu_buffer_pP,
           modeP);
185
186
}

187
188
189
190
191
192
193
194
195
//------------------------------------------------------------------------------
void
pdcp_rrc_data_ind(
  const protocol_ctxt_t* const ctxt_pP,
  const rb_id_t                srb_idP,
  const sdu_size_t             sdu_sizeP,
  uint8_t              * const buffer_pP
)
//------------------------------------------------------------------------------
196
{
197
198
199
200
201
  rrc_lite_data_ind(
    ctxt_pP,
    srb_idP,
    sdu_sizeP,
    buffer_pP);
202
203
}

204
205
206
207
208
209
210
//------------------------------------------------------------------------------
void
mac_rrc_meas_ind(
  const module_id_t module_idP,
  MAC_MEAS_REQ_ENTRY * const Meas_entry_pP
)
//------------------------------------------------------------------------------
211
{
gauthier's avatar
gauthier committed
212
  //  mac_rrc_meas_ind(module_idP,Meas_entry_pP);
213
214
}

215
216
217
218
219
220
221
//------------------------------------------------------------------------------
void
mac_sync_ind(
  const  module_id_t module_idP,
  const  uint8_t Status
)
//------------------------------------------------------------------------------
222
{
gauthier's avatar
gauthier committed
223
  mac_lite_sync_ind(module_idP,Status);
224
225
}

226
227
228
229
230
231
232
233
//------------------------------------------------------------------------------
void
mac_in_sync_ind(
  const module_id_t module_idP,
  const frame_t frameP,
  const uint16_t eNB_indexP
)
//------------------------------------------------------------------------------
234
{
gauthier's avatar
gauthier committed
235
  rrc_lite_in_sync_ind(module_idP,frameP,eNB_indexP);
236
237
}

238
239
240
241
242
243
244
245
//------------------------------------------------------------------------------
void
mac_out_of_sync_ind(
  const module_id_t module_idP,
  const frame_t frameP,
  const uint16_t eNB_indexP
)
//------------------------------------------------------------------------------
246
{
gauthier's avatar
gauthier committed
247
  rrc_lite_out_of_sync_ind(module_idP,frameP,eNB_indexP);
248
249
}

250
251
252
253
254
255
256
//------------------------------------------------------------------------------
int
mac_eNB_get_rrc_status(
  const module_id_t   module_idP,
  const rnti_t  rntiP
)
//------------------------------------------------------------------------------
257
{
258
259
260
261
262
263
264
265
266
267
268
  return mac_eNB_get_rrc_lite_status(module_idP, rntiP);
}
//------------------------------------------------------------------------------
int
mac_UE_get_rrc_status(
  const module_id_t module_idP,
  const uint8_t     sig_indexP
)
//------------------------------------------------------------------------------
{
  return mac_UE_get_rrc_lite_status(module_idP, sig_indexP);
269
270
}

271
272
273
274
275
276
277
//------------------------------------------------------------------------------
char
openair_rrc_ue_init(
  const module_id_t   module_idP,
  const unsigned char eNB_indexP
)
//------------------------------------------------------------------------------
278
{
gauthier's avatar
gauthier committed
279
  return openair_rrc_lite_ue_init(module_idP, eNB_indexP);
280
281
}

282
283
284
285
286
287
//------------------------------------------------------------------------------
char
openair_rrc_eNB_init(
  const module_id_t module_idP
)
//------------------------------------------------------------------------------
288
{
gauthier's avatar
gauthier committed
289
  return openair_rrc_lite_eNB_init(module_idP);
290
}