aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-12-20 07:57:26 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-12-20 14:06:30 -0500
commitc2ec9c1bbd17cdd1fc962f000b4ecb98c1dad830 (patch)
tree9694fd4b5845bdbbe5676b8f010dd3062e636a27
parent613a1c0c595fe2f2d9148a705f140a53bc9f56e1 (diff)
Bluetooth: Move l2cap_{set,clear}_timer to l2cap.h
It is the only place where it is used. Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r--include/net/bluetooth/l2cap.h15
-rw-r--r--net/bluetooth/l2cap_core.c14
2 files changed, 15 insertions, 14 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index c0d168adf9be..e199c2f0e4dc 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -595,6 +595,21 @@ enum {
595 FLAG_EFS_ENABLE, 595 FLAG_EFS_ENABLE,
596}; 596};
597 597
598static inline void l2cap_set_timer(struct l2cap_chan *chan,
599 struct delayed_work *work, long timeout)
600{
601 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
602
603 cancel_delayed_work_sync(work);
604
605 schedule_delayed_work(work, timeout);
606}
607
608static inline void l2cap_clear_timer(struct delayed_work *work)
609{
610 cancel_delayed_work_sync(work);
611}
612
598#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) 613#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
599#define __clear_chan_timer(c) l2cap_clear_timer(&c->chan_timer) 614#define __clear_chan_timer(c) l2cap_clear_timer(&c->chan_timer)
600#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \ 615#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index ffa2f6b8408f..5978d69f3d8a 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -228,20 +228,6 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
228 return 0; 228 return 0;
229} 229}
230 230
231static void l2cap_set_timer(struct l2cap_chan *chan, struct delayed_work *work, long timeout)
232{
233 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
234
235 cancel_delayed_work_sync(work);
236
237 schedule_delayed_work(work, timeout);
238}
239
240static void l2cap_clear_timer(struct delayed_work *work)
241{
242 cancel_delayed_work_sync(work);
243}
244
245static char *state_to_string(int state) 231static char *state_to_string(int state)
246{ 232{
247 switch(state) { 233 switch(state) {