[M] Change in osmo-bsc[master]: meas_feed: Use osmo_io instead of write queue

2023-09-25 Thread arehbein
Attention is currently required from: daniel.

arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email )

Change subject: meas_feed: Use osmo_io instead of write queue
..


Patch Set 1:

(1 comment)

Patchset:

PS1:
> TODOs: […]
okay, tests show something is probably not yet right with the sockets



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib0570a3242e2846062e24c93cd31137acdee
Gerrit-Change-Number: 34526
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Mon, 25 Sep 2023 22:49:09 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein 
Gerrit-MessageType: comment


[M] Change in osmo-bsc[master]: meas_feed: Use osmo_io instead of write queue

2023-09-25 Thread arehbein
Attention is currently required from: daniel.

arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email )

Change subject: meas_feed: Use osmo_io instead of write queue
..


Patch Set 1:

(1 comment)

This change is ready for review.

Patchset:

PS1:
TODOs:
 - tests may have to be fixed
 - one or two open questions (see TODO-comments)
 - not yet tested



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib0570a3242e2846062e24c93cd31137acdee
Gerrit-Change-Number: 34526
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-Reviewer: daniel 
Gerrit-CC: Jenkins Builder
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Mon, 25 Sep 2023 22:45:53 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in libosmo-netif[master]: stream_srv: Set io_fd pointer to NULL after freeing

2023-09-25 Thread arehbein
arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/34525?usp=email )


Change subject: stream_srv: Set io_fd pointer to NULL after freeing
..

stream_srv: Set io_fd pointer to NULL after freeing

Change-Id: Idb815a3e4e51189f9f1f3cceedd570dff9caf401
---
M src/stream_srv.c
1 file changed, 10 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/25/34525/1

diff --git a/src/stream_srv.c b/src/stream_srv.c
index b404604..ca22e1b 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -858,6 +858,7 @@
break;
case OSMO_STREAM_MODE_OSMO_IO:
osmo_iofd_free(conn->iofd);
+   conn->iofd = NULL;
break;
default:
OSMO_ASSERT(false);

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

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Idb815a3e4e51189f9f1f3cceedd570dff9caf401
Gerrit-Change-Number: 34525
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-MessageType: newchange


[S] Change in libosmocore[master]: sockaddr_str.h Fix OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULL syntax error

2023-09-25 Thread pespin
Attention is currently required from: laforge.

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

Change subject: sockaddr_str.h Fix OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULL syntax 
error
..


Patch Set 1:

(1 comment)

Patchset:

PS1:
> might this be something for a patch release?
Maybe if we ever do a patch release, but I don't think it's worth it on its 
own, basically because there were no users of such define so far. So it's more 
like we say this define is added in the next release.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iee361d740845257fa62c9093e30e8079fa933827
Gerrit-Change-Number: 34509
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Mon, 25 Sep 2023 21:03:42 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Clean up code

2023-09-25 Thread arehbein
Attention is currently required from: daniel.

arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34524?usp=email )

Change subject: osmo_io: Clean up code
..


Patch Set 1:

(1 comment)

Patchset:

PS1:
Minor cleanup (I suppose there is no good reason to keep these lines, 
@dwillm...@sysmocom.de ?)



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I77f7ae2b211507f420d87c484ec75ee054fceb63
Gerrit-Change-Number: 34524
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-Reviewer: daniel 
Gerrit-CC: Jenkins Builder
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Mon, 25 Sep 2023 20:06:41 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Clean up code

2023-09-25 Thread arehbein
arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34524?usp=email )


Change subject: osmo_io: Clean up code
..

osmo_io: Clean up code

 - Remove osmo_io_init() from header, since it has no function definition
 - Remove osmo_iofd_init from .map file, because it doesn't need to be exposed
   (it is called by on_dso_load_osmo_io() in osmo_io.c)

Change-Id: I77f7ae2b211507f420d87c484ec75ee054fceb63
---
M include/osmocom/core/osmo_io.h
M src/core/libosmocore.map
2 files changed, 13 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/24/34524/1

diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h
index b780d9a..4ff6bbc 100644
--- a/include/osmocom/core/osmo_io.h
+++ b/include/osmocom/core/osmo_io.h
@@ -69,8 +69,6 @@
};
 };

-void osmo_io_init(void);
-
 struct osmo_io_fd *osmo_iofd_setup(const void *ctx, int fd, const char *name,
  enum osmo_io_fd_mode mode, const struct osmo_io_ops *ioops, 
void *data);
 int osmo_iofd_register(struct osmo_io_fd *iofd, int fd);
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map
index c0e164b..a8b2c18 100644
--- a/src/core/libosmocore.map
+++ b/src/core/libosmocore.map
@@ -260,7 +260,6 @@
 osmo_iofd_get_name;
 osmo_iofd_set_name;
 osmo_iofd_get_priv_nr;
-osmo_iofd_init;
 osmo_iofd_ops;
 osmo_iofd_register;
 osmo_iofd_sendto_msgb;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I77f7ae2b211507f420d87c484ec75ee054fceb63
Gerrit-Change-Number: 34524
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-MessageType: newchange


[S] Change in osmo-msc[master]: SMS over GSUP: correctly route GSUP responses to MT SMS

2023-09-25 Thread falconia
falconia has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/34517?usp=email )

Change subject: SMS over GSUP: correctly route GSUP responses to MT SMS
..

SMS over GSUP: correctly route GSUP responses to MT SMS

When OsmoMSC is used with OsmoHLR rather than a GSUP-to-MAP gateway,
MT-forwardSM.req GSUP messages delivering MT SMS will be coming from
a separate SMSC relayed via OsmoHLR, rather than from OsmoHLR itself.
When we reply to these messages, in order for these replies to reach
the MT-sending SMSC via OsmoHLR, we need to save source_name from
the request and regurgitate it into destination_name in our response
messages.  Implement this logic.

