include: Rename l1a_l23_interface.h to l1ctl_proto.h
authorSylvain Munaut <tnt@246tNt.com>
Sun, 25 Jul 2010 22:12:48 +0000 (00:12 +0200)
committerSylvain Munaut <tnt@246tNt.com>
Tue, 27 Jul 2010 18:51:29 +0000 (20:51 +0200)
The interface between l1 and upper layer is called by several
name. IMHO l1ctl is shorted and sounds good so try to unify
using that.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
18 files changed:
include/l1a_l23_interface.h [deleted file]
include/l1ctl_proto.h [new file with mode: 0644]
src/host/layer23/include/Makefile.am
src/host/layer23/include/l1a_l23_interface.h [deleted symlink]
src/host/layer23/include/l1ctl_proto.h [new symlink]
src/host/layer23/include/osmocom/bb/common/lapdm.h
src/host/layer23/src/common/l1ctl.c
src/host/layer23/src/common/lapdm.c
src/host/layer23/src/misc/bcch_scan.c
src/target/firmware/include/layer1/l23_api.h
src/target/firmware/include/layer1/sync.h
src/target/firmware/layer1/l23_api.c
src/target/firmware/layer1/prim_fbsb.c
src/target/firmware/layer1/prim_pm.c
src/target/firmware/layer1/prim_rach.c
src/target/firmware/layer1/prim_rx_nb.c
src/target/firmware/layer1/prim_tx_nb.c
src/target/firmware/layer1/sync.c

