gprs: Add 'Negotiated READY timer value' IE to Attach/RAU Accept

Currently this optional IE is omitted, so that the optional
'Requested READY timer value' of the corresponding Request message
is used by the MS (or the default value if this IE is not used).

This patch extends gsm48_tx_gmm_att_ack and gsm48_tx_gmm_ra_upd_ack
to always include the IE set to the default value of T3312 (44s,
see GSM 04.08, table 11.4a).

Ticket: OW#1364
Sponsored-by: On-Waves ehf
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 32fb8e4..72239e0 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -50,6 +50,7 @@
 #include <openbsc/gprs_llc.h>
 #include <openbsc/gprs_sgsn.h>
 #include <openbsc/gprs_gmm.h>
+#include <openbsc/gprs_utils.h>
 #include <openbsc/sgsn.h>
 
 #include <pdp.h>
@@ -64,7 +65,7 @@
 
 /* Section 11.2.2 / Table 11.4a MM timers netwokr side */
 #define GSM0408_T3313_SECS	30	/* waiting for paging response */
-#define GSM0408_T3314_SECS	44	/* force to STBY on expiry */
+#define GSM0408_T3314_SECS	44	/* force to STBY on expiry, Ready timer */
 #define GSM0408_T3316_SECS	44
 
 /* Section 11.3 / Table 11.2d Timers of Session Management - network side */
@@ -338,8 +339,13 @@
 	ptsig[1] = mm->p_tmsi_sig >> 8;
 	ptsig[2] = mm->p_tmsi_sig & 0xff;
 
-	/* Optional: Negotiated Ready timer value */
 #endif
+	/* Optional: Negotiated Ready timer value
+	 * (fixed 44s, default value, GSM 04.08, table 11.4a) to safely limit
+	 * the inactivity time READY->STANDBY.
+	 */
+	msgb_tv_put(msg, GSM48_IE_GMM_TIMER_READY,
+		    gprs_secs_to_tmr_floor(GSM0408_T3314_SECS));
 
 #ifdef PTMSI_ALLOC
 	/* Optional: Allocated P-TMSI */
@@ -992,6 +998,10 @@
 	mid[0] = GSM48_IE_GMM_ALLOC_PTMSI;
 #endif
 
+	/* Optional: Negotiated READY timer value */
+	msgb_tv_put(msg, GSM48_IE_GMM_TIMER_READY,
+		    gprs_secs_to_tmr_floor(GSM0408_T3314_SECS));
+
 	/* Option: MS ID, ... */
 	return gsm48_gmm_sendmsg(msg, 0, mm);
 }