diff options
author | Andrei Emeltchenko <andrei.emeltchenko@nokia.com> | 2010-10-01 05:05:11 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-10-12 11:44:53 -0400 |
commit | 534c92fde74c8d2143fc15b5f1d957f42cb43570 (patch) | |
tree | 1f6fe4dcf8bebd4b8313357036614900f289aab2 /net/bluetooth/rfcomm | |
parent | ab3e571564a5d8fa4923e2e858e574c931a014c7 (diff) |
Bluetooth: clean up rfcomm code
Remove dead code and unused rfcomm thread events
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 4a22b14a2c60..39a5d87e33b4 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -113,11 +113,10 @@ static void rfcomm_session_del(struct rfcomm_session *s); | |||
113 | #define __get_rpn_stop_bits(line) (((line) >> 2) & 0x1) | 113 | #define __get_rpn_stop_bits(line) (((line) >> 2) & 0x1) |
114 | #define __get_rpn_parity(line) (((line) >> 3) & 0x7) | 114 | #define __get_rpn_parity(line) (((line) >> 3) & 0x7) |
115 | 115 | ||
116 | static inline void rfcomm_schedule(uint event) | 116 | static inline void rfcomm_schedule(void) |
117 | { | 117 | { |
118 | if (!rfcomm_thread) | 118 | if (!rfcomm_thread) |
119 | return; | 119 | return; |
120 | //set_bit(event, &rfcomm_event); | ||
121 | set_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event); | 120 | set_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event); |
122 | wake_up_process(rfcomm_thread); | 121 | wake_up_process(rfcomm_thread); |
123 | } | 122 | } |
@@ -203,13 +202,13 @@ static inline int __check_fcs(u8 *data, int type, u8 fcs) | |||
203 | static void rfcomm_l2state_change(struct sock *sk) | 202 | static void rfcomm_l2state_change(struct sock *sk) |
204 | { | 203 | { |
205 | BT_DBG("%p state %d", sk, sk->sk_state); | 204 | BT_DBG("%p state %d", sk, sk->sk_state); |
206 | rfcomm_schedule(RFCOMM_SCHED_STATE); | 205 | rfcomm_schedule(); |
207 | } | 206 | } |
208 | 207 | ||
209 | static void rfcomm_l2data_ready(struct sock *sk, int bytes) | 208 | static void rfcomm_l2data_ready(struct sock *sk, int bytes) |
210 | { | 209 | { |
211 | BT_DBG("%p bytes %d", sk, bytes); | 210 | BT_DBG("%p bytes %d", sk, bytes); |
212 | rfcomm_schedule(RFCOMM_SCHED_RX); | 211 | rfcomm_schedule(); |
213 | } | 212 | } |
214 | 213 | ||
215 | static int rfcomm_l2sock_create(struct socket **sock) | 214 | static int rfcomm_l2sock_create(struct socket **sock) |
@@ -255,7 +254,7 @@ static void rfcomm_session_timeout(unsigned long arg) | |||
255 | BT_DBG("session %p state %ld", s, s->state); | 254 | BT_DBG("session %p state %ld", s, s->state); |
256 | 255 | ||
257 | set_bit(RFCOMM_TIMED_OUT, &s->flags); | 256 | set_bit(RFCOMM_TIMED_OUT, &s->flags); |
258 | rfcomm_schedule(RFCOMM_SCHED_TIMEO); | 257 | rfcomm_schedule(); |
259 | } | 258 | } |
260 | 259 | ||
261 | static void rfcomm_session_set_timer(struct rfcomm_session *s, long timeout) | 260 | static void rfcomm_session_set_timer(struct rfcomm_session *s, long timeout) |
@@ -283,7 +282,7 @@ static void rfcomm_dlc_timeout(unsigned long arg) | |||
283 | 282 | ||
284 | set_bit(RFCOMM_TIMED_OUT, &d->flags); | 283 | set_bit(RFCOMM_TIMED_OUT, &d->flags); |
285 | rfcomm_dlc_put(d); | 284 | rfcomm_dlc_put(d); |
286 | rfcomm_schedule(RFCOMM_SCHED_TIMEO); | 285 | rfcomm_schedule(); |
287 | } | 286 | } |
288 | 287 | ||
289 | static void rfcomm_dlc_set_timer(struct rfcomm_dlc *d, long timeout) | 288 | static void rfcomm_dlc_set_timer(struct rfcomm_dlc *d, long timeout) |
@@ -465,7 +464,7 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err) | |||
465 | case BT_CONFIG: | 464 | case BT_CONFIG: |
466 | if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) { | 465 | if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) { |
467 | set_bit(RFCOMM_AUTH_REJECT, &d->flags); | 466 | set_bit(RFCOMM_AUTH_REJECT, &d->flags); |
468 | rfcomm_schedule(RFCOMM_SCHED_AUTH); | 467 | rfcomm_schedule(); |
469 | break; | 468 | break; |
470 | } | 469 | } |
471 | /* Fall through */ | 470 | /* Fall through */ |
@@ -485,7 +484,7 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err) | |||
485 | case BT_CONNECT2: | 484 | case BT_CONNECT2: |
486 | if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) { | 485 | if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) { |
487 | set_bit(RFCOMM_AUTH_REJECT, &d->flags); | 486 | set_bit(RFCOMM_AUTH_REJECT, &d->flags); |
488 | rfcomm_schedule(RFCOMM_SCHED_AUTH); | 487 | rfcomm_schedule(); |
489 | break; | 488 | break; |
490 | } | 489 | } |
491 | /* Fall through */ | 490 | /* Fall through */ |
@@ -533,7 +532,7 @@ int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb) | |||
533 | skb_queue_tail(&d->tx_queue, skb); | 532 | skb_queue_tail(&d->tx_queue, skb); |
534 | 533 | ||
535 | if (!test_bit(RFCOMM_TX_THROTTLED, &d->flags)) | 534 | if (!test_bit(RFCOMM_TX_THROTTLED, &d->flags)) |
536 | rfcomm_schedule(RFCOMM_SCHED_TX); | 535 | rfcomm_schedule(); |
537 | return len; | 536 | return len; |
538 | } | 537 | } |
539 | 538 | ||
@@ -545,7 +544,7 @@ void __rfcomm_dlc_throttle(struct rfcomm_dlc *d) | |||
545 | d->v24_sig |= RFCOMM_V24_FC; | 544 | d->v24_sig |= RFCOMM_V24_FC; |
546 | set_bit(RFCOMM_MSC_PENDING, &d->flags); | 545 | set_bit(RFCOMM_MSC_PENDING, &d->flags); |
547 | } | 546 | } |
548 | rfcomm_schedule(RFCOMM_SCHED_TX); | 547 | rfcomm_schedule(); |
549 | } | 548 | } |
550 | 549 | ||
551 | void __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d) | 550 | void __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d) |
@@ -556,7 +555,7 @@ void __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d) | |||
556 | d->v24_sig &= ~RFCOMM_V24_FC; | 555 | d->v24_sig &= ~RFCOMM_V24_FC; |
557 | set_bit(RFCOMM_MSC_PENDING, &d->flags); | 556 | set_bit(RFCOMM_MSC_PENDING, &d->flags); |
558 | } | 557 | } |
559 | rfcomm_schedule(RFCOMM_SCHED_TX); | 558 | rfcomm_schedule(); |
560 | } | 559 | } |
561 | 560 | ||
562 | /* | 561 | /* |
@@ -577,7 +576,7 @@ int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig) | |||
577 | d->v24_sig = v24_sig; | 576 | d->v24_sig = v24_sig; |
578 | 577 | ||
579 | if (!test_and_set_bit(RFCOMM_MSC_PENDING, &d->flags)) | 578 | if (!test_and_set_bit(RFCOMM_MSC_PENDING, &d->flags)) |
580 | rfcomm_schedule(RFCOMM_SCHED_TX); | 579 | rfcomm_schedule(); |
581 | 580 | ||
582 | return 0; | 581 | return 0; |
583 | } | 582 | } |
@@ -816,7 +815,7 @@ static int rfcomm_queue_disc(struct rfcomm_dlc *d) | |||
816 | cmd->fcs = __fcs2((u8 *) cmd); | 815 | cmd->fcs = __fcs2((u8 *) cmd); |
817 | 816 | ||
818 | skb_queue_tail(&d->tx_queue, skb); | 817 | skb_queue_tail(&d->tx_queue, skb); |
819 | rfcomm_schedule(RFCOMM_SCHED_TX); | 818 | rfcomm_schedule(); |
820 | return 0; | 819 | return 0; |
821 | } | 820 | } |
822 | 821 | ||
@@ -1884,7 +1883,7 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s) | |||
1884 | * L2CAP MTU minus UIH header and FCS. */ | 1883 | * L2CAP MTU minus UIH header and FCS. */ |
1885 | s->mtu = min(l2cap_pi(nsock->sk)->omtu, l2cap_pi(nsock->sk)->imtu) - 5; | 1884 | s->mtu = min(l2cap_pi(nsock->sk)->omtu, l2cap_pi(nsock->sk)->imtu) - 5; |
1886 | 1885 | ||
1887 | rfcomm_schedule(RFCOMM_SCHED_RX); | 1886 | rfcomm_schedule(); |
1888 | } else | 1887 | } else |
1889 | sock_release(nsock); | 1888 | sock_release(nsock); |
1890 | } | 1889 | } |
@@ -2093,7 +2092,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt) | |||
2093 | 2092 | ||
2094 | rfcomm_session_put(s); | 2093 | rfcomm_session_put(s); |
2095 | 2094 | ||
2096 | rfcomm_schedule(RFCOMM_SCHED_AUTH); | 2095 | rfcomm_schedule(); |
2097 | } | 2096 | } |
2098 | 2097 | ||
2099 | static struct hci_cb rfcomm_cb = { | 2098 | static struct hci_cb rfcomm_cb = { |