laforge submitted this change.
Move lchan_dl_tch_queue_enqueue to lchan.c and make it public
It will be used too by osmux code present in another file. This is a
preparation commit to simplify the one adding osmux support.
Change-Id: Ie7fa57bb04db9ad9b03971467e12ee7b8e4c190a
---
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/lchan.c
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h
index 64b7efa..484fccc 100644
--- a/include/osmo-bts/lchan.h
+++ b/include/osmo-bts/lchan.h
@@ -360,6 +360,8 @@
int lchan_rtp_socket_connect(struct gsm_lchan *lchan, const struct in_addr *ia, uint16_t connect_port);
void lchan_rtp_socket_free(struct gsm_lchan *lchan);
+void lchan_dl_tch_queue_enqueue(struct gsm_lchan *lchan, struct msgb *msg, unsigned int limit);
+
static inline bool lchan_is_dcch(const struct gsm_lchan *lchan)
{
switch (lchan->type) {
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 640ff57..acb2683 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -152,19 +152,6 @@
return GSM_RTP_DURATION;
}
-/*! limit number of queue entries to %u; drops any surplus messages */
-static void lchan_dl_tch_queue_enqueue(struct gsm_lchan *lchan, struct msgb *msg, unsigned int limit)
-{
- if (lchan->dl_tch_queue_len > limit)
- LOGPLCHAN(lchan, DL1P, LOGL_NOTICE, "freeing %d queued frames\n",
- lchan->dl_tch_queue_len - limit);
- while (lchan->dl_tch_queue_len > limit) {
- struct msgb *tmp = msgb_dequeue_count(&lchan->dl_tch_queue, &lchan->dl_tch_queue_len);
- msgb_free(tmp);
- }
- msgb_enqueue_count(&lchan->dl_tch_queue, msg, &lchan->dl_tch_queue_len);
-}
-
/* allocate a msgb containing a osmo_phsap_prim + optional l2 data
* in order to wrap femtobts header around l2 data, there must be enough space
* in front and behind data pointer */
diff --git a/src/common/lchan.c b/src/common/lchan.c
index c7d8d45..c521f26 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -641,3 +641,16 @@
msgb_queue_free(&lchan->dl_tch_queue);
lchan->dl_tch_queue_len = 0;
}
+
+/*! limit number of queue entries to %u; drops any surplus messages */
+void lchan_dl_tch_queue_enqueue(struct gsm_lchan *lchan, struct msgb *msg, unsigned int limit)
+{
+ if (lchan->dl_tch_queue_len > limit)
+ LOGPLCHAN(lchan, DL1P, LOGL_NOTICE, "freeing %d queued frames\n",
+ lchan->dl_tch_queue_len - limit);
+ while (lchan->dl_tch_queue_len > limit) {
+ struct msgb *tmp = msgb_dequeue_count(&lchan->dl_tch_queue, &lchan->dl_tch_queue_len);
+ msgb_free(tmp);
+ }
+ msgb_enqueue_count(&lchan->dl_tch_queue, msg, &lchan->dl_tch_queue_len);
+}
To view, visit change 29045. To unsubscribe, or for help writing mail filters, visit settings.