summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/mobile
diff options
context:
space:
mode:
authorAndreas Eversberg2011-07-17 11:12:15 +0200
committerAndreas Eversberg2011-07-17 11:12:15 +0200
commit9548ac0a419ac810d44516d040495cbfde19c79f (patch)
tree8de5ba9c44452bd5506187f3c5222f184400e3d8 /src/host/layer23/include/osmocom/bb/mobile
parent[mobile] Corrected output value of PCS power class (diff)
downloadosmocom-9548ac0a419ac810d44516d040495cbfde19c79f.tar.gz
osmocom-9548ac0a419ac810d44516d040495cbfde19c79f.tar.xz
osmocom-9548ac0a419ac810d44516d040495cbfde19c79f.zip
[layer23/mobile] Improvement and fixes of idle mode process
This patch introduces cell re-relection. When camping on a cell, it scanns neighbour cells. If a 'better' cell is found, the cell is selected. If the cell is in a different location area, a location upating is performed under certain conditions. The 'better' cell depends on various informations that are broadcasted on the BCCH of a neihbour cell and of course the RX level. Most operators don't set these informations, so the 'better' cell depend on a better RX level for the same location area, or a much better RX level (6 dBm) at a different location area. There were many issues at the idle mode process that has been fixed. Expecially when moving, the state machines got stuck, so no more cell search was possible, or no further calls / location updating was possible. In order to see the process of cell selection, enter the VTY interface and enable the network monitor: enable monitor network 1 (where '1' is the instance of the MS) In order to see the current state of the processes, enter: show ms
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/mobile')
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm322.h87
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h1
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/settings.h2
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/subscriber.h2
4 files changed, 72 insertions, 20 deletions
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm322.h b/src/host/layer23/include/osmocom/bb/mobile/gsm322.h
index d94e368..f39e566 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm322.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm322.h
@@ -29,8 +29,11 @@
#define GSM322_C7_CAMPED_ANY_CELL 7
#define GSM322_C8_ANY_CELL_RESEL 8
#define GSM322_C9_CHOOSE_ANY_CELL 9
-#define GSM322_PLMN_SEARCH 10
-#define GSM322_HPLMN_SEARCH 11
+#define GSM322_CONNECTED_MODE_1 10
+#define GSM322_CONNECTED_MODE_2 11
+#define GSM322_PLMN_SEARCH 12
+#define GSM322_HPLMN_SEARCH 13
+#define GSM322_ANY_SEARCH 14
/* GSM 03.22 events */
#define GSM322_EVENT_SWITCH_ON 1
@@ -102,12 +105,6 @@ struct gsm322_cs_list {
uint8_t flags; /* see GSM322_CS_FLAG_* */
int8_t rxlev; /* rx level range format */
struct gsm48_sysinfo *sysinfo;
-#if 0
- int8_t min_dbm; /* minimum level to enter cell */
- int8_t max_pwr; /* maximum power to access cell */
- uint16_t class_barr; /* barred classes */
- uint16_t mcc, mnc, lac; /* received mcc, mnc, lac */
-#endif
};
/* PLMN search process */
@@ -131,6 +128,32 @@ struct gsm322_plmn {
#define GSM322_CCCH_ST_SYNC 2 /* got sync */
#define GSM322_CCCH_ST_DATA 3 /* receiveing data */
+/* neighbour cell info list entry */
+struct gsm322_neighbour {
+ struct llist_head entry;
+ struct gsm322_cellsel *cs;
+ uint16_t arfcn; /* ARFCN identity of that neighbour */
+
+ uint8_t state; /* GSM322_NB_* */
+ time_t created; /* when was this neighbour created */
+ time_t when; /* when did we sync / read */
+ int16_t rxlev_dbm; /* sum of received levels */
+ uint8_t rxlev_count; /* number of received levels */
+ int8_t rla_c_dbm; /* average of the reveive level */
+ uint8_t c12_valid; /* both C1 and C2 are calculated */
+ int16_t c1, c2, crh;
+ uint8_t checked_for_resel;
+ uint8_t suitable_allowable;
+ uint8_t prio_low;
+};
+
+#define GSM322_NB_NEW 0 /* new NB instance */
+#define GSM322_NB_NOT_SUP 1 /* ARFCN not supported */
+#define GSM322_NB_RLA_C 2 /* valid measurement available */
+#define GSM322_NB_NO_SYNC 3 /* cannot sync to neighbour */
+#define GSM322_NB_NO_BCCH 4 /* sync */
+#define GSM322_NB_SYSINFO 5 /* sysinfo */
+
struct gsm48_sysinfo;
/* Cell selection process */
struct gsm322_cellsel {
@@ -139,25 +162,43 @@ struct gsm322_cellsel {
struct llist_head event_queue; /* event messages */
struct llist_head ba_list; /* BCCH Allocation per PLMN */
-
- struct osmo_timer_list timer;
-
- uint16_t mcc, mnc; /* current network to search for */
struct gsm322_cs_list list[1024+299];
/* cell selection list per frequency. */
-
+ /* scan and tune state */
+ struct osmo_timer_list timer; /* cell selection timer */
+ uint16_t mcc, mnc; /* current network to search for */
uint8_t powerscan; /* currently scanning for power */
- uint32_t scan_state; /* special state of current scan */
uint8_t ccch_state; /* special state of current ccch */
+ uint32_t scan_state; /* special state of current scan */
uint16_t arfcn; /* current tuned idle mode arfcn */
int arfci; /* list index of frequency above */
uint8_t ccch_mode; /* curren CCCH_MODE_* */
- struct gsm48_sysinfo *si; /* current sysinfo */
+ uint8_t sync_retries; /* number retries to sync */
+ uint8_t sync_pending; /* to prevent double sync req. */
+ struct gsm48_sysinfo *si; /* current sysinfo of tuned cell */
+ uint8_t tuned; /* if a cell is selected */
+ struct osmo_timer_list any_timer; /* restart search 'any cell' */
+ /* serving cell */
uint8_t selected; /* if a cell is selected */
- uint16_t sel_arfcn;
+ uint16_t sel_arfcn; /* current selected serving cell! */
struct gsm48_sysinfo sel_si; /* copy of selected cell, will update */
uint16_t sel_mcc, sel_mnc, sel_lac, sel_id;
+
+ /* cell re-selection */
+ struct llist_head nb_list; /* list of neighbour cells */
+ uint16_t last_serving_arfcn; /* the ARFCN of last cell */
+ uint8_t last_serving_valid; /* there is a last cell */
+ struct gsm322_neighbour *neighbour; /* when selecting neighbour cell */
+ time_t resel_when; /* timestamp of last re-selection */
+ int8_t nb_meas_set;
+ int16_t rxlev_dbm; /* sum of received levels */
+ uint8_t rxlev_count; /* number of received levels */
+ int8_t rla_c_dbm; /* average of received level */
+ uint8_t c12_valid; /* both C1 and C2 values are
+ calculated */
+ int16_t c1, c2;
+ uint8_t prio_low;
};
/* GSM 03.22 message */
@@ -167,6 +208,7 @@ struct gsm322_msg {
uint8_t sysinfo; /* system information type */
uint8_t same_cell; /* select same cell when RET_IDLE */
uint8_t reject; /* location update reject cause */
+ uint8_t limited; /* trigger search for limited serv. */
};
#define GSM322_ALLOC_SIZE sizeof(struct gsm322_msg)
@@ -195,14 +237,19 @@ int gsm322_dump_forbidden_la(struct osmocom_ms *ms,
void (*print)(void *, const char *, ...), void *priv);
int gsm322_dump_ba_list(struct gsm322_cellsel *cs, uint16_t mcc, uint16_t mnc,
void (*print)(void *, const char *, ...), void *priv);
+int gsm322_dump_nb_list(struct gsm322_cellsel *cs,
+ void (*print)(void *, const char *, ...), void *priv);
void start_cs_timer(struct gsm322_cellsel *cs, int sec, int micro);
void start_loss_timer(struct gsm322_cellsel *cs, int sec, int micro);
-extern const char *plmn_a_state_names[];
-extern const char *plmn_m_state_names[];
-extern const char *cs_state_names[];
+const char *get_a_state_name(int value);
+const char *get_m_state_name(int value);
+const char *get_cs_state_name(int value);
int gsm322_l1_signal(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data);
-char *gsm_print_rxlev(uint8_t rxlev);
+int gsm322_meas(struct osmocom_ms *ms, uint8_t rx_lev);
+
+char *gsm_print_rxlev(uint8_t rxlev);
+
#endif /* _GSM322_H */
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
index 1cfe401..afdcf02 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
@@ -132,6 +132,7 @@ struct gsm48_mmr {
#define GSM48_MM_EVENT_AUTH_RESPONSE 13
#define GSM48_MM_EVENT_SYSINFO 14
#define GSM48_MM_EVENT_USER_PLMN_SEL 15
+#define GSM48_MM_EVENT_LOST_COVERAGE 16
/* message for MM events */
struct gsm48_mm_event {
diff --git a/src/host/layer23/include/osmocom/bb/mobile/settings.h b/src/host/layer23/include/osmocom/bb/mobile/settings.h
index 20a8692..cd1b800 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/settings.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/settings.h
@@ -46,7 +46,9 @@ struct gsm_settings {
int8_t alter_delay;
uint8_t stick;
uint16_t stick_arfcn;
+ uint8_t skip_max_per_band;
uint8_t no_lupd;
+ uint8_t no_neighbour;
/* supported by configuration */
uint8_t cc_dtmf;
diff --git a/src/host/layer23/include/osmocom/bb/mobile/subscriber.h b/src/host/layer23/include/osmocom/bb/mobile/subscriber.h
index c6cf57a..cc0cfac 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/subscriber.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/subscriber.h
@@ -57,6 +57,8 @@ struct gsm_subscriber {
/* special things */
uint8_t always_search_hplmn;
/* search hplmn in other countries also (for test cards) */
+ uint8_t any_timeout;
+ /* timer to restart 'any cell selection' */
char sim_name[31]; /* name to load/save sim */
char sim_spn[17]; /* name of service privider */