Related: OS#6135
Change-Id: I436e333035b8f6e27f86a49fe293ea48ea07a013
---
M include/osmocom/msc/gsm_04_11.h
M include/osmocom/msc/transaction.h
M src/libmsc/gsm_04_11.c
M src/libmsc/gsm_04_11_gsup.c
4 files changed, 46 insertions(+), 3 deletions(-)

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




diff --git a/include/osmocom/msc/gsm_04_11.h b/include/osmocom/msc/gsm_04_11.h
index 19aaa3a..17a31ec 100644
--- a/include/osmocom/msc/gsm_04_11.h
+++ b/include/osmocom/msc/gsm_04_11.h
@@ -28,7 +28,8 @@
 int gsm411_send_rp_data(struct gsm_network *net, struct vlr_subscr *vsub,
size_t sm_rp_oa_len, const uint8_t *sm_rp_oa,
size_t sm_rp_ud_len, const uint8_t *sm_rp_ud,
-   bool sm_rp_mmts_ind);
+   bool sm_rp_mmts_ind, const uint8_t *gsup_source_name,
+   size_t gsup_source_name_len);

 void gsm411_sapi_n_reject(struct msc_a *msc_a);

diff --git a/include/osmocom/msc/transaction.h 
b/include/osmocom/msc/transaction.h
index a5a2e84..aa529e4 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -149,6 +149,9 @@
bool sm_rp_mmts_ind;

struct gsm_sms *sms;
+
+   uint8_t *gsup_source_name;
+   size_t gsup_source_name_len;
} sms;
struct {
/**
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index adc9d88..aa87a19 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -1230,7 +1230,8 @@
 int gsm411_send_rp_data(struct gsm_network *net, struct vlr_subscr *vsub,
size_t sm_rp_oa_len, const uint8_t *sm_rp_oa,
size_t sm_rp_ud_len, const uint8_t *sm_rp_ud,
-   bool sm_rp_mmts_ind)
+   bool sm_rp_mmts_ind, const uint8_t *gsup_source_name,
+   size_t gsup_source_name_len)
 {
struct gsm_trans *trans;
struct msgb *msg;
@@ -1245,6 +1246,17 @@
if (trans->msc_a != NULL)
gsm411_handle_mmts_ind(trans);

+   /* Save GSUP source_name for subsequent response messages */
+   if (gsup_source_name && gsup_source_name_len) {
+   trans->sms.gsup_source_name = talloc_memdup(trans, 
gsup_source_name,
+   
gsup_source_name_len);
+   if (!trans->sms.gsup_source_name) {
+   trans_free(trans);
+   return -ENOMEM;
+   }
+   trans->sms.gsup_source_name_len = gsup_source_name_len;
+   }
+
/* Allocate a message buffer for to be encoded SMS */
msg = gsm411_msgb_alloc();
if (!msg) {
diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index 0f18912..6225c6c 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -198,6 +198,10 @@
gsup_sm_msg_init(_msg, OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT,
trans->vsub->imsi, _rp_mr);

+   /* Ensure routing through OsmoHLR to the MT-sending SMSC */
+   gsup_msg.destination_name = trans->sms.gsup_source_name;
+   gsup_msg.destination_name_len = trans->sms.gsup_source_name_len;
+
return gsup_client_mux_tx(trans->net->gcm, _msg);
 }

@@ -215,6 +219,10 @@
gsup_sm_msg_init(_msg, OSMO_GSUP_MSGT_MT_FORWARD_SM_ERROR,
trans->vsub->imsi, _rp_mr);

+   /* Ensure routing through OsmoHLR to the MT-sending SMSC */
+   gsup_msg.destination_name = trans->sms.gsup_source_name;
+   gsup_msg.destination_name_len = trans->sms.gsup_source_name_len;
+
/* SM-RP-Cause value */
gsup_msg.sm_rp_cause = 

@@ -259,7 +267,8 @@
rc = gsm411_send_rp_data(net, vsub,
gsup_msg->sm_rp_oa_len, gsup_msg->sm_rp_oa,
gsup_msg->sm_rp_ui_len, gsup_msg->sm_rp_ui,
-   sm_rp_mmts_ind);
+   sm_rp_mmts_ind, gsup_msg->source_name,
+   gsup_msg->source_name_len);
if (rc) {
LOGP(DLSMS, 

[S] Change in osmo-msc[master]: gsup_client_mux: set destination_name in error reply function

2023-09-25 Thread falconia
falconia has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/34516?usp=email )

Change subject: gsup_client_mux: set destination_name in error reply function
..

gsup_client_mux: set destination_name in error reply function

If the GSUP request message to which we are replying is an MT SMS
delivery from an SMSC relayed via OsmoHLR, we must set destination_name
in our reply - otherwise our reply won't make it back to the SMSC.

Related: OS#6135
Change-Id: I892fe87a733a78ed9d5761a8ce238caa135dea1e
---
M src/libmsc/gsup_client_mux.c
1 file changed, 16 insertions(+), 0 deletions(-)

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




diff --git a/src/libmsc/gsup_client_mux.c b/src/libmsc/gsup_client_mux.c
index 1900377..9a0dc16 100644
--- a/src/libmsc/gsup_client_mux.c
+++ b/src/libmsc/gsup_client_mux.c
@@ -150,6 +150,8 @@
.cause = cause,
.message_type = 
OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type),
.message_class = gsup_orig->message_class,
+   .destination_name = gsup_orig->source_name,
+   .destination_name_len = gsup_orig->source_name_len,
 
