diff options
-rw-r--r-- | include/net/bluetooth/hci_core.h | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 22 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 4 | ||||
-rw-r--r-- | net/bluetooth/hci_sock.c | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index e83243318924..051fd7fd2992 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -196,7 +196,7 @@ struct hci_dev { | |||
196 | struct timer_list cmd_timer; | 196 | struct timer_list cmd_timer; |
197 | 197 | ||
198 | struct work_struct rx_work; | 198 | struct work_struct rx_work; |
199 | struct tasklet_struct cmd_task; | 199 | struct work_struct cmd_work; |
200 | struct tasklet_struct tx_task; | 200 | struct tasklet_struct tx_task; |
201 | 201 | ||
202 | struct sk_buff_head rx_q; | 202 | struct sk_buff_head rx_q; |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index de923ee60093..e2db2551b158 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -57,7 +57,7 @@ | |||
57 | int enable_hs; | 57 | int enable_hs; |
58 | 58 | ||
59 | static void hci_rx_work(struct work_struct *work); | 59 | static void hci_rx_work(struct work_struct *work); |
60 | static void hci_cmd_task(unsigned long arg); | 60 | static void hci_cmd_work(struct work_struct *work); |
61 | static void hci_tx_task(unsigned long arg); | 61 | static void hci_tx_task(unsigned long arg); |
62 | 62 | ||
63 | static DEFINE_MUTEX(hci_task_lock); | 63 | static DEFINE_MUTEX(hci_task_lock); |
@@ -209,7 +209,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) | |||
209 | skb->dev = (void *) hdev; | 209 | skb->dev = (void *) hdev; |
210 | 210 | ||
211 | skb_queue_tail(&hdev->cmd_q, skb); | 211 | skb_queue_tail(&hdev->cmd_q, skb); |
212 | tasklet_schedule(&hdev->cmd_task); | 212 | queue_work(hdev->workqueue, &hdev->cmd_work); |
213 | } | 213 | } |
214 | skb_queue_purge(&hdev->driver_init); | 214 | skb_queue_purge(&hdev->driver_init); |
215 | 215 | ||
@@ -548,7 +548,7 @@ int hci_dev_open(__u16 dev) | |||
548 | } else { | 548 | } else { |
549 | /* Init failed, cleanup */ | 549 | /* Init failed, cleanup */ |
550 | tasklet_kill(&hdev->tx_task); | 550 | tasklet_kill(&hdev->tx_task); |
551 | tasklet_kill(&hdev->cmd_task); | 551 | flush_work(&hdev->cmd_work); |
552 | flush_work(&hdev->rx_work); | 552 | flush_work(&hdev->rx_work); |
553 | 553 | ||
554 | skb_queue_purge(&hdev->cmd_q); | 554 | skb_queue_purge(&hdev->cmd_q); |
@@ -617,8 +617,8 @@ static int hci_dev_do_close(struct hci_dev *hdev) | |||
617 | clear_bit(HCI_INIT, &hdev->flags); | 617 | clear_bit(HCI_INIT, &hdev->flags); |
618 | } | 618 | } |
619 | 619 | ||
620 | /* Kill cmd task */ | 620 | /* flush cmd work */ |
621 | tasklet_kill(&hdev->cmd_task); | 621 | flush_work(&hdev->cmd_work); |
622 | 622 | ||
623 | /* Drop queues */ | 623 | /* Drop queues */ |
624 | skb_queue_purge(&hdev->rx_q); | 624 | skb_queue_purge(&hdev->rx_q); |
@@ -1207,7 +1207,7 @@ static void hci_cmd_timer(unsigned long arg) | |||
1207 | 1207 | ||
1208 | BT_ERR("%s command tx timeout", hdev->name); | 1208 | BT_ERR("%s command tx timeout", hdev->name); |
1209 | atomic_set(&hdev->cmd_cnt, 1); | 1209 | atomic_set(&hdev->cmd_cnt, 1); |
1210 | tasklet_schedule(&hdev->cmd_task); | 1210 | queue_work(hdev->workqueue, &hdev->cmd_work); |
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, | 1213 | struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, |
@@ -1458,8 +1458,8 @@ int hci_register_dev(struct hci_dev *hdev) | |||
1458 | hdev->sniff_min_interval = 80; | 1458 | hdev->sniff_min_interval = 80; |
1459 | 1459 | ||
1460 | INIT_WORK(&hdev->rx_work, hci_rx_work); | 1460 | INIT_WORK(&hdev->rx_work, hci_rx_work); |
1461 | INIT_WORK(&hdev->cmd_work, hci_cmd_work); | ||
1461 | 1462 | ||
1462 | tasklet_init(&hdev->cmd_task, hci_cmd_task,(unsigned long) hdev); | ||
1463 | tasklet_init(&hdev->tx_task, hci_tx_task, (unsigned long) hdev); | 1463 | tasklet_init(&hdev->tx_task, hci_tx_task, (unsigned long) hdev); |
1464 | 1464 | ||
1465 | skb_queue_head_init(&hdev->rx_q); | 1465 | skb_queue_head_init(&hdev->rx_q); |
@@ -1922,7 +1922,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param) | |||
1922 | hdev->init_last_cmd = opcode; | 1922 | hdev->init_last_cmd = opcode; |
1923 | 1923 | ||
1924 | skb_queue_tail(&hdev->cmd_q, skb); | 1924 | skb_queue_tail(&hdev->cmd_q, skb); |
1925 | tasklet_schedule(&hdev->cmd_task); | 1925 | queue_work(hdev->workqueue, &hdev->cmd_work); |
1926 | 1926 | ||
1927 | return 0; | 1927 | return 0; |
1928 | } | 1928 | } |
@@ -2560,9 +2560,9 @@ static void hci_rx_work(struct work_struct *work) | |||
2560 | mutex_unlock(&hci_task_lock); | 2560 | mutex_unlock(&hci_task_lock); |
2561 | } | 2561 | } |
2562 | 2562 | ||
2563 | static void hci_cmd_task(unsigned long arg) | 2563 | static void hci_cmd_work(struct work_struct *work) |
2564 | { | 2564 | { |
2565 | struct hci_dev *hdev = (struct hci_dev *) arg; | 2565 | struct hci_dev *hdev = container_of(work, struct hci_dev, cmd_work); |
2566 | struct sk_buff *skb; | 2566 | struct sk_buff *skb; |
2567 | 2567 | ||
2568 | BT_DBG("%s cmd %d", hdev->name, atomic_read(&hdev->cmd_cnt)); | 2568 | BT_DBG("%s cmd %d", hdev->name, atomic_read(&hdev->cmd_cnt)); |
@@ -2586,7 +2586,7 @@ static void hci_cmd_task(unsigned long arg) | |||
2586 | jiffies + msecs_to_jiffies(HCI_CMD_TIMEOUT)); | 2586 | jiffies + msecs_to_jiffies(HCI_CMD_TIMEOUT)); |
2587 | } else { | 2587 | } else { |
2588 | skb_queue_head(&hdev->cmd_q, skb); | 2588 | skb_queue_head(&hdev->cmd_q, skb); |
2589 | tasklet_schedule(&hdev->cmd_task); | 2589 | queue_work(hdev->workqueue, &hdev->cmd_work); |
2590 | } | 2590 | } |
2591 | } | 2591 | } |
2592 | } | 2592 | } |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 93ecb2dfa177..23466bb48423 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2112,7 +2112,7 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk | |||
2112 | if (ev->ncmd) { | 2112 | if (ev->ncmd) { |
2113 | atomic_set(&hdev->cmd_cnt, 1); | 2113 | atomic_set(&hdev->cmd_cnt, 1); |
2114 | if (!skb_queue_empty(&hdev->cmd_q)) | 2114 | if (!skb_queue_empty(&hdev->cmd_q)) |
2115 | tasklet_schedule(&hdev->cmd_task); | 2115 | queue_work(hdev->workqueue, &hdev->cmd_work); |
2116 | } | 2116 | } |
2117 | } | 2117 | } |
2118 | 2118 | ||
@@ -2194,7 +2194,7 @@ static inline void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2194 | if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) { | 2194 | if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) { |
2195 | atomic_set(&hdev->cmd_cnt, 1); | 2195 | atomic_set(&hdev->cmd_cnt, 1); |
2196 | if (!skb_queue_empty(&hdev->cmd_q)) | 2196 | if (!skb_queue_empty(&hdev->cmd_q)) |
2197 | tasklet_schedule(&hdev->cmd_task); | 2197 | queue_work(hdev->workqueue, &hdev->cmd_work); |
2198 | } | 2198 | } |
2199 | } | 2199 | } |
2200 | 2200 | ||
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 399be345ea22..d10a724810ec 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -538,7 +538,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
538 | tasklet_schedule(&hdev->tx_task); | 538 | tasklet_schedule(&hdev->tx_task); |
539 | } else { | 539 | } else { |
540 | skb_queue_tail(&hdev->cmd_q, skb); | 540 | skb_queue_tail(&hdev->cmd_q, skb); |
541 | tasklet_schedule(&hdev->cmd_task); | 541 | queue_work(hdev->workqueue, &hdev->cmd_work); |
542 | } | 542 | } |
543 | } else { | 543 | } else { |
544 | if (!capable(CAP_NET_RAW)) { | 544 | if (!capable(CAP_NET_RAW)) { |