[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-19 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email )

 (

3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: Indicate change in received Sa bits
..

Indicate change in received Sa bits

Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
---
M src/e1d.h
M src/intf_line.c
M src/mux_demux.c
3 files changed, 24 insertions(+), 1 deletion(-)

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




diff --git a/src/e1d.h b/src/e1d.h
index 3188cfc..4b70c0f 100644
--- a/src/e1d.h
+++ b/src/e1d.h
@@ -148,6 +148,8 @@
uint8_t prev_errmask;
/*! timer to re-set the rx_crc4_err and rx_alarm above */
struct osmo_timer_list timer;
+   /*! last received frame with Sa bits */
+   uint8_t rx_frame;
} ts0;

/* watchdog timer to catch situations where no more USB data is 
received */
diff --git a/src/intf_line.c b/src/intf_line.c
index 4433e96..b3dafff 100644
--- a/src/intf_line.c
+++ b/src/intf_line.c
@@ -272,6 +272,7 @@
line->intf = intf;
line->drv_data = drv_data;
line->mode = E1_LINE_MODE_CHANNELIZED;
+   line->ts0.rx_frame = 0xff;

for (int i = 0; i < 32; i++)
_ts_init(>ts[i], line, i);
diff --git a/src/mux_demux.c b/src/mux_demux.c
index abe01a3..71374ef 100644
--- a/src/mux_demux.c
+++ b/src/mux_demux.c
@@ -378,8 +378,8 @@
const uint8_t *frame = buf + i*32;
uint8_t frame_nr = (frame_base + i) & 0xf;

-   /* A bit is present in each odd frame */
if (frame_nr % 2) {
+   /* A bit is present in each odd frame */
if (frame[0] & 0x20) {
if (!(line->ts0.cur_errmask & 
E1L_TS0_RX_ALARM)) {
line->ts0.cur_errmask |= 
E1L_TS0_RX_ALARM;
@@ -394,6 +394,17 @@
   line->intf->id, 
line->id, 0, NULL, 0);
}
}
+   /* SA bits changed */
+   if (line->ts0.rx_frame != (frame[0] | 0xe0)) {
+   uint8_t sa_bits = ((frame[0] & 0x01) << 7) | /* 
Sa8 -> Bit 7 */
+ ((frame[0] & 0x02) << 5) | /* 
Sa7 -> Bit 6 */
+ ((frame[0] & 0x04) >> 2) | /* 
Sa6 -> Bit 0 */
+ ((frame[0] & 0x08) << 2) | /* 
Sa5 -> Bit 5 */
+ (frame[0] & 0x10); /* Sa4 -> 
Bit 4 */
+   line->ts0.rx_frame = frame[0] | 0xe0;
+   osmo_e1dp_server_event(line->intf->e1d->srv, 
E1DP_EVT_SABITS,
+  line->intf->id, 
line->id, 0, _bits, 1);
+   }
}

/* E bits are present in frame 13 + 15 */

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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 5
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-MessageType: merged


[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-19 Thread jolly
Attention is currently required from: jolly.

Hello Jenkins Builder, laforge, tnt,

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

https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email

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

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

The change is no longer submittable: Verified is unsatisfied now.


Change subject: Indicate change in received Sa bits
..

Indicate change in received Sa bits

Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
---
M src/e1d.h
M src/intf_line.c
M src/mux_demux.c
3 files changed, 24 insertions(+), 1 deletion(-)


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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 5
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Attention: jolly 
Gerrit-MessageType: newpatchset


[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-18 Thread jolly
Attention is currently required from: jolly.

Hello Jenkins Builder, laforge, tnt,

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

https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email

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

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

The change is no longer submittable: Verified is unsatisfied now.


Change subject: Indicate change in received Sa bits
..

Indicate change in received Sa bits

Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
---
M src/e1d.h
M src/intf_line.c
M src/mux_demux.c
3 files changed, 24 insertions(+), 1 deletion(-)


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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 4
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Attention: jolly 
Gerrit-MessageType: newpatchset


[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-18 Thread laforge
Attention is currently required from: jolly.

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

Change subject: Indicate change in received Sa bits
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 3
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Thu, 18 Jan 2024 08:56:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-15 Thread tnt
Attention is currently required from: jolly.

tnt has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email )

Change subject: Indicate change in received Sa bits
..


Patch Set 3: Code-Review+1


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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 3
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Tue, 16 Jan 2024 07:40:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-14 Thread tnt
Attention is currently required from: jolly.

tnt has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email )

Change subject: Indicate change in received Sa bits
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Sun, 14 Jan 2024 18:37:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-14 Thread laforge
Attention is currently required from: jolly, tnt.

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

Change subject: Indicate change in received Sa bits
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Attention: jolly 
Gerrit-Attention: tnt 
Gerrit-Comment-Date: Sun, 14 Jan 2024 17:26:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-e1d[master]: Indicate change in received Sa bits

2024-01-14 Thread jolly
jolly has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email )


Change subject: Indicate change in received Sa bits
..

Indicate change in received Sa bits

Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
---
M src/e1d.h
M src/intf_line.c
M src/mux_demux.c
3 files changed, 24 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/61/35561/1

diff --git a/src/e1d.h b/src/e1d.h
index ec264c7..74010ba 100644
--- a/src/e1d.h
+++ b/src/e1d.h
@@ -148,6 +148,8 @@
uint8_t prev_errmask;
/*! timer to re-set the rx_crc4_err and rx_alarm above */
struct osmo_timer_list timer;
+   /*! last received frame with Sa bits */
+   uint8_t rx_frame;
} ts0;

/* watchdog timer to catch situations where no more USB data is 
received */
diff --git a/src/intf_line.c b/src/intf_line.c
index 4433e96..b3dafff 100644
--- a/src/intf_line.c
+++ b/src/intf_line.c
@@ -272,6 +272,7 @@
line->intf = intf;
line->drv_data = drv_data;
line->mode = E1_LINE_MODE_CHANNELIZED;
+   line->ts0.rx_frame = 0xff;

for (int i = 0; i < 32; i++)
_ts_init(>ts[i], line, i);
diff --git a/src/mux_demux.c b/src/mux_demux.c
index abe01a3..71374ef 100644
--- a/src/mux_demux.c
+++ b/src/mux_demux.c
@@ -378,8 +378,8 @@
const uint8_t *frame = buf + i*32;
uint8_t frame_nr = (frame_base + i) & 0xf;

-   /* A bit is present in each odd frame */
if (frame_nr % 2) {
+   /* A bit is present in each odd frame */
if (frame[0] & 0x20) {
if (!(line->ts0.cur_errmask & 
E1L_TS0_RX_ALARM)) {
line->ts0.cur_errmask |= 
E1L_TS0_RX_ALARM;
@@ -394,6 +394,17 @@
   line->intf->id, 
line->id, 0, NULL, 0);
}
}
+   /* SA bits changed */
+   if (line->ts0.rx_frame != (frame[0] | 0xe0)) {
+   uint8_t sa_bits = ((frame[0] & 0x01) << 7) | /* 
Sa8 -> Bit 7 */
+ ((frame[0] & 0x02) << 5) | /* 
Sa7 -> Bit 6 */
+ ((frame[0] & 0x04) >> 2) | /* 
Sa6 -> Bit 0 */
+ ((frame[0] & 0x08) << 2) | /* 
Sa5 -> Bit 5 */
+ (frame[0] & 0x10); /* Sa4 -> 
Bit 4 */
+   line->ts0.rx_frame = frame[0] | 0xe0;
+   osmo_e1dp_server_event(line->intf->e1d->srv, 
E1DP_EVT_SABITS,
+  line->intf->id, 
line->id, 0, _bits, 1);
+   }
}

/* E bits are present in frame 13 + 15 */

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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-MessageType: newchange