/* RP-Message-Reference is mandatory for SM Service */
.sm_rp_mr = gsup_orig->sm_rp_mr,

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I892fe87a733a78ed9d5761a8ce238caa135dea1e
Gerrit-Change-Number: 34516
Gerrit-PatchSet: 1
Gerrit-Owner: falconia 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


[S] Change in osmo-msc[master]: SMS over GSUP: set source_name in GSUP reply messages

2023-09-25 Thread falconia
falconia has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/34518?usp=email )

Change subject: SMS over GSUP: set source_name in GSUP reply messages
..

SMS over GSUP: set source_name in GSUP reply messages

For MO-forwardSM and MT-forwardSM request messages, OsmoHLR applies
routing based on the SMSC address for MO or based on the IMSI for MT.
However, reply messages following these requests are routed passively
based on the destination_name IE.  This passive message routing path
requires the source_name IE to be set as well - implement this
source_name setting.

Related: OS#6135
Change-Id: I0b7f4760bdce8a38d43d3860086c6dfb7b390701
---
M include/osmocom/msc/gsup_client_mux.h
M src/libmsc/gsm_04_11_gsup.c
M src/libmsc/gsup_client_mux.c
3 files changed, 40 insertions(+), 0 deletions(-)

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




diff --git a/include/osmocom/msc/gsup_client_mux.h 
b/include/osmocom/msc/gsup_client_mux.h
index 07f17c2..501b81d 100644
--- a/include/osmocom/msc/gsup_client_mux.h
+++ b/include/osmocom/msc/gsup_client_mux.h
@@ -28,6 +28,7 @@
  struct ipaccess_unit *ipa_dev);

 int gsup_client_mux_tx(struct gsup_client_mux *gcm, const struct 
osmo_gsup_message *gsup_msg);
+void gsup_client_mux_tx_set_source(const struct gsup_client_mux *gcm, struct 
osmo_gsup_message *gsup_msg);
 void gsup_client_mux_tx_error_reply(struct gsup_client_mux *gcm, const struct 
osmo_gsup_message *gsup_orig,
enum gsm48_gmm_cause cause);

diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index 6225c6c..d1c2f27 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -201,6 +201,7 @@
/* Ensure routing through OsmoHLR to the MT-sending SMSC */
gsup_msg.destination_name = trans->sms.gsup_source_name;
gsup_msg.destination_name_len = trans->sms.gsup_source_name_len;
+   gsup_client_mux_tx_set_source(trans->net->gcm, _msg);

return gsup_client_mux_tx(trans->net->gcm, _msg);
 }
@@ -222,6 +223,7 @@
/* Ensure routing through OsmoHLR to the MT-sending SMSC */
gsup_msg.destination_name = trans->sms.gsup_source_name;
gsup_msg.destination_name_len = trans->sms.gsup_source_name_len;
+   gsup_client_mux_tx_set_source(trans->net->gcm, _msg);

/* SM-RP-Cause value */
gsup_msg.sm_rp_cause = 
diff --git a/src/libmsc/gsup_client_mux.c b/src/libmsc/gsup_client_mux.c
index 9a0dc16..1a3611f 100644
--- a/src/libmsc/gsup_client_mux.c
+++ b/src/libmsc/gsup_client_mux.c
@@ -136,6 +136,25 @@
return osmo_gsup_client_send(gcm->gsup_client, msg);
 }

+/* Set GSUP source_name to our local IPA name */
+void gsup_client_mux_tx_set_source(const struct gsup_client_mux *gcm,
+  struct osmo_gsup_message *gsup_msg)
+{
+   const char *local_msc_name;
+
+   if (!gcm)
+   return;
+   if (!gcm->gsup_client)
+   return;
+   if (!gcm->gsup_client->ipa_dev)
+   return;
+   local_msc_name = gcm->gsup_client->ipa_dev->serno;
+   if (!local_msc_name)
+   return;
+   gsup_msg->source_name = (const uint8_t *) local_msc_name;
+   gsup_msg->source_name_len = strlen(local_msc_name) + 1;
+}
+
 /* Transmit GSUP error in response to original message */
 void gsup_client_mux_tx_error_reply(struct gsup_client_mux *gcm, const struct 
osmo_gsup_message *gsup_orig,
enum gsm48_gmm_cause cause)
@@ -158,6 +177,7 @@
};

OSMO_STRLCPY_ARRAY(gsup_reply.imsi, gsup_orig->imsi);
+   gsup_client_mux_tx_set_source(gcm, _reply);

