pespin submitted this change.
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
layer23: subscriber: Move sap specific code inside subscriber.c
Step forward towards a generic subscriber interface.
Change-Id: I780f06203cd6971866d81060a5ecee8bc00782f4
---
M src/host/layer23/include/osmocom/bb/common/subscriber.h
M src/host/layer23/src/common/subscriber.c
M src/host/layer23/src/common/vty.c
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/host/layer23/include/osmocom/bb/common/subscriber.h b/src/host/layer23/include/osmocom/bb/common/subscriber.h
index 72f65f0..8f0966e 100644
--- a/src/host/layer23/include/osmocom/bb/common/subscriber.h
+++ b/src/host/layer23/include/osmocom/bb/common/subscriber.h
@@ -102,7 +102,6 @@
int gsm_subscr_sap_rsp_cb(struct osmocom_ms *ms, int res_code,
uint8_t res_type, uint16_t param_len, const uint8_t *param_val);
int gsm_subscr_sapcard(struct osmocom_ms *ms);
-int gsm_subscr_remove_sapcard(struct osmocom_ms *ms);
int gsm_subscr_simcard(struct osmocom_ms *ms);
void gsm_subscr_sim_pin(struct osmocom_ms *ms, char *pin1, char *pin2,
int8_t mode);
diff --git a/src/host/layer23/src/common/subscriber.c b/src/host/layer23/src/common/subscriber.c
index d5d0604..4357ca3 100644
--- a/src/host/layer23/src/common/subscriber.c
+++ b/src/host/layer23/src/common/subscriber.c
@@ -37,6 +37,8 @@
* if list is changed, the result is not written back to SIM */
//#define TEST_EMPTY_FPLMN
+static int gsm_subscr_remove_sapcard(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);
@@ -1006,6 +1008,9 @@
return -EINVAL;
}
+ if (subscr->sim_type == GSM_SIM_TYPE_SAP)
+ gsm_subscr_remove_sapcard(ms);
+
/* remove card */
osmo_signal_dispatch(SS_L23_SUBSCR, S_L23_SUBSCR_SIM_DETACHED, ms);
@@ -1257,7 +1262,7 @@
}
/* Deattach sapcard */
-int gsm_subscr_remove_sapcard(struct osmocom_ms *ms)
+static int gsm_subscr_remove_sapcard(struct osmocom_ms *ms)
{
return sap_close(ms);
}
diff --git a/src/host/layer23/src/common/vty.c b/src/host/layer23/src/common/vty.c
index 262d60a..56ff6bc 100644
--- a/src/host/layer23/src/common/vty.c
+++ b/src/host/layer23/src/common/vty.c
@@ -613,9 +613,6 @@
return CMD_WARNING;
}
- if (ms->subscr.sim_type == GSM_SIM_TYPE_SAP)
- gsm_subscr_remove_sapcard(ms);
-
gsm_subscr_remove(ms);
return CMD_SUCCESS;
}
To view, visit change 32749. To unsubscribe, or for help writing mail filters, visit settings.