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 */
53 CCCH_MODE_NON_COMBINED,
58 * NOTE: struct size. We do add manual padding out of the believe
59 * that it will avoid some unaligned access.
62 /* there are no more messages in a sequence */
63 #define L1CTL_F_DONE 0x01
70 } __attribute__((packed));
73 * downlink info ... down from the BTS..
75 struct l1ctl_info_dl {
76 /* GSM 08.58 channel number (9.3.1) */
78 /* GSM 08.58 link identifier (9.3.2) */
80 /* the ARFCN and the band. FIXME: what about MAIO? */
85 uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */
86 uint8_t snr; /* Signal/Noise Ration (dB) */
91 } __attribute__((packed));
93 /* new CCCH was found. This is following the header */
94 struct l1ctl_fbsb_conf {
95 int16_t initial_freq_err;
98 /* FIXME: contents of cell_info ? */
99 } __attribute__((packed));
101 /* CCCH mode was changed */
102 struct l1ctl_ccch_mode_conf {
103 uint8_t ccch_mode; /* enum ccch_mode */
105 } __attribute__((packed));
107 /* data on the CCCH was found. This is following the header */
108 struct l1ctl_data_ind {
110 } __attribute__((packed));
115 struct l1ctl_info_ul {
116 /* GSM 08.58 channel number (9.3.1) */
118 /* GSM 08.58 link identifier (9.3.2) */
123 } __attribute__((packed));
127 * the l1_info_ul header is in front
129 struct l1ctl_fbsb_req {
131 uint16_t timeout; /* in TDMA frames */
133 uint16_t freq_err_thresh1;
134 uint16_t freq_err_thresh2;
136 uint8_t num_freqerr_avg;
137 uint8_t flags; /* L1CTL_FBSB_F_* */
138 uint8_t sync_info_idx;
139 uint8_t ccch_mode; /* enum ccch_mode */
140 } __attribute__((packed));
142 #define L1CTL_FBSB_F_FB0 (1 << 0)
143 #define L1CTL_FBSB_F_FB1 (1 << 1)
144 #define L1CTL_FBSB_F_SB (1 << 2)
145 #define L1CTL_FBSB_F_FB01SB (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
148 * msg for CCCH_MODE_REQ
149 * the l1_info_ul header is in front
151 struct l1ctl_ccch_mode_req {
152 uint8_t ccch_mode; /* enum ccch_mode */
154 } __attribute__((packed));
156 /* the l1_info_ul header is in front */
157 struct l1ctl_rach_req {
162 } __attribute__((packed));
164 /* the l1_info_ul header is in front */
165 struct l1ctl_par_req {
169 } __attribute__((packed));
173 } __attribute__((packed));
181 } __attribute__((packed));
183 struct l1ctl_dm_est_req {
190 } __attribute__((packed));
192 struct l1ctl_dm_freq_req {
200 } __attribute__((packed));
202 struct l1ctl_pm_req {
208 uint16_t band_arfcn_from;
209 uint16_t band_arfcn_to;
212 } __attribute__((packed));
214 /* a single L1CTL_PM response */
215 struct l1ctl_pm_conf {
218 } __attribute__((packed));
220 enum l1ctl_reset_type {
221 L1CTL_RES_T_BOOT, /* only _IND */
226 /* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
230 } __attribute__((packed));
232 #endif /* __L1CTL_PROTO_H__ */