summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 6e9c197c..b17376d6 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 46b641c4..ab9d36dc 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;
}