dexter has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32402 )
(
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: e1d: fix logic to detect if a timeslot is in use
......................................................................
e1d: fix logic to detect if a timeslot is in use
When we check bfd->fd, we also treat 0 as "not in use". This is not
correct since 0 is a valid file descriptor (STDIN). Since we reliably
initialize the file descriptor numbers to -1 on startup we can fix this.
So let's treat all positive file descriptor numbers, including zero as
an open timeslot.
Change-Id: I67bc5ca25620ff96441391798f761144570c8306
Related: OS#5983
---
M src/input/e1d.c
1 file changed, 23 insertions(+), 7 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
msuraev: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/input/e1d.c b/src/input/e1d.c
index 88b4548..e1a1526 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -427,17 +427,17 @@
lapd_instance_free(e1i_ts->lapd);
e1i_ts->lapd = NULL;
}
- if (bfd->fd) {
+ if (bfd->fd >= 0) {
close(bfd->fd);
bfd->fd = -1;
}
continue;
case E1INP_TS_TYPE_SIGN:
- if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
+ if (bfd->fd >= 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
bfd->fd = -1;
}
- if (bfd->fd <= 0) {
+ if (bfd->fd < 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
E1DP_TSMODE_HDLCFCS, D_BCHAN_TX_GRAN);
}
@@ -463,11 +463,11 @@
e1i_ts->lapd = NULL;
}
/* close, if old timeslot mode doesn't match new config */
- if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
+ if (bfd->fd >= 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
bfd->fd = -1;
}
- if (bfd->fd <= 0) {
+ if (bfd->fd < 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
E1DP_TSMODE_HDLCFCS, D_BCHAN_TX_GRAN);
}
@@ -487,11 +487,11 @@
e1i_ts->lapd = NULL;
}
/* close, if old timeslot mode doesn't match new config */
- if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_RAW) {
+ if (bfd->fd >= 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_RAW) {
close(bfd->fd);
bfd->fd = -1;
}
- if (bfd->fd <= 0) {
+ if (bfd->fd < 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
E1DP_TSMODE_RAW, D_BCHAN_TX_GRAN);
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32402
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I67bc5ca25620ff96441391798f761144570c8306
Gerrit-Change-Number: 32402
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: neels, pespin.
Hello osmith, Jenkins Builder, neels, fixeria, daniel,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/32549
to look at the new patch set (#3).
Change subject: Fix 'Fix parsing of TLV_TYPE_SINGLE_TV'
......................................................................
Fix 'Fix parsing of TLV_TYPE_SINGLE_TV'
A commit was merged recently attempting to fix decoding of
TLV_TYPE_SINGLE_TV. It did mostly a good job, but missed updating the
o_tag pointer used to fill in the structures.
This commit fixes that specific part missing.
Fixes: 559a6ee68359dab691a483573982e6f8c6439ae2
Change-Id: Id619459c17976b77cd2c7e4179123bb06807285c
---
M src/gsm/tlv_parser.c
M tests/tlv/tlv_test.c
2 files changed, 28 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/32549/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32549
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id619459c17976b77cd2c7e4179123bb06807285c
Gerrit-Change-Number: 32549
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
dexter has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32401 )
(
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: e1d: initialize file descriptor numbers to -1 on startup
......................................................................
e1d: initialize file descriptor numbers to -1 on startup
The file descriptor numbers (bfd->fd) are not initialized, this means
they are set to 0 in the beginning. This technically also means that
the file descriptors point to STDIN, which is wrong. Let's use the
line_create callback of driver to initialize them to -1.
Change-Id: I2de8fccad56279748ed9cc035aebf4e2d3935172
Related: OS#5983
---
M src/input/e1d.c
1 file changed, 31 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
msuraev: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/input/e1d.c b/src/input/e1d.c
index 01da96d..88b4548 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -519,10 +519,26 @@
return 0;
}
+static int e1d_line_create(struct e1inp_line *line)
+{
+ int ts;
+
+ for (ts = 1; ts < line->num_ts; ts++) {
+ unsigned int idx = ts - 1;
+ struct e1inp_ts *e1i_ts = &line->ts[idx];
+ struct osmo_fd *bfd = &e1i_ts->driver.e1d.fd;
+
+ bfd->fd = -1;
+ }
+
+ return 0;
+}
+
struct e1inp_driver e1d_driver = {
.name = "e1d",
.want_write = e1d_want_write,
.line_update = e1d_line_update,
+ .line_create = e1d_line_create,
};
int e1inp_e1d_init(void)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32401
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I2de8fccad56279748ed9cc035aebf4e2d3935172
Gerrit-Change-Number: 32401
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
dexter has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32400 )
Change subject: e1_input: add new driver callback function: line_create
......................................................................
e1_input: add new driver callback function: line_create
When a line is created using e1inp_line_create, then the line data
structures are initialized and the line is registered in the line list.
struct e1inp_line also contains driver specific sub structs that,
depending on the driver, might also need some initialization. At the
moment is no way. Let's add a line_create callback that, when
populated by the driver, is executed on line creation.
Related: OS#5983
Change-Id: I404fa23e9b8a952be84e9716889c0dbbbc665d22
---
M TODO-RELEASE
M include/osmocom/abis/e1_input.h
M src/e1_input.c
3 files changed, 31 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
dexter: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 5f2f654..99d9735 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -9,3 +9,4 @@
#library what description / commit summary line
libosmo-abis struct e1inp_driver Field added at the end (ABI break)
libosmocodec >1.8.0 osmo_{fr,efr}_sid_classify() new functions
+libosmo-abis struct e1inp_driver Field added (line_create callback) at the end (ABI break)
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index a66f8eb..b40382e 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -190,6 +190,9 @@
/* Set Sa bits to transmit in TS0 (MSB to LSB): Sa8 Sa7 Sa5 Sa4 Sa64 Sa63 Sa62 Sa61/Sa6 */
int (*set_sa_bits)(struct e1inp_line *line, uint8_t sa_bits);
+
+ /* Optional callback to perform driver specific initialization when the line is created. */
+ int (*line_create)(struct e1inp_line *line);
};
struct e1inp_line_ops {
diff --git a/src/e1_input.c b/src/e1_input.c
index e3ac67e..6fca307 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -639,8 +639,16 @@
line->use_count.talloc_object = line;
line->use_count.use_cb = e1inp_line_use_cb;
- e1inp_line_get2(line, "ctor");
+ if (driver->line_create) {
+ if (driver->line_create(line) < 0) {
+ LOGPIL(line, DLINP, LOGL_ERROR, "Cannot initialize line driver\n");
+ talloc_free(line);
+ return NULL;
+ }
+ }
+
+ e1inp_line_get2(line, "ctor");
llist_add_tail(&line->list, &e1inp_line_list);
return line;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32400
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I404fa23e9b8a952be84e9716889c0dbbbc665d22
Gerrit-Change-Number: 32400
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: msuraev <msuraev(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: msuraev.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32400 )
Change subject: e1_input: add new driver callback function: line_create
......................................................................
Patch Set 5:
(2 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmo-abis/+/32400/comment/babd4388_cbe09c04
PS4, Line 14: moment is no way to do that, so lets add a line_create callback that,
> "moment there is no way" sounds better
Done
File src/e1_input.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/32400/comment/08f53764_d379ce44
PS4, Line 646: return NULL;
> That looks pretty important - shouldn't we log smth to let lib user know why the line wasn't created […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32400
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I404fa23e9b8a952be84e9716889c0dbbbc665d22
Gerrit-Change-Number: 32400
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: msuraev <msuraev(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 02 May 2023 13:01:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: msuraev <msuraev(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: msuraev.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-abis/+/32400
to look at the new patch set (#5).
Change subject: e1_input: add new driver callback function: line_create
......................................................................
e1_input: add new driver callback function: line_create
When a line is created using e1inp_line_create, then the line data
structures are initialized and the line is registered in the line list.
struct e1inp_line also contains driver specific sub structs that,
depending on the driver, might also need some initialization. At the
moment is no way. Let's add a line_create callback that, when
populated by the driver, is executed on line creation.
Related: OS#5983
Change-Id: I404fa23e9b8a952be84e9716889c0dbbbc665d22
---
M TODO-RELEASE
M include/osmocom/abis/e1_input.h
M src/e1_input.c
3 files changed, 31 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/00/32400/5
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32400
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I404fa23e9b8a952be84e9716889c0dbbbc665d22
Gerrit-Change-Number: 32400
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: msuraev <msuraev(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-MessageType: newpatchset
dexter has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32392 )
Change subject: e1d: do not set fd number to 0 after close
......................................................................
e1d: do not set fd number to 0 after close
0 is reserved for STDIN, so lets not set the file descriptor to 0 after
we close it. Lets use -1 instead.
Change-Id: I72e4775135caf4e3727c4f0654a545478c73bb83
Related: OS#5983
---
M src/input/e1d.c
1 file changed, 17 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/input/e1d.c b/src/input/e1d.c
index 44a710d..01da96d 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -429,13 +429,13 @@
}
if (bfd->fd) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
continue;
case E1INP_TS_TYPE_SIGN:
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
@@ -465,7 +465,7 @@
/* close, if old timeslot mode doesn't match new config */
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
@@ -489,7 +489,7 @@
/* close, if old timeslot mode doesn't match new config */
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_RAW) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32392
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I72e4775135caf4e3727c4f0654a545478c73bb83
Gerrit-Change-Number: 32392
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: merged