diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-11 13:24:21 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-11-19 19:50:31 +0300 |
commit | 7df26b56297456a133b8cc2efb069065d6b9a555 (patch) | |
tree | 3acc8fea8cb4e93a68d3fcbdacc22204113790b9 | |
parent | 2f27498107c298b9cdd93c77d9e3ad409949b36b (diff) | |
download | linux-7df26b56297456a133b8cc2efb069065d6b9a555.tar.xz |
Bluetooth: Pass inquiry length to bredr_inquiry()
Passing the needed inquiry length to bredr_inquiry() makes it possible
to also use this helper for interleaved discovery where the controller
doesn't support simultaneous Inquiry & LE scan.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/bluetooth/hci_request.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 3219ee66faad..98827e7631ca 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -1044,6 +1044,7 @@ static void le_scan_restart_work(struct work_struct *work) static int bredr_inquiry(struct hci_request *req, unsigned long opt) { + u8 length = opt; struct hci_cp_inquiry cp; /* General inquiry access code (GIAC) */ u8 lap[3] = { 0x33, 0x8b, 0x9e }; @@ -1056,7 +1057,7 @@ static int bredr_inquiry(struct hci_request *req, unsigned long opt) memset(&cp, 0, sizeof(cp)); memcpy(&cp.lap, lap, sizeof(cp.lap)); - cp.length = DISCOV_BREDR_INQUIRY_LEN; + cp.length = length; hci_req_add(req, HCI_OP_INQUIRY, sizeof(cp), &cp); @@ -1150,7 +1151,7 @@ static int interleaved_discov(struct hci_request *req, unsigned long opt) if (err) return err; - return bredr_inquiry(req, opt); + return bredr_inquiry(req, DISCOV_BREDR_INQUIRY_LEN); } static void start_discovery(struct hci_dev *hdev, u8 *status) @@ -1162,7 +1163,8 @@ static void start_discovery(struct hci_dev *hdev, u8 *status) switch (hdev->discovery.type) { case DISCOV_TYPE_BREDR: if (!hci_dev_test_flag(hdev, HCI_INQUIRY)) - hci_req_sync(hdev, bredr_inquiry, 0, HCI_CMD_TIMEOUT, + hci_req_sync(hdev, bredr_inquiry, + DISCOV_BREDR_INQUIRY_LEN, HCI_CMD_TIMEOUT, status); return; case DISCOV_TYPE_INTERLEAVED: |