bts: Move the frame_number into the BTS sructure

The current_frame is an attribute of the BTS. Move it from the
pcu_l1_if.cpp into the BTS. As the next step we can trigger
actions depending on the change of the frame.
diff --git a/src/bts.cpp b/src/bts.cpp
index 0609a5f..b278ecf 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -39,7 +39,13 @@
 }
 
 BTS::BTS()
+	: m_cur_fn(0)
 {
 	memset(&m_bts, 0, sizeof(m_bts));
 	m_bts.bts = this;
 }
+
+void BTS::set_current_frame_number(int fn)
+{
+	m_cur_fn = fn;
+}
diff --git a/src/bts.h b/src/bts.h
index 9a5b570..507c79f 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -106,9 +106,19 @@
 
 	struct gprs_rlcmac_bts *bts_data();
 
+	/** TODO: change the number to unsigned */
+	void set_current_frame_number(int frame_number);
+	int current_frame_number() const;
+
 private:
+	int m_cur_fn;
 	struct gprs_rlcmac_bts m_bts;
 };
+
+inline int BTS::current_frame_number() const
+{
+	return m_cur_fn;
+}
 #endif
 
 #ifdef __cplusplus
diff --git a/src/gsm_timer.cpp b/src/gsm_timer.cpp
index 95513b4..d3c59cb 100644
--- a/src/gsm_timer.cpp
+++ b/src/gsm_timer.cpp
@@ -33,9 +33,21 @@
 #include <limits.h>
 #include <gsm_timer.h>
 #include <pcu_l1_if.h>
+#include <bts.h>
+
 
 static struct rb_root timer_root = RB_ROOT;
 
+/*
+ * TODO: make this depend on the BTS. This means that
+ * all time functions schedule based on the BTS they
+ * are scheduled on.
+ */
+static int get_current_fn()
+{
+	return BTS::main_bts()->current_frame_number();
+}
+
 static void __add_gsm_timer(struct osmo_gsm_timer_list *timer)
 {
 	struct rb_node **new_node = &(timer_root.rb_node);
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 8239247..ad0887e 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -50,19 +50,6 @@
 
 extern void *tall_pcu_ctx;
 
-// Variable for storage current FN.
-int frame_number;
-
-int get_current_fn()
-{
-	return frame_number;
-}
-
-void set_current_fn(int fn)
-{
-	frame_number = fn;
-}
-
 /*
  * PCU messages
  */
@@ -512,6 +499,7 @@
 	struct gprs_rlcmac_sba *sba, *sba2;
 	uint32_t elapsed;
 	uint8_t fn13 = time_ind->fn % 13;
+	int frame_number = time_ind->fn;
 
 	/* omit frame numbers not starting at a MAC block */
 	if (fn13 != 0 && fn13 != 4 && fn13 != 8)
@@ -520,7 +508,7 @@
 //	LOGP(DL1IF, LOGL_DEBUG, "Time indication received: %d\n",
 //		time_ind->fn % 52);
 
-	set_current_fn(time_ind->fn);
+	BTS::main_bts()->set_current_frame_number(time_ind->fn);
 
 	/* check for poll timeout */
 	llist_for_each_entry(tbf, &gprs_rlcmac_ul_tbfs, list) {
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index f01b95a..bd8fe94 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -32,8 +32,6 @@
 #ifdef __cplusplus
 }
 
-int get_current_fn();
-
 void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn, 
         uint32_t fn, uint8_t block_nr);
 void pcu_l1if_tx_ptcch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn,