summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-27 08:53:38 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commitaf4acb0d6b6f86353d7769e1cbae846fd5eeb7f0 (patch)
tree38963bc2585a6b9bd1f4c144c44efbc1ea1ddd4f
parent5657fb2f69e18f929d5aecaf46eaa64e7c3961fa (diff)
host/trxcon/l1ctl.c: reset FBSB expire timer on shutdown
-rw-r--r--src/host/trxcon/l1ctl.c7
-rw-r--r--src/host/trxcon/l1ctl.h5
-rw-r--r--src/host/trxcon/l1ctl_link.c8
-rw-r--r--src/host/trxcon/l1ctl_link.h3
4 files changed, 22 insertions, 1 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 2c82e11..f71807a 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -685,3 +685,10 @@ int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg)
return -EINVAL;
}
}
+
+void l1ctl_shutdown_cb(struct l1ctl_link *l1l)
+{
+ /* Abort FBSB expire timer */
+ if (osmo_timer_pending(&l1l->fbsb_timer))
+ osmo_timer_del(&l1l->fbsb_timer);
+}
diff --git a/src/host/trxcon/l1ctl.h b/src/host/trxcon/l1ctl.h
index 6c61bfd..e83138d 100644
--- a/src/host/trxcon/l1ctl.h
+++ b/src/host/trxcon/l1ctl.h
@@ -6,6 +6,10 @@
#include "l1ctl_link.h"
#include "l1ctl_proto.h"
+/* Event handlers */
+int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg);
+void l1ctl_shutdown_cb(struct l1ctl_link *l1l);
+
int l1ctl_tx_fbsb_conf(struct l1ctl_link *l1l, uint8_t result,
struct l1ctl_info_dl *dl_info, uint8_t bsic);
int l1ctl_tx_ccch_mode_conf(struct l1ctl_link *l1l, uint8_t mode);
@@ -13,7 +17,6 @@ int l1ctl_tx_pm_conf(struct l1ctl_link *l1l, uint16_t band_arfcn,
int dbm, int last);
int l1ctl_tx_reset_conf(struct l1ctl_link *l1l, uint8_t type);
int l1ctl_tx_reset_ind(struct l1ctl_link *l1l, uint8_t type);
-int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg);
int l1ctl_tx_data_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *ind);
int l1ctl_tx_rach_conf(struct l1ctl_link *l1l, uint32_t fn);
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index dfcbecb..265bfeb 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -251,6 +251,10 @@ int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path)
return rc;
}
+ /* Bind shutdown handler */
+ l1l_new->shutdown_cb = l1ctl_shutdown_cb;
+
+ /* Bind connection handler */
bfd->cb = l1ctl_link_accept;
bfd->when = BSC_FD_READ;
bfd->data = l1l_new;
@@ -281,6 +285,10 @@ void l1ctl_link_shutdown(struct l1ctl_link *l1l)
LOGP(DL1C, LOGL_NOTICE, "Shutdown L1CTL link\n");
+ /* Call shutdown callback */
+ if (l1l->shutdown_cb != NULL)
+ l1l->shutdown_cb(l1l);
+
listen_bfd = &l1l->listen_bfd;
/* Check if we have an established connection */
diff --git a/src/host/trxcon/l1ctl_link.h b/src/host/trxcon/l1ctl_link.h
index f20af93..f9d91f1 100644
--- a/src/host/trxcon/l1ctl_link.h
+++ b/src/host/trxcon/l1ctl_link.h
@@ -28,6 +28,9 @@ struct l1ctl_link {
/* L1CTL handlers specific */
struct osmo_timer_list fbsb_timer;
uint8_t fbsb_conf_sent;
+
+ /* Shutdown callback */
+ void (*shutdown_cb)(struct l1ctl_link *l1l);
};
int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path);