SHARE
TWEET

Untitled

a guest Aug 13th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
  2. index 69967e5..9a161b8 100644
  3. --- a/include/net/bluetooth/hci_core.h
  4. +++ b/include/net/bluetooth/hci_core.h
  5. @@ -126,6 +126,8 @@ struct hci_dev {
  6.         __u16           sniff_min_interval;
  7.         __u16           sniff_max_interval;
  8.  
  9. +       __u32           auto_accept_delay;
  10. +
  11.         unsigned long   quirks;
  12.  
  13.         atomic_t        cmd_cnt;
  14. diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
  15. index 8775933..a6c3aa8 100644
  16. --- a/net/bluetooth/hci_sysfs.c
  17. +++ b/net/bluetooth/hci_sysfs.c
  18. @@ -511,6 +511,35 @@ static const struct file_operations uuids_fops = {
  19.         .release        = single_release,
  20.  };
  21.  
  22. +static int auto_accept_delay_set(void *data, u64 val)
  23. +{
  24. +       struct hci_dev *hdev = data;
  25. +
  26. +       hci_dev_lock_bh(hdev);
  27. +
  28. +       hdev->auto_accept_delay = val;
  29. +
  30. +       hci_dev_unlock_bh(hdev);
  31. +
  32. +       return 0;
  33. +}
  34. +
  35. +static int auto_accept_delay_get(void *data, u64 *val)
  36. +{
  37. +       struct hci_dev *hdev = data;
  38. +
  39. +       hci_dev_lock_bh(hdev);
  40. +
  41. +       *val = hdev->auto_accept_delay;
  42. +
  43. +       hci_dev_unlock_bh(hdev);
  44. +
  45. +       return 0;
  46. +}
  47. +
  48. +DEFINE_SIMPLE_ATTRIBUTE(auto_accept_delay_fops, auto_accept_delay_get,
  49. +                                       auto_accept_delay_set, "%llu\n");
  50. +
  51.  int hci_register_sysfs(struct hci_dev *hdev)
  52.  {
  53.         struct device *dev = &hdev->dev;
  54. @@ -545,6 +574,8 @@ int hci_register_sysfs(struct hci_dev *hdev)
  55.  
  56.         debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops);
  57.  
  58. +       debugfs_create_file("auto_accept_delay", 0444, hdev->debugfs, hdev,
  59. +                                               &auto_accept_delay_fops);
  60.         return 0;
  61.  }
RAW Paste Data
Top