summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.c
diff options
context:
space:
mode:
authorJohan Hedberg2016-01-05 12:19:32 +0100
committerMarcel Holtmann2016-01-05 17:02:50 +0100
commit78b781ca0d35191ebf8d8cad8beec810270f0f2e (patch)
tree7073d457c36cb802d1dee693df70ec57beaee268 /net/bluetooth/hci_request.c
parentBluetooth: Change eir_has_data_type() to more generic eir_get_data() (diff)
downloadkernel-qcow2-linux-78b781ca0d35191ebf8d8cad8beec810270f0f2e.tar.gz
kernel-qcow2-linux-78b781ca0d35191ebf8d8cad8beec810270f0f2e.tar.xz
kernel-qcow2-linux-78b781ca0d35191ebf8d8cad8beec810270f0f2e.zip
Bluetooth: Add support for Start Limited Discovery command
This patch implements the mgmt Start Limited Discovery command. Most of existing Start Discovery code is reused since the only difference is the presence of a 'limited' flag as part of the discovery state. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r--net/bluetooth/hci_request.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 9997c31ef987..41b5f3813f02 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -1737,8 +1737,8 @@ static int le_scan_disable(struct hci_request *req, unsigned long opt)
static int bredr_inquiry(struct hci_request *req, unsigned long opt)
{
u8 length = opt;
- /* General inquiry access code (GIAC) */
- u8 lap[3] = { 0x33, 0x8b, 0x9e };
+ const u8 giac[3] = { 0x33, 0x8b, 0x9e };
+ const u8 liac[3] = { 0x00, 0x8b, 0x9e };
struct hci_cp_inquiry cp;
BT_DBG("%s", req->hdev->name);
@@ -1748,7 +1748,12 @@ static int bredr_inquiry(struct hci_request *req, unsigned long opt)
hci_dev_unlock(req->hdev);
memset(&cp, 0, sizeof(cp));
- memcpy(&cp.lap, lap, sizeof(cp.lap));
+
+ if (req->hdev->discovery.limited)
+ memcpy(&cp.lap, liac, sizeof(cp.lap));
+ else
+ memcpy(&cp.lap, giac, sizeof(cp.lap));
+
cp.length = length;
hci_req_add(req, HCI_OP_INQUIRY, sizeof(cp), &cp);