This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/19229 )
Change subject: introduce concept of superchannel to data structures + CTL
......................................................................
introduce concept of superchannel to data structures + CTL
We treat the superchannel as an extra, separate timeslot. Initially
I thought of simply re-using TS1, but keeping the superchannel
separate ensures that it doesn't inherit any state (like half-sent
HDLC frames) from another timeslot when we switch between the modes
at runtime.
Change-Id: I0aacf251e155de2bb6ad03ffc4181067b22f1c90
---
M include/osmocom/e1d/proto.h
M src/ctl.c
M src/e1d.h
M src/intf_line.c
4 files changed, 30 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/29/19229/1
diff --git a/include/osmocom/e1d/proto.h b/include/osmocom/e1d/proto.h
index 56064b8..6711332 100644
--- a/include/osmocom/e1d/proto.h
+++ b/include/osmocom/e1d/proto.h
@@ -71,6 +71,7 @@
#define E1DP_MAGIC 0x00e1
#define E1DP_MAX_LEN 4096
+#define E1DP_TS_SUPERCHAN 0xfe
#define E1DP_INVALID 0xff
#define E1DP_DEFAULT_SOCKET "/tmp/osmo-e1d.ctl"
diff --git a/src/ctl.c b/src/ctl.c
index 482366f..5322ab4 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -68,7 +68,12 @@
static struct e1_ts *
_e1d_get_ts(struct e1_line *line, uint8_t ts)
{
- return (ts < 32) ? &line->ts[ts] : NULL;
+ if (ts < 32)
+ return &line->ts[ts];
+ else if (ts == E1DP_TS_SUPERCHAN)
+ return &line->superchan;
+ else
+ return NULL;
}
static void
diff --git a/src/e1d.h b/src/e1d.h
index f556e8f..2b8e32b 100644
--- a/src/e1d.h
+++ b/src/e1d.h
@@ -55,15 +55,28 @@
int fd;
};
+enum e1_line_mode {
+ /* 31 individual 64k timeslots, as used on 3GPP Abis, 3GPP A or ISDN */
+ E1_LINE_MODE_CHANNELIZED,
+ /* 1 channel group spanning all 31 TS, as used e.g. when using Frame Relay
+ * or raw HDLC over channelized E1. */
+ E1_LINE_MODE_SUPERCHANNEL,
+};
+
struct e1_line {
struct llist_head list;
struct e1_intf *intf;
uint8_t id;
+ enum e1_line_mode mode;
+
void *drv_data;
+ /* timeslots for channelized mode */
struct e1_ts ts[32];
+ /* superchannel */
+ struct e1_ts superchan;
};
enum e1_driver {
diff --git a/src/intf_line.c b/src/intf_line.c
index 5994805..75da211 100644
--- a/src/intf_line.c
+++ b/src/intf_line.c
@@ -90,6 +90,13 @@
talloc_free(intf);
}
+static void ts_init(struct e1_ts *ts, struct e1_line *line, int id)
+{
+ ts->line = line;
+ ts->id = id;
+ ts->fd = -1;
+}
+
struct e1_line *
e1_line_new(struct e1_intf *intf, void *drv_data)
{
@@ -100,12 +107,12 @@
line->intf = intf;
line->drv_data = drv_data;
+ line->mode = E1_LINE_MODE_CHANNELIZED;
for (int i=0; i<32; i++) {
- line->ts[i].line = line;
- line->ts[i].id = i;
- line->ts[i].fd = -1;
+ ts_init(&line->ts[i], line, i);
}
+ ts_init(&line->superchan, line, 255);
INIT_LLIST_HEAD(&line->list);
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/19229
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I0aacf251e155de2bb6ad03ffc4181067b22f1c90
Gerrit-Change-Number: 19229
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200712/4ef8a538/attachment.htm>