diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-03-05 13:37:47 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-03-08 08:40:26 -0500 |
commit | 11714b3d7acee54eecf85d41c938923a02fdd054 (patch) | |
tree | 3b22e42a6ffd636a94e97c3b86b0fc72b62c0df0 /net/bluetooth | |
parent | 71c76a170e979d60e01bd093c9b79e3adeb710cc (diff) |
Bluetooth: Fix stand-alone HCI command handling
To have a consistent content for hdev->cmd_q all entries need to follow
the semantics of asynchronous HCI requests. This means that even single
commands need to be dressed as requests by having a request start
indicator. This patch adds these indicators to the two places needing
it (hci_send_cmd and hci_sock_sendmsg).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 5 | ||||
-rw-r--r-- | net/bluetooth/hci_sock.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 6e6a9dd8a155..4f8142bdf655 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -2511,6 +2511,11 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param) | |||
2511 | if (test_bit(HCI_INIT, &hdev->flags)) | 2511 | if (test_bit(HCI_INIT, &hdev->flags)) |
2512 | hdev->init_last_cmd = opcode; | 2512 | hdev->init_last_cmd = opcode; |
2513 | 2513 | ||
2514 | /* Stand-alone HCI commands must be flaged as | ||
2515 | * single-command requests. | ||
2516 | */ | ||
2517 | bt_cb(skb)->req.start = true; | ||
2518 | |||
2514 | skb_queue_tail(&hdev->cmd_q, skb); | 2519 | skb_queue_tail(&hdev->cmd_q, skb); |
2515 | queue_work(hdev->workqueue, &hdev->cmd_work); | 2520 | queue_work(hdev->workqueue, &hdev->cmd_work); |
2516 | 2521 | ||
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index ec044d31f79c..aa4354fca77c 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -854,6 +854,11 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
854 | skb_queue_tail(&hdev->raw_q, skb); | 854 | skb_queue_tail(&hdev->raw_q, skb); |
855 | queue_work(hdev->workqueue, &hdev->tx_work); | 855 | queue_work(hdev->workqueue, &hdev->tx_work); |
856 | } else { | 856 | } else { |
857 | /* Stand-alone HCI commands must be flaged as | ||
858 | * single-command requests. | ||
859 | */ | ||
860 | bt_cb(skb)->req.start = true; | ||
861 | |||
857 | skb_queue_tail(&hdev->cmd_q, skb); | 862 | skb_queue_tail(&hdev->cmd_q, skb); |
858 | queue_work(hdev->workqueue, &hdev->cmd_work); | 863 | queue_work(hdev->workqueue, &hdev->cmd_work); |
859 | } | 864 | } |