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


Change subject: layer23: Define EF.LOCI Location Update Status values with an 
enum
......................................................................

layer23: Define EF.LOCI Location Update Status values with an enum

Change-Id: Ia54026fa8e4fca05da71e1e6a2dbdb8d900f0dd0
---
M src/host/layer23/include/osmocom/bb/common/sim.h
M src/host/layer23/src/common/subscriber.c
2 files changed, 24 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/41/32741/1

diff --git a/src/host/layer23/include/osmocom/bb/common/sim.h 
b/src/host/layer23/include/osmocom/bb/common/sim.h
index 35b48f4..149830a 100644
--- a/src/host/layer23/include/osmocom/bb/common/sim.h
+++ b/src/host/layer23/include/osmocom/bb/common/sim.h
@@ -287,9 +287,17 @@
        uint32_t tmsi;
        struct gsm48_loc_area_id lai;
        uint8_t tmsi_time;
-       uint8_t lupd_status;
+       uint8_t lupd_status; /* enum gsm1111_ef_loci_lupd_status */
 } __attribute__ ((packed));

+enum gsm1111_ef_loci_lupd_status {
+       GSM1111_EF_LOCI_LUPD_ST_UPDATED = 0,
+       GSM1111_EF_LOCI_LUPD_ST_NOT_UPDATED = 1,
+       GSM1111_EF_LOCI_LUPD_ST_PLMN_NOT_ALLOWED = 2,
+       GSM1111_EF_LOCI_LUPD_ST_LA_NOT_ALLOWED = 3,
+       GSM1111_EF_LOCI_LUPD_ST_RESERVED = 7,
+};
+
 /* Section 10.5.1 */
 struct gsm1111_ef_adn {
        uint8_t len_bcd;
diff --git a/src/host/layer23/src/common/subscriber.c 
b/src/host/layer23/src/common/subscriber.c
index 0669598..4fdb4d6 100644
--- a/src/host/layer23/src/common/subscriber.c
+++ b/src/host/layer23/src/common/subscriber.c
@@ -263,11 +263,11 @@

        /* location update status */
        switch (loci->lupd_status & 0x07) {
-       case 0x00:
+       case GSM1111_EF_LOCI_LUPD_ST_UPDATED:
                subscr->ustate = GSM_SIM_U1_UPDATED;
                break;
-       case 0x02:
-       case 0x03:
+       case GSM1111_EF_LOCI_LUPD_ST_PLMN_NOT_ALLOWED:
+       case GSM1111_EF_LOCI_LUPD_ST_LA_NOT_ALLOWED:
                subscr->ustate = GSM_SIM_U3_ROAMING_NA;
                break;
        default:
@@ -845,13 +845,13 @@
        /* location update status */
        switch (subscr->ustate) {
        case GSM_SIM_U1_UPDATED:
-               loci->lupd_status = 0x00;
+               loci->lupd_status = GSM1111_EF_LOCI_LUPD_ST_UPDATED;
                break;
        case GSM_SIM_U3_ROAMING_NA:
-               loci->lupd_status = 0x03;
+               loci->lupd_status = GSM1111_EF_LOCI_LUPD_ST_LA_NOT_ALLOWED;
                break;
        default:
-               loci->lupd_status = 0x01;
+               loci->lupd_status = GSM1111_EF_LOCI_LUPD_ST_NOT_UPDATED;
        }

        sim_job(ms, nmsg);

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32741
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

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

Reply via email to