now we get up to the SETUP of MO calls

diff --git a/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h
index 219fdd3..7696728 100644
--- a/include/openbsc/abis_rsl.h
+++ b/include/openbsc/abis_rsl.h
@@ -244,6 +244,22 @@
 #endif
 } __attribute__ ((packed));
 
+/* Chapter 9.3.22 */
+#define RLL_CAUSE_T200_EXPIRED		0x01
+#define RLL_CAUSE_REEST_REQ		0x02
+#define RLL_CAUSE_UNSOL_UA_RESP		0x03
+#define RLL_CAUSE_UNSOL_DM_RESP		0x04
+#define RLL_CAUSE_UNSOL_DM_RESP_MF	0x05
+#define RLL_CAUSE_UNSOL_SPRV_RESP	0x06
+#define RLL_CAUSE_SEQ_ERR		0x07
+#define RLL_CAUSE_UFRM_INC_PARAM	0x08
+#define RLL_CAUSE_SFRM_INC_PARAM	0x09
+#define RLL_CAUSE_IFRM_INC_MBITS	0x0a
+#define RLL_CAUSE_IFRM_INC_LEN		0x0b
+#define RLL_CAUSE_FRM_UNIMPL		0x0c
+#define RLL_CAUSE_SABM_MF		0x0d
+#define RLL_CAUSE_SABM_INFO_NOTALL	0x0e
+
 /* Chapter 9.3.26 */
 #define RSL_ERRCLS_NORMAL		0x00
 #define RSL_ERRCLS_RESOURCE_UNAVAIL	0x20
diff --git a/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h
index dc5eba9..389daf5 100644
--- a/include/openbsc/gsm_04_08.h
+++ b/include/openbsc/gsm_04_08.h
@@ -46,6 +46,7 @@
 	u_int8_t mob_alloc[0];
 };
 
+/* Chapter 10.5.1.3 */
 struct gsm48_loc_area_id {
 	u_int8_t digits[3];	/* BCD! */
 	u_int16_t lac;
@@ -57,7 +58,6 @@
 		 key_seq:4;
 	struct gsm48_loc_area_id lai;
 	u_int8_t classmark1;
-	u_int8_t ie_mi;
 	u_int8_t mi_len;
 	u_int8_t mi[0];
 } __attribute__ ((packed));
@@ -70,7 +70,7 @@
 } __attribute__ ((packed));
 
 /* Section 10.2 */
-#define GSM48_PDISC_CC		0x02
+#define GSM48_PDISC_CC		0x03
 #define GSM48_PDISC_MM		0x05
 #define GSM48_PDISC_RR		0x06
 #define GSM48_PDISC_MM_GPRS	0x08
@@ -235,6 +235,23 @@
 #define GSM_MI_TYPE_TMSI	0x04
 #define GSM_MI_ODD		0x08
 
+#define GSM48_IE_MOBILE_ID	0x17
+
+/* Section 10.5.4.11 / Table 10.5.122 */
+#define GSM48_CAUSE_CS_GSM	0x60
+
+enum gsm48_cause_loc {
+	GSM48_CAUSE_LOC_USER		= 0x00,
+	GSM48_CAUSE_LOC_PRN_S_LU	= 0x01,
+	GSM48_CAUSE_LOC_PUN_S_LU	= 0x02,
+	GSM48_CAUSE_LOC_TRANS_NET	= 0x03,
+	GSM48_CAUSE_LOC_PUN_S_RU	= 0x04,
+	GSM48_CAUSE_LOC_PRN_S_RU	= 0x05,
+	/* not defined */
+	GSM48_CAUSE_LOC_INN_NET		= 0x07,
+	GSM48_CAUSE_LOC_NET_BEYOND	= 0x0a,
+};
+
 struct msgb;
 struct gsm_bts;
 
diff --git a/include/openbsc/tlv.h b/include/openbsc/tlv.h
index 38ca811..70d0319 100644
--- a/include/openbsc/tlv.h
+++ b/include/openbsc/tlv.h
@@ -57,6 +57,15 @@
 	return buf;
 }
 
+static inline u_int8_t *tv16_put(u_int8_t *buf, u_int8_t tag, 
+				 u_int16_t val)
+{
+	*buf++ = tag;
+	*buf++ = val >> 8;
+	*buf++ = val & 0xff;
+	return buf;
+}
+
 static inline u_int8_t *msgb_tlv_put(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int8_t *val)
 {
 	u_int8_t *buf = msgb_put(msg, TLV_GROSS_LEN(len));
@@ -69,6 +78,12 @@
 	return tv_put(buf, tag, val);
 }
 
+static inline u_int8_t *msgb_tv16_put(struct msgb *msg, u_int8_t tag, u_int16_t val)
+{
+	u_int8_t *buf = msgb_put(msg, 3);
+	return tv16_put(buf, tag, val);
+}
+
 static inline u_int8_t *msgb_tlv_push(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int8_t *val)
 {
 	u_int8_t *buf = msgb_push(msg, TLV_GROSS_LEN(len));
@@ -81,4 +96,11 @@
 	return tv_put(buf, tag, val);
 }
 
+static inline u_int8_t *msgb_tv16_push(struct msgb *msg, u_int8_t tag, u_int16_t val)
+{
+	u_int8_t *buf = msgb_push(msg, 3);
+	return tv16_put(buf, tag, val);
+}
+
+
 #endif /* _TLV_H */