[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-23 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email )


Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..

Add GSMTAP encapsulation of RLP frames in CSD NT mode

In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
---
M src/common/l1sap.c
1 file changed, 55 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/35124/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index c599726..4b2ca02 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1841,19 +1841,54 @@
return 1;
 }

-static void send_ul_rtp_packet_data(struct gsm_lchan *lchan, uint32_t fn,
+static void gsmtap_csd_ul(struct gsm_lchan *lchan, const struct ph_tch_param 
*tch_ind, const uint8_t *data, unsigned int data_len)
+{
+   struct gsm_bts_trx *trx = lchan->ts->trx;
+   struct gsmtap_inst *inst = trx->bts->gsmtap.inst;
+   if (!inst)
+   return;
+
+   if (lchan->csd_mode == LCHAN_CSD_M_NT) {
+   pbit_t buf[data_len/8+1];
+   int len = osmo_ubit2pbit_ext(buf, 0, data, 0, data_len, 1);
+   gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP, trx->arfcn | 
GSMTAP_ARFCN_F_UPLINK, lchan->ts->nr,
+   lchan->type == GSM_LCHAN_TCH_H ? 
GSMTAP_CHANNEL_TCH_H : GSMTAP_CHANNEL_TCH_F,
+   lchan->nr, tch_ind->fn, tch_ind->rssi, 0, buf, 
len);
+
+   }
+}
+
+static void gsmtap_csd_dl(struct gsm_lchan *lchan, const uint8_t *data, 
unsigned int data_len)
+{
+   struct gsm_bts_trx *trx = lchan->ts->trx;
+   struct gsmtap_inst *inst = trx->bts->gsmtap.inst;
+   if (!inst)
+   return;
+
+   if (lchan->csd_mode == LCHAN_CSD_M_NT) {
+   pbit_t buf[data_len/8+1];
+   int len = osmo_ubit2pbit_ext(buf, 0, data, 0, data_len, 1);
+   gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP, trx->arfcn, 
lchan->ts->nr,
+   lchan->type == GSM_LCHAN_TCH_H ? 
GSMTAP_CHANNEL_TCH_H : GSMTAP_CHANNEL_TCH_F,
+   lchan->nr, 0, 0, 0, buf, len);
+   }
+}
+
+static void send_ul_rtp_packet_data(struct gsm_lchan *lchan, const struct 
ph_tch_param *tch_ind,
const uint8_t *data, uint16_t data_len)
 {
uint8_t rtp_pl[RFC4040_RTP_PLEN];
int rc;

+   gsmtap_csd_ul(lchan, tch_ind, data, data_len);
+
rc = csd_v110_rtp_encode(lchan, &rtp_pl[0], data, data_len);
if (rc < 0)
return;

osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
&rtp_pl[0], sizeof(rtp_pl),
-   fn_ms_adj(fn, lchan),
+   fn_ms_adj(tch_ind->fn, lchan),
lchan->rtp_tx_marker);
/* Only clear the marker bit once we have sent a RTP packet with it */
lchan->rtp_tx_marker = false;
@@ -1987,7 +2022,7 @@
send_ul_rtp_packet_speech(lchan, fn, msg->data, 
msg->len);
break;
case RSL_CMOD_SPD_DATA:
-   send_ul_rtp_packet_data(lchan, fn, msg->data, msg->len);
+   send_ul_rtp_packet_data(lchan, tch_ind, msg->data, 
msg->len);
break;
case RSL_CMOD_SPD_SIGN:
return 0; /* drop stale TCH.ind */
@@ -2296,6 +2331,7 @@
int rc = csd_v110_rtp_decode(lchan, msg->tail,
 rtp_pl, rtp_pl_len);
