Bluetooth: Add __hci_cmd_sync() helper function
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 2 Apr 2013 10:35:04 +0000 (13:35 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 4 Apr 2013 16:16:06 +0000 (19:16 +0300)
commit75e84b7c522c6e07964cd1f5bf28535768a1e9fa
treef446f05dddbc3fff7f9345ac524239f4e7d19baf
parentb6ddb638235d90ed67af9af40e63880fd66a1939
Bluetooth: Add __hci_cmd_sync() helper function

This patch adds a helper function for sending a single HCI command
waiting for its completion and then returning back the parameters in the
resulting command complete event (if there was one).

The implementation is very similar to that of hci_req_sync() except that
instead of invocing a callback for sending HCI commands the function
constructs and sends one itself and after being woken up picks the last
received event from hdev->recv_evt (if it matches the right criteria)
and returns it.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c