diff options
Diffstat (limited to 'net/bluetooth/mgmt.c')
-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; |