Add vty command "radio-link-timeout infinite" for uplink rx testing

When we are performing Rx sensitivity testing on a BTS, we want to
deactivate the connection failure criterion / radio link timeout, i.e.
no matter how many SACCH frames in uplink are failed to decode, the BTS
should never close the channel.

OsmoBTS Change-Id I736f21f6528db5c16fa80cdb905af20673797be5 covers a way
how this behavior can be requested from the BTS via an OML attribute.
This patch adds support to the BSC to actually set that attribute.

Do not use this in production networks, as the BTS will keep open radio
channels indefinitely even if the phone is gone and no longer
transmitting anything.  This is a pure testing feature.

Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2
diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c
index 0291129..473e1ca 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c
@@ -38,6 +38,7 @@
 {
 	struct msgb *msgb;
 	uint8_t buf[256];
+	int rlt;
 	msgb = msgb_alloc(1024, "nanobts_attr_bts");
 
 	memcpy(buf, "\x55\x5b\x61\x67\x6d\x73", 6);
@@ -46,9 +47,16 @@
 	/* interference avg. period in numbers of SACCH multifr */
 	msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, 0x06);
 
-	/* conn fail based on SACCH error rate */
-	buf[0] = 0x01;
-	buf[1] = get_radio_link_timeout(&bts->si_common.cell_options);
+	rlt = gsm_bts_get_radio_link_timeout(bts);
+	if (rlt == -1) {
+		/* Osmocom extension: Use infinite radio link timeout */
+		buf[0] = 0xFF;
+		buf[1] = 0x00;
+	} else {
+		/* conn fail based on SACCH error rate */
+		buf[0] = 0x01;
+		buf[1] = rlt;
+	}
 	msgb_tl16v_put(msgb, NM_ATT_CONN_FAIL_CRIT, 2, buf);
 
 	memcpy(buf, "\x1e\x24\x24\xa8\x34\x21\xa8", 7);