[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

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

Change subject: mobile: handle V.24 line status updates from V.110 TA
..

mobile: handle V.24 line status updates from V.110 TA

Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336
Related: OS#4396
---
M src/host/layer23/src/mobile/tch_data.c
1 file changed, 36 insertions(+), 2 deletions(-)

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




diff --git a/src/host/layer23/src/mobile/tch_data.c 
b/src/host/layer23/src/mobile/tch_data.c
index 7169efa..451f267 100644
--- a/src/host/layer23/src/mobile/tch_data.c
+++ b/src/host/layer23/src/mobile/tch_data.c
@@ -187,11 +187,35 @@
osmo_soft_uart_tx_ubits(state->suart, buf, buf_size);
 }

+static const struct {
+   enum osmo_v110_ta_circuit c;
+   enum osmo_soft_uart_status s;
+} tch_v110_circuit_map[] = {
+   { OSMO_V110_TA_C_106, OSMO_SUART_STATUS_F_CTS },
+   { OSMO_V110_TA_C_107, OSMO_SUART_STATUS_F_DSR },
+   { OSMO_V110_TA_C_109, OSMO_SUART_STATUS_F_DCD },
+};
+
 static void tch_v110_ta_status_update_cb(void *priv, unsigned int status)
 {
-   LOGP(DCSD, LOGL_DEBUG, "%s(): [status=0x%08x]\n", __func__, status);
+   const struct tch_data_state *state = (struct tch_data_state *)priv;

-   /* TODO: update status lines of the soft-UART (if state.suart != NULL) 
*/
+   LOGP(DCSD, LOGL_DEBUG, "V.110 TA status mask=0x%08x\n", status);
+
+   for (unsigned int i = 0; i < ARRAY_SIZE(tch_v110_circuit_map); i++) {
+   enum osmo_v110_ta_circuit c = tch_v110_circuit_map[i].c;
+   enum osmo_soft_uart_status s = tch_v110_circuit_map[i].s;
+   bool is_on = (status & (1 << c)) != 0;
+
+   LOGP(DCSD, LOGL_DEBUG, "V.110 TA circuit %s (%s) is %s\n",
+osmo_v110_ta_circuit_name(c),
+osmo_v110_ta_circuit_desc(c),
+is_on ? "ON" : "OFF");
+
+   /* update status lines of the soft-UART */
+   if (state->suart != NULL)
+   osmo_soft_uart_set_status_line(state->suart, s, is_on);
+   }
 }

 struct osmo_v110_ta *tch_v110_ta_alloc(struct osmocom_ms *ms,

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


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-24 Thread fixeria
Attention is currently required from: laforge.

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

Change subject: mobile: handle V.24 line status updates from V.110 TA
..


Patch Set 5: Code-Review+2

(1 comment)

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

https://gerrit.osmocom.org/c/osmocom-bb/+/35640/comment/ff805358_8b36fb52
PS2, Line 210:  LOGP(DL1C, LOGL_NOTICE, "V.110 TA circuit %s (%s) is 
%s\n",
> RTS/CTS flow control will happen *all the time* in any realistic scenario 
> where you have a backlog o […]
Ack. Let's simply use `DEBUG` then.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35640?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: I05ba2e10fefe3cae687831b5ced971aa244ad336
Gerrit-Change-Number: 35640
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Wed, 24 Jan 2024 16:55:45 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-24 Thread pespin
Attention is currently required from: fixeria.

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

Change subject: mobile: handle V.24 line status updates from V.110 TA
..


Patch Set 5: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35640?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: I05ba2e10fefe3cae687831b5ced971aa244ad336
Gerrit-Change-Number: 35640
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Wed, 24 Jan 2024 16:51:46 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-24 Thread fixeria
Attention is currently required from: fixeria.

Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmocom-bb/+/35640?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: mobile: handle V.24 line status updates from V.110 TA
..

mobile: handle V.24 line status updates from V.110 TA

Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336
Related: OS#4396
---
M src/host/layer23/src/mobile/tch_data.c
1 file changed, 36 insertions(+), 2 deletions(-)


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


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-24 Thread laforge
Attention is currently required from: fixeria.

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

Change subject: mobile: handle V.24 line status updates from V.110 TA
..


Patch Set 4:

(1 comment)

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

https://gerrit.osmocom.org/c/osmocom-bb/+/35640/comment/d18acff1_e7e7b1ea
PS2, Line 210:  LOGP(DL1C, LOGL_NOTICE, "V.110 TA circuit %s (%s) is 
%s\n",
> I agree in genral, but I don't expect the circuit state to change too often, 
> unless the flow control […]
RTS/CTS flow control will happen *all the time* in any realistic scenario where 
you have a backlog of to be transmitted data.  This is nothing a user ever 
wants to read about.

If you need higher log priority for things like DTR, then you have to 
differentiate between those two.  But for normal flow control it  should 
definitely not be anything > DEBUG.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35640?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: I05ba2e10fefe3cae687831b5ced971aa244ad336
Gerrit-Change-Number: 35640
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Wed, 24 Jan 2024 08:38:48 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-22 Thread fixeria
Attention is currently required from: laforge.

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

Change subject: mobile: handle V.24 line status updates from V.110 TA
..


Patch Set 3:

(1 comment)

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

https://gerrit.osmocom.org/c/osmocom-bb/+/35640/comment/540f71ec_ebfe76da
PS2, Line 210:  LOGP(DL1C, LOGL_NOTICE, "V.110 TA circuit %s (%s) is 
%s\n",
> this is something that happens on aregular basis, IMHO it should be DEBUG and 
> not NOTICE. […]
I agree in genral, but I don't expect the circuit state to change too often, 
unless the flow control is employed. Even in the later case, `LOGL_INFO` should 
be ok.

See also: https://gerrit.osmocom.org/c/osmocom-bb/+/35656.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35640?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: I05ba2e10fefe3cae687831b5ced971aa244ad336
Gerrit-Change-Number: 35640
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Mon, 22 Jan 2024 21:30:33 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-22 Thread fixeria
Attention is currently required from: fixeria.

Hello Jenkins Builder,

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

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

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

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


Change subject: mobile: handle V.24 line status updates from V.110 TA
..

mobile: handle V.24 line status updates from V.110 TA

Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336
Related: OS#4396
---
M src/host/layer23/src/mobile/tch_data.c
1 file changed, 36 insertions(+), 2 deletions(-)


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


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-20 Thread laforge
Attention is currently required from: fixeria.

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

Change subject: mobile: handle V.24 line status updates from V.110 TA
..


Patch Set 2:

(1 comment)

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

https://gerrit.osmocom.org/c/osmocom-bb/+/35640/comment/ea3b3bc3_bc9728e2
PS2, Line 210:  LOGP(DL1C, LOGL_NOTICE, "V.110 TA circuit %s (%s) is 
%s\n",
this is something that happens on aregular basis, IMHO it should be DEBUG and 
not NOTICE. Also, it might be worth considering adding a new log subsystem for 
the TA related features?



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35640?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: I05ba2e10fefe3cae687831b5ced971aa244ad336
Gerrit-Change-Number: 35640
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Sat, 20 Jan 2024 08:39:39 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-19 Thread fixeria
Hello Jenkins Builder,

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

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

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

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


Change subject: mobile: handle V.24 line status updates from V.110 TA
..

mobile: handle V.24 line status updates from V.110 TA

Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336
Related: OS#4396
---
M src/host/layer23/src/mobile/tch_data.c
1 file changed, 36 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/40/35640/2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35640?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: I05ba2e10fefe3cae687831b5ced971aa244ad336
Gerrit-Change-Number: 35640
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA

2024-01-19 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/35640?usp=email )


Change subject: mobile: handle V.24 line status updates from V.110 TA
..

mobile: handle V.24 line status updates from V.110 TA

Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336
Related: OS#4396
---
M src/host/layer23/src/mobile/tch_data.c
1 file changed, 35 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/40/35640/1

diff --git a/src/host/layer23/src/mobile/tch_data.c 
b/src/host/layer23/src/mobile/tch_data.c
index 6ee89dc..920fd38 100644
--- a/src/host/layer23/src/mobile/tch_data.c
+++ b/src/host/layer23/src/mobile/tch_data.c
@@ -187,11 +187,34 @@
osmo_soft_uart_tx_ubits(state->suart, buf, buf_size);
 }

+static const struct tch_v110_circuit_map_item {
+   enum osmo_v110_ta_circuit c;
+   enum osmo_soft_uart_status s;
+} tch_v110_circuit_map[] = {
+   { OSMO_V110_TA_C_106, OSMO_SUART_STATUS_F_CTS },
+   { OSMO_V110_TA_C_107, OSMO_SUART_STATUS_F_DSR },
+   { OSMO_V110_TA_C_109, OSMO_SUART_STATUS_F_DCD },
+};
+
 static void tch_v110_ta_status_update_cb(void *priv, unsigned int status)
 {
-   LOGP(DL1C, LOGL_DEBUG, "%s(): [status=0x%08x]\n", __func__, status);
+   const struct tch_data_state *state = (struct tch_data_state *)priv;

-   /* TODO: update status lines of the soft-UART (if state.suart != NULL) 
*/
+   LOGP(DL1C, LOGL_DEBUG, "V.110 TA status mask=0x%08x\n", status);
+
+   for (unsigned int i = 0; i < ARRAY_SIZE(tch_v110_circuit_map); i++) {
+   const struct tch_v110_circuit_map_item *item = 
&tch_v110_circuit_map[i];
+   bool is_on = (status & (1 << item->c)) != 0;
+
+   LOGP(DL1C, LOGL_NOTICE, "V.110 TA circuit %s (%s) is %s\n",
+osmo_v110_ta_circuit_name(item->c),
+osmo_v110_ta_circuit_desc(item->c),
+is_on ? "ON" : "OFF");
+
+   /* update status lines of the soft-UART */
+   if (state->suart != NULL)
+   osmo_soft_uart_set_status_line(state->suart, item->s, 
is_on);
+   }
 }

 struct osmo_v110_ta *tch_v110_ta_alloc(struct osmocom_ms *ms,

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