summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sock.c
diff options
context:
space:
mode:
authorJohan Hedberg2013-03-05 19:37:47 +0100
committerGustavo Padovan2013-03-08 14:40:26 +0100
commit11714b3d7acee54eecf85d41c938923a02fdd054 (patch)
tree3b22e42a6ffd636a94e97c3b86b0fc72b62c0df0 /net/bluetooth/hci_sock.c
parentBluetooth: Introduce new hci_req_add function (diff)
downloadkernel-qcow2-linux-11714b3d7acee54eecf85d41c938923a02fdd054.tar.gz
kernel-qcow2-linux-11714b3d7acee54eecf85d41c938923a02fdd054.tar.xz
kernel-qcow2-linux-11714b3d7acee54eecf85d41c938923a02fdd054.zip
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/hci_sock.c')
-rw-r--r--net/bluetooth/hci_sock.c5
1 files changed, 5 insertions, 0 deletions
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,
skb_queue_tail(&hdev->raw_q, skb);
queue_work(hdev->workqueue, &hdev->tx_work);
} else {
+ /* Stand-alone HCI commands must be flaged as
+ * single-command requests.
+ */
+ bt_cb(skb)->req.start = true;
+
skb_queue_tail(&hdev->cmd_q, skb);
queue_work(hdev->workqueue, &hdev->cmd_work);
}