aboutsummaryrefslogtreecommitdiffstats
path: root/src/llc.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-04 17:10:54 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-18 12:11:27 +0100
commit550bb88a9e70b90b60720b0612e136c3467c5281 (patch)
treea868b221757db79f8f6449bcffbd4dfbc19417b0 /src/llc.cpp
parent88553abf4d9390ab0f2a5fddad0cb034696ed370 (diff)
llc: Count the number of frames queued inside the LLC queue
Diffstat (limited to 'src/llc.cpp')
-rw-r--r--src/llc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/llc.cpp b/src/llc.cpp
index e5d56465..b756d338 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -42,6 +42,7 @@ void gprs_llc::reset_frame_space()
void gprs_llc::enqueue(struct msgb *llc_msg)
{
+ m_queue_size += 1;
msgb_enqueue(&queue, llc_msg);
}
@@ -67,16 +68,21 @@ void gprs_llc::clear(BTS *bts)
bts->llc_dropped_frame();
msgb_free(msg);
}
+
+ m_queue_size = 0;
}
void gprs_llc::init()
{
INIT_LLIST_HEAD(&queue);
+ m_queue_size = 0;
reset();
}
struct msgb *gprs_llc::dequeue()
{
+ if (m_queue_size > 0)
+ m_queue_size -= 1;
return msgb_dequeue(&queue);
}