aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-01-08 16:11:15 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:25 -0500
commita8b2d5c2cfe1c6398e3fdd4372c4ae7f74fb4493 (patch)
tree5e732f5143512a52eb7a343c143c1eaeb565c8f7 /net/bluetooth/mgmt.c
parentcbe8fed490601862310f035b9973509b8634998e (diff)
Bluetooth: Move mgmt related flags from hdev->flags to hdev->dev_flags
There's no point in exposing these to user-space (which is what happens to everything in hdev->flags) so move them to dev_flags instead. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 295cfc8a3076..3de1e909471a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -226,10 +226,10 @@ static int read_index_list(struct sock *sk)
226 226
227 i = 0; 227 i = 0;
228 list_for_each_entry(d, &hci_dev_list, list) { 228 list_for_each_entry(d, &hci_dev_list, list) {
229 if (test_and_clear_bit(HCI_AUTO_OFF, &d->flags)) 229 if (test_and_clear_bit(HCI_AUTO_OFF, &d->dev_flags))
230 cancel_delayed_work(&d->power_off); 230 cancel_delayed_work(&d->power_off);
231 231
232 if (test_bit(HCI_SETUP, &d->flags)) 232 if (test_bit(HCI_SETUP, &d->dev_flags))
233 continue; 233 continue;
234 234
235 put_unaligned_le16(d->id, &rp->index[i++]); 235 put_unaligned_le16(d->id, &rp->index[i++]);
@@ -285,7 +285,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
285 if (test_bit(HCI_ISCAN, &hdev->flags)) 285 if (test_bit(HCI_ISCAN, &hdev->flags))
286 settings |= MGMT_SETTING_DISCOVERABLE; 286 settings |= MGMT_SETTING_DISCOVERABLE;
287 287
288 if (test_bit(HCI_PAIRABLE, &hdev->flags)) 288 if (test_bit(HCI_PAIRABLE, &hdev->dev_flags))
289 settings |= MGMT_SETTING_PAIRABLE; 289 settings |= MGMT_SETTING_PAIRABLE;
290 290
291 if (!(hdev->features[4] & LMP_NO_BREDR)) 291 if (!(hdev->features[4] & LMP_NO_BREDR))
@@ -419,7 +419,7 @@ static int update_eir(struct hci_dev *hdev)
419 if (hdev->ssp_mode == 0) 419 if (hdev->ssp_mode == 0)
420 return 0; 420 return 0;
421 421
422 if (test_bit(HCI_SERVICE_CACHE, &hdev->flags)) 422 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
423 return 0; 423 return 0;
424 424
425 memset(&cp, 0, sizeof(cp)); 425 memset(&cp, 0, sizeof(cp));
@@ -451,7 +451,7 @@ static int update_class(struct hci_dev *hdev)
451 451
452 BT_DBG("%s", hdev->name); 452 BT_DBG("%s", hdev->name);
453 453
454 if (test_bit(HCI_SERVICE_CACHE, &hdev->flags)) 454 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
455 return 0; 455 return 0;
456 456
457 cod[0] = hdev->minor_class; 457 cod[0] = hdev->minor_class;
@@ -469,7 +469,7 @@ static void service_cache_off(struct work_struct *work)
469 struct hci_dev *hdev = container_of(work, struct hci_dev, 469 struct hci_dev *hdev = container_of(work, struct hci_dev,
470 service_cache.work); 470 service_cache.work);
471 471
472 if (!test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->flags)) 472 if (!test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
473 return; 473 return;
474 474
475 hci_dev_lock(hdev); 475 hci_dev_lock(hdev);
@@ -482,10 +482,10 @@ static void service_cache_off(struct work_struct *work)
482 482
483static void mgmt_init_hdev(struct hci_dev *hdev) 483static void mgmt_init_hdev(struct hci_dev *hdev)
484{ 484{
485 if (!test_and_set_bit(HCI_MGMT, &hdev->flags)) 485 if (!test_and_set_bit(HCI_MGMT, &hdev->dev_flags))
486 INIT_DELAYED_WORK(&hdev->service_cache, service_cache_off); 486 INIT_DELAYED_WORK(&hdev->service_cache, service_cache_off);
487 487
488 if (!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->flags)) 488 if (!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
489 schedule_delayed_work(&hdev->service_cache, 489 schedule_delayed_work(&hdev->service_cache,
490 msecs_to_jiffies(SERVICE_CACHE_TIMEOUT)); 490 msecs_to_jiffies(SERVICE_CACHE_TIMEOUT));
491} 491}
@@ -502,7 +502,7 @@ static int read_controller_info(struct sock *sk, u16 index)
502 return cmd_status(sk, index, MGMT_OP_READ_INFO, 502 return cmd_status(sk, index, MGMT_OP_READ_INFO,
503 MGMT_STATUS_INVALID_PARAMS); 503 MGMT_STATUS_INVALID_PARAMS);
504 504
505 if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->flags)) 505 if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags))
506 cancel_delayed_work_sync(&hdev->power_off); 506 cancel_delayed_work_sync(&hdev->power_off);
507 507
508 hci_dev_lock(hdev); 508 hci_dev_lock(hdev);
@@ -851,9 +851,9 @@ static int set_pairable(struct sock *sk, u16 index, unsigned char *data,
851 hci_dev_lock(hdev); 851 hci_dev_lock(hdev);
852 852
853 if (cp->val) 853 if (cp->val)
854 set_bit(HCI_PAIRABLE, &hdev->flags); 854 set_bit(HCI_PAIRABLE, &hdev->dev_flags);
855 else 855 else
856 clear_bit(HCI_PAIRABLE, &hdev->flags); 856 clear_bit(HCI_PAIRABLE, &hdev->dev_flags);
857 857
858 err = send_settings_rsp(sk, MGMT_OP_SET_PAIRABLE, hdev); 858 err = send_settings_rsp(sk, MGMT_OP_SET_PAIRABLE, hdev);
859 if (err < 0) 859 if (err < 0)
@@ -1008,7 +1008,7 @@ static int set_dev_class(struct sock *sk, u16 index, unsigned char *data,
1008 hdev->major_class = cp->major; 1008 hdev->major_class = cp->major;
1009 hdev->minor_class = cp->minor; 1009 hdev->minor_class = cp->minor;
1010 1010
1011 if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->flags)) { 1011 if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) {
1012 hci_dev_unlock(hdev); 1012 hci_dev_unlock(hdev);
1013 cancel_delayed_work_sync(&hdev->service_cache); 1013 cancel_delayed_work_sync(&hdev->service_cache);
1014 hci_dev_lock(hdev); 1014 hci_dev_lock(hdev);
@@ -1063,12 +1063,12 @@ static int load_link_keys(struct sock *sk, u16 index, unsigned char *data,
1063 1063
1064 hci_link_keys_clear(hdev); 1064 hci_link_keys_clear(hdev);
1065 1065
1066 set_bit(HCI_LINK_KEYS, &hdev->flags); 1066 set_bit(HCI_LINK_KEYS, &hdev->dev_flags);
1067 1067
1068 if (cp->debug_keys) 1068 if (cp->debug_keys)
1069 set_bit(HCI_DEBUG_KEYS, &hdev->flags); 1069 set_bit(HCI_DEBUG_KEYS, &hdev->dev_flags);
1070 else 1070 else
1071 clear_bit(HCI_DEBUG_KEYS, &hdev->flags); 1071 clear_bit(HCI_DEBUG_KEYS, &hdev->dev_flags);
1072 1072
1073 for (i = 0; i < key_count; i++) { 1073 for (i = 0; i < key_count; i++) {
1074 struct mgmt_link_key_info *key = &cp->keys[i]; 1074 struct mgmt_link_key_info *key = &cp->keys[i];