[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-10-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34529?usp=email )

Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..

ASCI: Prepare gsm48_rr_rx_acch for voice group channel

The gsm48_rr_rx_acch function receives FACCH/SACCH. This is not only
used for system information on SACCH, but also for short header messages
and regular UI messages on TCH.

Related: OS#5364
Change-Id: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 62 insertions(+), 12 deletions(-)

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




diff --git a/src/host/layer23/src/mobile/gsm48_rr.c 
b/src/host/layer23/src/mobile/gsm48_rr.c
index d725642..bda9861 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -4884,23 +4884,58 @@
}
 }

+#define N201_Bter_SACCH21
+#define N201_Bter_SDCCH_FACCH  23
+#define N201_B419
+
 /* receive ACCH at RR layer */
 static int gsm48_rr_rx_acch(struct osmocom_ms *ms, struct msgb *msg)
 {
-   struct gsm48_system_information_type_header *sih = msgb_l3(msg);
+   const struct gsm48_system_information_type_header *sih;
+   const struct gsm48_hdr_sh *sgh;
+   const struct gsm48_hdr *gh;

-   switch (sih->system_information) {
-   case GSM48_MT_RR_SYSINFO_5:
-   return gsm48_rr_rx_sysinfo5(ms, msg);
-   case GSM48_MT_RR_SYSINFO_5bis:
-   return gsm48_rr_rx_sysinfo5bis(ms, msg);
-   case GSM48_MT_RR_SYSINFO_5ter:
-   return gsm48_rr_rx_sysinfo5ter(ms, msg);
-   case GSM48_MT_RR_SYSINFO_6:
-   return gsm48_rr_rx_sysinfo6(ms, msg);
+   /* Bter frame (SACCH or SDCCH/FACCH) */
+   if (msgb_l3len(msg) == N201_Bter_SACCH || msgb_l3len(msg) == 
N201_Bter_SDCCH_FACCH) {
+   sgh = msgb_l3(msg);
+   if (sgh->rr_short_pd != GSM48_PDISC_SH_RR) {
+   LOGP(DRR, LOGL_NOTICE, "Short header message is not an 
RR message.\n");
+   return -EINVAL;
+   }
+   switch (sgh->msg_type) {
+   default:
+   LOGP(DRR, LOGL_NOTICE, "Short header message type 
0x%02x unsupported.\n", sgh->msg_type);
+   return -EINVAL;
+   }
+   }
+
+   /* B4 frame (SACCH) */
+   if ((msg->cb[0] & 0x40) && msgb_l3len(msg) == N201_B4) {
+   sih = msgb_l3(msg);
+   switch (sih->system_information) {
+   case GSM48_MT_RR_SYSINFO_5:
+   return gsm48_rr_rx_sysinfo5(ms, msg);
+   case GSM48_MT_RR_SYSINFO_5bis:
+   return gsm48_rr_rx_sysinfo5bis(ms, msg);
+   case GSM48_MT_RR_SYSINFO_5ter:
+   return gsm48_rr_rx_sysinfo5ter(ms, msg);
+   case GSM48_MT_RR_SYSINFO_6:
+   return gsm48_rr_rx_sysinfo6(ms, msg);
+   default:
+   LOGP(DRR, LOGL_NOTICE, "ACCH message type 0x%02x 
unknown.\n", sih->system_information);
+   return -EINVAL;
+   }
+   }
+
+   /* B frame (UI frame on VGCS) */
+   if (msgb_l3len(msg) < sizeof(*gh)) {
+   LOGP(DRR, LOGL_NOTICE, "ACCH message too short.\n");
+   return -EINVAL;
+   }
+   gh = msgb_l3(msg);
+   switch (gh->msg_type) {
default:
-   LOGP(DRR, LOGL_NOTICE, "ACCH message type 0x%02x unknown.\n",
-   sih->system_information);
+   LOGP(DRR, LOGL_NOTICE, "ACCH message type 0x%02x unknown.\n", 
gh->msg_type);
return -EINVAL;
}
 }
@@ -4991,6 +5026,7 @@
case RSL_CHAN_Lm_ACCHs:
case RSL_CHAN_SDCCH4_ACCH:
case RSL_CHAN_SDCCH8_ACCH:
+   msg->cb[0] = rllh->link_id;
return gsm48_rr_rx_acch(ms, msg);
default:
LOGP(DRSL, LOGL_NOTICE, "RSL with chan_nr 0x%02x unknown.\n",

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 7
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-30 Thread fixeria
Attention is currently required from: jolly, laforge.

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

Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..


Patch Set 7: Code-Review+2

(2 comments)

File src/host/layer23/src/mobile/gsm48_rr.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/ea0b0f9a_d50706cc
PS3, Line 4895: sgh = msgb_l3(msg);
> No, the header is only one byte. […]
Ah, indeed. Marking as resolved.


https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/f0a47ec1_2780820f
PS3, Line 4909: sih = msgb_l3(msg);
> No, similar as above. B4 frame length is already checked. The header is way 
> smaller.
I overlooked the check, sorry. Marking as resolved.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 7
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Sat, 30 Sep 2023 08:49:05 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: jolly 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-27 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

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

Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..


Patch Set 4: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 4
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Wed, 27 Sep 2023 12:51:36 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-27 Thread jolly
Attention is currently required from: fixeria, laforge, pespin.

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

Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..


Patch Set 4:

(3 comments)

File src/host/layer23/src/mobile/gsm48_rr.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/a7dee417_af60de10
PS3, Line 4889: struct gsm48_system_information_type_header *sih;
  : struct gsm48_hdr_sh *sgh;
  : struct gsm48_hdr *gh;
> all `const`?
Done


https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/4a76a0c9_6487fd29
PS3, Line 4895: sgh = msgb_l3(msg);
> do we want to check `if (msgb_l3len(msg) < sizeof(*sgh))` here?
No, the header is only one byte. There is already a length check for Bter 
frames which are 21 oe 23 bytes.


https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/7ba57cdf_105be506
PS3, Line 4909: sih = msgb_l3(msg);
> do we want to check `if (msgb_l3len(msg) < sizeof(*sih))` here?
No, similar as above. B4 frame length is already checked. The header is way 
smaller.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 4
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Wed, 27 Sep 2023 12:50:19 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-27 Thread jolly
Attention is currently required from: jolly, laforge, pespin.

Hello Jenkins Builder, laforge, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmocom-bb/+/34529?usp=email

to look at the new patch set (#4).

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


Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..

ASCI: Prepare gsm48_rr_rx_acch for voice group channel

The gsm48_rr_rx_acch function receives FACCH/SACCH. This is not only
used for system information on SACCH, but also for short header messages
and regular UI messages on TCH.

Related: OS#5364
Change-Id: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 67 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/29/34529/4
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 4
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-26 Thread fixeria
Attention is currently required from: jolly.

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

Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..


Patch Set 3:

(4 comments)

File src/host/layer23/src/mobile/gsm48_rr.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/56bd95db_5345a46b
PS3, Line 4882: N201_Bter_SACCH
These defines can also be found is libosmocore.git.
But I see that they're not in a header file, unfortunately.


https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/89ef37d5_0ec61e83
PS3, Line 4889: struct gsm48_system_information_type_header *sih;
  : struct gsm48_hdr_sh *sgh;
  : struct gsm48_hdr *gh;
all `const`?


https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/a4121561_73e6e496
PS3, Line 4895: sgh = msgb_l3(msg);
do we want to check `if (msgb_l3len(msg) < sizeof(*sgh))` here?


https://gerrit.osmocom.org/c/osmocom-bb/+/34529/comment/d194695f_932eac3a
PS3, Line 4909: sih = msgb_l3(msg);
do we want to check `if (msgb_l3len(msg) < sizeof(*sih))` here?



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 3
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Tue, 26 Sep 2023 14:50:48 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-26 Thread laforge
Attention is currently required from: jolly.

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

Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 3
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Tue, 26 Sep 2023 13:57:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-26 Thread pespin
Attention is currently required from: jolly.

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

Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 3
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Tue, 26 Sep 2023 11:46:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Prepare gsm48_rr_rx_acch for voice group channel

2023-09-26 Thread jolly
jolly has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34529?usp=email )


Change subject: ASCI: Prepare gsm48_rr_rx_acch for voice group channel
..

ASCI: Prepare gsm48_rr_rx_acch for voice group channel

The gsm48_rr_rx_acch function receives FACCH/SACCH. This is not only
used for system information on SACCH, but also for short header messages
and regular UI messages on TCH.

Related: OS#5364
Change-Id: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 62 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/29/34529/1

diff --git a/src/host/layer23/src/mobile/gsm48_rr.c 
b/src/host/layer23/src/mobile/gsm48_rr.c
index 9a23d47..be67ba8 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -4879,23 +4879,58 @@
}
 }

+#define N201_Bter_SACCH21
+#define N201_Bter_SDCCH_FACCH  23
+#define N201_B419
+
 /* receive ACCH at RR layer */
 static int gsm48_rr_rx_acch(struct osmocom_ms *ms, struct msgb *msg)
 {
-   struct gsm48_system_information_type_header *sih = msgb_l3(msg);
+   struct gsm48_system_information_type_header *sih;
+   struct gsm48_hdr_sh *sgh;
+   struct gsm48_hdr *gh;

-   switch (sih->system_information) {
-   case GSM48_MT_RR_SYSINFO_5:
-   return gsm48_rr_rx_sysinfo5(ms, msg);
-   case GSM48_MT_RR_SYSINFO_5bis:
-   return gsm48_rr_rx_sysinfo5bis(ms, msg);
-   case GSM48_MT_RR_SYSINFO_5ter:
-   return gsm48_rr_rx_sysinfo5ter(ms, msg);
-   case GSM48_MT_RR_SYSINFO_6:
-   return gsm48_rr_rx_sysinfo6(ms, msg);
+   /* Bter frame (SACCH or SDCCH/FACCH) */
+   if (msgb_l3len(msg) == N201_Bter_SACCH || msgb_l3len(msg) == 
N201_Bter_SDCCH_FACCH) {
+   sgh = msgb_l3(msg);
+   if (sgh->rr_short_pd != GSM48_PDISC_SH_RR) {
+   LOGP(DRR, LOGL_NOTICE, "Short header message is not an 
RR message.\n");
+   return -EINVAL;
+   }
+   switch (sgh->msg_type) {
+   default:
+   LOGP(DRR, LOGL_NOTICE, "Short header message type 
0x%02x unsupported.\n", sgh->msg_type);
+   return -EINVAL;
+   }
+   }
+
+   /* B4 frame (SACCH) */
+   if ((msg->cb[0] & 0x40) && msgb_l3len(msg) == N201_B4) {
+   sih = msgb_l3(msg);
+   switch (sih->system_information) {
+   case GSM48_MT_RR_SYSINFO_5:
+   return gsm48_rr_rx_sysinfo5(ms, msg);
+   case GSM48_MT_RR_SYSINFO_5bis:
+   return gsm48_rr_rx_sysinfo5bis(ms, msg);
+   case GSM48_MT_RR_SYSINFO_5ter:
+   return gsm48_rr_rx_sysinfo5ter(ms, msg);
+   case GSM48_MT_RR_SYSINFO_6:
+   return gsm48_rr_rx_sysinfo6(ms, msg);
+   default:
+   LOGP(DRR, LOGL_NOTICE, "ACCH message type 0x%02x 
unknown.\n", sih->system_information);
+   return -EINVAL;
+   }
+   }
+
+   /* B frame (UI frame on VGCS) */
+   if (msgb_l3len(msg) < sizeof(*gh)) {
+   LOGP(DRR, LOGL_NOTICE, "ACCH message too short.\n");
+   return -EINVAL;
+   }
+   gh = msgb_l3(msg);
+   switch (gh->msg_type) {
default:
-   LOGP(DRR, LOGL_NOTICE, "ACCH message type 0x%02x unknown.\n",
-   sih->system_information);
+   LOGP(DRR, LOGL_NOTICE, "ACCH message type 0x%02x unknown.\n", 
gh->msg_type);
return -EINVAL;
}
 }
@@ -4986,6 +5021,7 @@
case RSL_CHAN_Lm_ACCHs:
case RSL_CHAN_SDCCH4_ACCH:
case RSL_CHAN_SDCCH8_ACCH:
+   msg->cb[0] = rllh->link_id;
return gsm48_rr_rx_acch(ms, msg);
default:
LOGP(DRSL, LOGL_NOTICE, "RSL with chan_nr 0x%02x unknown.\n",

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34529?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: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
Gerrit-Change-Number: 34529
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-MessageType: newchange