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/libosmo-abis/+/18933 )
Change subject: e1_input: Support I.460 timeslot type
......................................................................
e1_input: Support I.460 timeslot type
Unlike the legacy TRAU mode, this only adds I460 mux/demux,
without any TRAU frame synchronization. The user must still be
adding the actual sub-channels using osmo_i460_subchan_add()
depending on his requirements.
Change-Id: I44da6dfec77ef475adb35001a0e4fa11d549aa02
---
M include/osmocom/abis/e1_input.h
M src/e1_input.c
M src/input/dahdi.c
M src/input/e1d.c
M src/input/misdn.c
5 files changed, 41 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/33/18933/1
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index 8230e44..cdd5b7c 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -8,6 +8,7 @@
#include <osmocom/core/timer.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/select.h>
+#include <osmocom/gsm/i460_mux.h>
#include <osmocom/abis/subchan_demux.h>
#include <osmocom/abis/lapd.h>
@@ -72,9 +73,10 @@
E1INP_TS_TYPE_TRAU,
E1INP_TS_TYPE_RAW,
E1INP_TS_TYPE_HDLC,
+ E1INP_TS_TYPE_I460,
};
const char *e1inp_tstype_name(enum e1inp_ts_type tp);
-extern const struct value_string e1inp_ts_type_names[6];
+extern const struct value_string e1inp_ts_type_names[];
/* A timeslot in the E1 interface */
struct e1inp_ts {
@@ -114,6 +116,9 @@
/* queue of pending to-be-transmitted msgbs */
struct llist_head tx_queue;
} hdlc;
+ struct {
+ struct osmo_i460_timeslot i460_ts;
+ } i460;
};
union {
struct {
diff --git a/src/e1_input.c b/src/e1_input.c
index 9ea4f17..79393b0 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -43,6 +43,7 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/signal.h>
#include <osmocom/core/endian.h>
+#include <osmocom/gsm/i460_mux.h>
#include <osmocom/abis/e1_input.h>
#define NUM_E1_TS 32
@@ -240,12 +241,13 @@
return get_value_string(e1inp_sign_type_names, tp);
}
-const struct value_string e1inp_ts_type_names[6] = {
+const struct value_string e1inp_ts_type_names[] = {
{ E1INP_TS_TYPE_NONE, "None" },
{ E1INP_TS_TYPE_SIGN, "Signalling" },
{ E1INP_TS_TYPE_TRAU, "TRAU" },
{ E1INP_TS_TYPE_RAW, "RAW" },
{ E1INP_TS_TYPE_HDLC, "HDLC" },
+ { E1INP_TS_TYPE_I460, "I460" },
{ 0, NULL }
};
@@ -312,6 +314,17 @@
return 0;
}
+int e1inp_ts_config_i460(struct e1inp_ts *ts, struct e1inp_line *line)
+{
+ if (ts->type == E1INP_TS_TYPE_I460 && ts->line && line)
+ return 0;
+
+ ts->type = E1INP_TS_TYPE_I460;
+ ts->line = line;
+ osmo_i460_ts_init(&ts->i460.i460_ts);
+ return 0;
+}
+
void e1inp_ts_name(char *out, size_t out_len, const struct e1inp_ts *ts)
{
if (ts->line->name)
@@ -656,6 +669,10 @@
case E1INP_TS_TYPE_HDLC:
ts->hdlc.recv_cb(ts, msg);
break;
+ case E1INP_TS_TYPE_I460:
+ osmo_i460_demux_in(&ts->i460.i460_ts, msg->l2h, msgb_l2len(msg));
+ msgb_free(msg);
+ break;
default:
ret = -EINVAL;
LOGPITS(ts, DLMI, LOGL_ERROR, "unknown TS type %u\n", ts->type);
@@ -786,6 +803,13 @@
/* Get msgb from tx_queue */
msg = msgb_dequeue(&e1i_ts->hdlc.tx_queue);
break;
+ case E1INP_TS_TYPE_I460:
+ msg = msgb_alloc(TSX_ALLOC_SIZE, "I460_TX");
+ if (!msg)
+ return NULL;
+ len = osmo_i460_mux_out(&e1i_ts->i460.i460_ts, msg->data, 40);
+ msgb_put(msg, len);
+ break;
default:
LOGPITS(e1i_ts, DLMI, LOGL_ERROR, "unsupported E1 TS type %u\n", e1i_ts->type);
return NULL;
diff --git a/src/input/dahdi.c b/src/input/dahdi.c
index a461f27..075b7ff 100644
--- a/src/input/dahdi.c
+++ b/src/input/dahdi.c
@@ -198,7 +198,8 @@
/* We never include the DAHDI B-Channel FD into the
* writeset, since it doesn't support poll() based
* write flow control */
- if (e1i_ts->type == E1INP_TS_TYPE_TRAU) {
+ if (e1i_ts->type == E1INP_TS_TYPE_TRAU ||
+ e1i_ts->type == E1INP_TS_TYPE_I460) {
LOGPITS(e1i_ts, DLINP, LOGL_DEBUG, "Trying to write TRAU ts\n");
return 0;
}
@@ -501,6 +502,7 @@
handle_hdlc_write(bfd);
break;
case E1INP_TS_TYPE_TRAU:
+ case E1INP_TS_TYPE_I460:
if (what & BSC_FD_EXCEPT)
handle_dahdi_exception(e1i_ts);
if (what & BSC_FD_READ)
@@ -702,6 +704,7 @@
return ret;
break;
case E1INP_TS_TYPE_TRAU:
+ case E1INP_TS_TYPE_I460:
case E1INP_TS_TYPE_RAW:
/* close/release LAPD instance, if any */
if (e1i_ts->lapd) {
diff --git a/src/input/e1d.c b/src/input/e1d.c
index f7a0b18..617c747 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -162,7 +162,8 @@
e1d_want_write(struct e1inp_ts *e1i_ts)
{
/* We never include the DAHDI B-Channel FD into the writeset */
- if (e1i_ts->type == E1INP_TS_TYPE_TRAU) {
+ if (e1i_ts->type == E1INP_TS_TYPE_TRAU ||
+ e1i_ts->type == E1INP_TS_TYPE_I460) {
LOGPITS(e1i_ts, DLINP, LOGL_DEBUG, "Trying to write TRAU ts\n");
return 0;
}
@@ -285,6 +286,7 @@
bfd->when = BSC_FD_READ;
break;
case E1INP_TS_TYPE_TRAU:
+ case E1INP_TS_TYPE_I460:
case E1INP_TS_TYPE_RAW:
/* close/release LAPD instance, if any */
if (e1i_ts->lapd) {
diff --git a/src/input/misdn.c b/src/input/misdn.c
index 564d008..9fe2989 100644
--- a/src/input/misdn.c
+++ b/src/input/misdn.c
@@ -213,7 +213,8 @@
/* We never include the mISDN B-Channel FD into the
* writeset, since it doesn't support poll() based
* write flow control */
- if (e1i_ts->type == E1INP_TS_TYPE_TRAU)
+ if (e1i_ts->type == E1INP_TS_TYPE_TRAU ||
+ e1i_ts->type == E1INP_TS_TYPE_I460)
return 0;
e1i_ts->driver.misdn.fd.when |= BSC_FD_WRITE;
@@ -615,6 +616,7 @@
bfd->when = BSC_FD_READ;
break;
case E1INP_TS_TYPE_TRAU:
+ case E1INP_TS_TYPE_I460:
case E1INP_TS_TYPE_RAW:
bfd->fd = socket(PF_ISDN, SOCK_DGRAM, ISDN_P_B_RAW);
/* We never include the mISDN B-Channel FD into the
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/18933
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I44da6dfec77ef475adb35001a0e4fa11d549aa02
Gerrit-Change-Number: 18933
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/20200620/33b611c0/attachment.htm>