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 */
56 CCCH_MODE_NON_COMBINED,
61 * NOTE: struct size. We do add manual padding out of the believe
62 * that it will avoid some unaligned access.
65 /* there are no more messages in a sequence */
66 #define L1CTL_F_DONE 0x01
73 } __attribute__((packed));
76 * downlink info ... down from the BTS..
78 struct l1ctl_info_dl {
79 /* GSM 08.58 channel number (9.3.1) */
81 /* GSM 08.58 link identifier (9.3.2) */
83 /* the ARFCN and the band. FIXME: what about MAIO? */
88 uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */
89 uint8_t snr; /* Signal/Noise Ration (dB) */
94 } __attribute__((packed));
96 /* new CCCH was found. This is following the header */
97 struct l1ctl_fbsb_conf {
98 int16_t initial_freq_err;
101 /* FIXME: contents of cell_info ? */
102 } __attribute__((packed));
104 /* CCCH mode was changed */
105 struct l1ctl_ccch_mode_conf {
106 uint8_t ccch_mode; /* enum ccch_mode */
108 } __attribute__((packed));
110 /* data on the CCCH was found. This is following the header */
111 struct l1ctl_data_ind {
113 } __attribute__((packed));
118 struct l1ctl_info_ul {
119 /* GSM 08.58 channel number (9.3.1) */
121 /* GSM 08.58 link identifier (9.3.2) */
126 } __attribute__((packed));
130 * the l1_info_ul header is in front
132 struct l1ctl_fbsb_req {
134 uint16_t timeout; /* in TDMA frames */
136 uint16_t freq_err_thresh1;
137 uint16_t freq_err_thresh2;
139 uint8_t num_freqerr_avg;
140 uint8_t flags; /* L1CTL_FBSB_F_* */
141 uint8_t sync_info_idx;
142 uint8_t ccch_mode; /* enum ccch_mode */
143 } __attribute__((packed));
145 #define L1CTL_FBSB_F_FB0 (1 << 0)
146 #define L1CTL_FBSB_F_FB1 (1 << 1)
147 #define L1CTL_FBSB_F_SB (1 << 2)
148 #define L1CTL_FBSB_F_FB01SB (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
151 * msg for CCCH_MODE_REQ
152 * the l1_info_ul header is in front
154 struct l1ctl_ccch_mode_req {
155 uint8_t ccch_mode; /* enum ccch_mode */
157 } __attribute__((packed));
159 /* the l1_info_ul header is in front */
160 struct l1ctl_rach_req {
165 } __attribute__((packed));
167 /* the l1_info_ul header is in front */
168 struct l1ctl_par_req {
172 } __attribute__((packed));
176 } __attribute__((packed));
184 } __attribute__((packed));
186 struct l1ctl_dm_est_req {
193 } __attribute__((packed));
195 struct l1ctl_dm_freq_req {
203 } __attribute__((packed));
205 struct l1ctl_crypto_req {
208 } __attribute__((packed));
210 struct l1ctl_pm_req {
216 uint16_t band_arfcn_from;
217 uint16_t band_arfcn_to;
220 } __attribute__((packed));
222 /* a single L1CTL_PM response */
223 struct l1ctl_pm_conf {
226 } __attribute__((packed));
228 enum l1ctl_reset_type {
229 L1CTL_RES_T_BOOT, /* only _IND */
234 /* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
238 } __attribute__((packed));
240 #endif /* __L1CTL_PROTO_H__ */