pespin has uploaded this change for review.

View Change

osmux: Drop long time deprecated APIs

Those APIs where deprecated 4 years ago (end of Aug 2018), and they have
been used since around that time. Hence it can be considered safe to
drop them, since they only make the whole code more complex to
understand.

API osmux_xfrm_output_init() is left since openbsc.git is still using
it.

Related: OS#5987
Change-Id: Icbdd364a8161a8113dbf1406716946f684d0a853
---
M include/osmocom/netif/osmux.h
M src/osmux.c
2 files changed, 0 insertions(+), 116 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/56/29256/1
diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h
index ff537c0..8d39344 100644
--- a/include/osmocom/netif/osmux.h
+++ b/include/osmocom/netif/osmux.h
@@ -110,13 +110,9 @@
void osmux_xfrm_output_init(struct osmux_out_handle *h, uint32_t rtp_ssrc) OSMO_DEPRECATED("Use osmux_xfrm_output_init2() instead");
void osmux_xfrm_output_init2(struct osmux_out_handle *h, uint32_t rtp_ssrc, uint8_t rtp_payload_type);
void osmux_xfrm_output_set_tx_cb(struct osmux_out_handle *h, void (*tx_cb)(struct msgb *msg, void *data), void *data);
-int osmux_xfrm_output(struct osmux_hdr *osmuxh, struct osmux_out_handle *h, struct llist_head *list) OSMO_DEPRECATED("Use osmux_xfrm_output_sched() instead");
int osmux_xfrm_output_sched(struct osmux_out_handle *h, struct osmux_hdr *osmuxh);
void osmux_xfrm_output_flush(struct osmux_out_handle *h);
struct osmux_hdr *osmux_xfrm_output_pull(struct msgb *msg);
-
-void osmux_tx_sched(struct llist_head *list, void (*tx_cb)(struct msgb *msg, void *data), void *data) OSMO_DEPRECATED("Use osmux_xfrm_output_set_tx_cb() instead");
-
/*! @} */

#endif
diff --git a/src/osmux.c b/src/osmux.c
index c43c3eb..990216e 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -191,46 +191,6 @@
return out_msg;
}

-int osmux_xfrm_output(struct osmux_hdr *osmuxh, struct osmux_out_handle *h,
- struct llist_head *list)
-{
- struct msgb *msg;
- int i;
-
- INIT_LLIST_HEAD(list);
-
- for (i=0; i<osmuxh->ctr+1; i++) {
- struct rtp_hdr *rtph;
-
- msg = osmux_rebuild_rtp(h, osmuxh,
- osmux_get_payload(osmuxh) +
- i * osmo_amr_bytes(osmuxh->amr_ft),
- osmo_amr_bytes(osmuxh->amr_ft), !i);
- if (msg == NULL)
- continue;
-
- rtph = osmo_rtp_get_hdr(msg);
- if (rtph == NULL)
- continue;
-
-#ifdef DEBUG_MSG
- {
- char buf[4096];
-
- osmo_rtp_snprintf(buf, sizeof(buf), msg);
- buf[sizeof(buf)-1] = '\0';
- LOGP(DLMUX, LOGL_DEBUG, "to BTS: %s\n", buf);
- }
-#endif
- llist_add_tail(&msg->list, list);
- }
-
- /* Update last seen seq number: */
- h->osmux_seq_ack = osmuxh->seq;
-
- return i;
-}
-
static void osmux_xfrm_output_trigger(void *data)
{
struct osmux_out_handle *h = data;
@@ -924,80 +884,8 @@
struct msgb *msg;
void (*tx_cb)(struct msgb *msg, void *data);
void *data;
-#ifdef DEBUG_TIMING
- struct timeval start;
- struct timeval when;
-#endif
};

-static void osmux_tx_cb(void *data)
-{
- struct osmux_tx_handle *h = data;
-#ifdef DEBUG_TIMING
- struct timeval now, diff;
-
- osmo_gettimeofday(&now, NULL);
- timersub(&now, &h->start, &diff);
- timersub(&diff,&h->when, &diff);
- LOGP(DLMUX, LOGL_DEBUG, "we are lagging %lu.%.6lu in scheduled "
- "transmissions\n", diff.tv_sec, diff.tv_usec);
-#endif
-
- h->tx_cb(h->msg, h->data);
-
- talloc_free(h);
-}
-
-static void
-osmux_tx(struct msgb *msg, struct timeval *when,
- void (*tx_cb)(struct msgb *msg, void *data), void *data)
-{
- struct osmux_tx_handle *h;
-
- h = talloc_zero(osmux_ctx, struct osmux_tx_handle);
- if (h == NULL)
- return;
-
- h->msg = msg;
- h->tx_cb = tx_cb;
- h->data = data;
- osmo_timer_setup(&h->timer, osmux_tx_cb, h);
-
-#ifdef DEBUG_TIMING
- osmo_gettimeofday(&h->start, NULL);
- h->when.tv_sec = when->tv_sec;
- h->when.tv_usec = when->tv_usec;
-#endif
- /* send it now */
- if (when->tv_sec == 0 && when->tv_usec == 0) {
- osmux_tx_cb(h);
- return;
- }
- osmo_timer_schedule(&h->timer, when->tv_sec, when->tv_usec);
-}
-
-void
-osmux_tx_sched(struct llist_head *list,
- void (*tx_cb)(struct msgb *msg, void *data), void *data)
-{
- struct msgb *cur, *tmp;
- struct timeval delta = { .tv_sec = 0, .tv_usec = DELTA_RTP_MSG };
- struct timeval when;
-
- timerclear(&when);
-
- llist_for_each_entry_safe(cur, tmp, list, list) {
-
-#ifdef DEBUG_MSG
- LOGP(DLMUX, LOGL_DEBUG, "scheduled transmision in %lu.%6lu "
- "seconds, msg=%p\n", when.tv_sec, when.tv_usec, cur);
-#endif
- llist_del(&cur->list);
- osmux_tx(cur, &when, tx_cb, data);
- timeradd(&when, &delta, &when);
- }
-}
-
void osmux_xfrm_output_init2(struct osmux_out_handle *h, uint32_t rtp_ssrc, uint8_t rtp_payload_type)
{
memset(h, 0, sizeof(*h));

To view, visit change 29256. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Icbdd364a8161a8113dbf1406716946f684d0a853
Gerrit-Change-Number: 29256
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange