tbf: Store the timing advance (TA) value in the GprsMs object

The TA value rather relates to an MS and not to a single TBF. So all
TBFs share the same TA value. Currently the TA value is stored per
TBF and eventually copied from an old TBF to a new one. It is in
general only passed with an RACH request when the TLLI and thus the
MS is not yet known.

This commit adds a TA member to the GprsMs class and uses that one
when the TBF is associated to an MS object. Since the TBF is not
always associated with an MS object (after RACH or when it has been
replaced by another TBF), the TA value is still stored in each TBF
and that value is used as long as no MS object is being associated.

Sponsored-by: On-Waves ehf
diff --git a/src/tbf.h b/src/tbf.h
index 5ea6d4e..d288669 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -149,6 +149,8 @@
 
 	const char *imsi() const;
 	void assign_imsi(const char *imsi);
+	uint8_t ta() const;
+	void set_ta(uint8_t);
 
 	time_t created_ts() const;
 
@@ -165,7 +167,6 @@
 	uint8_t control_ts; /* timeslot control messages and polling */
 	uint8_t ms_class;
 	struct gprs_rlcmac_pdch *pdch[8]; /* list of PDCHs allocated to TBF */
-	uint16_t ta;
 
 	gprs_llc m_llc;
 
@@ -225,6 +226,9 @@
 	static const char *tbf_state_name[6];
 
 	class GprsMs *m_ms;
+
+	/* Field to take the TA value if no MS is associated */
+	uint8_t m_ta;
 private:
 	mutable char m_name_buf[60];
 };