/* For SS/USSD, it's important to keep both session state and ID IEs */
if (gsup_orig->session_state != OSMO_GSUP_SESSION_STATE_NONE) {

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I0b7f4760bdce8a38d43d3860086c6dfb7b390701
Gerrit-Change-Number: 34518
Gerrit-PatchSet: 2
Gerrit-Owner: falconia 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-MessageType: merged


[M] Change in osmo-bsc[master]: sccplite: Support multiple MGW in MGW pool

2023-09-25 Thread laforge
Attention is currently required from: pespin.

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

Change subject: sccplite: Support multiple MGW in MGW pool
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia106a21b7692eb5b2ac3b5ac2b358bedbc3b9da6
Gerrit-Change-Number: 34511
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:10:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: sockaddr_str.h Fix OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULL syntax error

2023-09-25 Thread laforge
Attention is currently required from: pespin.

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

Change subject: sockaddr_str.h Fix OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULL syntax 
error
..


Patch Set 1: Code-Review+1

(1 comment)

Patchset:

PS1:
might this be something for a patch release?



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iee361d740845257fa62c9093e30e8079fa933827
Gerrit-Change-Number: 34509
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:09:52 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-bts[master]: Do not prefix UI header to System Information Type 10

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

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

Change subject: Do not prefix UI header to System Information Type 10
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34519?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: Ifede42bfd84ea5914b559a20ae68f594d2ee1a5c
Gerrit-Change-Number: 34519
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:08:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: l1gprs: migrate to gsm0502_fn_compare()

2023-09-25 Thread laforge
Attention is currently required from: fixeria.

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

Change subject: l1gprs: migrate to gsm0502_fn_compare()
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34522?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: I10261aa114b5dce3efee26ea84a1caa50c49a1d2
Gerrit-Change-Number: 34522
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:08:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in libosmocore[master]: gsm: add gsm0502_fn_compare() for comparing TDMA FNs

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

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

Change subject: gsm: add gsm0502_fn_compare() for comparing TDMA FNs
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9590f2e836fc48650decf1564b6ab46306c4fe2d
Gerrit-Change-Number: 34520
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:07:52 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-msc[master]: SMS over GSUP: set source_name in GSUP reply messages

2023-09-25 Thread laforge
Attention is currently required from: falconia, neels.

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

Change subject: SMS over GSUP: set source_name in GSUP reply messages
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I0b7f4760bdce8a38d43d3860086c6dfb7b390701
Gerrit-Change-Number: 34518
Gerrit-PatchSet: 2
Gerrit-Owner: falconia 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Attention: falconia 
Gerrit-Attention: neels 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:07:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-msc[master]: SMS over GSUP: correctly route GSUP responses to MT SMS

2023-09-25 Thread laforge
Attention is currently required from: falconia.

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

Change subject: SMS over GSUP: correctly route GSUP responses to MT SMS
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I436e333035b8f6e27f86a49fe293ea48ea07a013
Gerrit-Change-Number: 34517
Gerrit-PatchSet: 2
Gerrit-Owner: falconia 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: falconia 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:07:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-msc[master]: gsup_client_mux: set destination_name in error reply function

2023-09-25 Thread laforge
Attention is currently required from: falconia.

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

Change subject: gsup_client_mux: set destination_name in error reply function
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I892fe87a733a78ed9d5761a8ce238caa135dea1e
Gerrit-Change-Number: 34516
Gerrit-PatchSet: 1
Gerrit-Owner: falconia 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: falconia 
Gerrit-Comment-Date: Mon, 25 Sep 2023 19:06:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in libosmocore[master]: gsm: add gsm0502_fn_compare() for comparing TDMA FNs

2023-09-25 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34520?usp=email )

Change subject: gsm: add gsm0502_fn_compare() for comparing TDMA FNs
..


Set Ready For Review


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9590f2e836fc48650decf1564b6ab46306c4fe2d
Gerrit-Change-Number: 34520
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 25 Sep 2023 17:42:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: trxcon/l1sched: rework dequeueing of PDCH Tx prims

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


Change subject: trxcon/l1sched: rework dequeueing of PDCH Tx prims
..

trxcon/l1sched: rework dequeueing of PDCH Tx prims

When an UL BLOCK.req is received late, i.e. after the first Tx burst
of the respective TDMA Fn was requested by the PHY, a domino effect
can be observed: the stale Tx primitive remains in the queue and
prevents transmission of the next primitive, even if the later was
received in time.  This breaks transmission of consecutive UL blocks.

Don't let stale primitives poison the Tx queue: drop them like before,
but keep looking for a primitive with the matching TDMA Fn.  If found
a primitive with TDMA Fn past the current one, stop the iteration.

Change-Id: I439615639b8e840b9fd4f3af6934d9f298f32216
Depends: libosmocore.git I9590f2e836fc48650decf1564b6ab46306c4fe2d
Related: OS#5500
---
M src/host/trxcon/src/sched_lchan_pdtch.c
1 file changed, 38 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/23/34523/1

diff --git a/src/host/trxcon/src/sched_lchan_pdtch.c 
b/src/host/trxcon/src/sched_lchan_pdtch.c
index 0f8a25f..d1f426b 100644
--- a/src/host/trxcon/src/sched_lchan_pdtch.c
+++ b/src/host/trxcon/src/sched_lchan_pdtch.c
@@ -26,6 +26,7 @@
 #include 
 #include 

+#include 
 #include 
 #include 
 #include 
@@ -104,20 +105,25 @@

 static struct msgb *prim_dequeue_pdtch(struct l1sched_lchan_state *lchan, 
uint32_t fn)
 {
-   const struct l1sched_prim *prim;
struct msgb *msg;

-   msg = msgb_dequeue(>tx_prims);
-   if (msg == NULL)
-   return NULL;
-   prim = l1sched_prim_from_msgb(msg);
+   llist_for_each_entry(msg, >tx_prims, list) {
+   const struct l1sched_prim *prim = l1sched_prim_from_msgb(msg);
+   int ret = gsm0502_fn_compare(prim->data_req.frame_nr, fn);

-   if (OSMO_LIKELY(prim->data_req.frame_nr == fn))
-   return msg;
-   LOGP_LCHAND(lchan, LOGL_ERROR,
-   "%s(): dropping Tx primitive (current Fn=%u, prim Fn=%u)\n",
-   __func__, fn, prim->data_req.frame_nr);
-   msgb_free(msg);
+   if (OSMO_LIKELY(ret == 0)) { /* it's a match! */
+   llist_del(msg->list);
+   return msg;
+   } else if (ret > 0) { /* not now, come back later */
+   break;
+   } /* else: the ship has sailed, drop your ticket */
+
+   LOGP_LCHAND(lchan, LOGL_ERROR,
+   "%s(): dropping stale Tx primitive (current Fn=%u, 
prim Fn=%u)\n",
+   __func__, fn, prim->data_req.frame_nr);
+   msgb_free(msg);
+   }
+
return NULL;
 }


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


