aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp <pmaier@sysmocom.de>2016-10-19 18:38:58 +0200
committerHarald Welte <laforge@gnumonks.org>2016-11-02 09:23:01 +0000
commit0c7d5f4a61cc7897a6a8092cd3e0872a39cc98f1 (patch)
tree5f08460d2f27fbf8fc761c1ed1aeca38e53d6788
parent7895e0456a4e3fb48344932e4ca83d216038eadf (diff)
lapd: adding support for ericsson's lapd dialect
Ericsson's RBS2111-BTS (and similar) implements a lapdm dialect which uses a link establishment method that differs from the standard. While the BSC is transmitting sabm frames on one specific timeslot, the BTS will periodically scan through all timeslots to check for incoming sabm frames. When the BTS detcts the sabm fames on one of the timeslots it will stay there and continue to commence the link establishment. The described procedure requires a slightly modified lapd profile, the t200 retransmission timeout has to be configured to exactly 300 msek. Otherwise the link establishment will fail. Since the BTS will switch from timeslot to timeslot most of the sabm frames will not be seen by the BTS, so the maximum retransmission has to be increased. This patch suggests a maximum retry count of 300, which is an educated guess and has worked fine during our tests. Change-Id: I892af57013d7ab4216e9e2d0873a69129aaeb8e5
-rw-r--r--include/osmocom/abis/lapd.h9
-rw-r--r--src/input/lapd.c28
2 files changed, 37 insertions, 0 deletions
diff --git a/include/osmocom/abis/lapd.h b/include/osmocom/abis/lapd.h
index 2987633..d618187 100644
--- a/include/osmocom/abis/lapd.h
+++ b/include/osmocom/abis/lapd.h
@@ -18,8 +18,10 @@ struct lapd_profile {
int short_address;
};
+/* predefined lapd profiles (see lapd.c for definition) */
extern const struct lapd_profile lapd_profile_isdn;
extern const struct lapd_profile lapd_profile_abis;
+extern const struct lapd_profile lapd_profile_abis_ericsson;
extern const struct lapd_profile lapd_profile_sat;
struct lapd_instance {
@@ -63,6 +65,13 @@ struct lapd_instance *lapd_instance_alloc(int network_side,
void *rx_cbdata), void *rx_cbdata,
const struct lapd_profile *profile);
+/* In rare cases (e.g. Ericsson's lapd dialect), it may be necessary to
+ * exchange the lapd profile on the fly. lapd_instance_set_profile()
+ * allwos to set the lapd profile on a lapd instance danymically to
+ * one of the lapd profiles define above. */
+void lapd_instance_set_profile(struct lapd_instance *li,
+ const struct lapd_profile *profile);
+
void lapd_instance_free(struct lapd_instance *li);
/* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
diff --git a/src/input/lapd.c b/src/input/lapd.c
index ac24fd8..f5909b4 100644
--- a/src/input/lapd.c
+++ b/src/input/lapd.c
@@ -95,6 +95,27 @@ const struct lapd_profile lapd_profile_abis = {
.short_address = 0
};
+/* Ericssons OM2000 lapd dialect requires a sabm frame retransmission
+ * timeout of exactly 300 msek. Shorter or longer retransmission will
+ * cause the link establishment to fail permanently. Since the BTS is
+ * periodically scanning through all timeslots to find the timeslot
+ * where the bsc is transmitting its sabm frames the normal maximum
+ * retransmission (n200) of 3 is not enough. In order not to miss
+ * the bts, n200 has been increased to 300, which is an educated
+ * guess. */
+
+const struct lapd_profile lapd_profile_abis_ericsson = {
+ .k = LAPD_SET_K(2,1),
+ .n200 = 300,
+ .n201 = 260,
+ .n202 = 0, /* infinite */
+ .t200_sec = 0, .t200_usec = 300000,
+ .t201_sec = 1, .t201_usec = 0,
+ .t202_sec = 2, .t202_usec = 0,
+ .t203_sec = 10, .t203_usec = 0,
+ .short_address = 0
+};
+
const struct lapd_profile lapd_profile_sat = {
.k = LAPD_SET_K(15,15),
.n200 = 5,
@@ -664,6 +685,13 @@ struct lapd_instance *lapd_instance_alloc(int network_side,
return li;
}
+/* Change lapd-profile on the fly (use with caution!) */
+void lapd_instance_set_profile(struct lapd_instance *li,
+ const struct lapd_profile *profile)
+{
+ memcpy(&li->profile, profile, sizeof(li->profile));
+}
+
void lapd_instance_free(struct lapd_instance *li)
{
struct lapd_tei *teip, *teip2;