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 submitted this change. ( 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(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index 44708bb..9b99f12 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -9,6 +9,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> @@ -73,9 +74,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 { @@ -115,6 +117,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 df61c7b..04c464a 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -44,6 +44,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 @@ -241,12 +242,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 } }; @@ -313,6 +315,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) @@ -679,6 +692,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); @@ -809,6 +826,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, 160); + 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 a29a233..e59518a 100644 --- a/src/input/dahdi.c +++ b/src/input/dahdi.c @@ -199,7 +199,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; } @@ -498,6 +499,7 @@ * writeset, since it doesn't support poll() based * write flow control */ break; + case E1INP_TS_TYPE_I460: case E1INP_TS_TYPE_RAW: if (what & OSMO_FD_EXCEPT) handle_dahdi_exception(e1i_ts); @@ -685,6 +687,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 e3a3b82..3ae1d89 100644 --- a/src/input/e1d.c +++ b/src/input/e1d.c @@ -310,7 +310,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; } @@ -429,6 +430,7 @@ bfd->when = OSMO_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 52cd311..0237cb9 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 |= OSMO_FD_WRITE; @@ -611,6 +612,7 @@ bfd->when = OSMO_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: 5 Gerrit-Owner: laforge <laforge at osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210203/c495416c/attachment.htm>