summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-27 08:53:38 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commit10fd43e586231a3f9e1095ece1340a023aef4b19 (patch)
treed6698c791bffc72c050187c70a41448bede7a1cc
parent6c3ce20d758cff3b7867a32490ae38a1eaaf2e9d (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 2c82e11a..f71807a0 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 6c61bfd9..e83138d6 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 dfcbecb2..265bfeb2 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 f20af937..f9d91f14 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);