aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-23 12:32:38 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-26 08:44:27 +0100
commit841d95f86701b9e813402c65a7b1f88d132593fb (patch)
tree4de5ae79180dac41fb6c1bc635290f38f78b6e67
parent8de9c48c997a84f1afbfd3306435403bdbfd9f6a (diff)
gprs: Use a macro value to set the 'Periodic RA update timer'
Currently the T3312 timer is directly set as encoded value when generating the Attach/RAU Accept messages. This patch adds GSM0408_T3312_SECS and uses it to set the information element's value. Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/gprs_gmm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 72239e0..3977c66 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -57,6 +57,9 @@
#define PTMSI_ALLOC
+/* Section 11.2.2 / Table 11.3a GPRS Mobility management timers – MS side */
+#define GSM0408_T3312_SECS (10*60) /* periodic RAU interval, default 54min */
+
/* Section 11.2.2 / Table 11.4 MM timers netwokr side */
#define GSM0408_T3322_SECS 6 /* DETACH_REQ -> DETACH_ACC */
#define GSM0408_T3350_SECS 6 /* waiting for ATT/RAU/TMSI COMPL */
@@ -327,7 +330,7 @@ static int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm)
aa = (struct gsm48_attach_ack *) msgb_put(msg, sizeof(*aa));
aa->force_stby = 0; /* not indicated */
aa->att_result = 1; /* GPRS only */
- aa->ra_upd_timer = GPRS_TMR_MINUTE | 10;
+ aa->ra_upd_timer = gprs_secs_to_tmr_floor(GSM0408_T3312_SECS);
aa->radio_prio = 4; /* lowest */
gsm48_construct_ra(aa->ra_id.digits, &mm->ra);
@@ -978,7 +981,7 @@ static int gsm48_tx_gmm_ra_upd_ack(struct sgsn_mm_ctx *mm)
rua = (struct gsm48_ra_upd_ack *) msgb_put(msg, sizeof(*rua));
rua->force_stby = 0; /* not indicated */
rua->upd_result = 0; /* RA updated */
- rua->ra_upd_timer = GPRS_TMR_MINUTE | 10;
+ rua->ra_upd_timer = gprs_secs_to_tmr_floor(GSM0408_T3312_SECS);
gsm48_construct_ra(rua->ra_id.digits, &mm->ra);