pespin has uploaded this change for review.

View Change

layer23: split subscr_write_plmn_na() internally per-backend

Change-Id: I5e3a4996bbb5cbfbe81342eadb46aa10a2033fd9
---
M src/host/layer23/src/common/subscriber.c
1 file changed, 35 insertions(+), 5 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/57/32757/1
diff --git a/src/host/layer23/src/common/subscriber.c b/src/host/layer23/src/common/subscriber.c
index f3e6f20..bdd6b62 100644
--- a/src/host/layer23/src/common/subscriber.c
+++ b/src/host/layer23/src/common/subscriber.c
@@ -61,6 +61,8 @@
static int gsm_subscr_sim_pin_simcard(struct osmocom_ms *ms, const char *pin1, const char *pin2,
int8_t mode);

+static int subscr_write_plmn_na_simcard(struct osmocom_ms *ms);
+
static void subscr_sim_query_cb(struct osmocom_ms *ms, struct msgb *msg);
static void subscr_sim_update_cb(struct osmocom_ms *ms, struct msgb *msg);
static void subscr_sim_key_cb(struct osmocom_ms *ms, struct msgb *msg);
@@ -303,6 +305,29 @@
}
}

+/* update plmn not allowed list on SIM */
+static int subscr_write_plmn_na(struct osmocom_ms *ms)
+{
+ struct gsm_subscriber *subscr = &ms->subscr;
+
+ /* skip, if no real valid SIM */
+ if (subscr->sim_type == GSM_SIM_TYPE_NONE || !subscr->sim_valid)
+ return 0;
+
+ LOGP(DMM, LOGL_INFO, "Updating FPLMN on SIM\n");
+
+ switch (subscr->sim_type) {
+ case GSM_SIM_TYPE_L1PHY:
+ case GSM_SIM_TYPE_SAP:
+ return subscr_write_plmn_na_simcard(ms);
+ case GSM_SIM_TYPE_TEST:
+ LOGP(DMM, LOGL_NOTICE, "Updating FPLMN on test SIM: not implemented!\n");
+ return 0; /* TODO */
+ default:
+ OSMO_ASSERT(0);
+ }
+}
+
/*
* test card
*/
@@ -926,7 +951,7 @@
}

/* update plmn not allowed list on SIM */
-static int subscr_write_plmn_na(struct osmocom_ms *ms)
+static int subscr_write_plmn_na_simcard(struct osmocom_ms *ms)
{
struct gsm_subscriber *subscr = &ms->subscr;
struct msgb *nmsg;
@@ -940,10 +965,6 @@
return 0;
#endif

- /* skip, if no real valid SIM */
- if (!GSM_SIM_IS_READER(subscr->sim_type) || !subscr->sim_valid)
- return 0;
-
/* get tail list from "PLMN not allowed" */
llist_for_each_entry(na, &subscr->plmn_na, entry) {
if (count < 4)

To view, visit change 32757. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I5e3a4996bbb5cbfbe81342eadb46aa10a2033fd9
Gerrit-Change-Number: 32757
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange