summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/common/sysinfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/common/sysinfo.h')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/sysinfo.h125
1 files changed, 94 insertions, 31 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/sysinfo.h b/src/host/layer23/include/osmocom/bb/common/sysinfo.h
index f843f271..c31cf9d6 100644
--- a/src/host/layer23/include/osmocom/bb/common/sysinfo.h
+++ b/src/host/layer23/include/osmocom/bb/common/sysinfo.h
@@ -2,6 +2,7 @@
#define _SYSINFO_H
#include <osmocom/gsm/gsm48_ie.h>
+#include <osmocom/gsm/gsm23003.h>
/* collection of system information of the current cell */
@@ -17,11 +18,27 @@
#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 si10_cell_info {
+ uint8_t index; /* frequency index of the frequencies received in SI5* */
+ int16_t arfcn; /* ARFCN or -1 (if not found in SI5*) */
+ uint8_t bsic;
+ bool barred; /* Cell is barred, values below are invalid. */
+ bool la_different; /* Location area is different, so CRH is valid. */
+ uint8_t cell_resel_hyst_db;
+ uint8_t ms_txpwr_max_cch;
+ uint8_t rxlev_acc_min_db;
+ uint8_t cell_resel_offset;
+ uint8_t temp_offset;
+ uint8_t penalty_time;
+};
+
+/* structure of all received system information */
struct gsm48_sysinfo {
/* flags of available information */
uint8_t si1, si2, si2bis, si2ter, si3,
- si4, si5, si5bis, si5ter, si6;
+ si4, si5, si5bis, si5ter, si6,
+ si13;
+ bool si10;
/* memory maps to simply detect change in system info messages */
uint8_t si1_msg[23];
@@ -34,6 +51,8 @@ struct gsm48_sysinfo {
uint8_t si5b_msg[18];
uint8_t si5t_msg[18];
uint8_t si6_msg[18];
+ uint8_t si10_msg[21];
+ uint8_t si13_msg[23];
struct gsm_sysinfo_freq freq[1024]; /* all frequencies */
uint16_t hopping[64]; /* hopping arfcn */
@@ -42,7 +61,7 @@ struct gsm48_sysinfo {
/* serving cell */
uint8_t bsic;
uint16_t cell_id;
- uint16_t mcc, mnc, lac; /* LAI */
+ struct osmo_location_area_id lai;
uint8_t max_retrans; /* decoded */
uint8_t tx_integer; /* decoded */
uint8_t reest_denied; /* 1 = denied */
@@ -52,7 +71,7 @@ struct gsm48_sysinfo {
/* si1 rest */
uint8_t nch;
uint8_t nch_position;
- uint8_t band_ind; /* set for DCS */
+ bool band_ind; /* set for DCS */
/* si3 rest */
uint8_t sp;
@@ -66,9 +85,46 @@ struct gsm48_sysinfo {
uint8_t ecsm;
uint8_t sched;
uint8_t sched_where;
- uint8_t gprs;
- uint8_t gprs_ra_colour;
- uint8_t gprs_si13_pos;
+
+ struct {
+ /* si3/si4 rest */
+ uint8_t supported;
+ uint8_t ra_colour;
+ uint8_t si13_pos;
+
+ /* si13 rest */
+ uint8_t hopping;
+ uint8_t hsn;
+ uint8_t rfl_num_len;
+ uint8_t rfl_num[4];
+
+ uint8_t ma_bitlen;
+ uint8_t ma_bitmap[64 / 8];
+ uint8_t arfcn_idx_len;
+ uint8_t arfcn_idx[16];
+
+ /* PBCCH is not present */
+ uint8_t rac;
+ uint8_t prio_acc_thresh;
+ uint8_t nco;
+
+ /* GPRS Cell Options */
+ uint8_t nmo;
+ uint8_t T3168;
+ uint8_t T3192;
+ uint8_t ab_type;
+ uint8_t ctrl_ack_type_use_block;
+ uint8_t bs_cv_max;
+ uint8_t pan_params_present;
+ uint8_t pan_dec;
+ uint8_t pan_inc;
+ uint8_t pan_max;
+
+ /* EGPRS Cell Options */
+ uint8_t egprs_supported;
+ uint8_t egprs_pkt_chan_req;
+ uint8_t egprs_bep_period;
+ } gprs;
/* cell selection */
int8_t ms_txpwr_max_cch;
@@ -118,45 +174,52 @@ struct gsm48_sysinfo {
uint8_t nb_reest_denied; /* 1 = denied */
uint8_t nb_cell_barr; /* 1 = barred */
uint16_t nb_class_barr; /* bit 10 is emergency */
+
+ /* SI 10 */
+ uint8_t si10_cell_num; /* number neighbor cells found in SI 10 */
+ struct si10_cell_info si10_cell[32]; /* 32 neighbor cell descriptions */
};
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);
+bool gsm_refer_pcs(uint16_t cell_arfcn, const struct gsm48_sysinfo *cell_s);
+uint16_t gsm_arfcn_refer_pcs(uint16_t cell_arfcn, const struct gsm48_sysinfo *cell_s, uint16_t arfcn);
+int gsm48_sysinfo_dump(const struct gsm48_sysinfo *s, uint16_t arfcn,
+ void (*print)(void *, const char *, ...),
+ void *priv, uint8_t *freq_map);
+int gsm48_si10_dump(const struct gsm48_sysinfo *s, void (*print)(void *, const char *, ...), void *priv);
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_chan_h0(const struct gsm48_chan_desc *cd,
+ uint8_t *tsc, uint16_t *arfcn);
+int gsm48_decode_chan_h1(const 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);
+ const 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);
+ const 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);
+ const 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);
+ const 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);
+ const 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);
+ const 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);
+ const 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);
+ const 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);
+ const 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);
+ const struct gsm48_system_information_type_6 *si, int len);
+int gsm48_decode_sysinfo10(struct gsm48_sysinfo *s,
+ const struct gsm48_system_information_type_10 *si, int len);
+int gsm48_decode_sysinfo13(struct gsm48_sysinfo *s,
+ const struct gsm48_system_information_type_13 *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);
-int gsm48_encode_lai_hex(struct gsm48_loc_area_id *lai, uint16_t mcc,
- uint16_t mnc, uint16_t lac);
-int gsm48_decode_lai_hex(struct gsm48_loc_area_id *lai, uint16_t *mcc,
- uint16_t *mnc, uint16_t *lac);
+ const uint8_t *ma, uint8_t len,
+ uint16_t *hopping, uint8_t *hopp_len, int si4);
+int16_t arfcn_from_freq_index(const struct gsm48_sysinfo *s, uint16_t index);
#endif /* _SYSINFO_H */