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 */
58 CCCH_MODE_NON_COMBINED,
63 * NOTE: struct size. We do add manual padding out of the believe
64 * that it will avoid some unaligned access.
67 /* there are no more messages in a sequence */
68 #define L1CTL_F_DONE 0x01
75 } __attribute__((packed));
78 * downlink info ... down from the BTS..
80 struct l1ctl_info_dl {
81 /* GSM 08.58 channel number (9.3.1) */
83 /* GSM 08.58 link identifier (9.3.2) */
85 /* the ARFCN and the band. FIXME: what about MAIO? */
90 uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */
91 uint8_t snr; /* Signal/Noise Ration (dB) */
96 } __attribute__((packed));
98 /* new CCCH was found. This is following the header */
99 struct l1ctl_fbsb_conf {
100 int16_t initial_freq_err;
103 /* FIXME: contents of cell_info ? */
104 } __attribute__((packed));
106 /* CCCH mode was changed */
107 struct l1ctl_ccch_mode_conf {
108 uint8_t ccch_mode; /* enum ccch_mode */
110 } __attribute__((packed));
112 /* TCH mode was changed */
113 struct l1ctl_tch_mode_conf {
114 uint8_t tch_mode; /* enum tch_mode */
116 } __attribute__((packed));
118 /* data on the CCCH was found. This is following the header */
119 struct l1ctl_data_ind {
121 } __attribute__((packed));
126 struct l1ctl_info_ul {
127 /* GSM 08.58 channel number (9.3.1) */
129 /* GSM 08.58 link identifier (9.3.2) */
134 } __attribute__((packed));
138 * the l1_info_ul header is in front
140 struct l1ctl_fbsb_req {
142 uint16_t timeout; /* in TDMA frames */
144 uint16_t freq_err_thresh1;
145 uint16_t freq_err_thresh2;
147 uint8_t num_freqerr_avg;
148 uint8_t flags; /* L1CTL_FBSB_F_* */
149 uint8_t sync_info_idx;
150 uint8_t ccch_mode; /* enum ccch_mode */
151 } __attribute__((packed));
153 #define L1CTL_FBSB_F_FB0 (1 << 0)
154 #define L1CTL_FBSB_F_FB1 (1 << 1)
155 #define L1CTL_FBSB_F_SB (1 << 2)
156 #define L1CTL_FBSB_F_FB01SB (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
159 * msg for CCCH_MODE_REQ
160 * the l1_info_ul header is in front
162 struct l1ctl_ccch_mode_req {
163 uint8_t ccch_mode; /* enum ccch_mode */
165 } __attribute__((packed));
168 * msg for TCH_MODE_REQ
169 * the l1_info_ul header is in front
171 struct l1ctl_tch_mode_req {
172 uint8_t tch_mode; /* enum gsm48_chan_mode */
174 } __attribute__((packed));
176 /* the l1_info_ul header is in front */
177 struct l1ctl_rach_req {
181 } __attribute__((packed));
183 /* the l1_info_ul header is in front */
184 struct l1ctl_par_req {
188 } __attribute__((packed));
192 } __attribute__((packed));
200 } __attribute__((packed));
202 struct l1ctl_dm_est_req {
211 } __attribute__((packed));
213 struct l1ctl_dm_freq_req {
221 } __attribute__((packed));
223 struct l1ctl_crypto_req {
226 } __attribute__((packed));
228 struct l1ctl_pm_req {
234 uint16_t band_arfcn_from;
235 uint16_t band_arfcn_to;
238 } __attribute__((packed));
240 /* a single L1CTL_PM response */
241 struct l1ctl_pm_conf {
244 } __attribute__((packed));
246 enum l1ctl_reset_type {
247 L1CTL_RES_T_BOOT, /* only _IND */
252 /* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
256 } __attribute__((packed));
258 #endif /* __L1CTL_PROTO_H__ */