From 841d95f86701b9e813402c65a7b1f88d132593fb Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Fri, 23 Jan 2015 12:32:38 +0100 Subject: 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 --- openbsc/src/gprs/gprs_gmm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 72239e0bf..3977c6657 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); -- cgit v1.2.3