[M] Change in osmocom-bb[master]: layer23/ccch_scan: use osmo_mobile_identity API

2024-01-09 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email )

Change subject: layer23/ccch_scan: use osmo_mobile_identity API
..

layer23/ccch_scan: use osmo_mobile_identity API

* Migrate from deprecated gsm48_mi_to_string() API.
* Take a chance to unfify printing of mobile identity.
* Use osmo_load32be() for printing TMSI - this is what
  the osmo_mobile_identity API does internally.

Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Depends: libosmocore.git If4f7be606e54cfa1c59084cf169785b1cbda5cf5
---
M src/host/layer23/src/misc/app_ccch_scan.c
1 file changed, 49 insertions(+), 48 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




diff --git a/src/host/layer23/src/misc/app_ccch_scan.c 
b/src/host/layer23/src/misc/app_ccch_scan.c
index 7cbe267..d2b6c24 100644
--- a/src/host/layer23/src/misc/app_ccch_scan.c
+++ b/src/host/layer23/src/misc/app_ccch_scan.c
@@ -236,24 +236,6 @@
}
 }

-static char *mi_type_to_string(int type)
-{
-   switch (type) {
-   case GSM_MI_TYPE_NONE:
-   return "none";
-   case GSM_MI_TYPE_IMSI:
-   return "imsi";
-   case GSM_MI_TYPE_IMEI:
-   return "imei";
-   case GSM_MI_TYPE_IMEISV:
-   return "imeisv";
-   case GSM_MI_TYPE_TMSI:
-   return "tmsi";
-   default:
-   return "invalid";
-   }
-}
-
 /**
  * This can contain two MIs. The size checking is a bit of a mess.
  */
@@ -261,6 +243,7 @@
 {
struct gsm48_paging1 *pag;
int len1, len2, mi_type, tag;
+   struct osmo_mobile_identity mi;
char mi_string[GSM48_MI_SIZE];

/* is there enough room for the header + LV? */
@@ -279,11 +262,11 @@
}

if (mi_type != GSM_MI_TYPE_NONE) {
-   gsm48_mi_to_string(mi_string, sizeof(mi_string), >data[1], 
len1);
-   LOGP(DRR, LOGL_NOTICE, "Paging1: %s chan %s to %s M(%s) \n",
+   osmo_mobile_identity_decode(, >data[1], len1, false);
+   osmo_mobile_identity_to_str_buf(mi_string, sizeof(mi_string), 
);
+   LOGP(DRR, LOGL_NOTICE, "Paging1: %s chan %s to M(%s)\n",
 pag_print_mode(pag->pag_mode),
 chan_need(pag->cneed1),
-mi_type_to_string(mi_type),
 mi_string);
}

@@ -300,11 +283,11 @@
return -1;
}

-   gsm48_mi_to_string(mi_string, sizeof(mi_string), >data[2 + 
len1 + 2], len2);
-   LOGP(DRR, LOGL_NOTICE, "Paging2: %s chan %s to %s M(%s) \n",
+   osmo_mobile_identity_decode(, >data[2 + len1 + 2], 
len2, false);
+   osmo_mobile_identity_to_str_buf(mi_string, sizeof(mi_string), 
);
+   LOGP(DRR, LOGL_NOTICE, "Paging2: %s chan %s to M(%s)\n",
 pag_print_mode(pag->pag_mode),
 chan_need(pag->cneed2),
-mi_type_to_string(mi_type),
 mi_string);
}
return 0;
@@ -313,8 +296,9 @@
 static int gsm48_rx_paging_p2(struct msgb *msg, struct osmocom_ms *ms)
 {
struct gsm48_paging2 *pag;
-   int tag, len, mi_type;
+   struct osmo_mobile_identity mi;
char mi_string[GSM48_MI_SIZE];
+   int tag, len;

if (msgb_l3len(msg) < sizeof(*pag)) {
LOGP(DRR, LOGL_ERROR, "Paging2 message is too small.\n");
@@ -322,12 +306,14 @@
}

pag = msgb_l3(msg);
-   LOGP(DRR, LOGL_NOTICE, "Paging1: %s chan %s to TMSI M(0x%x) \n",
-pag_print_mode(pag->pag_mode),
-chan_need(pag->cneed1), pag->tmsi1);
-   LOGP(DRR, LOGL_NOTICE, "Paging2: %s chan %s to TMSI M(0x%x) \n",
-pag_print_mode(pag->pag_mode),
-chan_need(pag->cneed2), pag->tmsi2);
+   LOGP(DRR, LOGL_NOTICE, "Paging1: %s chan %s to M(TMSI-0x%08x)\n",
+pag_print_mode(pag->pag_mode),
+chan_need(pag->cneed1),
+osmo_load32be(>tmsi1));
+   LOGP(DRR, LOGL_NOTICE, "Paging2: %s chan %s to M(TMSI-0x%08x)\n",
+pag_print_mode(pag->pag_mode),
+chan_need(pag->cneed2),
+osmo_load32be(>tmsi2));

/* no optional element */
if (msgb_l3len(msg) < sizeof(*pag) + 3)
@@ -335,7 +321,6 @@

tag = pag->data[0];
len = pag->data[1];
-   mi_type = pag->data[2] & GSM_MI_TYPE_MASK;

if (tag != GSM48_IE_MOBILE_ID)
return 0;
@@ -345,11 +330,10 @@
return -1;
}