diff --git a/include/l1a_l23_interface.h b/include/l1a_l23_interface.h
deleted file mode 100644 (file)
index 6c47246..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Messages to be sent between the different layers */
-
-/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
- * (C) 2010 by Holger Hans Peter Freyther
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#ifndef l1a_l23_interface_h
-#define l1a_l23_interface_h
-
-#define L1CTL_FBSB_REQ         1
-#define L1CTL_FBSB_CONF                2
-#define L1CTL_DATA_IND         3
-#define L1CTL_RACH_REQ         4
-#define L1CTL_DM_EST_REQ       5
-#define L1CTL_DATA_REQ         7
-#define L1CTL_RESET_IND                8
-#define L1CTL_PM_REQ           9       /* power measurement */
-#define L1CTL_PM_CONF          10      /* power measurement */
-#define L1CTL_ECHO_REQ         11
-#define L1CTL_ECHO_CONF                12
-#define L1CTL_RACH_CONF                13
-#define L1CTL_RESET_REQ                14
-#define L1CTL_RESET_CONF       15
-#define L1CTL_DATA_CONF                16
-#define L1CTL_CCCH_MODE_REQ    17
-#define L1CTL_CCCH_MODE_CONF   18
-#define L1CTL_DM_REL_REQ       19
-#define L1CTL_PARAM_REQ                20
-
-enum ccch_mode {
-       CCCH_MODE_NONE = 0,
-       CCCH_MODE_NON_COMBINED,
-       CCCH_MODE_COMBINED,
-};
-
-/*
- * NOTE: struct size. We do add manual padding out of the believe
- * that it will avoid some unaligned access.
- */
-
-/* there are no more messages in a sequence */
-#define L1CTL_F_DONE   0x01
-
-struct l1ctl_hdr {
-       uint8_t msg_type;
-       uint8_t flags;
-       uint8_t padding[2];
-       uint8_t data[0];
-} __attribute__((packed));
-
-/*
- * downlink info ... down from the BTS..
- */
-struct l1ctl_info_dl {
-       /* GSM 08.58 channel number (9.3.1) */
-       uint8_t chan_nr;
-       /* GSM 08.58 link identifier (9.3.2) */
-       uint8_t link_id;
-       /* the ARFCN and the band. FIXME: what about MAIO? */
-       uint16_t band_arfcn;
-
-       uint32_t frame_nr;
-
-       uint8_t rx_level;       /* 0 .. 63 in typical GSM notation (dBm+110) */
-       uint8_t snr;            /* Signal/Noise Ration (dB) */
-       uint8_t num_biterr;
-       uint8_t fire_crc;
-
-       uint8_t payload[0];
-} __attribute__((packed));
-
-/* new CCCH was found. This is following the header */
-struct l1ctl_fbsb_conf {
-       int16_t initial_freq_err;
-       uint8_t result;
-       uint8_t bsic;
-       /* FIXME: contents of cell_info ? */
-} __attribute__((packed));
-
-/* CCCH mode was changed */
-struct l1ctl_ccch_mode_conf {
-       uint8_t ccch_mode;      /* enum ccch_mode */
-       uint8_t padding[3];
-} __attribute__((packed));
-
-/* data on the CCCH was found. This is following the header */
-struct l1ctl_data_ind {
-       uint8_t data[23];
-} __attribute__((packed));
-
-/*
- * uplink info
- */
-struct l1ctl_info_ul {
-       /* GSM 08.58 channel number (9.3.1) */
-       uint8_t chan_nr;
-       /* GSM 08.58 link identifier (9.3.2) */
-       uint8_t link_id;
-       uint8_t padding[2];
-
-       uint8_t payload[0];
-} __attribute__((packed));
-
-/*
- * msg for FBSB_REQ
- * the l1_info_ul header is in front
- */
-struct l1ctl_fbsb_req {
-       uint16_t band_arfcn;
-       uint16_t timeout;       /* in TDMA frames */
-
-       uint16_t freq_err_thresh1;
-       uint16_t freq_err_thresh2;
-
-       uint8_t num_freqerr_avg;
-       uint8_t flags;          /* L1CTL_FBSB_F_* */
-       uint8_t sync_info_idx;
-       uint8_t ccch_mode;      /* enum ccch_mode */
-} __attribute__((packed));
-
-#define L1CTL_FBSB_F_FB0       (1 << 0)
-#define L1CTL_FBSB_F_FB1       (1 << 1)
-#define L1CTL_FBSB_F_SB                (1 << 2)
-#define L1CTL_FBSB_F_FB01SB    (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
-
-/*
- * msg for CCCH_MODE_REQ
- * the l1_info_ul header is in front
- */
-struct l1ctl_ccch_mode_req {
-       uint8_t ccch_mode;      /* enum ccch_mode */
-       uint8_t padding[3];
-} __attribute__((packed));
-
-/* the l1_info_ul header is in front */
-struct l1ctl_rach_req {
-       uint8_t ra;
-       uint8_t fn51;
-       uint8_t mf_off;
-       uint8_t padding[1];
-} __attribute__((packed));
-
-/* the l1_info_ul header is in front */
-struct l1ctl_par_req {
-       int8_t ta;
-       uint8_t tx_power;
-       uint8_t padding[2];
-} __attribute__((packed));
-
-struct l1ctl_dm_est_req {
-       uint8_t tsc;
-       uint8_t h;
-       union {
-               struct {
-                       uint16_t band_arfcn;
-               } h0;
-               struct {
-                       uint8_t hsn;
-                       uint8_t maio;
-                       uint8_t n;
-                       uint8_t _padding[1];
-                       uint16_t ma[64];
-               } h1;
-       };
-} __attribute__((packed));
-
-struct l1ctl_pm_req {
-       uint8_t type;
-       uint8_t padding[3];
-
-       union {
-               struct {
-                       uint16_t band_arfcn_from;
-                       uint16_t band_arfcn_to;
-               } range;
-       };
-} __attribute__((packed));
-
-/* a single L1CTL_PM response */
-struct l1ctl_pm_conf {
-       uint16_t band_arfcn;
-       uint8_t pm[2];
-} __attribute__((packed));
-
-enum l1ctl_reset_type {
-       L1CTL_RES_T_BOOT,       /* only _IND */
-       L1CTL_RES_T_FULL,
-       L1CTL_RES_T_SCHED,
-};
-
-/* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
-struct l1ctl_reset {
-       uint8_t type;
-       uint8_t pad[3];
-} __attribute__((packed));
-
-#endif
diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h
new file mode 100644 (file)
index 0000000..6c47246
--- /dev/null
@@ -0,0 +1,214 @@
+/* Messages to be sent between the different layers */
+
+/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2010 by Holger Hans Peter Freyther
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#ifndef l1a_l23_interface_h
+#define l1a_l23_interface_h
+
+#define L1CTL_FBSB_REQ         1
+#define L1CTL_FBSB_CONF                2
+#define L1CTL_DATA_IND         3
+#define L1CTL_RACH_REQ         4
+#define L1CTL_DM_EST_REQ       5
+#define L1CTL_DATA_REQ         7
+#define L1CTL_RESET_IND                8
+#define L1CTL_PM_REQ           9       /* power measurement */
+#define L1CTL_PM_CONF          10      /* power measurement */
+#define L1CTL_ECHO_REQ         11
+#define L1CTL_ECHO_CONF                12
+#define L1CTL_RACH_CONF                13
+#define L1CTL_RESET_REQ                14
+#define L1CTL_RESET_CONF       15
+#define L1CTL_DATA_CONF                16
+#define L1CTL_CCCH_MODE_REQ    17
+#define L1CTL_CCCH_MODE_CONF   18
+#define L1CTL_DM_REL_REQ       19
+#define L1CTL_PARAM_REQ                20
+
+enum ccch_mode {
+       CCCH_MODE_NONE = 0,
+       CCCH_MODE_NON_COMBINED,
+       CCCH_MODE_COMBINED,
+};
+
+/*
+ * NOTE: struct size. We do add manual padding out of the believe
+ * that it will avoid some unaligned access.
+ */
+
+/* there are no more messages in a sequence */
+#define L1CTL_F_DONE   0x01
+
+struct l1ctl_hdr {
+       uint8_t msg_type;
+       uint8_t flags;
+       uint8_t padding[2];
+       uint8_t data[0];
+} __attribute__((packed));
+
+/*
+ * downlink info ... down from the BTS..
+ */
+struct l1ctl_info_dl {
+       /* GSM 08.58 channel number (9.3.1) */
+       uint8_t chan_nr;
+       /* GSM 08.58 link identifier (9.3.2) */
+       uint8_t link_id;
+       /* the ARFCN and the band. FIXME: what about MAIO? */
+       uint16_t band_arfcn;
+
+       uint32_t frame_nr;
+
+       uint8_t rx_level;       /* 0 .. 63 in typical GSM notation (dBm+110) */
+       uint8_t snr;            /* Signal/Noise Ration (dB) */
+       uint8_t num_biterr;
+       uint8_t fire_crc;
+
+       uint8_t payload[0];
+} __attribute__((packed));
+
+/* new CCCH was found. This is following the header */
+struct l1ctl_fbsb_conf {
+       int16_t initial_freq_err;
+       uint8_t result;
+       uint8_t bsic;
+       /* FIXME: contents of cell_info ? */
+} __attribute__((packed));
+
+/* CCCH mode was changed */
+struct l1ctl_ccch_mode_conf {
+       uint8_t ccch_mode;      /* enum ccch_mode */
+       uint8_t padding[3];
+} __attribute__((packed));
+
+/* data on the CCCH was found. This is following the header */
+struct l1ctl_data_ind {
+       uint8_t data[23];
+} __attribute__((packed));
+
+/*
+ * uplink info
+ */
+struct l1ctl_info_ul {
+       /* GSM 08.58 channel number (9.3.1) */
+       uint8_t chan_nr;
+       /* GSM 08.58 link identifier (9.3.2) */
+       uint8_t link_id;
+       uint8_t padding[2];
+
+       uint8_t payload[0];
+} __attribute__((packed));
+
+/*
+ * msg for FBSB_REQ
+ * the l1_info_ul header is in front
+ */
+struct l1ctl_fbsb_req {
+       uint16_t band_arfcn;
+       uint16_t timeout;       /* in TDMA frames */
+
+       uint16_t freq_err_thresh1;
+       uint16_t freq_err_thresh2;
+
+       uint8_t num_freqerr_avg;
+       uint8_t flags;          /* L1CTL_FBSB_F_* */
+       uint8_t sync_info_idx;
+       uint8_t ccch_mode;      /* enum ccch_mode */
+} __attribute__((packed));
+
+#define L1CTL_FBSB_F_FB0       (1 << 0)
+#define L1CTL_FBSB_F_FB1       (1 << 1)
+#define L1CTL_FBSB_F_SB                (1 << 2)
+#define L1CTL_FBSB_F_FB01SB    (L1CTL_FBSB_F_FB0|L1CTL_FBSB_F_FB1|L1CTL_FBSB_F_SB)
+
+/*
+ * msg for CCCH_MODE_REQ
+ * the l1_info_ul header is in front
+ */
+struct l1ctl_ccch_mode_req {
+       uint8_t ccch_mode;      /* enum ccch_mode */
+       uint8_t padding[3];
+} __attribute__((packed));
+
+/* the l1_info_ul header is in front */
+struct l1ctl_rach_req {
+       uint8_t ra;
+       uint8_t fn51;
+       uint8_t mf_off;
+       uint8_t padding[1];
+} __attribute__((packed));
+
+/* the l1_info_ul header is in front */
+struct l1ctl_par_req {
+       int8_t ta;
+       uint8_t tx_power;
+       uint8_t padding[2];
+} __attribute__((packed));
+
+struct l1ctl_dm_est_req {
+       uint8_t tsc;
+       uint8_t h;
+       union {
+               struct {
+                       uint16_t band_arfcn;
+               } h0;
+               struct {
+                       uint8_t hsn;
+                       uint8_t maio;
+                       uint8_t n;
+                       uint8_t _padding[1];
+                       uint16_t ma[64];
+               } h1;
+       };
+} __attribute__((packed));
+
+struct l1ctl_pm_req {
+       uint8_t type;
+       uint8_t padding[3];
+
+       union {
+               struct {
+                       uint16_t band_arfcn_from;
+                       uint16_t band_arfcn_to;
+               } range;
+       };
+} __attribute__((packed));
+
+/* a single L1CTL_PM response */
+struct l1ctl_pm_conf {
+       uint16_t band_arfcn;
+       uint8_t pm[2];
+} __attribute__((packed));
+
+enum l1ctl_reset_type {
+       L1CTL_RES_T_BOOT,       /* only _IND */
+       L1CTL_RES_T_FULL,
+       L1CTL_RES_T_SCHED,
+};
+
+/* argument to L1CTL_RESET_REQ and L1CTL_RESET_IND */
+struct l1ctl_reset {
+       uint8_t type;
+       uint8_t pad[3];
+} __attribute__((packed));
+
+#endif
index ca774b6..297ece9 100644 (file)
@@ -1,2 +1,2 @@
-noinst_HEADERS = l1a_l23_interface.h
+noinst_HEADERS = l1ctl_proto.h
 SUBDIRS = osmocom
