<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12429">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mobile/subscriber.c: consider GSM_SIM_TYPE_SAP too<br><br>There are several SIM card interfaces, two of which:<br><br>  - GSM_SIM_TYPE_L1PHY (using built-in SIM reader of the L1 PHY),<br>  - GSM_SIM_TYPE_SAP (using remote reader via (BT)SAP protocol),<br><br>can actually deal with a physical SIM card. But, for some reason,<br>only GSM_SIM_TYPE_L1PHY was considered as such. Let's also get<br>along with GSM_SIM_TYPE_SAP for the following procedures:<br><br>  - PIN management and verification,<br>  - FPLMN / LOCI updating,<br>  - A3 authentication.<br><br>Change-Id: I4b3080fa7a5332467a449a314ba3cc3a07a9b7df<br>---<br>M src/host/layer23/include/osmocom/bb/mobile/subscriber.h<br>M src/host/layer23/src/mobile/subscriber.c<br>2 files changed, 7 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/29/12429/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/host/layer23/include/osmocom/bb/mobile/subscriber.h b/src/host/layer23/include/osmocom/bb/mobile/subscriber.h</span><br><span>index 958700a..c747af9 100644</span><br><span>--- a/src/host/layer23/include/osmocom/bb/mobile/subscriber.h</span><br><span>+++ b/src/host/layer23/include/osmocom/bb/mobile/subscriber.h</span><br><span>@@ -20,6 +20,9 @@</span><br><span> </span><br><span> #define GSM_IMSI_LENGTH             16</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#define GSM_SIM_IS_READER(type) \</span><br><span style="color: hsl(120, 100%, 40%);">+     (type == GSM_SIM_TYPE_L1PHY || type == GSM_SIM_TYPE_SAP)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> enum {</span><br><span>         GSM_SIM_TYPE_NONE = 0,</span><br><span>       GSM_SIM_TYPE_L1PHY,</span><br><span>diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c</span><br><span>index 097f785..7f24d56 100644</span><br><span>--- a/src/host/layer23/src/mobile/subscriber.c</span><br><span>+++ b/src/host/layer23/src/mobile/subscriber.c</span><br><span>@@ -711,7 +711,7 @@</span><br><span>       uint8_t job;</span><br><span> </span><br><span>     /* skip, if no real valid SIM */</span><br><span style="color: hsl(0, 100%, 40%);">-        if (subscr->sim_type != GSM_SIM_TYPE_L1PHY)</span><br><span style="color: hsl(120, 100%, 40%);">+        if (!GSM_SIM_IS_READER(subscr->sim_type))</span><br><span>                 return;</span><br><span> </span><br><span>  switch (mode) {</span><br><span>@@ -790,7 +790,7 @@</span><br><span> #endif</span><br><span> </span><br><span>  /* skip, if no real valid SIM */</span><br><span style="color: hsl(0, 100%, 40%);">-        if (subscr->sim_type != GSM_SIM_TYPE_L1PHY || !subscr->sim_valid)</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!GSM_SIM_IS_READER(subscr->sim_type) || !subscr->sim_valid)</span><br><span>                return 0;</span><br><span> </span><br><span>        /* get tail list from "PLMN not allowed" */</span><br><span>@@ -844,7 +844,7 @@</span><br><span>  struct gsm1111_ef_loci *loci;</span><br><span> </span><br><span>    /* skip, if no real valid SIM */</span><br><span style="color: hsl(0, 100%, 40%);">-        if (subscr->sim_type != GSM_SIM_TYPE_L1PHY || !subscr->sim_valid)</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!GSM_SIM_IS_READER(subscr->sim_type) || !subscr->sim_valid)</span><br><span>                return 0;</span><br><span> </span><br><span>        LOGP(DMM, LOGL_INFO, "Updating LOCI on SIM\n");</span><br><span>@@ -907,8 +907,7 @@</span><br><span>      struct sim_hdr *nsh;</span><br><span> </span><br><span>     /* not a SIM */</span><br><span style="color: hsl(0, 100%, 40%);">- if ((subscr->sim_type != GSM_SIM_TYPE_L1PHY</span><br><span style="color: hsl(0, 100%, 40%);">-    && subscr->sim_type != GSM_SIM_TYPE_TEST)</span><br><span style="color: hsl(120, 100%, 40%);">+        if (!GSM_SIM_IS_READER(subscr->sim_type)</span><br><span>   || !subscr->sim_valid || no_sim) {</span><br><span>               struct gsm48_mm_event *nmme;</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12429">change 12429</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12429"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmocom-bb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I4b3080fa7a5332467a449a314ba3cc3a07a9b7df </div>
<div style="display:none"> Gerrit-Change-Number: 12429 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>