Change in libosmo-abis[master]: e1d: Use line->port_nr to specify e1d interface/line

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.org
Sun Jan 12 14:37:41 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/16822 )

Change subject: e1d: Use line->port_nr to specify e1d interface/line
......................................................................

e1d: Use line->port_nr to specify e1d interface/line

This way we can support more than one E1 line via osmo-e1d.  As
neither mISDN nor DAHDI distinguish between mutliple cards of single
ports vs. multi-port cards, we havee to map both interface + line number
into a single uint8_t.

Change-Id: I3b6975624a0155a68d2c67bfdbc1fb751fb50b13
---
M src/input/e1d.c
1 file changed, 11 insertions(+), 3 deletions(-)

Approvals:
  tnt: 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 c15c081..e111d14 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -179,11 +179,17 @@
 	int ts;
 	int ret;
 
+	/* we use higher 4 bits for interface, lower 4 bits for line,
+	 * resulting in max. 16 interfaces with 16 lines each */
+	uint8_t e1d_intf = (line->port_nr >> 4) & 0xF;
+	uint8_t e1d_line = line->port_nr & 0xF;
+
 	if (line->driver != &e1d_driver)
 		return -EINVAL;
 
 
-	LOGP(DLINP, LOGL_ERROR, "Line update %d %d %d\n", line->num, line->port_nr, line->num_ts);
+	LOGP(DLINP, LOGL_NOTICE, "Line update %d %d=E1D(%d:%d) %d\n", line->num, line->port_nr,
+		e1d_intf, e1d_line, line->num_ts);
 
 	for (ts=1; ts<line->num_ts; ts++)
 	{
@@ -212,8 +218,10 @@
 			}
                         continue;
 		case E1INP_TS_TYPE_SIGN:
-			if (bfd->fd <= 0)
-				bfd->fd = osmo_e1dp_client_ts_open(g_e1d, 0, 0, ts, E1DP_TSMODE_HDLCFCS);
+			if (bfd->fd <= 0) {
+				bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
+								   E1DP_TSMODE_HDLCFCS);
+			}
 			if (bfd->fd < 0) {
 				LOGP(DLINP, LOGL_ERROR,
 					"Could not open timeslot %d\n", ts);

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/16822
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I3b6975624a0155a68d2c67bfdbc1fb751fb50b13
Gerrit-Change-Number: 16822
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Assignee: tnt <tnt at 246tNt.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200112/8769ccdd/attachment.htm>


More information about the gerrit-log mailing list