[S] Change in osmocom-bb[master]: l1gprs: migrate to gsm0502_fn_compare()

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


Change subject: l1gprs: migrate to gsm0502_fn_compare()
..

l1gprs: migrate to gsm0502_fn_compare()

Change-Id: I10261aa114b5dce3efee26ea84a1caa50c49a1d2
Depends: libosmocore.git I9590f2e836fc48650decf1564b6ab46306c4fe2d
Related: OS#5500
---
M src/shared/l1gprs.c
1 file changed, 12 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/22/34522/1

diff --git a/src/shared/l1gprs.c b/src/shared/l1gprs.c
index bfbda59..5f45614 100644
--- a/src/shared/l1gprs.c
+++ b/src/shared/l1gprs.c
@@ -344,19 +344,6 @@
  LOG_TBF_ARGS(preq), preq->start_fn);
 }

-/* Check if the current TDMA Fn is past the start TDMA Fn.
- * Based on fn_cmp() implementation from osmo-pcu.git, simplified. */
-static bool l1gprs_check_fn(uint32_t current, uint32_t start)
-{
-   const uint32_t thresh = GSM_TDMA_HYPERFRAME / 2;
-
-   if ((current < start && (start - current) < thresh) ||
-   (current > start && (current - start) > thresh))
-   return false;
-
-   return true;
-}
-
 /* Check the list of pending TBFs and move those with expired Fn to the active 
list */
 static void l1gprs_check_pending_tbfs(struct l1gprs_state *gprs, uint32_t fn)
 {
@@ -364,7 +351,7 @@
struct l1gprs_tbf *tbf;

llist_for_each_entry_safe(preq, tmp, >tbf_list_pending, list) {
-   if (!l1gprs_check_fn(fn, preq->start_fn))
+   if (gsm0502_fn_compare(fn, preq->start_fn) < 0)
continue;

LOGP_GPRS(gprs, LOGL_INFO,

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


[S] Change in osmo-pcu[master]: pdch_ul_controller: migrate from fn_cmp() to gsm0502_fn_compare()

2023-09-25 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/34521?usp=email )


Change subject: pdch_ul_controller: migrate from fn_cmp() to 
gsm0502_fn_compare()
..

pdch_ul_controller: migrate from fn_cmp() to gsm0502_fn_compare()

This function is also needed in osmocom-bb.git, so it becomes
a library function (part of libosmogsm).

Change-Id: I6a8502c2b2015ca7d0452ab9f5da0484a03ce91e
Depends: libosmocore.git I9590f2e836fc48650decf1564b6ab46306c4fe2d
---
M src/pdch_ul_controller.c
1 file changed, 17 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/21/34521/1

diff --git a/src/pdch_ul_controller.c b/src/pdch_ul_controller.c
index c0e26de..85bfdc9 100644
--- a/src/pdch_ul_controller.c
+++ b/src/pdch_ul_controller.c
@@ -43,20 +43,6 @@
{ 0, NULL }
 };

-#define GSM_MAX_FN_THRESH (GSM_MAX_FN >> 1)
-/* 0: equal, -1: fn1 BEFORE fn2, 1: fn1 AFTER fn2 */
-static inline int fn_cmp(uint32_t fn1, uint32_t fn2)
-{
-   if (fn1 == fn2)
-   return 0;
-   /* FN1 goes before FN2: */
-   if ((fn1 < fn2 && (fn2 - fn1) < GSM_MAX_FN_THRESH) ||
-   (fn1 > fn2 && (fn1 - fn2) > GSM_MAX_FN_THRESH))
-   return -1;
-   /* FN1 goes after FN2: */
-   return 1;
-}
-
 struct pdch_ulc *pdch_ulc_alloc(struct gprs_rlcmac_pdch *pdch, void *ctx)
 {
struct pdch_ulc* ulc;
@@ -78,7 +64,7 @@

while (node) {
it = rb_entry(node, struct pdch_ulc_node, node);
-   res = fn_cmp(it->fn, fn);
+   res = gsm0502_fn_compare(it->fn, fn);
if (res > 0) /* it->fn AFTER fn */
node = node->rb_left;
else if (res < 0) /* it->fn BEFORE fn */
@@ -167,7 +153,7 @@

for (node = rb_first(>tree_root); node; node = rb_next(node)) {
it = container_of(node, struct pdch_ulc_node, node);
-   res = fn_cmp(it->fn, check_fn);
+   res = gsm0502_fn_compare(it->fn, check_fn);
if (res > 0) { /* it->fn AFTER check_fn */
/* Next reserved FN is passed check_fn, hence it means 
check_fn is free */
return check_fn;
@@ -203,7 +189,7 @@
it = container_of(*n, struct pdch_ulc_node, node);

parent = *n;
-   res = fn_cmp(item->fn, it->fn);
+   res = gsm0502_fn_compare(item->fn, it->fn);
if (res < 0) { /* item->fn "BEFORE" it->fn */
n = &((*n)->rb_left);
} else if (res > 0) { /* item->fn "AFTER" it->fn */
@@ -305,7 +291,7 @@
struct rb_node *first;
while ((first = rb_first(>tree_root))) {
item = container_of(first, struct pdch_ulc_node, node);
-   res = fn_cmp(item->fn, fn);
+   res = gsm0502_fn_compare(item->fn, fn);
if (res > 0) /* item->fn AFTER fn */
break;
if (res < 0) { /* item->fn BEFORE fn */

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I6a8502c2b2015ca7d0452ab9f5da0484a03ce91e
Gerrit-Change-Number: 34521
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


[S] Change in libosmocore[master]: gsm: add gsm0502_fn_is_greater() for comparing TDMA FNs

2023-09-25 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34520?usp=email )


Change subject: gsm: add gsm0502_fn_is_greater() for comparing TDMA FNs
..

gsm: add gsm0502_fn_is_greater() for comparing TDMA FNs

We need this function in:

* osmocom-bb.git for trxcon and l1gprs,
* osmo-pcu.git replacing fn_cmp().

Change-Id: I9590f2e836fc48650decf1564b6ab46306c4fe2d
Related: OS#5500
---
M include/osmocom/gsm/gsm0502.h
M tests/gsm0502/gsm0502_test.c
2 files changed, 49 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/34520/1

diff --git a/include/osmocom/gsm/gsm0502.h b/include/osmocom/gsm/gsm0502.h
index ffd6e20..0d70aaf 100644
--- a/include/osmocom/gsm/gsm0502.h
+++ b/include/osmocom/gsm/gsm0502.h
@@ -6,6 +6,7 @@
 #pragma once

 #include 
+#include 

 #include 
 #include 
@@ -64,6 +65,20 @@
 #define GSM_NBITS_AB_GMSK_TAIL GSM_NBITS_NB_GMSK_TAIL
 #define GSM_NBITS_AB_GMSK_BURSTGSM_NBITS_NB_GMSK_BURST

+/* Check if the given TDMA Fn 'fn1' is greater than TDMA Fn 'fn2',
+ * taking the wrapping into account (i.e. 0 is greater than 2715647).
+ * Based on fn_cmp() implementation from osmo-pcu.git, simplified. */
+static inline bool gsm0502_fn_is_greater(uint32_t fn1, uint32_t fn2)
+{
+   const uint32_t thresh = GSM_TDMA_HYPERFRAME / 2;
+
+   if ((fn1 < fn2 && (fn2 - fn1) < thresh) ||
+   (fn1 > fn2 && (fn1 - fn2) > thresh))
+   return false;
+
+   return true;
+}
+
 /* Table 5 Clause 7 TS 05.02 */
 static inline unsigned int
 gsm0502_get_n_pag_blocks(const struct gsm48_control_channel_descr *chan_desc)
diff --git a/tests/gsm0502/gsm0502_test.c b/tests/gsm0502/gsm0502_test.c
index e9deaa9..6390d8b 100644
--- a/tests/gsm0502/gsm0502_test.c
+++ b/tests/gsm0502/gsm0502_test.c
@@ -148,8 +148,27 @@
printf("\n");
 }

+static void test_gsm0502_fn_is_greater(void)
+{
+   OSMO_ASSERT(gsm0502_fn_is_greater(42, 1337) == false);
+   OSMO_ASSERT(gsm0502_fn_is_greater(1337, 42) == true);
+   OSMO_ASSERT(gsm0502_fn_is_greater(42, 0)== true);
+
+   /* 2715642 is very close to the Fn period (GSM_TDMA_HYPERFRAME) */
+   OSMO_ASSERT(gsm0502_fn_is_greater(2715642, 42)  == false);
+   OSMO_ASSERT(gsm0502_fn_is_greater(42, 2715642)  == true);
+   OSMO_ASSERT(gsm0502_fn_is_greater(0, 2715642)   == true);
+
+   /* 1357824 is half of the Fn period (GSM_TDMA_HYPERFRAME) */
+   OSMO_ASSERT(gsm0502_fn_is_greater(1357820, 1357824) == false);
+   OSMO_ASSERT(gsm0502_fn_is_greater(1357820, 1357825) == false);
+   OSMO_ASSERT(gsm0502_fn_is_greater(1357824, 1357820) == true);
+   OSMO_ASSERT(gsm0502_fn_is_greater(1357825, 1357820) == true);
+}
+
 int main(int argc, char **argv)
 {
test_gsm0502_fn_remap();
+   test_gsm0502_fn_is_greater();
return EXIT_SUCCESS;
 }

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9590f2e836fc48650decf1564b6ab46306c4fe2d
Gerrit-Change-Number: 34520
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


[S] Change in osmo-msc[master]: SMS over GSUP: set source_name in GSUP reply messages

2023-09-25 Thread fixeria
Attention is currently required from: falconia, neels.

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

Change subject: SMS over GSUP: set source_name in GSUP reply messages
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I0b7f4760bdce8a38d43d3860086c6dfb7b390701
Gerrit-Change-Number: 34518
Gerrit-PatchSet: 2
Gerrit-Owner: falconia 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: neels 
Gerrit-Attention: falconia 
Gerrit-Attention: neels 
Gerrit-Comment-Date: Mon, 25 Sep 2023 14:11:52 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-msc[master]: SMS over GSUP: correctly route GSUP responses to MT SMS

2023-09-25 Thread fixeria
Attention is currently required from: falconia.

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

Change subject: SMS over GSUP: correctly route GSUP responses to MT SMS
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I436e333035b8f6e27f86a49fe293ea48ea07a013
Gerrit-Change-Number: 34517
Gerrit-PatchSet: 2
Gerrit-Owner: falconia 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: falconia 
Gerrit-Comment-Date: Mon, 25 Sep 2023 14:11:36 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmocom-bb[master]: modem: grr: implement RACH.req retransmission

2023-09-25 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34514?usp=email )

Change subject: modem: grr: implement RACH.req retransmission
..

modem: grr: implement RACH.req retransmission

Sometimes sending one Access Burst is not enough, so we need to repeat
sending it a few more more times changing the 3 LSBs randomly.  This
is what we already do in the mobile app, but not in the modem app.

* Rename GRR_EV_RACH_{REQ,CNF} to GRR_EV_CHAN_ACCESS_{REQ,CNF}.
* Rename VTY command 'grr tx-chan-req' to 'grr start-chan-access'.
* Add an intermediate state GRR_ST_PACKET_ACCESS.
** The GRR_EV_CHAN_ACCESS_REQ transitions to this state.
** One RACH.req gets transmitted when entering this state.
** The GRR_EV_CHAN_ACCESS_CNF confirms transmission of a RACH.req.
** Upon the timeout (300 ms) expiry, a loop state transition happens.
** After 3 loop-transitions, transition to GRR_ST_PACKET_NOT_READY.

Change-Id: Iab6d9147f6e0aeb99239affacf318a3897fd6ffe
Related: libosmo-gprs.git If0de3ed86b1e2897d70183f3b0f4fbfd7d2bda80
Related: OS#5500, OS#6131
---
M src/host/layer23/include/osmocom/bb/modem/grr.h
M src/host/layer23/src/modem/grr.c
M src/host/layer23/src/modem/rlcmac.c
M src/host/layer23/src/modem/vty.c
4 files changed, 189 insertions(+), 78 deletions(-)

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




diff --git a/src/host/layer23/include/osmocom/bb/modem/grr.h 
b/src/host/layer23/include/osmocom/bb/modem/grr.h
index 8235d59..99800ad 100644
--- a/src/host/layer23/include/osmocom/bb/modem/grr.h
+++ b/src/host/layer23/include/osmocom/bb/modem/grr.h
@@ -11,14 +11,15 @@
 enum grr_fsm_state {
GRR_ST_PACKET_NOT_READY,
GRR_ST_PACKET_IDLE,
+   GRR_ST_PACKET_ACCESS,
GRR_ST_PACKET_TRANSFER,
 };

 enum grr_fsm_event {
GRR_EV_BCCH_BLOCK_IND,
GRR_EV_PCH_AGCH_BLOCK_IND,
-   GRR_EV_RACH_REQ,
-   GRR_EV_RACH_CNF,
+   GRR_EV_CHAN_ACCESS_REQ,
+   GRR_EV_CHAN_ACCESS_CNF,
GRR_EV_PDCH_ESTABLISH_REQ,
GRR_EV_PDCH_RELEASE_REQ,
GRR_EV_PDCH_UL_TBF_CFG_REQ,
@@ -31,4 +32,3 @@
 extern struct osmo_fsm grr_fsm_def;

 int modem_grr_rslms_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx);
-uint8_t modem_grr_gen_chan_req(bool single_block);
diff --git a/src/host/layer23/src/modem/grr.c b/src/host/layer23/src/modem/grr.c
index af773a3..a029dd8 100644
--- a/src/host/layer23/src/modem/grr.c
+++ b/src/host/layer23/src/modem/grr.c
@@ -63,7 +63,7 @@
 }

 /* Generate an 8-bit CHANNEL REQUEST message as per 3GPP TS 44.018, 9.1.8 */
-uint8_t modem_grr_gen_chan_req(bool single_block)
+static uint8_t grr_gen_chan_req(bool single_block)
 {
uint8_t rnd = (uint8_t)rand();

@@ -408,7 +408,7 @@

switch (ch->c.msg_type) {
case RSL_MT_CHAN_CONF: /* RACH.conf */
-   return osmo_fsm_inst_dispatch(ms->grr_fi, GRR_EV_RACH_CNF,
+   return osmo_fsm_inst_dispatch(ms->grr_fi, 
GRR_EV_CHAN_ACCESS_CNF,
  (void *)>data[1]);
default:
LOGP(DRSL, LOGL_NOTICE, "Unhandled RSLms CCHAN message "
@@ -449,6 +449,78 @@

 #include  // XXX

+/* RACH re-transmission delay value (in ms) */
+#define GRR_PACKET_ACCESS_DELAY_MS 300
+/* RACH max number of transmissions */
+#define GRR_PACKET_ACCESS_MAX_CHAN_REQ 3
+
+static void handle_chan_access_req(struct osmo_fsm_inst *fi,
+  const struct osmo_gprs_rlcmac_l1ctl_prim *lp)
+{
+   struct osmocom_ms *ms = fi->priv;
+   struct gsm48_rrlayer *rr = >rrlayer;
+
+   if (lp->rach_req.is_11bit) { /* TODO: implement 11-bit RACH */
+   LOGPFSML(fi, LOGL_ERROR, "11-bit RACH is not supported\n");
+   return;
+   }
+
+   memset(>cr_hist[0], 0x00, sizeof(rr->cr_hist));
+   rr->chan_req_val = lp->rach_req.ra & ~0x07;
+   rr->n_chan_req = GRR_PACKET_ACCESS_MAX_CHAN_REQ;
+   rr->state = GSM48_RR_ST_CONN_PEND;
+
+   osmo_fsm_inst_state_chg_ms(fi, GRR_ST_PACKET_ACCESS,
+  GRR_PACKET_ACCESS_DELAY_MS, 0);
+}
+
+static void handle_pdch_establish_req(struct osmo_fsm_inst *fi,
+ const struct osmo_gprs_rlcmac_l1ctl_prim 
*lp)
+{
+   struct osmocom_ms *ms = fi->priv;
+
+   if (!lp->pdch_est_req.fh) {
+   LOGPFSML(fi, LOGL_INFO,
+"PDCH Establish.Req: TSC=%u, H0, ARFCN=%u\n",
+lp->pdch_est_req.tsc, lp->pdch_est_req.arfcn);
+   l1ctl_tx_dm_est_req_h0(ms, lp->pdch_est_req.arfcn,
+  RSL_CHAN_OSMO_PDCH | 
lp->pdch_est_req.ts_nr,
+  lp->pdch_est_req.tsc, GSM48_CMODE_SIGN, 
0);
+   } else {
+   /* 

[L] Change in osmocom-bb[master]: modem: grr: implement RACH.req retransmission

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

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

Change subject: modem: grr: implement RACH.req retransmission
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34514?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: Iab6d9147f6e0aeb99239affacf318a3897fd6ffe
Gerrit-Change-Number: 34514
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 25 Sep 2023 13:03:38 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-bts[master]: Do not prefix UI header to System Information Type 10

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

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

Change subject: Do not prefix UI header to System Information Type 10
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34519?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: Ifede42bfd84ea5914b559a20ae68f594d2ee1a5c
Gerrit-Change-Number: 34519
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Mon, 25 Sep 2023 12:59:54 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmocom-bb[master]: modem: grr: implement RACH.req retransmission

2023-09-25 Thread osmith
Attention is currently required from: fixeria, laforge, pespin.

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

Change subject: modem: grr: implement RACH.req retransmission
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34514?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: Iab6d9147f6e0aeb99239affacf318a3897fd6ffe
Gerrit-Change-Number: 34514
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 25 Sep 2023 09:12:59 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-bts[master]: Do not prefix UI header to System Information Type 10

2023-09-25 Thread jolly
jolly has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/34519?usp=email )


Change subject: Do not prefix UI header to System Information Type 10
..

Do not prefix UI header to System Information Type 10

System Information Type 10 uses short L2 header that is transmitted as
Bter UI frame. The complete frame is sent by BSC, including short L2
header. Only the SACCH layer 1 header is added by the BTS.

A switch() statement is used, so other System Information with short L2
header can be added in the future.

Change-Id: Ifede42bfd84ea5914b559a20ae68f594d2ee1a5c
---
M src/common/rsl.c
1 file changed, 25 insertions(+), 0 deletions(-)



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

diff --git a/src/common/rsl.c b/src/common/rsl.c
index f11ec0e..09723be 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -993,6 +993,15 @@
  *  \param[in] len length of \a current in octets */
 static inline void lapdm_ui_prefix(uint8_t *buf, uint32_t *valid, const 
uint8_t *current, uint8_t osmo_si, uint16_t len)
 {
+   /* Special case for short header SI. Do not pre-fix the two-byte UI 
header. */
+   switch (osmo_si) {
+   case SYSINFO_TYPE_10:
+   (*valid) |= (1 << osmo_si);
+   memset(buf, GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t));
+   memcpy(buf, current, len);
+   return;
+   }
+
/* We have to pre-fix with the two-byte LAPDM UI header */
if (len > sizeof(sysinfo_buf_t) - 2) {
LOGP(DRSL, LOGL_ERROR, "Truncating received SI%s (%u -> %zu) to 
prepend LAPDM UI header (2 bytes)\n",

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


[S] Change in osmo-bts[master]: ASCI: Ignore LAPD frames from MS, while the uplink is not active

2023-09-25 Thread jolly
jolly has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/34423?usp=email )

Change subject: ASCI: Ignore LAPD frames from MS, while the uplink is not active
..

ASCI: Ignore LAPD frames from MS, while the uplink is not active

Do not forward any message that is received on the uplink to LAPD while
the uplink is not active. If the MS did not recognize (fast enough) that
the uplink is free, it may continue to transmit LAPD messages. A
response by LAPD to these messages is not desired and not required. If
LAPD would respond, it would cause stopping transmission of UPLINK FREE
messages. No MS could access the uplink anymore.

Note: UPLINK FREE messages are repeated automatically until a different
  message is transmitted.

Related: OS#5781
Change-Id: I5075115123055b2997481f56ddf473430a1dc9e3
---
M src/common/l1sap.c
1 file changed, 34 insertions(+), 3 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/common/l1sap.c b/src/common/l1sap.c
index 13d271e..b828307 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1810,9 +1810,20 @@
if (lchan->ho.active == HANDOVER_WAIT_FRAME)
handover_frame(lchan);

-   /* report first valid received frame to VGCS talker process */
-   if (rsl_chan_rt_is_asci(lchan->rsl_chan_rt) && 
lchan->asci.talker_active == VGCS_TALKER_WAIT_FRAME)
-   vgcs_talker_frame(lchan);
+   if (rsl_chan_rt_is_asci(lchan->rsl_chan_rt)) {
+   /* report first valid received frame to VGCS talker process */
+   if (lchan->asci.talker_active == VGCS_TALKER_WAIT_FRAME)
+   vgcs_talker_frame(lchan);
+   /* Do not forward any message that is received on the uplink to 
LAPD while
+* the uplink is not active. If the MS did not recognize (fast 
enough) that
+* the uplink is free, it may continue to transmit LAPD 
messages. A
+* response by LAPD to these messages is not desired and not 
required. If
+* LAPD would respond, it would cause stopping transmission of 
UPLINK FREE
+* messages. No MS could access the uplink anymore.
+*/
+   if (lchan->asci.talker_active != VGCS_TALKER_ACTIVE)
+   return 0;
+   }

if (L1SAP_IS_LINK_SACCH(link_id))
le = >lapdm_ch.lapdm_acch;

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


[S] Change in osmo-bts[master]: ASCI: Ignore LAPD frames from MS, while the uplink is not active

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

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

Change subject: ASCI: Ignore LAPD frames from MS, while the uplink is not active
..


Patch Set 3:

(1 comment)

File src/common/l1sap.c:

https://gerrit.osmocom.org/c/osmo-bts/+/34423/comment/0e36e284_99f81354
PS2, Line 1817: /* Do not forward any message from the MS to 
LAPD while the uplink is not
> I did some rephrasing. I hope it it clear now.
Done



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34423?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: I5075115123055b2997481f56ddf473430a1dc9e3
Gerrit-Change-Number: 34423
Gerrit-PatchSet: 3
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Mon, 25 Sep 2023 06:21:29 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly 
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment