diff options
author | Harald Welte <laforge@osmocom.org> | 2020-01-12 12:31:45 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-01-12 14:24:24 +0100 |
commit | ccf84ea3ddd55cedea3cc722d0560558029347de (patch) | |
tree | 54e2e431d01472a916cdb82571c9b2649be1143d | |
parent | 52e14129f20c6ec2fc129ed436f9c941dc714775 (diff) |
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
-rw-r--r-- | src/input/e1d.c | 14 |
1 files changed, 11 insertions, 3 deletions
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 @@ e1d_line_update(struct e1inp_line *line) 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 @@ e1d_line_update(struct e1inp_line *line) } 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); |