TBF: unify timer handling
Use generic timer handling infrastracture to handle assignment/reject
internal timer. Rename timer array accordingly. Use defines with
explicit second/microsecond values to make it more readable.
Change-Id: I63fb7e6f0695383a83472c836a381a055f64690b
diff --git a/src/tbf.h b/src/tbf.h
index 4489695..88f5d6a 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -39,9 +39,9 @@
* TBF instance
*/
-#define Tassign_agch 0,200000 /* waiting after IMM.ASS confirm */
-#define Tassign_pacch 2,0 /* timeout for pacch assigment */
-#define Treject_pacch 0,2000 /* timeout for tbf reject for PRR*/
+#define T_ASS_AGCH_USEC 200000 /* waiting after IMM.ASS confirm */
+#define T_ASS_PACCH_SEC 2 /* timeout for pacch assigment */
+#define T_REJ_PACCH_USEC 2000 /* timeout for tbf reject for PRR*/
enum gprs_rlcmac_tbf_state {
GPRS_RLCMAC_NULL = 0, /* new created TBF */
@@ -139,6 +139,9 @@
#define LOGPTBFDL(tbf, level, fmt, args...) LOGP(DRLCMACDL, level, "%s " fmt, tbf_name(tbf), ## args)
enum tbf_timers {
+ /* internal assign/reject timer */
+ T0,
+
/* Wait for reuse of USF and TFI(s) after the MS uplink assignment for this TBF is invalid. */
T3169,
@@ -194,7 +197,6 @@
int update();
void handle_timeout();
- void stop_timer(const char *reason);
void stop_timers(const char *reason);
bool timers_pending(enum tbf_timers t);
void t_stop(enum tbf_timers t, const char *reason);
@@ -266,9 +268,6 @@
gprs_rlc m_rlc;
uint8_t n3105; /* N3105 counter */
-
- struct osmo_timer_list timer;
- unsigned int T; /* Txxxx number */
struct osmo_gsm_timer_list gsm_timer;
unsigned int fT; /* fTxxxx number */
@@ -328,7 +327,7 @@
LListHead<gprs_rlcmac_tbf> m_list;
LListHead<gprs_rlcmac_tbf> m_ms_list;
bool m_egprs_enabled;
- struct osmo_timer_list T31[T_MAX];
+ struct osmo_timer_list T[T_MAX];
mutable char m_name_buf[60];
};
@@ -352,9 +351,6 @@
int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf);
-void tbf_timer_start(struct gprs_rlcmac_tbf *tbf, unsigned int T,
- unsigned int seconds, unsigned int microseconds, const char *reason);
-
inline bool gprs_rlcmac_tbf::state_is(enum gprs_rlcmac_tbf_state rhs) const
{
return state == rhs;