diff --git a/src/host/layer23/include/l1a_l23_interface.h b/src/host/layer23/include/l1a_l23_interface.h
deleted file mode 120000 (symlink)
index 2bbc967..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../../include/l1a_l23_interface.h
\ No newline at end of file
diff --git a/src/host/layer23/include/l1ctl_proto.h b/src/host/layer23/include/l1ctl_proto.h
new file mode 120000 (symlink)
index 0000000..f12ba71
--- /dev/null
@@ -0,0 +1 @@
+../../../../include/l1ctl_proto.h
\ No newline at end of file
index ab048b8..de954fb 100644 (file)
@@ -6,7 +6,7 @@
 #include <osmocore/timer.h>
 #include <osmocore/msgb.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 enum lapdm_state {
        LAPDm_STATE_NULL = 0,
index 3ddae8a..132d5ce 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <arpa/inet.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 #include <osmocore/signal.h>
 #include <osmocore/logging.h>
index c47bd7c..4aa4662 100644 (file)
@@ -70,7 +70,7 @@
 #include <osmocom/bb/common/lapdm.h>
 #include <osmocom/bb/common/logging.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 /* TS 04.06 Figure 4 / Section 3.2 */
 #define LAPDm_LPD_NORMAL  0
index e057da3..dff4dc9 100644 (file)
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <errno.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 #include <osmocore/logging.h>
 #include <osmocore/talloc.h>
