Skip to content

Commit

Permalink
Bluetooth: Enable Low Energy support by default
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcel Holtmann authored and Gustavo Padovan committed May 9, 2012
1 parent 2ee8ce3 commit 9d42820
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,5 @@ struct hci_inquiry_req {
#define IREQ_CACHE_FLUSH 0x0001

extern bool enable_hs;
extern bool enable_le;

#endif /* __HCI_H */
2 changes: 1 addition & 1 deletion net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ static void hci_set_le_support(struct hci_dev *hdev)

memset(&cp, 0, sizeof(cp));

if (enable_le && test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {
if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {
cp.le = 1;
cp.simul = !!(hdev->features[6] & LMP_SIMUL_LE_BR);
}
Expand Down
12 changes: 3 additions & 9 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <net/bluetooth/smp.h>

bool enable_hs;
bool enable_le;

#define MGMT_VERSION 1
#define MGMT_REVISION 1
Expand Down Expand Up @@ -384,10 +383,8 @@ static u32 get_supported_settings(struct hci_dev *hdev)
if (enable_hs)
settings |= MGMT_SETTING_HS;

if (enable_le) {
if (hdev->features[4] & LMP_LE)
settings |= MGMT_SETTING_LE;
}
if (hdev->features[4] & LMP_LE)
settings |= MGMT_SETTING_LE;

return settings;
}
Expand Down Expand Up @@ -1199,7 +1196,7 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)

hci_dev_lock(hdev);

if (!enable_le || !(hdev->features[4] & LMP_LE)) {
if (!(hdev->features[4] & LMP_LE)) {
err = cmd_status(sk, hdev->id, MGMT_OP_SET_LE,
MGMT_STATUS_NOT_SUPPORTED);
goto unlock;
Expand Down Expand Up @@ -3657,6 +3654,3 @@ int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)

module_param(enable_hs, bool, 0644);
MODULE_PARM_DESC(enable_hs, "Enable High Speed support");

module_param(enable_le, bool, 0644);
MODULE_PARM_DESC(enable_le, "Enable Low Energy support");

0 comments on commit 9d42820

Please sign in to comment.