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.
This commit is contained in:
Harald Welte 2011-08-09 11:21:23 +02:00
parent cdf76cff9f
commit 0b69bc34d7
1 changed files with 7 additions and 1 deletions

View File

@ -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: