aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-19 20:47:12 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:10 +0100
commitcedf89092849569a8bc5e89b83d89b421c7bbdfa (patch)
treedfecfa2a7613c8c87ffc37616421e89a4db1e8aa /src/bts.cpp
parent621dc2fd010dbcde6c6a202d48d427afbf6a2e1a (diff)
sba: Create a SBAController that will manage the sbas for a BTS
The PollController is a friend of the SBAController and is allowed to access the internal list. The list is hidden from everyone else. This is done because the calculation of timeout should belong into the PollController and not into the SBAController.
Diffstat (limited to 'src/bts.cpp')
-rw-r--r--src/bts.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 3d0fc335..353451c6 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -64,6 +64,7 @@ struct gprs_rlcmac_bts *bts_main_data()
BTS::BTS()
: m_cur_fn(0)
, m_pollController(*this)
+ , m_sba(*this)
{
memset(&m_bts, 0, sizeof(m_bts));
m_bts.bts = this;
@@ -165,10 +166,10 @@ void gprs_rlcmac_pdch::disable()
m_is_enabled = 0;
}
-void gprs_rlcmac_pdch::free_resources(uint8_t trx, uint8_t ts)
+/* TODO: kill the parameter and make a pdch belong to a trx.. to a bts.. */
+void gprs_rlcmac_pdch::free_resources(BTS *bts, uint8_t trx, uint8_t ts)
{
struct gprs_rlcmac_paging *pag;
- struct gprs_rlcmac_sba *sba, *sba2;
/* we are not enabled. there should be no resources */
if (!is_enabled())
@@ -181,12 +182,7 @@ void gprs_rlcmac_pdch::free_resources(uint8_t trx, uint8_t ts)
while ((pag = dequeue_paging()))
talloc_free(pag);
- llist_for_each_entry_safe(sba, sba2, &gprs_rlcmac_sbas, list) {
- if (sba->trx == trx && sba->ts == ts) {
- llist_del(&sba->list);
- talloc_free(sba);
- }
- }
+ bts->sba()->free_resources(trx, ts);
}
struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging()