summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso2011-08-09 23:15:38 +0200
committerPablo Neira Ayuso2011-08-16 14:12:33 +0200
commit31fe5f2ef8391b7f61b7dd1cb2632f27c7843534 (patch)
tree27a0897c837222864cca709a67b8b416fff60722 /include
parentLAPD: Use proper log levels and prefix all messages with LAPD (diff)
downloadlibosmo-abis-31fe5f2ef8391b7f61b7dd1cb2632f27c7843534.tar.gz
libosmo-abis-31fe5f2ef8391b7f61b7dd1cb2632f27c7843534.tar.xz
libosmo-abis-31fe5f2ef8391b7f61b7dd1cb2632f27c7843534.zip
LAPD: Propagate lapd_receive() errors to the E1 driver
Scenario: BTS are configured and working, then the BSC stops working for some reason (crash or administrative stop). If the BSC comes back to life, LAPD among other things does not know about the previous existing TEIs. Instead of ignoring these frames, we notify the driver that we are seeing frames with unknown TEIs, so it can try to recover, e.g. by resending the SABM message.
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/abis/e1_input.h1
-rw-r--r--include/osmocom/abis/lapd.h16
2 files changed, 15 insertions, 2 deletions
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index acbc110..9825999 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -151,6 +151,7 @@ enum signal_input {
S_INP_NONE,
S_INP_TEI_UP,
S_INP_TEI_DN,
+ S_INP_TEI_UNKNOWN,
S_INP_LINE_INIT,
S_INP_LINE_ALARM,
S_INP_LINE_NOALARM,
diff --git a/include/osmocom/abis/lapd.h b/include/osmocom/abis/lapd.h
index fb980d1..dd22028 100644
--- a/include/osmocom/abis/lapd.h
+++ b/include/osmocom/abis/lapd.h
@@ -26,8 +26,20 @@ struct lapd_instance {
struct llist_head tei_list; /* list of TEI in this LAPD instance */
};
-extern uint8_t *lapd_receive(struct lapd_instance *li, uint8_t *data, unsigned int len,
- int *ilen, lapd_mph_type *prim);
+enum lapd_recv_errors {
+ LAPD_ERR_NONE = 0,
+ LAPD_ERR_BAD_LEN,
+ LAPD_ERR_BAD_ADDR,
+ LAPD_ERR_UNKNOWN_S_CMD,
+ LAPD_ERR_UNKNOWN_U_CMD,
+ LAPD_ERR_UNKNOWN_TEI,
+ LAPD_ERR_BAD_CMD,
+ __LAPD_ERR_MAX
+};
+
+extern uint8_t *lapd_receive(struct lapd_instance *li, uint8_t *data,
+ unsigned int len, int *ilen, lapd_mph_type *prim,
+ int *error);
extern void lapd_transmit(struct lapd_instance *li, uint8_t tei, uint8_t sapi,
uint8_t *data, unsigned int len);