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 */
63 CCCH_MODE_NON_COMBINED,
73 #define TRAFFIC_DATA_LEN 40
76 * NOTE: struct size. We do add manual padding out of the believe
77 * that it will avoid some unaligned access.
80 /* there are no more messages in a sequence */
81 #define L1CTL_F_DONE 0x01
88 } __attribute__((packed));
91 * downlink info ... down from the BTS..
93 struct l1ctl_info_dl {
94 /* GSM 08.58 channel number (9.3.1) */
96 /* GSM 08.58 link identifier (9.3.2) */
98 /* the ARFCN and the band. FIXME: what about MAIO? */
103 uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */
104 uint8_t snr; /* Signal/Noise Ration (dB) */
109 } __attribute__((packed));
111 /* new CCCH was found. This is following the header */
112 struct l1ctl_fbsb_conf {
113 int16_t initial_freq_err;
116 /* FIXME: contents of cell_info ? */
117 } __attribute__((packed));
119 /* CCCH mode was changed */
120 struct l1ctl_ccch_mode_conf {
121 uint8_t ccch_mode; /* enum ccch_mode */
123 } __attribute__((packed));
125 /* TCH mode was changed */
126 struct l1ctl_tch_mode_conf {
127 uint8_t tch_mode; /* enum tch_mode */
129 } __attribute__((packed));
131 /* data on the CCCH was found. This is following the header */
132 struct l1ctl_data_ind {
134 } __attribute__((packed));
136 /* traffic from the network */
137 struct l1ctl_traffic_ind {
138 uint8_t data[TRAFFIC_DATA_LEN];
139 } __attribute__((packed));
144 struct l1ctl_info_ul {
145 /* GSM 08.58 channel number (9.3.1) */
147 /* GSM 08.58 link identifier (9.3.2) */
152 } __attribute__((packed));
156 * the l1_info_ul header is in front
158 struct l1ctl_fbsb_req {
160 uint16_t timeout; /* in TDMA frames */
162 uint16_t freq_err_thresh1;
163 uint16_t freq_err_thresh2;
165 uint8_t num_freqerr_avg;
166 uint8_t flags; /* L1CTL_FBSB_F_* */
167 uint8_t sync_info_idx;
168 uint8_t ccch_mode; /* enum ccch_mode */
169 } __attribute__((packed));
171 #define L1CTL_FBSB_F_FB0 (1 << 0)
172 #define L1CTL_FBSB_F_FB1 (1 << 1)
173 #define L1CTL_FBSB_F_SB (1 << 2)
174 #define L1CTL_FBSB_F_FB01SB (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
177 * msg for CCCH_MODE_REQ
178 * the l1_info_ul header is in front
180 struct l1ctl_ccch_mode_req {
181 uint8_t ccch_mode; /* enum ccch_mode */
183 } __attribute__((packed));
186 * msg for TCH_MODE_REQ
187 * the l1_info_ul header is in front
189 struct l1ctl_tch_mode_req {
190 uint8_t tch_mode; /* enum gsm48_chan_mode */
192 } __attribute__((packed));
194 /* the l1_info_ul header is in front */
195 struct l1ctl_rach_req {
199 } __attribute__((packed));
201 /* the l1_info_ul header is in front */
202 struct l1ctl_par_req {
206 } __attribute__((packed));
210 } __attribute__((packed));
218 } __attribute__((packed));
220 struct l1ctl_dm_est_req {
229 } __attribute__((packed));
231 struct l1ctl_dm_freq_req {
239 } __attribute__((packed));
241 struct l1ctl_crypto_req {
244 } __attribute__((packed));
246 struct l1ctl_pm_req {
252 uint16_t band_arfcn_from;
253 uint16_t band_arfcn_to;
256 } __attribute__((packed));
258 /* a single L1CTL_PM response */
259 struct l1ctl_pm_conf {
262 } __attribute__((packed));
264 enum l1ctl_reset_type {
265 L1CTL_RES_T_BOOT, /* only _IND */
270 /* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
274 } __attribute__((packed));
276 struct l1ctl_neigh_pm_req {
279 uint16_t band_arfcn[64];
280 } __attribute__((packed));
282 /* neighbour cell measurement results */
283 struct l1ctl_neigh_pm_ind {
286 } __attribute__((packed));
288 /* traffic data to network */
289 struct l1ctl_traffic_req {
290 uint8_t data[TRAFFIC_DATA_LEN];
291 } __attribute__((packed));
293 #endif /* __L1CTL_PROTO_H__ */