summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte2011-08-09 11:21:23 +0200
committerPablo Neira Ayuso2011-08-16 13:46:06 +0200
commitf3ca61c5cd49603d04eea167cca9fbcdc82154e4 (patch)
treedd351b729fa27e2f7f7c69d2fede8793ffed8b9d
parentinclude: add missing ipa.h to Makefile.am so make distcheck works again (diff)
downloadlibosmo-abis-f3ca61c5cd49603d04eea167cca9fbcdc82154e4.tar.gz
libosmo-abis-f3ca61c5cd49603d04eea167cca9fbcdc82154e4.tar.xz
libosmo-abis-f3ca61c5cd49603d04eea167cca9fbcdc82154e4.zip
DAHDI: Fix case where we have multiple E1 ports/cards (spans)
DAHDI creates one device node for every E1 timeslot, starting from '1', and keeps incrementing that number even for additional ports/cards. Thus, we have to use the e1inp_line number multiplied by 31 as a base.
-rw-r--r--src/input/dahdi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/input/dahdi.c b/src/input/dahdi.c
index f0d12b7..3adfa18 100644
--- a/src/input/dahdi.c
+++ b/src/input/dahdi.c
@@ -415,11 +415,17 @@ static int dahdi_e1_setup(struct e1inp_line *line)
char openstr[128];
struct e1inp_ts *e1i_ts = &line->ts[idx];
struct osmo_fd *bfd = &e1i_ts->driver.dahdi.fd;
+ int dev_nr;
+
+ /* DAHDI device names/numbers just keep incrementing
+ * even over multiple boards. So TS1 of the second
+ * board will be 32 */
+ dev_nr = line->num * (NUM_E1_TS-1) + ts;
bfd->data = line;
bfd->priv_nr = ts;
bfd->cb = dahdi_fd_cb;
- snprintf(openstr, sizeof(openstr), "/dev/dahdi/%d", ts);
+ snprintf(openstr, sizeof(openstr), "/dev/dahdi/%d", dev_nr);
switch (e1i_ts->type) {
case E1INP_TS_TYPE_NONE: