aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-01-13 00:40:04 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-14 21:47:30 +0100
commit4cd68dc4d772e367851a5d26dcc558fec8fd0e7b (patch)
tree8701e8d93db60b867bcc382f59b11728fae64209 /src/common/bts.c
parenteab71534efee978576713618099b2e4dafe05419 (diff)
bts: Use msgb_dequeue and msgb_enqueue for the AGCH queue
The TODO item still applies to somehow limit the queue of incoming messages and drop older ones first. A sane limit would be the number of channels (+ or * 2).
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 19bdd3be..1e418497 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -402,24 +402,17 @@ int lchan_init_lapdm(struct gsm_lchan *lchan)
int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg)
{
- struct gsm_bts_role_bts *btsb = bts_role_bts(bts);;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
/* FIXME: implement max queue length */
- llist_add_tail(&msg->list, &btsb->agch_queue);
+ msgb_enqueue(&btsb->agch_queue, msg);
return 0;
}
struct msgb *bts_agch_dequeue(struct gsm_bts *bts)
{
- struct gsm_bts_role_bts *btsb = bts_role_bts(bts);;
- struct msgb *msg;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
- if (llist_empty(&btsb->agch_queue))
- return NULL;
-
- msg = llist_entry(btsb->agch_queue.next, struct msgb, list);
- llist_del(&msg->list);
-
- return msg;
+ return msgb_dequeue(&btsb->agch_queue);
}