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/bts.cpp b/src/bts.cpp
index 403b1e3..b2ec50f 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -226,7 +226,7 @@
 }
 
 /* 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)
+void gprs_rlcmac_pdch::free_resources()
 {
 	struct gprs_rlcmac_paging *pag;
 
@@ -241,7 +241,7 @@
 	while ((pag = dequeue_paging()))
 		talloc_free(pag);
 
-	bts->sba()->free_resources(trx, ts);
+	trx->bts->sba()->free_resources(this);
 }
 
 struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging()
diff --git a/src/bts.h b/src/bts.h
index c05779a..a8b6223 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -47,8 +47,7 @@
 
 	void add_paging(struct gprs_rlcmac_paging *pag);
 
-	/* TODO: the PDCH should know the trx/ts it belongs to */
-	void free_resources(BTS *bts, uint8_t trx, uint8_t ts);
+	void free_resources();
 
 	bool is_enabled() const;
 
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index ab9c134..53303d9 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -321,7 +321,7 @@
 		for (trx = 0; trx < 8; trx++) {
 			bts->trx[trx].arfcn = info_ind->trx[trx].arfcn;
 			for (ts = 0; ts < 8; ts++)
-				bts->trx[trx].pdch[ts].free_resources(bts->bts, trx, ts);
+				bts->trx[trx].pdch[ts].free_resources();
 		}
 		gprs_bssgp_destroy_or_exit();
 		return 0;
@@ -456,7 +456,7 @@
 			} else {
 				if (pdch->is_enabled()) {
 					pcu_tx_act_req(trx, ts, 0);
-					pdch->free_resources(bts->bts, trx, ts);
+					pdch->free_resources();
 					pdch->disable();
 				}
 			}
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);
 		}
diff --git a/src/sba.h b/src/sba.h
index c25aa14..b8d7675 100644
--- a/src/sba.h
+++ b/src/sba.h
@@ -35,8 +35,8 @@
  */
 struct gprs_rlcmac_sba {
 	struct llist_head list;
-	uint8_t trx;
-	uint8_t ts;
+	uint8_t trx_no;
+	uint8_t ts_no;
 	uint32_t fn;
 	uint8_t ta;
 };
@@ -57,7 +57,7 @@
 	uint32_t sched(uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr);
 
 	int timeout(struct gprs_rlcmac_sba *sba);
-	void free_resources(uint8_t trx, uint8_t ts);
+	void free_resources(struct gprs_rlcmac_pdch *pdch);
 
 private:
 	BTS &m_bts;