Jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30450 )
Change subject: Send raw data with mISDN as it arrives from application
......................................................................
Send raw data with mISDN as it arrives from application
The application is responsible to send raw data in sync with the
raw data it receives. It also cares about sending data in advance,
to prevent underruns, if required
Change-Id: Ib311331fbbeff3661f6745e3474918987a8aa460
---
M src/input/misdn.c
1 file changed, 5 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/50/30450/1
diff --git a/src/input/misdn.c b/src/input/misdn.c
index 580bee0..00627f3 100644
--- a/src/input/misdn.c
+++ b/src/input/misdn.c
@@ -392,7 +392,7 @@
}
/* write to a raw channel TS */
-static int handle_ts_raw_write(struct osmo_fd *bfd, unsigned int len)
+static int handle_ts_raw_write(struct osmo_fd *bfd)
{
struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr;
@@ -403,14 +403,9 @@
/* get the next msg for this timeslot */
msg = e1inp_tx_ts(e1i_ts, NULL);
- if (!msg)
+ if (!msg) {
+ osmo_fd_write_disable(bfd);
return 0;
-
- if (msg->len != len) {
- /* This might lead to a transmit underrun, as we call tx
- * from the rx path, as there's no select/poll on dahdi
- * */
- LOGPITS(e1i_ts, DLINP, LOGL_NOTICE, "unexpected msg->len = %u, expected %u\n", msg->len, len);
}
LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "RAW CHAN TX: %s\n", osmo_hexdump(msg->data, msg->len));
@@ -460,8 +455,6 @@
msg->l2h = msg->data;
LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "RAW CHAN RX: %s\n",
osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
- /* the number of bytes received indicates that data to send */
- handle_ts_raw_write(bfd, msgb_l2len(msg));
return e1inp_rx_ts(e1i_ts, msg, 0, 0);
case PH_ACTIVATE_IND:
case PH_DATA_CNF:
@@ -586,9 +579,8 @@
case E1INP_TS_TYPE_RAW:
if (what & OSMO_FD_READ)
rc = handle_ts_raw_read(bfd);
- /* We never include the mISDN B-Channel FD into the
- * writeset, since it doesn't support poll() based
- * write flow control */
+ if (what & OSMO_FD_WRITE)
+ rc = handle_ts_raw_write(bfd);
break;
case E1INP_TS_TYPE_HDLC:
if (what & OSMO_FD_READ)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30450
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ib311331fbbeff3661f6745e3474918987a8aa460
Gerrit-Change-Number: 30450
Gerrit-PatchSet: 1
Gerrit-Owner: Jolly <andreas(a)eversberg.eu>
Gerrit-MessageType: newchange