1 /* Messages to be sent between the different layers */
3 /* (C) 2010 by Harald Welte <laforge@gnumonks.org>
4 * (C) 2010 by Holger Hans Peter Freyther
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #ifndef __L1CTL_PROTO_H__
25 #define __L1CTL_PROTO_H__
36 L1CTL_PM_REQ
, /* power measurement */
37 L1CTL_PM_CONF
, /* power measurement */
61 /* configure TBF for uplink/downlink */
68 /* Extended (11-bit) RACH (see 3GPP TS 05.02, section 5.2.7) */
74 CCCH_MODE_NON_COMBINED
,
76 CCCH_MODE_COMBINED_CBCH
,
85 enum l1ctl_coding_scheme
{
103 * NOTE: struct size. We do add manual padding out of the believe
104 * that it will avoid some unaligned access.
107 /* there are no more messages in a sequence */
108 #define L1CTL_F_DONE 0x01
115 } __attribute__((packed
));
118 * downlink info ... down from the BTS..
120 struct l1ctl_info_dl
{
121 /* GSM 08.58 channel number (9.3.1) */
123 /* GSM 08.58 link identifier (9.3.2) */
125 /* the ARFCN and the band. FIXME: what about MAIO? */
130 uint8_t rx_level
; /* 0 .. 63 in typical GSM notation (dBm+110) */
131 uint8_t snr
; /* Signal/Noise Ration (dB) */
136 } __attribute__((packed
));
138 /* new CCCH was found. This is following the header */
139 struct l1ctl_fbsb_conf
{
140 int16_t initial_freq_err
;
143 /* FIXME: contents of cell_info ? */
144 } __attribute__((packed
));
146 /* CCCH mode was changed */
147 struct l1ctl_ccch_mode_conf
{
148 uint8_t ccch_mode
; /* enum ccch_mode */
150 } __attribute__((packed
));
152 /* TCH mode was changed */
153 struct l1ctl_tch_mode_conf
{
154 uint8_t tch_mode
; /* enum tch_mode */
157 } __attribute__((packed
));
159 /* data on the CCCH was found. This is following the header */
160 struct l1ctl_data_ind
{
162 } __attribute__((packed
));
164 /* traffic from the network */
165 struct l1ctl_traffic_ind
{
167 } __attribute__((packed
));
172 struct l1ctl_info_ul
{
173 /* GSM 08.58 channel number (9.3.1) */
175 /* GSM 08.58 link identifier (9.3.2) */
180 } __attribute__((packed
));
182 struct l1ctl_info_ul_tbf
{
183 /* references l1ctl_tbf_cfg_req.tbf_nr */
185 uint8_t coding_scheme
;
187 /* RLC/MAC block, size determines CS */
189 } __attribute__((packed
));
193 * the l1_info_ul header is in front
195 struct l1ctl_fbsb_req
{
197 uint16_t timeout
; /* in TDMA frames */
199 uint16_t freq_err_thresh1
;
200 uint16_t freq_err_thresh2
;
202 uint8_t num_freqerr_avg
;
203 uint8_t flags
; /* L1CTL_FBSB_F_* */
204 uint8_t sync_info_idx
;
205 uint8_t ccch_mode
; /* enum ccch_mode */
206 uint8_t rxlev_exp
; /* expected signal level */
207 } __attribute__((packed
));
209 #define L1CTL_FBSB_F_FB0 (1 << 0)
210 #define L1CTL_FBSB_F_FB1 (1 << 1)
211 #define L1CTL_FBSB_F_SB (1 << 2)
212 #define L1CTL_FBSB_F_FB01SB (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
215 * msg for CCCH_MODE_REQ
216 * the l1_info_ul header is in front
218 struct l1ctl_ccch_mode_req
{
219 uint8_t ccch_mode
; /* enum ccch_mode */
221 } __attribute__((packed
));
224 * msg for TCH_MODE_REQ
225 * the l1_info_ul header is in front
227 struct l1ctl_tch_mode_req
{
228 uint8_t tch_mode
; /* enum gsm48_chan_mode */
229 #define AUDIO_TX_MICROPHONE (1<<0)
230 #define AUDIO_TX_TRAFFIC_REQ (1<<1)
231 #define AUDIO_RX_SPEAKER (1<<2)
232 #define AUDIO_RX_TRAFFIC_IND (1<<3)
235 } __attribute__((packed
));
237 /* the l1_info_ul header is in front */
238 struct l1ctl_rach_req
{
242 } __attribute__((packed
));
245 /* the l1_info_ul header is in front */
246 struct l1ctl_ext_rach_req
{
251 } __attribute__((packed
));
253 /* the l1_info_ul header is in front */
254 struct l1ctl_par_req
{
258 } __attribute__((packed
));
262 } __attribute__((packed
));
270 } __attribute__((packed
));
272 struct l1ctl_dm_est_req
{
281 } __attribute__((packed
));
283 struct l1ctl_dm_freq_req
{
291 } __attribute__((packed
));
293 struct l1ctl_crypto_req
{
297 } __attribute__((packed
));
299 struct l1ctl_pm_req
{
305 uint16_t band_arfcn_from
;
306 uint16_t band_arfcn_to
;
309 } __attribute__((packed
));
311 #define BI_FLG_DUMMY (1 << 4)
312 #define BI_FLG_SACCH (1 << 5)
314 struct l1ctl_burst_ind
{
316 uint16_t band_arfcn
; /* ARFCN + band + ul indicator */
317 uint8_t chan_nr
; /* GSM 08.58 channel number (9.3.1) */
318 uint8_t flags
; /* BI_FLG_xxx + burst_id = 2LSBs */
319 uint8_t rx_level
; /* 0 .. 63 in typical GSM notation (dBm+110) */
320 uint8_t snr
; /* Reported SNR >> 8 (0-255) */
321 uint8_t bits
[15]; /* 114 bits + 2 steal bits. Filled MSB first */
322 } __attribute__((packed
));
324 /* a single L1CTL_PM response */
325 struct l1ctl_pm_conf
{
328 } __attribute__((packed
));
330 enum l1ctl_reset_type
{
331 L1CTL_RES_T_BOOT
, /* only _IND */
336 /* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
340 } __attribute__((packed
));
342 struct l1ctl_neigh_pm_req
{
345 uint16_t band_arfcn
[64];
347 } __attribute__((packed
));
349 /* neighbour cell measurement results */
350 struct l1ctl_neigh_pm_ind
{
355 } __attribute__((packed
));
357 /* traffic data to network */
358 struct l1ctl_traffic_req
{
360 } __attribute__((packed
));
362 struct l1ctl_tbf_cfg_req
{
363 /* future support for multiple concurrent TBFs. 0 for now */
365 /* is this about an UL TBF (1) or DL (0) */
369 /* one USF for each TN, or 255 for invalid/unused */
371 } __attribute__((packed
));
373 #endif /* __L1CTL_PROTO_H__ */