aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_l1_if.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-19 17:37:48 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:09 +0100
commit17b0d83a1f1a153b21b198f101294c8ed9e172ac (patch)
tree0cd522f1ed4ec659bddaf36eaff8623c94c3eeb5 /src/pcu_l1_if.cpp
parentba5543fbf3f31819d63d4d6c019fe08893c32889 (diff)
pdch: Move enable/disable into the PDCH code
When a PDCH is disabled all resources should be freed. This is currently not possible as the PDCH does not know where it belongs to. On top of that the list (and other resources) should be properly initialized on construction so that disable() is idempotent and does not check if it was disabled. During the re-factoring I noticed that during a sysmobts re-start some resources are not freed. I left a warning in the code to resolve this issue later.
Diffstat (limited to 'src/pcu_l1_if.cpp')
-rw-r--r--src/pcu_l1_if.cpp40
1 files changed, 7 insertions, 33 deletions
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 438bfa8..49c9147 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -295,28 +295,6 @@ static int pcu_rx_rach_ind(struct gsm_pcu_if_rach_ind *rach_ind)
return rc;
}
-int flush_pdch(struct gprs_rlcmac_pdch *pdch, uint8_t trx, uint8_t ts)
-{
- struct gprs_rlcmac_paging *pag;
- struct gprs_rlcmac_sba *sba, *sba2;
-
- /* kick all TBF on slot */
- gprs_rlcmac_tbf::free_all(pdch);
-
- /* flush all pending paging messages */
- while ((pag = gprs_rlcmac_dequeue_paging(pdch)))
- 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);
- }
- }
-
- return 0;
-}
-
static int pcu_rx_info_ind(struct gsm_pcu_if_info_ind *info_ind)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@@ -342,11 +320,8 @@ bssgp_failed:
/* free all TBF */
for (trx = 0; trx < 8; trx++) {
bts->trx[trx].arfcn = info_ind->trx[trx].arfcn;
- for (ts = 0; ts < 8; ts++) {
- if (bts->trx[trx].pdch[ts].enable)
- flush_pdch(&bts->trx[trx].pdch[ts],
- trx, ts);
- }
+ for (ts = 0; ts < 8; ts++)
+ bts->trx[trx].pdch[ts].free_resources(trx, ts);
}
gprs_bssgp_destroy_or_exit();
return 0;
@@ -465,7 +440,7 @@ bssgp_failed:
pdch = &bts->trx[trx].pdch[ts];
if ((info_ind->trx[trx].pdch_mask & (1 << ts))) {
/* FIXME: activate dynamically at RLCMAC */
- if (!pdch->enable) {
+ if (!pdch->is_enabled()) {
#ifdef ENABLE_SYSMODSP
if ((info_ind->flags &
PCU_IF_FLAG_SYSMO))
@@ -473,17 +448,16 @@ bssgp_failed:
bts->trx[trx].fl1h, ts);
#endif
pcu_tx_act_req(trx, ts, 1);
- INIT_LLIST_HEAD(&pdch->paging_list);
- pdch->enable = 1;
+ pdch->enable();
}
pdch->tsc = info_ind->trx[trx].tsc[ts];
LOGP(DL1IF, LOGL_INFO, "PDCH: trx=%d ts=%d\n",
trx, ts);
} else {
- if (pdch->enable) {
+ if (pdch->is_enabled()) {
pcu_tx_act_req(trx, ts, 0);
- pdch->enable = 0;
- flush_pdch(pdch, trx, ts);
+ pdch->free_resources(trx, ts);
+ pdch->disable();
}
}
}