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 */
54 CCCH_MODE_NON_COMBINED,
59 * NOTE: struct size. We do add manual padding out of the believe
60 * that it will avoid some unaligned access.
63 /* there are no more messages in a sequence */
64 #define L1CTL_F_DONE 0x01
71 } __attribute__((packed));
74 * downlink info ... down from the BTS..
76 struct l1ctl_info_dl {
77 /* GSM 08.58 channel number (9.3.1) */
79 /* GSM 08.58 link identifier (9.3.2) */
81 /* the ARFCN and the band. FIXME: what about MAIO? */
86 uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */
87 uint8_t snr; /* Signal/Noise Ration (dB) */
92 } __attribute__((packed));
94 /* new CCCH was found. This is following the header */
95 struct l1ctl_fbsb_conf {
96 int16_t initial_freq_err;
99 /* FIXME: contents of cell_info ? */
100 } __attribute__((packed));
102 /* CCCH mode was changed */
103 struct l1ctl_ccch_mode_conf {
104 uint8_t ccch_mode; /* enum ccch_mode */
106 } __attribute__((packed));
108 /* data on the CCCH was found. This is following the header */
109 struct l1ctl_data_ind {
111 } __attribute__((packed));
116 struct l1ctl_info_ul {
117 /* GSM 08.58 channel number (9.3.1) */
119 /* GSM 08.58 link identifier (9.3.2) */
124 } __attribute__((packed));
128 * the l1_info_ul header is in front
130 struct l1ctl_fbsb_req {
132 uint16_t timeout; /* in TDMA frames */
134 uint16_t freq_err_thresh1;
135 uint16_t freq_err_thresh2;
137 uint8_t num_freqerr_avg;
138 uint8_t flags; /* L1CTL_FBSB_F_* */
139 uint8_t sync_info_idx;
140 uint8_t ccch_mode; /* enum ccch_mode */
141 } __attribute__((packed));
143 #define L1CTL_FBSB_F_FB0 (1 << 0)
144 #define L1CTL_FBSB_F_FB1 (1 << 1)
145 #define L1CTL_FBSB_F_SB (1 << 2)
146 #define L1CTL_FBSB_F_FB01SB (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
149 * msg for CCCH_MODE_REQ
150 * the l1_info_ul header is in front
152 struct l1ctl_ccch_mode_req {
153 uint8_t ccch_mode; /* enum ccch_mode */
155 } __attribute__((packed));
157 /* the l1_info_ul header is in front */
158 struct l1ctl_rach_req {
163 } __attribute__((packed));
165 /* the l1_info_ul header is in front */
166 struct l1ctl_par_req {
170 } __attribute__((packed));
174 } __attribute__((packed));
182 } __attribute__((packed));
184 struct l1ctl_dm_est_req {
191 } __attribute__((packed));
193 struct l1ctl_dm_freq_req {
201 } __attribute__((packed));
203 struct l1ctl_crypto_req {
206 } __attribute__((packed));
208 struct l1ctl_pm_req {
214 uint16_t band_arfcn_from;
215 uint16_t band_arfcn_to;
218 } __attribute__((packed));
220 /* a single L1CTL_PM response */
221 struct l1ctl_pm_conf {
224 } __attribute__((packed));
226 enum l1ctl_reset_type {
227 L1CTL_RES_T_BOOT, /* only _IND */
232 /* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
236 } __attribute__((packed));
238 #endif /* __L1CTL_PROTO_H__ */