-   gsm48_mi_to_string(mi_string, sizeof(mi_string), >data[2], len);
-   LOGP(DRR, LOGL_NOTICE, "Paging3: %s chan %s to %s M(%s) \n",
+   osmo_mobile_identity_decode(, >data[2], len, false);
+   

[M] Change in osmocom-bb[master]: layer23/ccch_scan: use osmo_mobile_identity API

2024-01-09 Thread laforge
Attention is currently required from: fixeria, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email )

Change subject: layer23/ccch_scan: use osmo_mobile_identity API
..


Patch Set 6: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Gerrit-Change-Number: 33317
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Tue, 09 Jan 2024 13:04:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: layer23/ccch_scan: use osmo_mobile_identity API

2024-01-08 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email )

Change subject: layer23/ccch_scan: use osmo_mobile_identity API
..


Patch Set 6: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Gerrit-Change-Number: 33317
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Mon, 08 Jan 2024 15:58:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: layer23/ccch_scan: use osmo_mobile_identity API

2024-01-08 Thread fixeria
Attention is currently required from: jolly, laforge, pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email )

Change subject: layer23/ccch_scan: use osmo_mobile_identity API
..


Patch Set 6:

(1 comment)

Patchset:

PS4:
> I gave this patch a try, and there is a little problem: […]
Done. I also fixed little vs big endian of TMSI, and some formatting issues.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Gerrit-Change-Number: 33317
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 08 Jan 2024 15:55:00 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: layer23/ccch_scan: use osmo_mobile_identity API

2024-01-08 Thread fixeria
Attention is currently required from: fixeria, jolly, laforge, pespin.

fixeria has uploaded a new patch set (#6) to the change originally created by 
laforge. ( https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email )

The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder


Change subject: layer23/ccch_scan: use osmo_mobile_identity API
..

layer23/ccch_scan: use osmo_mobile_identity API

* Migrate from deprecated gsm48_mi_to_string() API.
* Take a chance to unfify printing of mobile identity.
* Use osmo_load32be() for printing TMSI - this is what
  the osmo_mobile_identity API does internally.

Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Depends: libosmocore.git If4f7be606e54cfa1c59084cf169785b1cbda5cf5
---
M src/host/layer23/src/misc/app_ccch_scan.c
1 file changed, 49 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/17/33317/6
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Gerrit-Change-Number: 33317
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


[M] Change in osmocom-bb[master]: layer23/ccch_scan: use osmo_mobile_identity API

2024-01-08 Thread Jenkins Builder
Attention is currently required from: jolly, laforge, pespin.

Jenkins Builder has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email )

Change subject: layer23/ccch_scan: use osmo_mobile_identity API
..


Patch Set 5:

(2 comments)

File src/host/layer23/src/misc/app_ccch_scan.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13509):
https://gerrit.osmocom.org/c/osmocom-bb/+/33317/comment/37029ff5_11dfc8a6
PS5, Line 309:  LOGP(DRR, LOGL_NOTICE, "Paging1: %s chan %s to M(TMSI-0x%08x) 
\n",
unnecessary whitespace before a quoted newline


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13509):
https://gerrit.osmocom.org/c/osmocom-bb/+/33317/comment/afa8d962_3431c8f0
PS5, Line 313:  LOGP(DRR, LOGL_NOTICE, "Paging2: %s chan %s to M(TMSI-0x%08x) 
\n",
unnecessary whitespace before a quoted newline



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Gerrit-Change-Number: 33317
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 08 Jan 2024 15:45:36 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: layer23/ccch_scan: use osmo_mobile_identity API

2024-01-08 Thread fixeria
Attention is currently required from: jolly, laforge, pespin.

fixeria has uploaded a new patch set (#5) to the change originally created by 
laforge. ( https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email )

The following approvals got outdated and were removed:
Code-Review+1 by pespin, Verified+1 by Jenkins Builder


Change subject: layer23/ccch_scan: use osmo_mobile_identity API
..

layer23/ccch_scan: use osmo_mobile_identity API

* Migrate from deprecated gsm48_mi_to_string() API.
* Take a chance to unfify printing of mobile identity.
* Use osmo_load32be() for printing TMSI - this is what
  the osmo_mobile_identity API does internally.

Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Depends: libosmocore.git If4f7be606e54cfa1c59084cf169785b1cbda5cf5
---
M src/host/layer23/src/misc/app_ccch_scan.c
1 file changed, 49 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/17/33317/5
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33317?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139
Gerrit-Change-Number: 33317
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset