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.
diff --git a/src/sba.cpp b/src/sba.cpp
index 4b856e0..7396811 100644
--- a/src/sba.cpp
+++ b/src/sba.cpp
@@ -73,8 +73,8 @@
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 @@
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 @@
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);
}