aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-03 02:35:18 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-03 15:31:08 -0500
commit04422da990b33bf814944a3dd5d49c920eae4f7b (patch)
treeb075380a8f6d4184b818d0c06787356d25755a21
parent36cf942adf78c215f381554dfbac0ef8d05a6c21 (diff)
Bluetooth: Remove dead code for manufacturer inquiry mode quirks
There are some old Bluetooth modules from Silicon Wave and Broadcom which support Inquiry Result with RSSI, but do not advertise it. The core has quirks in the code to enable that inquiry mode. However as it stands right now, that code is not even executed since entering the function to determine which inquiry mode requires that the device has the feature bit for Inquiry Result with RSSI set in the first place. So this makes this dead code that hasn't work for a long time. In conclusion, just remove these extra quirks and simplify the setup of the inquiry mode to be inline and with that a lot easier to read and understand. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/hci_core.c50
1 files changed, 11 insertions, 39 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 6c12110b75a7..ebac859e1258 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -497,43 +497,6 @@ static void le_setup(struct hci_request *req)
497 set_bit(HCI_LE_ENABLED, &hdev->dev_flags); 497 set_bit(HCI_LE_ENABLED, &hdev->dev_flags);
498} 498}
499 499
500static u8 hci_get_inquiry_mode(struct hci_dev *hdev)
501{
502 if (lmp_ext_inq_capable(hdev))
503 return 0x02;
504
505 if (lmp_inq_rssi_capable(hdev))
506 return 0x01;
507
508 if (hdev->manufacturer == 11 && hdev->hci_rev == 0x00 &&
509 hdev->lmp_subver == 0x0757)
510 return 0x01;
511
512 if (hdev->manufacturer == 15) {
513 if (hdev->hci_rev == 0x03 && hdev->lmp_subver == 0x6963)
514 return 0x01;
515 if (hdev->hci_rev == 0x09 && hdev->lmp_subver == 0x6963)
516 return 0x01;
517 if (hdev->hci_rev == 0x00 && hdev->lmp_subver == 0x6965)
518 return 0x01;
519 }
520
521 if (hdev->manufacturer == 31 && hdev->hci_rev == 0x2005 &&
522 hdev->lmp_subver == 0x1805)
523 return 0x01;
524
525 return 0x00;
526}
527
528static void hci_setup_inquiry_mode(struct hci_request *req)
529{
530 u8 mode;
531
532 mode = hci_get_inquiry_mode(req->hdev);
533
534 hci_req_add(req, HCI_OP_WRITE_INQUIRY_MODE, 1, &mode);
535}
536
537static void hci_setup_event_mask(struct hci_request *req) 500static void hci_setup_event_mask(struct hci_request *req)
538{ 501{
539 struct hci_dev *hdev = req->hdev; 502 struct hci_dev *hdev = req->hdev;
@@ -658,8 +621,17 @@ static void hci_init2_req(struct hci_request *req, unsigned long opt)
658 } 621 }
659 } 622 }
660 623
661 if (lmp_inq_rssi_capable(hdev)) 624 if (lmp_inq_rssi_capable(hdev)) {
662 hci_setup_inquiry_mode(req); 625 u8 mode;
626
627 /* If Extended Inquiry Result events are supported, then
628 * they are clearly preferred over Inquiry Result with RSSI
629 * events.
630 */
631 mode = lmp_ext_inq_capable(hdev) ? 0x02 : 0x01;
632
633 hci_req_add(req, HCI_OP_WRITE_INQUIRY_MODE, 1, &mode);
634 }
663 635
664 if (lmp_inq_tx_pwr_capable(hdev)) 636 if (lmp_inq_tx_pwr_capable(hdev))
665 hci_req_add(req, HCI_OP_READ_INQ_RSP_TX_POWER, 0, NULL); 637 hci_req_add(req, HCI_OP_READ_INQ_RSP_TX_POWER, 0, NULL);