jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/31034 )
Change subject: Add setting of Sa bits to misdn driver ......................................................................
Add setting of Sa bits to misdn driver
Change-Id: I54205a2534a7638cc071888d853f9d6d312dc9f0 --- M src/input/misdn.c 1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/34/31034/1
diff --git a/src/input/misdn.c b/src/input/misdn.c index 815eb53..c97d3e5 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -293,6 +293,27 @@ return 0; }
+static int set_sa_bits(struct e1inp_line *line, uint8_t sa_bits) +{ + struct e1inp_ts *e1i_ts = &line->ts[16-1]; + struct osmo_fd *bfd = &e1i_ts->driver.misdn.fd; + uint8_t buffer[sizeof(struct mISDNhead) + sizeof(int)]; + struct mISDNhead *hh = (struct mISDNhead *)buffer; + int *info = (int *)(buffer + sizeof(struct mISDNhead)); + int ret; + + LOGP(DLMI, LOGL_DEBUG, "MPH_INFORMATION_REQ\n"); + + hh->prim = MPH_INFORMATION_REQ; + hh->id = TEI_SAPI | (GROUP_TEI << 8); /* manager address */ + *info = L1_SIGNAL_SA_BITS | sa_bits; + + ret = write(bfd->fd, &buffer, sizeof(buffer)); + if (ret < 0) + LOGP(DLINP, LOGL_ERROR, "MPH_INFORMATION_REQ returns %d\n", ret); + return ret; +} + static void timeout_ts1_write(void *data) { struct e1inp_ts *e1i_ts = (struct e1inp_ts *)data; @@ -715,6 +736,7 @@ struct e1inp_driver misdn_driver = { .name = "misdn", .want_write = ts_want_write, + .set_sa_bits = set_sa_bits, .default_delay = 50000, .line_update = &mi_e1_line_update, };