if (rc > 0) {
+   gsmtap_csd_dl(lchan, msg->tail, rc);
msgb_put(msg, rc);
} else {
msgb_free(msg);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-23 Thread laforge
Attention is currently required from: fixeria.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 1:

(1 comment)

Patchset:

PS1:
this needs to be vty-configurable and should likely contain a [default] setting 
of suppressing any NULL Frames to avoid filling the pcap with uesless info



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: fixeria 
Gerrit-CC: Jenkins Builder
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 23 Nov 2023 22:19:49 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-26 Thread laforge
Attention is currently required from: fixeria.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 2:

(3 comments)

This change is ready for review.

Patchset:

PS1:
> this needs to be vty-configurable and should likely contain a [default] 
> setting of suppressing any N […]
Done


File src/common/l1sap.c:

https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/05a0cb5b_9de0bc77
PS1, Line 1855: GSMTAP_CHANNEL_TCH_H : GSMTAP_CHANNEL_TCH_F
> I was thinking about the same, but then wasn't really sure if we should 
> really add those. […]
Done


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/cbff05d0_7e89d3ef
PS1, Line 1868: lchan->csd_mode == LCHAN_CSD_M_NT
> I think we should buffer and re-assemble those two blocks in osmo-bts. […]
Done



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Sun, 26 Nov 2023 17:30:55 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-26 Thread laforge
Attention is currently required from: fixeria.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email

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


Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..

Add GSMTAP encapsulation of RLP frames in CSD NT mode

In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
---
M include/osmo-bts/bts.h
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/vty.c
4 files changed, 117 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/35124/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-26 Thread Jenkins Builder
Attention is currently required from: fixeria.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 3:

(2 comments)

File src/common/l1sap.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12628):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/69d24c3e_801b4dde
PS3, Line 1879: } else {
else is not generally useful after a break or return


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12628):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/5cedae41_98cbda3b
PS3, Line 1893: } else {
else is not generally useful after a break or return



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Sun, 26 Nov 2023 17:35:28 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-26 Thread laforge
Attention is currently required from: fixeria, laforge.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email

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


Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..

Add GSMTAP encapsulation of RLP frames in CSD NT mode

In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
---
M include/osmo-bts/bts.h
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/vty.c
4 files changed, 121 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/35124/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 4
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-26 Thread Jenkins Builder
Attention is currently required from: fixeria, laforge.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 4:

(2 comments)

File src/common/l1sap.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12629):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/7a7ef0d6_695625f6
PS4, Line 1879: } else {
else is not generally useful after a break or return


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12629):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/91af6fe2_41c93e21
PS4, Line 1893: } else {
else is not generally useful after a break or return



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 4
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Sun, 26 Nov 2023 17:38:14 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-28 Thread laforge
Attention is currently required from: fixeria, laforge.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email

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

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


Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..

Add GSMTAP encapsulation of RLP frames in CSD NT mode

In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
---
M include/osmo-bts/bts.h
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/vty.c
M tests/osmo-bts.vty
5 files changed, 123 insertions(+), 4 deletions(-)


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-28 Thread Jenkins Builder
Attention is currently required from: fixeria, laforge.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 5:

(2 comments)

File src/common/l1sap.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12695):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/cad0efa7_87105560
PS5, Line 1879: } else {
else is not generally useful after a break or return


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12695):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/5bdef780_58ff2f99
PS5, Line 1893: } else {
else is not generally useful after a break or return



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 5
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Tue, 28 Nov 2023 22:00:45 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-28 Thread laforge
Attention is currently required from: fixeria, laforge.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email

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

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


Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..

Add GSMTAP encapsulation of RLP frames in CSD NT mode

In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
---
M include/osmo-bts/bts.h
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/vty.c
M tests/osmo-bts.vty
5 files changed, 124 insertions(+), 4 deletions(-)


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-28 Thread Jenkins Builder
Attention is currently required from: fixeria, laforge.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 6:

(2 comments)

File src/common/l1sap.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12698):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/21244cd8_c8b32077
PS6, Line 1879: } else {
else is not generally useful after a break or return


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12698):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/8f7b8427_f0815275
PS6, Line 1893: } else {
else is not generally useful after a break or return



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Tue, 28 Nov 2023 22:12:21 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-30 Thread osmith
Attention is currently required from: fixeria, laforge.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email )

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 6:

(1 comment)

File src/common/l1sap.c:

https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/ca3a1ff3_e76f541b
PS6, Line 1879: } else {
FYI if you think the UNNECESSARY_ELSE check is not something we need to follow 
for the Osmocom coding style we can easily disable it



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: osmith 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 30 Nov 2023 08:24:01 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-11-30 Thread fixeria
Attention is currently required from: laforge, osmith.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 6: Code-Review-1

(5 comments)

File src/common/l1sap.c:

https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/596bb9af_6b338676
PS6, Line 1854: if (!inst || !trx->bts->gsmtap.rlp)
We also need to check `if (lchan->csd_mode == LCHAN_CSD_M_NT)`, otherwise we 
would be emitting garbage RLP frames during transparent calls. I saw this check 
in an early revision of this patch, but somehow it's gone?


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/2382735b_2be5884e
PS6, Line 1866: 2x
Actually it's `4x36bit` for TCH/H2.4.
Similarly to TCH/H4.8 carrying more data (per-block) than TCH/F4.8.

* TCH/F2.4: `2 * 36` bits every 20 ms, so `2 * 36 * (1000 / 20) = 3600` => 3.6 
kbps
* TCH/H2.4: `4 * 36` bits every 40 ms, so `4 * 36 * (1000 / 40) = 3600` => 3.6 
kbps


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/e05035e2_2a196cef
PS6, Line 1867: 2x 290 bit
IIRC, 290 is actually `8 * 36 + 2`.


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/ae1a3861_11e2db86
PS6, Line 1867: TCH/H 14.4
TCH/F, not half-rate.


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/a31d677b_cf7187f9
PS6, Line 1879: } else {
> FYI if you think the UNNECESSARY_ELSE check is not something we need to 
> follow for the Osmocom codin […]
I think it's fine to have it enabled in general. pylint is also enforcing the 
same rule for Python by default. The benefit of following this rule is reduced 
nesting. But I wish there was a way to say 'wontfix' for specific comments, 
rather than having to remove Jenkins and do CR+1 manually, or having to disable 
checks in the linter.



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 30 Nov 2023 10:08:38 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: osmith 
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-17 Thread laforge
Attention is currently required from: fixeria, laforge, osmith.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email

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

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


Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..

Add GSMTAP encapsulation of RLP frames in CSD NT mode

In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
---
M include/osmo-bts/bts.h
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/vty.c
M tests/osmo-bts.vty
5 files changed, 127 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/35124/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-17 Thread laforge
Attention is currently required from: fixeria, osmith.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 6:

(4 comments)

File src/common/l1sap.c:

https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/cd2e5146_6136d7a8
PS6, Line 1854: if (!inst || !trx->bts->gsmtap.rlp)
> We also need to check `if (lchan->csd_mode == LCHAN_CSD_M_NT)`, otherwise we 
> would be emitting garba […]
Done


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/7468b140_31128147
PS6, Line 1866: 2x
> Actually it's `4x36bit` for TCH/H2.4. […]
Done


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/0ab2c337_6d368a94
PS6, Line 1867: TCH/H 14.4
> TCH/F, not half-rate.
Done


https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/9b562d2d_e4bb0b2d
PS6, Line 1879: } else {
> I think it's fine to have it enabled in general. […]
Done



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Sun, 17 Dec 2023 11:08:26 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-17 Thread fixeria
Attention is currently required from: laforge, osmith.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 7: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Sun, 17 Dec 2023 11:10:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-17 Thread Jenkins Builder
Attention is currently required from: laforge, osmith.

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

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 7:

(2 comments)

File src/common/l1sap.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13154):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/45c2a135_173a4b22
PS7, Line 1889: } else {
else is not generally useful after a break or return


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13154):
https://gerrit.osmocom.org/c/osmo-bts/+/35124/comment/2e4f9a18_c2d3b502
PS7, Line 1903: } else {
else is not generally useful after a break or return



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Sun, 17 Dec 2023 11:11:05 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-18 Thread osmith
Attention is currently required from: laforge.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email )

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 7: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Mon, 18 Dec 2023 11:46:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-21 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email )

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Patch Set 7: Verified+1 Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 21 Dec 2023 11:37:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-21 Thread laforge
laforge has removed a vote from this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email )


Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..


Removed Verified-1 by Jenkins Builder (102)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
Gerrit-Change-Number: 35124
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: deleteVote


[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode

2023-12-21 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email )

Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode
..

Add GSMTAP encapsulation of RLP frames in CSD NT mode

In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
---
M include/osmo-bts/bts.h
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/vty.c
M tests/osmo-bts.vty
5 files changed, 127 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved; Verified
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve




diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index 60e308c..b12125c 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -377,6 +377,7 @@
char *local_host;
uint32_t sapi_mask;
uint8_t sapi_acch;
+   bool rlp;
} gsmtap;

struct osmux_state osmux;
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h
index 92973a7..585483b 100644
--- a/include/osmo-bts/lchan.h
+++ b/include/osmo-bts/lchan.h
@@ -287,7 +287,11 @@
} dtx_fr_hr_efr;
uint8_t last_cmr;
uint32_t last_fn;
-
+   struct {
+   /* buffers to re-combine RLP frame from multiple Um 
blocks */
+   uint8_t rlp_buf_ul[576/8]; /* maximum size of RLP frame 
*/
+   uint8_t rlp_buf_dl[576/8]; /* maximum size of RLP frame 
*/
+   } csd;
} tch;

/* 3GPP TS 48.058 § 9.3.37: [0; 255] ok, -1 means invalid*/
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 90a61e2..c579af5 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1848,19 +1848,88 @@
return 1;
 }

-static void send_ul_rtp_packet_data(struct gsm_lchan *lchan, uint32_t fn,
+/* process one MAC block of unpacked bits of a non-transparent CSD channel */
+static void gsmtap_csd_rlp_process(struct gsm_lchan *lchan, bool is_uplink,
+  const struct ph_tch_param *tch_ind,
+  const uint8_t *data, unsigned int data_len)
+{
+   struct gsm_bts_trx *trx = lchan->ts->trx;
+   struct gsmtap_inst *inst = trx->bts->gsmtap.inst;
+   pbit_t *rlp_buf;
+   int byte_len;
+
+   if (!inst || !trx->bts->gsmtap.rlp)
+   return;
+
+   if (lchan->csd_mode != LCHAN_CSD_M_NT)
+   return;
+
+   if (is_uplink)
+   rlp_buf = lchan->tch.csd.rlp_buf_ul;
+   else
+   rlp_buf = lchan->tch.csd.rlp_buf_dl;
+
+   /* TCH/F 9.6: 4x60bit block => 240bit RLP frame
+* TCH/F 4.8: 2x 2x60bit blocks starting at B0/B2/B4 => 240bit RLP frame
+* TCH/H 4.8: 4x60bit block => 240bit RLP frame
+* TCH/F 2.4: 2x36bit blocks => transparent only
+* TCH/H 2.4: 4x36bit blocks => transparent only
+* TCH/F 14.4: 2x 290 bit block (starting with M1=0) => 576-bit RLP 
frame
+*/
+
+   if (lchan->type == GSM_LCHAN_TCH_F && lchan->tch_mode == 
GSM48_CMODE_DATA_6k0) {
+   /* in this mode we have 120bit MAC blocks; two of them need to 
be concatenated
+* to render a 240-bit RLP frame. The fist block is present in 
B0/B2/B4.
+* The E7 bit is used to indicate the Frame MF0a */
+   OSMO_ASSERT(data_len == 120);
+   ubit_t e7 = data[4*7+3];
+   if (e7 == 0) {
+   osmo_ubit2pbit_ext(rlp_buf, 0, data, 0, data_len, 1);
+   return;
+   } else {
+   osmo_ubit2pbit_ext(rlp_buf, 120, data, 0, data_len, 1);
+   byte_len = 240/8;
+   }
+   } else if (lchan->type == GSM_LCHAN_TCH_F && lchan->tch_mode == 
GSM48_CMODE_DATA_14k5) {
+   /* in this mode we have 290bit MAC blocks containing M1, M2 and 
288 data bits;
+* two of them need to be concatenated to render a
+* 576-bit RLP frame. The start of a RLP frame is
+* denoted by a block with M1-bit set to 0. */
+   OSMO_ASSERT(data_len == 290);
+   ubit_t m1 = data[0];
+   if (m1 == 0) {
+   osmo_ubit2pbit_ext(rlp_buf, 0, data, 2, data_len, 1);
+   return;
+   } else {
+   osmo_ubit2pbit_ext(rlp_buf, 288, data, 2, data_len, 1);
+   byte_len = 576/8;
+   }
+   } else {
+   byte_len = osmo_ubit2pbit_ext(