diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-20 16:37:05 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-30 21:24:10 +0100 |
commit | 09ef27ae04a11e758de81939ff479445d38e0b6d (patch) | |
tree | 90c0590149a8de8af5b32ef46960462bfc6281e4 /src/sba.cpp | |
parent | 4ed1dae5339bb85b98afa245ae37b1eb4925724a (diff) |
pdch: Simplify the reset code, rename variables to XYZ_no
Simplify the reset code now that the PDCH can know where it is
located. Rename the variables in the sba to trx_no and ts_no as
it stores the number and not the actual thing.
Diffstat (limited to 'src/sba.cpp')
-rw-r--r-- | src/sba.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sba.cpp b/src/sba.cpp index 4b856e00..73968118 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -73,8 +73,8 @@ int SBAController::alloc( fn = (pdch->last_rts_fn + AGCH_START_OFFSET) % 2715648; - sba->trx = trx; - sba->ts = ts; + sba->trx_no = trx; + sba->ts_no = ts; sba->fn = fn; sba->ta = ta; @@ -91,7 +91,7 @@ gprs_rlcmac_sba *SBAController::find(uint8_t trx, uint8_t ts, uint32_t fn) struct gprs_rlcmac_sba *sba; llist_for_each_entry(sba, &m_sbas, list) { - if (sba->trx == trx && sba->ts == ts && sba->fn == fn) + if (sba->trx_no == trx && sba->ts_no == ts && sba->fn == fn) return sba; } @@ -124,12 +124,14 @@ int SBAController::timeout(struct gprs_rlcmac_sba *sba) return 0; } -void SBAController::free_resources(uint8_t trx, uint8_t ts) +void SBAController::free_resources(struct gprs_rlcmac_pdch *pdch) { struct gprs_rlcmac_sba *sba, *sba2; + const uint8_t trx_no = pdch->trx->trx_no; + const uint8_t ts_no = pdch->ts_no; llist_for_each_entry_safe(sba, sba2, &m_sbas, list) { - if (sba->trx == trx && sba->ts == ts) { + if (sba->trx_no == trx_no && sba->ts_no == ts_no) { llist_del(&sba->list); talloc_free(sba); } |