diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-05-03 01:12:31 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo@padovan.org> | 2012-05-09 00:40:52 -0400 |
commit | 9d42820f378e6372f154a3f0c8def5d4bba29191 (patch) | |
tree | b4d5263609b9a6228f697ed6eda7e7d019ff4477 | |
parent | 2ee8ce35b1e8ba2523fa4c45fa19f9dbe321f008 (diff) |
Bluetooth: Enable Low Energy support by default
The Bluetooth Low Energy support so far was disabled by default via
a module parameter. With this change the module parameter will be removed
and Low Energy is enabled by default.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
-rw-r--r-- | include/net/bluetooth/hci.h | 1 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 2 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 12 |
3 files changed, 4 insertions, 11 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 346f08779792..66a7b579e31c 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -1438,6 +1438,5 @@ struct hci_inquiry_req { | |||
1438 | #define IREQ_CACHE_FLUSH 0x0001 | 1438 | #define IREQ_CACHE_FLUSH 0x0001 |
1439 | 1439 | ||
1440 | extern bool enable_hs; | 1440 | extern bool enable_hs; |
1441 | extern bool enable_le; | ||
1442 | 1441 | ||
1443 | #endif /* __HCI_H */ | 1442 | #endif /* __HCI_H */ |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index ae0a57d21ec4..d81262aff263 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -725,7 +725,7 @@ static void hci_set_le_support(struct hci_dev *hdev) | |||
725 | 725 | ||
726 | memset(&cp, 0, sizeof(cp)); | 726 | memset(&cp, 0, sizeof(cp)); |
727 | 727 | ||
728 | if (enable_le && test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { | 728 | if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { |
729 | cp.le = 1; | 729 | cp.le = 1; |
730 | cp.simul = !!(hdev->features[6] & LMP_SIMUL_LE_BR); | 730 | cp.simul = !!(hdev->features[6] & LMP_SIMUL_LE_BR); |
731 | } | 731 | } |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 9038118d37a3..966f6bcfbcb9 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <net/bluetooth/smp.h> | 35 | #include <net/bluetooth/smp.h> |
36 | 36 | ||
37 | bool enable_hs; | 37 | bool enable_hs; |
38 | bool enable_le; | ||
39 | 38 | ||
40 | #define MGMT_VERSION 1 | 39 | #define MGMT_VERSION 1 |
41 | #define MGMT_REVISION 1 | 40 | #define MGMT_REVISION 1 |
@@ -384,10 +383,8 @@ static u32 get_supported_settings(struct hci_dev *hdev) | |||
384 | if (enable_hs) | 383 | if (enable_hs) |
385 | settings |= MGMT_SETTING_HS; | 384 | settings |= MGMT_SETTING_HS; |
386 | 385 | ||
387 | if (enable_le) { | 386 | if (hdev->features[4] & LMP_LE) |
388 | if (hdev->features[4] & LMP_LE) | 387 | settings |= MGMT_SETTING_LE; |
389 | settings |= MGMT_SETTING_LE; | ||
390 | } | ||
391 | 388 | ||
392 | return settings; | 389 | return settings; |
393 | } | 390 | } |
@@ -1199,7 +1196,7 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) | |||
1199 | 1196 | ||
1200 | hci_dev_lock(hdev); | 1197 | hci_dev_lock(hdev); |
1201 | 1198 | ||
1202 | if (!enable_le || !(hdev->features[4] & LMP_LE)) { | 1199 | if (!(hdev->features[4] & LMP_LE)) { |
1203 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_LE, | 1200 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_LE, |
1204 | MGMT_STATUS_NOT_SUPPORTED); | 1201 | MGMT_STATUS_NOT_SUPPORTED); |
1205 | goto unlock; | 1202 | goto unlock; |
@@ -3657,6 +3654,3 @@ int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type) | |||
3657 | 3654 | ||
3658 | module_param(enable_hs, bool, 0644); | 3655 | module_param(enable_hs, bool, 0644); |
3659 | MODULE_PARM_DESC(enable_hs, "Enable High Speed support"); | 3656 | MODULE_PARM_DESC(enable_hs, "Enable High Speed support"); |
3660 | |||
3661 | module_param(enable_le, bool, 0644); | ||
3662 | MODULE_PARM_DESC(enable_le, "Enable Low Energy support"); | ||