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 l1a_l23_interface_h
25 #define l1a_l23_interface_h
27 #define L1CTL_FBSB_REQ 1
28 #define L1CTL_FBSB_CONF 2
29 #define L1CTL_DATA_IND 3
30 #define L1CTL_RACH_REQ 4
31 #define L1CTL_DM_EST_REQ 5
32 #define L1CTL_DATA_REQ 7
33 #define L1CTL_RESET_IND 8
34 #define L1CTL_PM_REQ 9 /* power measurement */
35 #define L1CTL_PM_CONF 10 /* power measurement */
36 #define L1CTL_ECHO_REQ 11
37 #define L1CTL_ECHO_CONF 12
38 #define L1CTL_RACH_CONF 13
39 #define L1CTL_RESET_REQ 14
40 #define L1CTL_RESET_CONF 15
41 #define L1CTL_DATA_CONF 16
42 #define L1CTL_CCCH_MODE_REQ 17
43 #define L1CTL_CCCH_MODE_CONF 18
44 #define L1CTL_DM_REL_REQ 19
48 CCCH_MODE_NON_COMBINED,
53 * NOTE: struct size. We do add manual padding out of the believe
54 * that it will avoid some unaligned access.
57 /* there are no more messages in a sequence */
58 #define L1CTL_F_DONE 0x01
65 } __attribute__((packed));
68 * downlink info ... down from the BTS..
70 struct l1ctl_info_dl {
71 /* GSM 08.58 channel number (9.3.1) */
73 /* GSM 08.58 link identifier (9.3.2) */
75 /* the ARFCN and the band. FIXME: what about MAIO? */
80 uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */
81 uint8_t snr; /* Signal/Noise Ration (dB) */
86 } __attribute__((packed));
88 /* new CCCH was found. This is following the header */
89 struct l1ctl_fbsb_conf {
90 int16_t initial_freq_err;
93 /* FIXME: contents of cell_info ? */
94 } __attribute__((packed));
96 /* CCCH mode was changed */
97 struct l1ctl_ccch_mode_conf {
98 uint8_t ccch_mode; /* enum ccch_mode */
100 } __attribute__((packed));
102 /* data on the CCCH was found. This is following the header */
103 struct l1ctl_data_ind {
105 } __attribute__((packed));
110 struct l1ctl_info_ul {
111 /* GSM 08.58 channel number (9.3.1) */
113 /* GSM 08.58 link identifier (9.3.2) */
119 } __attribute__((packed));
123 * the l1_info_ul header is in front
125 struct l1ctl_fbsb_req {
127 uint16_t timeout; /* in TDMA frames */
129 uint16_t freq_err_thresh1;
130 uint16_t freq_err_thresh2;
132 uint8_t num_freqerr_avg;
133 uint8_t flags; /* L1CTL_FBSB_F_* */
134 uint8_t sync_info_idx;
135 uint8_t ccch_mode; /* enum ccch_mode */
136 } __attribute__((packed));
138 #define L1CTL_FBSB_F_FB0 (1 << 0)
139 #define L1CTL_FBSB_F_FB1 (1 << 1)
140 #define L1CTL_FBSB_F_SB (1 << 2)
141 #define L1CTL_FBSB_F_FB01SB (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
144 * msg for CCCH_MODE_REQ
145 * the l1_info_ul header is in front
147 struct l1ctl_ccch_mode_req {
148 uint8_t ccch_mode; /* enum ccch_mode */
150 } __attribute__((packed));
152 /* the l1_info_ul header is in front */
153 struct l1ctl_rach_req {
156 } __attribute__((packed));
158 struct l1ctl_dm_est_req {
173 } __attribute__((packed));
175 struct l1ctl_pm_req {
181 uint16_t band_arfcn_from;
182 uint16_t band_arfcn_to;
185 } __attribute__((packed));
187 /* a single L1CTL_PM response */
188 struct l1ctl_pm_conf {
191 } __attribute__((packed));
193 enum l1ctl_reset_type {
194 L1CTL_RES_T_BOOT, /* only _IND */
198 /* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
202 } __attribute__((packed));