summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2011-12-01 11:14:50 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2016-09-25 08:11:46 +0200
commit7f67caed4f1c4650dc2c4475e1371a2e80a17fc2 (patch)
tree103a3d5ce623d4200e907bd2fb58d7d24468f487
parent258662afe324b5da2fc46783f63d6c4223e89a2a (diff)
layer23/mobile Store current PLMN with the network name
This is essential, so we know if the least given name is still valid in the network we are currently on.
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h1
-rw-r--r--src/host/layer23/src/mobile/gsm48_mm.c11
2 files changed, 10 insertions, 2 deletions
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 6e9c197..b17376d 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
@@ -176,6 +176,7 @@ struct gsm48_mmlayer {
/* network name */
char name_short[32];
char name_long[32];
+ uint16_t name_mcc, name_mnc; /* PLMN of the name */
/* location update */
uint8_t lupd_pending; /* current pending loc. upd. */
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c
index 46b641c..ab9d36d 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -2041,6 +2041,7 @@ static int gsm48_mm_rx_abort(struct osmocom_ms *ms, struct msgb *msg)
static int gsm48_mm_rx_info(struct osmocom_ms *ms, struct msgb *msg)
{
struct gsm48_mmlayer *mm = &ms->mmlayer;
+ struct gsm322_cellsel *cs = &ms->cellsel;
struct gsm48_hdr *gh = msgb_l3(msg);
int payload_len = msgb_l3len(msg) - sizeof(*gh);
struct tlv_parsed tp;
@@ -2056,12 +2057,18 @@ static int gsm48_mm_rx_info(struct osmocom_ms *ms, struct msgb *msg)
if (TLVP_PRESENT(&tp, GSM48_IE_NAME_LONG)) {
decode_network_name(mm->name_long, sizeof(mm->name_long),
TLVP_VAL(&tp, GSM48_IE_NAME_LONG)-1);
- }
+ mm->name_mcc = cs->sel_mcc;
+ mm->name_mnc = cs->sel_mnc;
+ } else
+ mm->name_long[0] = '\0';
/* short name */
if (TLVP_PRESENT(&tp, GSM48_IE_NAME_SHORT)) {
decode_network_name(mm->name_short, sizeof(mm->name_short),
TLVP_VAL(&tp, GSM48_IE_NAME_SHORT)-1);
- }
+ mm->name_mcc = cs->sel_mcc;
+ mm->name_mnc = cs->sel_mnc;
+ } else
+ mm->name_short[0] = '\0';
return 0;
}