diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-15 09:33:53 -0400 |
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-15 10:20:15 -0400 |
| commit | 6acd7db41dc2b6bc91b930edf21fbfd8654cbb68 (patch) | |
| tree | 5983c35c2a55834279b1b2bb9a867a622d144a88 | |
| parent | 441ad2d04123eecb06d7c14948a0e7b07bf75aa5 (diff) | |
Bluetooth: Introduce flag for limited discoverable mode
Add a new flag that can be set when in limited discoverable mode. This
flag will cause the limited discoverable bit in the class of device
value to bet set.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| -rw-r--r-- | include/net/bluetooth/hci.h | 1 | ||||
| -rw-r--r-- | net/bluetooth/mgmt.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index b096f5f73789..f4650a8c1194 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -125,6 +125,7 @@ enum { | |||
| 125 | HCI_ADVERTISING, | 125 | HCI_ADVERTISING, |
| 126 | HCI_CONNECTABLE, | 126 | HCI_CONNECTABLE, |
| 127 | HCI_DISCOVERABLE, | 127 | HCI_DISCOVERABLE, |
| 128 | HCI_LIMITED_DISCOVERABLE, | ||
| 128 | HCI_LINK_SECURITY, | 129 | HCI_LINK_SECURITY, |
| 129 | HCI_PERIODIC_INQ, | 130 | HCI_PERIODIC_INQ, |
| 130 | HCI_FAST_CONNECTABLE, | 131 | HCI_FAST_CONNECTABLE, |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 285d571eee6b..d5eaa28bfd52 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
| @@ -724,6 +724,9 @@ static void update_class(struct hci_request *req) | |||
| 724 | cod[1] = hdev->major_class; | 724 | cod[1] = hdev->major_class; |
| 725 | cod[2] = get_service_classes(hdev); | 725 | cod[2] = get_service_classes(hdev); |
| 726 | 726 | ||
| 727 | if (test_bit(HCI_LIMITED_DISCOVERABLE, &hdev->dev_flags)) | ||
| 728 | cod[1] |= 0x20; | ||
| 729 | |||
| 727 | if (memcmp(cod, hdev->dev_class, 3) == 0) | 730 | if (memcmp(cod, hdev->dev_class, 3) == 0) |
| 728 | return; | 731 | return; |
| 729 | 732 | ||
