aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2016-01-05 06:19:32 -0500
committerMarcel Holtmann <marcel@holtmann.org>2016-01-05 11:02:50 -0500
commit78b781ca0d35191ebf8d8cad8beec810270f0f2e (patch)
tree7073d457c36cb802d1dee693df70ec57beaee268 /net/bluetooth/hci_request.c
parent0d3b7f64c84d53658daf28e2f9772e38acb9340d (diff)
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)
1737static int bredr_inquiry(struct hci_request *req, unsigned long opt) 1737static int bredr_inquiry(struct hci_request *req, unsigned long opt)
1738{ 1738{
1739 u8 length = opt; 1739 u8 length = opt;
1740 /* General inquiry access code (GIAC) */ 1740 const u8 giac[3] = { 0x33, 0x8b, 0x9e };
1741 u8 lap[3] = { 0x33, 0x8b, 0x9e }; 1741 const u8 liac[3] = { 0x00, 0x8b, 0x9e };
1742 struct hci_cp_inquiry cp; 1742 struct hci_cp_inquiry cp;
1743 1743
1744 BT_DBG("%s", req->hdev->name); 1744 BT_DBG("%s", req->hdev->name);
@@ -1748,7 +1748,12 @@ static int bredr_inquiry(struct hci_request *req, unsigned long opt)
1748 hci_dev_unlock(req->hdev); 1748 hci_dev_unlock(req->hdev);
1749 1749
1750 memset(&cp, 0, sizeof(cp)); 1750 memset(&cp, 0, sizeof(cp));
1751 memcpy(&cp.lap, lap, sizeof(cp.lap)); 1751
1752 if (req->hdev->discovery.limited)
1753 memcpy(&cp.lap, liac, sizeof(cp.lap));
1754 else
1755 memcpy(&cp.lap, giac, sizeof(cp.lap));
1756
1752 cp.length = length; 1757 cp.length = length;
1753 1758
1754 hci_req_add(req, HCI_OP_INQUIRY, sizeof(cp), &cp); 1759 hci_req_add(req, HCI_OP_INQUIRY, sizeof(cp), &cp);