summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-08-09 11:21:23 +0200
committerHarald Welte <laforge@gnumonks.org>2011-08-09 22:05:42 +0200
commit0b69bc34d78073c568c03bf59af3d36e8ff057e6 (patch)
treec3b89e4e1cadce0a064958ba3ad2896631d08375
parentcdf76cff9f06f4c0ee98207862648334425e211a (diff)
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--openbsc/src/libabis/input/dahdi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/libabis/input/dahdi.c b/openbsc/src/libabis/input/dahdi.c
index 6f8983763..a7b45a1af 100644
--- a/openbsc/src/libabis/input/dahdi.c
+++ b/openbsc/src/libabis/input/dahdi.c
@@ -421,11 +421,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: