bts: Add backpointers to the PDCH and TRX structures
This will allow to kill various parameters from all the functions
as we can walk back.
diff --git a/src/bts.cpp b/src/bts.cpp
index d6ed8f3..403b1e3 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -64,6 +64,19 @@
INIT_LLIST_HEAD(&m_bts.ul_tbfs);
INIT_LLIST_HEAD(&m_bts.dl_tbfs);
m_bts.bts = this;
+
+ /* initialize back pointers */
+ for (size_t trx_no = 0; trx_no < ARRAY_SIZE(m_bts.trx); ++trx_no) {
+ struct gprs_rlcmac_trx *trx = &m_bts.trx[trx_no];
+ trx->trx_no = trx_no;
+ trx->bts = this;
+
+ for (size_t ts_no = 0; ts_no < ARRAY_SIZE(trx->pdch); ++ts_no) {
+ struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts_no];
+ pdch->ts_no = ts_no;
+ pdch->trx = trx;
+ }
+ }
}
void BTS::set_current_frame_number(int fn)
diff --git a/src/bts.h b/src/bts.h
index 05f2200..c05779a 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -64,6 +64,10 @@
struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */
struct llist_head paging_list; /* list of paging messages */
uint32_t last_rts_fn; /* store last frame number of RTS */
+
+ /* back pointers */
+ struct gprs_rlcmac_trx *trx;
+ uint8_t ts_no;
};
struct gprs_rlcmac_trx {
@@ -72,6 +76,10 @@
struct gprs_rlcmac_pdch pdch[8];
struct gprs_rlcmac_tbf *ul_tbf[32]; /* array of UL TBF, by UL TFI */
struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */
+
+ /* back pointers */
+ struct BTS *bts;
+ uint8_t trx_no;
};
/**