summaryrefslogtreecommitdiffstats
path: root/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common
diff options
context:
space:
mode:
Diffstat (limited to 'Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common')
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/Makefile.am2
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/gps.h53
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1ctl.h65
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1l2_interface.h8
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l23_app.h35
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/lapdm.h100
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/logging.h28
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/networks.h22
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/osmocom_data.h114
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sap_interface.h11
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sim.h274
-rw-r--r--Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sysinfo.h157
12 files changed, 0 insertions, 869 deletions
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/Makefile.am b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/Makefile.am
deleted file mode 100644
index 26e63cf..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-noinst_HEADERS = l1ctl.h l1l2_interface.h l23_app.h lapdm.h logging.h \
- networks.h gps.h sysinfo.h osmocom_data.h
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/gps.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/gps.h
deleted file mode 100644
index 58c0c53..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/gps.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * (C) 2010 by Andreas Eversberg <jolly@eversberg.eu>
- *
- * 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.
- *
- */
-
-enum {
- GPS_TYPE_UNDEF,
- GPS_TYPE_GPSD,
- GPS_TYPE_SERIAL
-};
-
-struct osmo_gps {
- /* GPS device */
- uint8_t enable;
- uint8_t gps_type;
-
-#ifdef _HAVE_GPSD
- char gpsd_host[32];
- char gpsd_port[6];
-#endif
-
- char device[32];
- uint32_t baud;
-
- /* current data */
- uint8_t valid; /* we have a fix */
- time_t gmt; /* GMT time when position was received */
- double latitude, longitude;
-};
-
-extern struct osmo_gps g;
-
-int osmo_gps_open(void);
-void osmo_gps_close(void);
-void osmo_gps_init(void);
-
-
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1ctl.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1ctl.h
deleted file mode 100644
index 7eb0c8c..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1ctl.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef osmocom_l1ctl_h
-#define osmocom_l1ctl_h
-
-#include <osmocom/core/msgb.h>
-#include <osmocom/bb/common/osmocom_data.h>
-
-struct osmocom_ms;
-
-/* Receive incoming data from L1 using L1CTL format */
-int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg);
-
-/* Transmit L1CTL_DATA_REQ */
-int l1ctl_tx_data_req(struct osmocom_ms *ms, struct msgb *msg, uint8_t chan_nr,
- uint8_t link_id);
-
-/* Transmit L1CTL_PARAM_REQ */
-int l1ctl_tx_param_req(struct osmocom_ms *ms, uint8_t ta, uint8_t tx_power);
-
-int l1ctl_tx_crypto_req(struct osmocom_ms *ms, uint8_t algo, uint8_t *key,
- uint8_t len);
-
-/* Transmit L1CTL_RACH_REQ */
-int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint16_t offset,
- uint8_t combined);
-
-/* Transmit L1CTL_DM_EST_REQ */
-int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
- uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode);
-int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
- uint16_t *ma, uint8_t ma_len, uint8_t chan_nr, uint8_t tsc,
- uint8_t tch_mode);
-
-/* Transmit L1CTL_DM_FREQ_REQ */
-int l1ctl_tx_dm_freq_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
- uint8_t tsc, uint16_t fn);
-int l1ctl_tx_dm_freq_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
- uint16_t *ma, uint8_t ma_len, uint8_t tsc, uint16_t fn);
-
-/* Transmit L1CTL_DM_REL_REQ */
-int l1ctl_tx_dm_rel_req(struct osmocom_ms *ms);
-
-/* Transmit FBSB_REQ */
-int l1ctl_tx_fbsb_req(struct osmocom_ms *ms, uint16_t arfcn,
- uint8_t flags, uint16_t timeout, uint8_t sync_info_idx,
- uint8_t ccch_mode);
-
-/* Transmit CCCH_MODE_REQ */
-int l1ctl_tx_ccch_mode_req(struct osmocom_ms *ms, uint8_t ccch_mode);
-
-/* Transmit TCH_MODE_REQ */
-int l1ctl_tx_tch_mode_req(struct osmocom_ms *ms, uint8_t tch_mode);
-
-/* Transmit ECHO_REQ */
-int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len);
-
-/* Transmit L1CTL_RESET_REQ */
-int l1ctl_tx_reset_req(struct osmocom_ms *ms, uint8_t type);
-
-/* Transmit L1CTL_PM_REQ */
-int l1ctl_tx_pm_req_range(struct osmocom_ms *ms, uint16_t arfcn_from,
- uint16_t arfcm_to);
-
-int l1ctl_tx_sim_req(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
-
-#endif
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1l2_interface.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1l2_interface.h
deleted file mode 100644
index 41403d8..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l1l2_interface.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _L1L2_INTERFACE_H
-#define _L1L2_INTERFACE_H
-
-int layer2_open(struct osmocom_ms *ms, const char *socket_path);
-int layer2_close(struct osmocom_ms *ms);
-int osmo_send_l1(struct osmocom_ms *ms, struct msgb *msg);
-
-#endif /* _L1L2_INTERFACE_H */
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l23_app.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l23_app.h
deleted file mode 100644
index e4c5d55..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/l23_app.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _L23_APP_H
-#define _L23_APP_H
-
-struct option;
-
-/* Options supported by the l23 app */
-enum {
- L23_OPT_SAP = 1,
- L23_OPT_ARFCN = 2,
- L23_OPT_TAP = 4,
- L23_OPT_VTY = 8,
- L23_OPT_DBG = 16,
-};
-
-/* initialization, called once when starting the app, before entering
- * select loop */
-extern int l23_app_init(struct osmocom_ms *ms);
-extern int (*l23_app_work) (struct osmocom_ms *ms);
-extern int (*l23_app_exit) (struct osmocom_ms *ms);
-
-/* configuration options */
-struct l23_app_info {
- const char *copyright;
- const char *contribution;
-
- char *getopt_string;
- int (*cfg_supported)();
- int (*cfg_print_help)();
- int (*cfg_getopt_opt)(struct option **options);
- int (*cfg_handle_opt)(int c,const char *optarg);
-};
-
-extern struct l23_app_info *l23_app_info();
-
-#endif /* _L23_APP_H */
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/lapdm.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/lapdm.h
deleted file mode 100644
index b502ffd..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/lapdm.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef _OSMOCOM_LAPDM_H
-#define _OSMOCOM_LAPDM_H
-
-#include <stdint.h>
-
-#include <osmocom/core/timer.h>
-#include <osmocom/core/msgb.h>
-
-#include <l1ctl_proto.h>
-
-enum lapdm_state {
- LAPDm_STATE_NULL = 0,
- LAPDm_STATE_IDLE,
- LAPDm_STATE_SABM_SENT,
- LAPDm_STATE_MF_EST,
- LAPDm_STATE_TIMER_RECOV,
- LAPDm_STATE_DISC_SENT,
-};
-
-struct lapdm_entity;
-struct osmocom_ms;
-
-struct lapdm_msg_ctx {
- struct lapdm_datalink *dl;
- int lapdm_fmt;
- uint8_t n201;
- uint8_t chan_nr;
- uint8_t link_id;
- uint8_t addr;
- uint8_t ctrl;
- uint8_t ta_ind;
- uint8_t tx_power_ind;
-};
-
-/* TS 04.06 / Section 3.5.2 */
-struct lapdm_datalink {
- uint8_t V_send; /* seq nr of next I frame to be transmitted */
- uint8_t V_ack; /* last frame ACKed by peer */
- uint8_t N_send; /* ? set to V_send at Tx time*/
- uint8_t V_recv; /* seq nr of next I frame expected to be received */
- uint8_t N_recv; /* expected send seq nr of the next received I frame */
- uint32_t state;
- int seq_err_cond; /* condition of sequence error */
- uint8_t own_busy, peer_busy;
- struct osmo_timer_list t200;
- uint8_t retrans_ctr;
- struct llist_head send_queue; /* frames from L3 */
- struct msgb *send_buffer; /* current frame transmitting */
- int send_out; /* how much was sent from send_buffer */
- uint8_t tx_hist[8][200]; /* tx history buffer */
- int tx_length[8]; /* length in history buffer */
- struct llist_head tx_queue; /* frames to L1 */
- struct lapdm_msg_ctx mctx; /* context of established connection */
- struct msgb *rcv_buffer; /* buffer to assemble the received message */
-
- struct lapdm_entity *entity;
-};
-
-enum lapdm_dl_sapi {
- DL_SAPI0 = 0,
- DL_SAPI3 = 1,
- _NR_DL_SAPI
-};
-
-struct lapdm_entity {
- struct lapdm_datalink datalink[_NR_DL_SAPI];
- int last_tx_dequeue; /* last entity that was dequeued */
- int tx_pending; /* currently a pending frame not confirmed by L1 */
- struct osmocom_ms *ms;
-};
-
-const char *get_rsl_name(int value);
-extern const char *lapdm_state_names[];
-
-/* initialize a LAPDm entity */
-void lapdm_init(struct lapdm_entity *le, struct osmocom_ms *ms);
-
-/* deinitialize a LAPDm entity */
-void lapdm_exit(struct lapdm_entity *le);
-
-/* input into layer2 (from layer 1) */
-int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, struct l1ctl_info_dl *l1i);
-int l2_ph_data_conf(struct msgb *msg, struct lapdm_entity *le);
-
-/* L1 confirms channel request */
-int l2_ph_chan_conf(struct msgb *msg, struct osmocom_ms *ms,
- struct l1ctl_info_dl *dl);
-
-/* input into layer2 (from layer 3) */
-int rslms_recvmsg(struct msgb *msg, struct osmocom_ms *ms);
-
-/* sending messages up from L2 to L3 */
-int rslms_sendmsg(struct msgb *msg, struct osmocom_ms *ms);
-
-typedef int (*osmol2_cb_t)(struct msgb *msg, struct osmocom_ms *ms);
-
-/* register message handler for messages that are sent from L2->L3 */
-int osmol2_register_handler(struct osmocom_ms *ms, osmol2_cb_t cb);
-
-#endif /* _OSMOCOM_LAPDM_H */
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/logging.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/logging.h
deleted file mode 100644
index 9205fec..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/logging.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _LOGGING_H
-#define _LOGGING_H
-
-#define DEBUG
-#include <osmocom/core/logging.h>
-
-enum {
- DRSL,
- DRR,
- DPLMN,
- DCS,
- DMM,
- DCC,
- DSMS,
- DMNCC,
- DMEAS,
- DPAG,
- DLAPDM,
- DL1C,
- DSAP,
- DSUM,
- DSIM,
- DGPS,
-};
-
-extern const struct log_info log_info;
-
-#endif /* _LOGGING_H */
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/networks.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/networks.h
deleted file mode 100644
index e8c1b18..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/networks.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _NETWORKS_H
-#define _NETWORKS_H
-
-struct gsm_networks {
- uint16_t mcc;
- int16_t mnc;
- const char *name;
-};
-
-int gsm_match_mcc(uint16_t mcc, char *imsi);
-int gsm_match_mnc(uint16_t mcc, uint8_t mnc, char *imsi);
-const char *gsm_print_mcc(uint16_t mcc);
-const char *gsm_print_mnc(uint16_t mcc);
-const char *gsm_get_mcc(uint16_t mcc);
-const char *gsm_get_mnc(uint16_t mcc, uint16_t mnc);
-const char *gsm_imsi_mcc(char *imsi);
-const char *gsm_imsi_mnc(char *imsi);
-const uint16_t gsm_input_mcc(char *string);
-const uint16_t gsm_input_mnc(char *string);
-
-#endif /* _NETWORKS_H */
-
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
deleted file mode 100644
index 9ca4114..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ /dev/null
@@ -1,114 +0,0 @@
-#ifndef osmocom_data_h
-#define osmocom_data_h
-
-#include <osmocom/core/select.h>
-#include <osmocom/gsm/gsm_utils.h>
-#include <osmocom/core/write_queue.h>
-
-struct osmocom_ms;
-
- /* FIXME no 'mobile' specific stuff should be here */
-#include <osmocom/bb/mobile/support.h>
-#include <osmocom/bb/mobile/settings.h>
-#include <osmocom/bb/mobile/subscriber.h>
-#include <osmocom/bb/common/lapdm.h>
-#include <osmocom/bb/common/sap_interface.h>
-#include <osmocom/bb/mobile/gsm48_rr.h>
-#include <osmocom/bb/common/sysinfo.h>
-#include <osmocom/bb/mobile/gsm322.h>
-#include <osmocom/bb/mobile/gsm48_mm.h>
-#include <osmocom/bb/mobile/gsm48_cc.h>
-#include <osmocom/bb/common/sim.h>
-
-/* A layer2 entity */
-struct osmol2_entity {
- struct lapdm_entity lapdm_dcch;
- struct lapdm_entity lapdm_acch;
- osmol2_cb_t msg_handler;
-};
-
-struct osmosap_entity {
- osmosap_cb_t msg_handler;
-};
-
-/* RX measurement statistics */
-struct rx_meas_stat {
- uint32_t last_fn;
-
- /* cumulated values of current cell from SACCH dl */
- uint32_t frames;
- uint32_t snr;
- uint32_t berr;
- uint32_t rxlev;
-
- /* counters loss criterion */
- int16_t dsc, ds_fail;
- int16_t s, rl_fail;
-};
-
-/* One Mobilestation for osmocom */
-struct osmocom_ms {
- struct llist_head entity;
- char name[32];
- struct osmo_wqueue l2_wq, sap_wq;
- uint16_t test_arfcn;
-
- uint8_t deleting, shutdown, started;
- struct gsm_support support;
- struct gsm_settings settings;
- struct gsm_subscriber subscr;
- struct gsm_sim sim;
- struct osmol2_entity l2_entity;
- struct osmosap_entity sap_entity;
- struct rx_meas_stat meas;
- struct gsm48_rrlayer rrlayer;
- struct gsm322_plmn plmn;
- struct gsm322_cellsel cellsel;
- struct gsm48_mmlayer mmlayer;
- struct gsm48_cclayer cclayer;
- struct llist_head trans_list;
-};
-
-enum osmobb_sig_subsys {
- SS_L1CTL,
- SS_GLOBAL,
-};
-
-enum osmobb_l1ctl_sig {
- S_L1CTL_FBSB_ERR,
- S_L1CTL_FBSB_RESP,
- S_L1CTL_RESET,
- S_L1CTL_PM_RES,
- S_L1CTL_PM_DONE,
- S_L1CTL_CCCH_MODE_CONF,
- S_L1CTL_TCH_MODE_CONF,
- S_L1CTL_LOSS_IND,
-};
-
-enum osmobb_global_sig {
- S_GLOBAL_SHUTDOWN,
-};
-
-struct osmobb_fbsb_res {
- struct osmocom_ms *ms;
- int8_t snr;
- uint8_t bsic;
-};
-
-struct osmobb_meas_res {
- struct osmocom_ms *ms;
- uint16_t band_arfcn;
- uint8_t rx_lev;
-};
-
-struct osmobb_ccch_mode_conf {
- struct osmocom_ms *ms;
- uint8_t ccch_mode;
-};
-
-struct osmobb_tch_mode_conf {
- struct osmocom_ms *ms;
- uint8_t tch_mode;
-};
-
-#endif
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sap_interface.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sap_interface.h
deleted file mode 100644
index f2f577a..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sap_interface.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _SAP_INTERFACE_H
-#define _SAP_INTERFACE_H
-
-typedef int (*osmosap_cb_t)(struct msgb *msg, struct osmocom_ms *ms);
-
-int sap_open(struct osmocom_ms *ms, const char *socket_path);
-int sap_close(struct osmocom_ms *ms);
-int osmosap_send(struct osmocom_ms *ms, struct msgb *msg);
-int osmosap_register_handler(struct osmocom_ms *ms, osmosap_cb_t cb);
-
-#endif /* _SAP_INTERFACE_H */
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sim.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sim.h
deleted file mode 100644
index a676b92..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sim.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * (C) 2010 by Andreas Eversberg <jolly@eversberg.eu>
- *
- * 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.
- *
- */
-
-
-/* 9.2 commands */
-#define GSM1111_CLASS_GSM 0xa0
-#define GSM1111_INST_SELECT 0xa4
-#define GSM1111_INST_STATUS 0xf2
-#define GSM1111_INST_READ_BINARY 0xb0
-#define GSM1111_INST_UPDATE_BINARY 0xd6
-#define GSM1111_INST_READ_RECORD 0xb2
-#define GSM1111_INST_UPDATE_RECORD 0xdc
-#define GSM1111_INST_SEEK 0xa2
-#define GSM1111_INST_INCREASE 0x32
-#define GSM1111_INST_VERIFY_CHV 0x20
-#define GSM1111_INST_CHANGE_CHV 0x24
-#define GSM1111_INST_DISABLE_CHV 0x26
-#define GSM1111_INST_ENABLE_CHV 0x28
-#define GSM1111_INST_UNBLOCK_CHV 0x2c
-#define GSM1111_INST_INVALIDATE 0x04
-#define GSM1111_INST_REHABLILITATE 0x44
-#define GSM1111_INST_RUN_GSM_ALGO 0x88
-#define GSM1111_INST_SLEEP 0xfa
-#define GSM1111_INST_GET_RESPONSE 0xc0
-#define GSM1111_INST_TERMINAL_PROFILE 0x10
-#define GSM1111_INST_ENVELOPE 0xc2
-#define GSM1111_INST_FETCH 0x12
-#define GSM1111_INST_TERMINAL_RESPONSE 0x14
-
-/* 9.3 access conditions */
-#define GSM1111_ACC_ALWAYS 0x0
-#define GSM1111_ACC_CHV1 0x1
-#define GSM1111_ACC_CHV2 0x2
-#define GSM1111_ACC_RFU 0x3
-#define GSM1111_ACC_NEW 0xf
-/* others are ADM */
-
-/* 9.3 type of file */
-#define GSM1111_TOF_RFU 0x00
-#define GSM1111_TOF_MF 0x01
-#define GSM1111_TOF_DF 0x02
-#define GSM1111_TOF_EF 0x04
-
-/* 9.3 struct of file */
-#define GSM1111_SOF_TRANSPARENT 0x00
-#define GSM1111_SOF_LINEAR 0x01
-#define GSM1111_SOF_CYCLIC 0x03
-
-/* 9.4 status */
-#define GSM1111_STAT_NORMAL 0x90
-#define GSM1111_STAT_PROACTIVE 0x91
-#define GSM1111_STAT_DL_ERROR 0x9e
-#define GSM1111_STAT_RESPONSE 0x9f
-#define GSM1111_STAT_RESPONSE_TOO 0x61
-#define GSM1111_STAT_APP_TK_BUSY 0x93
-#define GSM1111_STAT_MEM_PROBLEM 0x92
-#define GSM1111_STAT_REFERENCING 0x94
-#define GSM1111_STAT_SECURITY 0x98
-#define GSM1111_STAT_INCORR_P3 0x67
-#define GSM1111_STAT_INCORR_P1_P2 0x6b
-#define GSM1111_STAT_UKN_INST 0x6d
-#define GSM1111_STAT_WRONG_CLASS 0x6e
-#define GSM1111_STAT_TECH_PROBLEM 0x6f
-
-/* 9.4.4 Referencing management SW2 */
-#define GSM1111_REF_NO_EF 0x00
-#define GSM1111_REF_OUT_OF_RANGE 0x02
-#define GSM1111_REF_FILE_NOT_FOUND 0x04
-#define GSM1111_REF_FILE_INCONSI 0x08
-
-/* 9.4.5 Security management SW2 */
-#define GSM1111_SEC_NO_CHV 0x02
-#define GSM1111_SEC_NO_ACCESS 0x04
-#define GSM1111_SEC_CONTRA_CHV 0x08
-#define GSM1111_SEC_CONTRA_INVAL 0x10
-#define GSM1111_SEC_BLOCKED 0x40
-#define GSM1111_SEC_MAX_VALUE 0x50
-
-/* messages from application to sim client */
-enum {
- /* requests */
- SIM_JOB_READ_BINARY,
- SIM_JOB_UPDATE_BINARY,
- SIM_JOB_READ_RECORD,
- SIM_JOB_UPDATE_RECORD,
- SIM_JOB_SEEK_RECORD,
- SIM_JOB_INCREASE,
- SIM_JOB_INVALIDATE,
- SIM_JOB_REHABILITATE,
- SIM_JOB_RUN_GSM_ALGO,
- SIM_JOB_PIN1_UNLOCK,
- SIM_JOB_PIN1_CHANGE,
- SIM_JOB_PIN1_DISABLE,
- SIM_JOB_PIN1_ENABLE,
- SIM_JOB_PIN1_UNBLOCK,
- SIM_JOB_PIN2_UNLOCK,
- SIM_JOB_PIN2_CHANGE,
- SIM_JOB_PIN2_UNBLOCK,
-
- /* results */
- SIM_JOB_OK,
- SIM_JOB_ERROR,
-};
-
-/* messages from sim client to application */
-#define SIM_JOB_OK 0
-#define SIM_JOB_ERROR 1
-
-/* error causes */
-#define SIM_CAUSE_NO_SIM 0 /* no SIM present, if detectable */
-#define SIM_CAUSE_SIM_ERROR 1 /* any error while reading SIM */
-#define SIM_CAUSE_REQUEST_ERROR 2 /* error in request */
-#define SIM_CAUSE_PIN1_REQUIRED 3 /* CHV1 is required for access */
-#define SIM_CAUSE_PIN2_REQUIRED 4 /* CHV2 is required for access */
-#define SIM_CAUSE_PIN1_BLOCKED 5 /* CHV1 was entered too many times */
-#define SIM_CAUSE_PIN2_BLOCKED 6 /* CHV2 was entered too many times */
-#define SIM_CAUSE_PUC_BLOCKED 7 /* unblock entered too many times */
-
-/* job states */
-enum {
- SIM_JST_IDLE = 0,
- SIM_JST_SELECT_MFDF, /* SELECT sent */
- SIM_JST_SELECT_MFDF_RESP, /* GET RESPONSE sent */
- SIM_JST_SELECT_EF, /* SELECT sent */
- SIM_JST_SELECT_EF_RESP, /* GET RESPONSE sent */
- SIM_JST_WAIT_FILE, /* file command sent */
- SIM_JST_RUN_GSM_ALGO, /* wait for algorithm to process */
- SIM_JST_RUN_GSM_ALGO_RESP, /* wait for response */
- SIM_JST_PIN1_UNLOCK,
- SIM_JST_PIN1_CHANGE,
- SIM_JST_PIN1_DISABLE,
- SIM_JST_PIN1_ENABLE,
- SIM_JST_PIN1_UNBLOCK,
- SIM_JST_PIN2_UNLOCK,
- SIM_JST_PIN2_CHANGE,
- SIM_JST_PIN2_UNBLOCK,
-};
-
-#define MAX_SIM_PATH_LENGTH 6 + 1 /* one for the termination */
-
-struct gsm_sim_handler {
- struct llist_head entry;
-
- uint32_t handle;
- void (*cb)(struct osmocom_ms *ms, struct msgb *msg);
-};
-
-struct gsm_sim {
- struct llist_head handlers; /* gsm_sim_handler */
- struct llist_head jobs; /* messages */
- uint16_t path[MAX_SIM_PATH_LENGTH];
- uint16_t file;
-
- struct msgb *job_msg;
- uint32_t job_handle;
- int job_state;
-
- uint8_t reset;
- uint8_t chv1_remain, chv2_remain;
- uint8_t unblk1_remain, unblk2_remain;
-};
-
-struct sim_hdr {
- int handle;
- uint8_t job_type;
- uint16_t path[MAX_SIM_PATH_LENGTH];
- uint16_t file;
- uint8_t rec_no, rec_mode; /* in case of record */
- uint8_t seek_type_mode; /* in case of seek command */
-};
-
-#define SIM_ALLOC_SIZE 512
-#define SIM_ALLOC_HEADROOM 64
-
-struct msgb *gsm_sim_msgb_alloc(uint32_t handle, uint8_t job_type);
-uint32_t sim_open(struct osmocom_ms *ms,
- void (*cb)(struct osmocom_ms *ms, struct msgb *msg));
-void sim_close(struct osmocom_ms *ms, uint32_t handle);
-void sim_job(struct osmocom_ms *ms, struct msgb *msg);
-
-/* Section 9.2.1 (response to selecting DF or MF) */
-struct gsm1111_response_mfdf {
- uint16_t rfu1;
- uint16_t free_mem;
- uint16_t file_id;
- uint8_t tof;
- uint8_t rfu2[5];
- uint8_t length;
- uint8_t gsm_data[0];
-} __attribute__ ((packed));
-
-struct gsm1111_response_mfdf_gsm {
- uint8_t file_char;
- uint8_t num_df;
- uint8_t num_ef;
- uint8_t num_codes;
- uint8_t rfu1;
- uint8_t chv1_remain:4,
- rfu2:3,
- chv1_init:1;
- uint8_t unblk1_remain:4,
- rfu3:3,
- unblk1_init:1;
- uint8_t chv2_remain:4,
- rfu4:3,
- chv2_init:1;
- uint8_t unblk2_remain:4,
- rfu5:3,
- unblk2_init:1;
- uint8_t more_data[0];
-} __attribute__ ((packed));
-
-/* Section 9.2.1 (response to selecting EF) */
-struct gsm1111_response_ef {
- uint16_t rfu1;
- uint16_t file_size;
- uint16_t file_id;
- uint8_t tof;
- uint8_t inc_allowed;
- uint8_t acc_update:4,
- acc_read:4;
- uint8_t rfu2:4,
- acc_inc:4;
- uint8_t acc_inval:4,
- acc_reha:4;
- uint8_t not_inval:1,
- rfu3:1,
- ru_inval:1,
- rfu4:5;
- uint8_t length;
- uint8_t structure;
-} __attribute__ ((packed));
-
-/* Section 10.3.17 */
-struct gsm1111_ef_loci {
- uint32_t tmsi;
- struct gsm48_loc_area_id lai;
- uint8_t tmsi_time;
- uint8_t lupd_status;
-} __attribute__ ((packed));
-
-/* Section 10.5.1 */
-struct gsm1111_ef_adn {
- uint8_t len_bcd;
- uint8_t ton_npi;
- uint8_t number[10];
- uint8_t capa_conf;
- uint8_t ext_id;
-} __attribute__ ((packed));
-
-int sim_apdu_resp(struct osmocom_ms *ms, struct msgb *msg);
-int gsm_sim_init(struct osmocom_ms *ms);
-int gsm_sim_exit(struct osmocom_ms *ms);
-int gsm_sim_job_dequeue(struct osmocom_ms *ms);
-
-
diff --git a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sysinfo.h b/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sysinfo.h
deleted file mode 100644
index 0498e91..0000000
--- a/Src/osmocom-bb/src/host/layer23/include/osmocom/bb/common/sysinfo.h
+++ /dev/null
@@ -1,157 +0,0 @@
-#ifndef _SYSINFO_H
-#define _SYSINFO_H
-
-#include <osmocom/gsm/gsm48_ie.h>
-
-/* collection of system information of the current cell */
-
-/* frequency mask flags of frequency type */
-#define FREQ_TYPE_SERV 0x01 /* frequency of the serving cell */
-#define FREQ_TYPE_HOPP 0x02 /* frequency used for channel hopping */
-#define FREQ_TYPE_NCELL 0x1c /* frequency of the neighbor cell */
-#define FREQ_TYPE_NCELL_2 0x04 /* sub channel of SI 2 */
-#define FREQ_TYPE_NCELL_2bis 0x08 /* sub channel of SI 2bis */
-#define FREQ_TYPE_NCELL_2ter 0x10 /* sub channel of SI 2ter */
-#define FREQ_TYPE_REP 0xe0 /* frequency to be reported */
-#define FREQ_TYPE_REP_5 0x20 /* sub channel of SI 5 */
-#define FREQ_TYPE_REP_5bis 0x40 /* sub channel of SI 5bis */
-#define FREQ_TYPE_REP_5ter 0x80 /* sub channel of SI 5ter */
-
-/* structure of all received system informations */
-struct gsm48_sysinfo {
- /* flags of available information */
- uint8_t si1, si2, si2bis, si2ter, si3,
- si4, si5, si5bis, si5ter, si6;
-
- /* memory maps to simply detect change in system info messages */
- uint8_t si1_msg[23];
- uint8_t si2_msg[23];
- uint8_t si2b_msg[23];
- uint8_t si2t_msg[23];
- uint8_t si3_msg[23];
- uint8_t si4_msg[23];
- uint8_t si5_msg[18];
- uint8_t si5b_msg[18];
- uint8_t si5t_msg[18];
- uint8_t si6_msg[18];
-
- struct gsm_sysinfo_freq freq[1024]; /* all frequencies */
- uint16_t hopping[64]; /* hopping arfcn */
- uint8_t hopp_len;
-
- /* serving cell */
- uint8_t bsic;
- uint16_t cell_id;
- uint16_t mcc, mnc, lac; /* LAI */
- uint8_t max_retrans; /* decoded */
- uint8_t tx_integer; /* decoded */
- uint8_t reest_denied; /* 1 = denied */
- uint8_t cell_barr; /* 1 = barred */
- uint16_t class_barr; /* bit 10 is emergency */
-
- /* si1 rest */
- uint8_t nch;
- uint8_t nch_position;
- uint8_t band_ind; /* set for DCS */
-
- /* si3 rest */
- uint8_t sp;
- uint8_t sp_cbq;
- uint8_t sp_cro;
- uint8_t sp_to;
- uint8_t sp_pt;
- uint8_t po;
- uint8_t po_value;
- uint8_t si2ter_ind;
- uint8_t ecsm;
- uint8_t sched;
- uint8_t sched_where;
- uint8_t gi_ra_colour;
- uint8_t gi_si13_pos;
-
- /* cell selection */
- int8_t ms_txpwr_max_cch;
- int8_t cell_resel_hyst_db;
- int8_t rxlev_acc_min_db;
- uint8_t neci;
- uint8_t acs;
- /* bcch options */
- uint8_t bcch_radio_link_timeout;
- uint8_t bcch_dtx;
- uint8_t bcch_pwrc;
- /* sacch options */
- uint8_t sacch_radio_link_timeout;
- uint8_t sacch_dtx;
- uint8_t sacch_pwrc;
- /* control channel */
- uint8_t ccch_conf;
- uint8_t bs_ag_blks_res;
- uint8_t att_allowed;
- uint8_t pag_mf_periods;
- int32_t t3212; /* real value in seconds */
- /* channel description */
- uint8_t tsc;
- uint8_t h; /* using hopping */
- uint16_t arfcn;
- uint8_t maio;
- uint8_t hsn;
- uint8_t chan_nr; /* type, slot, sub slot */
-
- /* neighbor cell */
- uint8_t nb_ext_ind_si2;
- uint8_t nb_ba_ind_si2;
- uint8_t nb_ext_ind_si2bis;
- uint8_t nb_ba_ind_si2bis;
- uint8_t nb_multi_rep_si2ter; /* see GSM 05.08 8.4.3 */
- uint8_t nb_ba_ind_si2ter;
- uint8_t nb_ext_ind_si5;
- uint8_t nb_ba_ind_si5;
- uint8_t nb_ext_ind_si5bis;
- uint8_t nb_ba_ind_si5bis;
- uint8_t nb_multi_rep_si5ter;
- uint8_t nb_ba_ind_si5ter;
- uint8_t nb_ncc_permitted_si2;
- uint8_t nb_ncc_permitted_si6;
- uint8_t nb_max_retrans; /* decoded */
- uint8_t nb_tx_integer; /* decoded */
- uint8_t nb_reest_denied; /* 1 = denied */
- uint8_t nb_cell_barr; /* 1 = barred */
- uint16_t nb_class_barr; /* bit 10 is emergency */
-};
-
-char *gsm_print_arfcn(uint16_t arfcn);
-uint8_t gsm_refer_pcs(uint16_t arfcn, struct gsm48_sysinfo *s);
-int gsm48_sysinfo_dump(struct gsm48_sysinfo *s, uint16_t arfcn,
- void (*print)(void *, const char *, ...), void *priv,
- uint8_t *freq_map);
-int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc,
- uint16_t *mnc, uint16_t *lac);
-int gsm48_decode_chan_h0(struct gsm48_chan_desc *cd, uint8_t *tsc,
- uint16_t *arfcn);
-int gsm48_decode_chan_h1(struct gsm48_chan_desc *cd, uint8_t *tsc,
- uint8_t *maio, uint8_t *hsn);
-int gsm48_decode_sysinfo1(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_1 *si, int len);
-int gsm48_decode_sysinfo2(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_2 *si, int len);
-int gsm48_decode_sysinfo2bis(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_2bis *si, int len);
-int gsm48_decode_sysinfo2ter(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_2ter *si, int len);
-int gsm48_decode_sysinfo3(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_3 *si, int len);
-int gsm48_decode_sysinfo4(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_4 *si, int len);
-int gsm48_decode_sysinfo5(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_5 *si, int len);
-int gsm48_decode_sysinfo5bis(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_5bis *si, int len);
-int gsm48_decode_sysinfo5ter(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_5ter *si, int len);
-int gsm48_decode_sysinfo6(struct gsm48_sysinfo *s,
- struct gsm48_system_information_type_6 *si, int len);
-int gsm48_decode_mobile_alloc(struct gsm_sysinfo_freq *freq,
- uint8_t *ma, uint8_t len, uint16_t *hopping, uint8_t *hopp_len,
- int si4);
-
-#endif /* _SYSINFO_H */