Jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30447 )
Change subject: Add missing functions to send HDLC/RAW data ......................................................................
Add missing functions to send HDLC/RAW data
Change-Id: Iebcb99f491b945d364b1044a59638524637dd8b2 --- M include/osmocom/abis/e1_input.h M src/e1_input.c 2 files changed, 33 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/47/30447/1
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index a466ef6..919c2f5 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -365,4 +365,7 @@ int abis_sendmsg(struct msgb *msg); int abis_rsl_sendmsg(struct msgb *msg);
+int e1inp_ts_send_raw(struct e1inp_ts *ts, struct msgb *msg); +int e1inp_ts_send_hdlc(struct e1inp_ts *ts, struct msgb *msg); + #endif /* _E1_INPUT_H */ diff --git a/src/e1_input.c b/src/e1_input.c index ee529cc..6dd9374 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -331,6 +331,36 @@ return abis_sendmsg(msg); }
+int e1inp_ts_send_raw(struct e1inp_ts *ts, struct msgb *msg) +{ + struct e1inp_driver *driver; + + OSMO_ASSERT(ts->type == E1INP_TS_TYPE_RAW); + + /* notify the driver we have something to write */ + driver = ts->line->driver; + driver->want_write(ts); + + msgb_enqueue(&ts->raw.tx_queue, msg); + + return 0; +} + +int e1inp_ts_send_hdlc(struct e1inp_ts *ts, struct msgb *msg) +{ + struct e1inp_driver *driver; + + OSMO_ASSERT(ts->type == E1INP_TS_TYPE_HDLC); + + /* notify the driver we have something to write */ + driver = ts->line->driver; + driver->want_write(ts); + + msgb_enqueue(&ts->hdlc.tx_queue, msg); + + return 0; +} + /* Timeslot */ int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line, int (*trau_rcv_cb)(struct subch_demux *dmx, int ch,