diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-19 16:38:22 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-10-20 12:05:41 -0400 |
commit | b456f87cb0c726cf97ce1e88aecfcbacf1cdf5fe (patch) | |
tree | 6b0cae620884c4ab5f5450cfbda19ceade4c6a50 /net/bluetooth | |
parent | 4b580614e1435628490a1762726638546f3a5e4e (diff) |
Bluetooth: Move HCI_LIMITED_DISCOVERABLE changes to a general place
We'll soon be introducing also LE support for the Set Discoverable
management command, so move the HCI_LIMITED_DISCOVERABLE flag clearing
and setting out from the if-branch that is only used for a BR/EDR
specific HCI command.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 67b95a80f829..796db5849795 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1220,6 +1220,12 @@ static int set_discoverable(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1220 | cancel_delayed_work(&hdev->discov_off); | 1220 | cancel_delayed_work(&hdev->discov_off); |
1221 | hdev->discov_timeout = timeout; | 1221 | hdev->discov_timeout = timeout; |
1222 | 1222 | ||
1223 | /* Limited discoverable mode */ | ||
1224 | if (cp->val == 0x02) | ||
1225 | set_bit(HCI_LIMITED_DISCOVERABLE, &hdev->dev_flags); | ||
1226 | else | ||
1227 | clear_bit(HCI_LIMITED_DISCOVERABLE, &hdev->dev_flags); | ||
1228 | |||
1223 | hci_req_init(&req, hdev); | 1229 | hci_req_init(&req, hdev); |
1224 | 1230 | ||
1225 | scan = SCAN_PAGE; | 1231 | scan = SCAN_PAGE; |
@@ -1229,8 +1235,6 @@ static int set_discoverable(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1229 | 1235 | ||
1230 | if (cp->val == 0x02) { | 1236 | if (cp->val == 0x02) { |
1231 | /* Limited discoverable mode */ | 1237 | /* Limited discoverable mode */ |
1232 | set_bit(HCI_LIMITED_DISCOVERABLE, &hdev->dev_flags); | ||
1233 | |||
1234 | hci_cp.num_iac = 2; | 1238 | hci_cp.num_iac = 2; |
1235 | hci_cp.iac_lap[0] = 0x00; /* LIAC */ | 1239 | hci_cp.iac_lap[0] = 0x00; /* LIAC */ |
1236 | hci_cp.iac_lap[1] = 0x8b; | 1240 | hci_cp.iac_lap[1] = 0x8b; |
@@ -1240,8 +1244,6 @@ static int set_discoverable(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1240 | hci_cp.iac_lap[5] = 0x9e; | 1244 | hci_cp.iac_lap[5] = 0x9e; |
1241 | } else { | 1245 | } else { |
1242 | /* General discoverable mode */ | 1246 | /* General discoverable mode */ |
1243 | clear_bit(HCI_LIMITED_DISCOVERABLE, &hdev->dev_flags); | ||
1244 | |||
1245 | hci_cp.num_iac = 1; | 1247 | hci_cp.num_iac = 1; |
1246 | hci_cp.iac_lap[0] = 0x33; /* GIAC */ | 1248 | hci_cp.iac_lap[0] = 0x33; /* GIAC */ |
1247 | hci_cp.iac_lap[1] = 0x8b; | 1249 | hci_cp.iac_lap[1] = 0x8b; |