index 1ba6d17..b160270 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <stdint.h>
 #include <osmocore/msgb.h>
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 void l1a_l23api_init(void);
 void l1_queue_for_l2(struct msgb *msg);
index 7613449..257244b 100644 (file)
@@ -5,7 +5,7 @@
 #include <osmocore/gsm_utils.h>
 #include <layer1/tdma_sched.h>
 #include <layer1/mframe_sched.h>
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 /* structure representing L1 sync information about a cell */
 struct l1_cell_info {
index f1997dc..8cd8ad0 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <rf/trf6151.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 /* the size we will allocate struct msgb* for HDLC */
 #define L3_MSG_HEAD 4
index 4360f7c..a399d90 100644 (file)
@@ -47,7 +47,7 @@
 #include <layer1/tpu_window.h>
 #include <layer1/l23_api.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 #define FB0_RETRY_COUNT                3
 #define AFC_RETRY_COUNT                30
index 80650f6..b5260cb 100644 (file)
@@ -45,7 +45,7 @@
 #include <layer1/tpu_window.h>
 #include <layer1/l23_api.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 static void l1ddsp_meas_read(uint8_t nbmeas, uint16_t *pm)
 {
index 6f4ad6d..763ec61 100644 (file)
@@ -46,7 +46,7 @@
 #include <layer1/tpu_window.h>
 #include <layer1/l23_api.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 struct {
        uint32_t fn;
index 036f4e6..e49e1a4 100644 (file)
@@ -47,7 +47,7 @@
 #include <layer1/l23_api.h>
 #include <layer1/rfch.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 struct l1s_rxnb_state {
        struct l1s_meas_hdr meas[4];
index 7e4bd96..f1398e0 100644 (file)
@@ -48,7 +48,7 @@
 #include <layer1/l23_api.h>
 #include <layer1/rfch.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 /* Channel type definitions for DEDICATED mode */
 #define INVALID_CHANNEL    0
index d4d2aed..7d7d29f 100644 (file)
@@ -56,7 +56,7 @@
 #include <layer1/tpu_window.h>
 #include <layer1/l23_api.h>
 
-#include <l1a_l23_interface.h>
+#include <l1ctl_proto.h>
 
 struct l1s_state l1s;