summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/common
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-05-17 15:29:35 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-05-19 13:56:58 +0200
commit7b53ad536c6c4fd8cbea4ae0f6f1a5716b72108b (patch)
tree878f189e7ca85185c346b3bec17baf384a80a6bf /src/host/layer23/include/osmocom/bb/common
parent8be5119702ac8cedc9691badbe71972d0aa4a155 (diff)
layer23: Generalize subscriber SIM insert API
With this patch, during VTY config the SIM type is selected, and the app calls a generic gsm_subscriber_insert() API which will take of internally initializing and starting whatever specific-backend setup is needed. Change-Id: I5aa34ae297ec0114e1d2355d59fdd77b43b35464
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/common')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/settings.h3
-rw-r--r--src/host/layer23/include/osmocom/bb/common/subscriber.h13
2 files changed, 8 insertions, 8 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h b/src/host/layer23/include/osmocom/bb/common/settings.h
index 01db2a79..e312a1c1 100644
--- a/src/host/layer23/include/osmocom/bb/common/settings.h
+++ b/src/host/layer23/include/osmocom/bb/common/settings.h
@@ -90,7 +90,8 @@ struct gsm_settings {
int plmn_mode; /* PLMN_MODE_* */
/* SIM */
- int sim_type; /* selects card on power on */
+ int sim_type; /* enum gsm_subscriber_sim_type,
+ * selects card on power on */
char emergency_imsi[OSMO_IMSI_BUF_SIZE];
/* SMS */
diff --git a/src/host/layer23/include/osmocom/bb/common/subscriber.h b/src/host/layer23/include/osmocom/bb/common/subscriber.h
index 8f0966ef..81191037 100644
--- a/src/host/layer23/include/osmocom/bb/common/subscriber.h
+++ b/src/host/layer23/include/osmocom/bb/common/subscriber.h
@@ -32,7 +32,7 @@ struct gsm_sub_plmn_na {
#define GSM_SIM_IS_READER(type) \
(type == GSM_SIM_TYPE_L1PHY || type == GSM_SIM_TYPE_SAP)
-enum {
+enum gsm_subscriber_sim_type {
GSM_SIM_TYPE_NONE = 0,
GSM_SIM_TYPE_L1PHY,
GSM_SIM_TYPE_TEST,
@@ -43,8 +43,8 @@ struct gsm_subscriber {
struct osmocom_ms *ms;
/* status */
- uint8_t sim_type; /* type of sim */
- uint8_t sim_valid; /* sim inserted and valid */
+ enum gsm_subscriber_sim_type sim_type; /* type of sim */
+ bool sim_valid; /* sim inserted and valid */
enum gsm_sub_sim_ustate ustate; /* update status */
uint8_t imsi_attached; /* attached state */
@@ -98,17 +98,16 @@ struct gsm_subscriber {
int gsm_subscr_init(struct osmocom_ms *ms);
int gsm_subscr_exit(struct osmocom_ms *ms);
-int gsm_subscr_testcard(struct osmocom_ms *ms);
+int gsm_subscr_insert(struct osmocom_ms *ms);
+int gsm_subscr_remove(struct osmocom_ms *ms);
+
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_simcard(struct osmocom_ms *ms);
void gsm_subscr_sim_pin(struct osmocom_ms *ms, char *pin1, char *pin2,
int8_t mode);
int gsm_subscr_write_loci(struct osmocom_ms *ms);
int gsm_subscr_generate_kc(struct osmocom_ms *ms, uint8_t key_seq,
uint8_t *rand, uint8_t no_sim);
-int gsm_subscr_remove(struct osmocom_ms *ms);
void new_sim_ustate(struct gsm_subscriber *subscr, int state);
int gsm_subscr_del_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc,
uint16_t mnc);