pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/32749 )


Change subject: layer23: subscriber: Move sap specific code inside subscriber.c
......................................................................

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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/49/32749/1

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..a5d5e8a 100644
--- a/src/host/layer23/src/common/subscriber.c
+++ b/src/host/layer23/src/common/subscriber.c
@@ -996,6 +996,8 @@
  * detach
  */

+static int gsm_subscr_remove_sapcard(struct osmocom_ms *ms);
+
 /* Detach card */
 int gsm_subscr_remove(struct osmocom_ms *ms)
 {
@@ -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 8da9a87..a48eaa9 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 https://gerrit.osmocom.org/c/osmocom-bb/+/32749
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I780f06203cd6971866d81060a5ecee8bc00782f4
Gerrit-Change-Number: 32749
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to