diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-02-20 15:47:49 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-20 16:08:17 -0500 |
commit | d7b7e79688c07b445bc52adfedf9a176be156f4b (patch) | |
tree | 0bdc072b86cfcf7a35b29e52336001ce2817de31 | |
parent | 801f13bd8ecc58f2cf42ec602a2b5db10fc5a132 (diff) |
Bluetooth: Set supported settings based on enabled HS and/or LE
Since neither High Speed (HS) nor Low Energy (LE) are fully implemented
yet, only expose them in supported settings when enabled.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r-- | include/net/bluetooth/hci.h | 1 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 5 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 5 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 18 |
4 files changed, 17 insertions, 12 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 60a4727be935..ad5e94c757e7 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -1422,5 +1422,6 @@ struct hci_inquiry_req { | |||
1422 | #define IREQ_CACHE_FLUSH 0x0001 | 1422 | #define IREQ_CACHE_FLUSH 0x0001 |
1423 | 1423 | ||
1424 | extern bool enable_hs; | 1424 | extern bool enable_hs; |
1425 | extern bool enable_le; | ||
1425 | 1426 | ||
1426 | #endif /* __HCI_H */ | 1427 | #endif /* __HCI_H */ |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 87ff7ffdb367..cc52e037440e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -54,8 +54,6 @@ | |||
54 | 54 | ||
55 | #define AUTO_OFF_TIMEOUT 2000 | 55 | #define AUTO_OFF_TIMEOUT 2000 |
56 | 56 | ||
57 | bool enable_hs; | ||
58 | |||
59 | static void hci_rx_work(struct work_struct *work); | 57 | static void hci_rx_work(struct work_struct *work); |
60 | static void hci_cmd_work(struct work_struct *work); | 58 | static void hci_cmd_work(struct work_struct *work); |
61 | static void hci_tx_work(struct work_struct *work); | 59 | static void hci_tx_work(struct work_struct *work); |
@@ -2913,6 +2911,3 @@ int hci_cancel_inquiry(struct hci_dev *hdev) | |||
2913 | 2911 | ||
2914 | return hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL); | 2912 | return hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL); |
2915 | } | 2913 | } |
2916 | |||
2917 | module_param(enable_hs, bool, 0644); | ||
2918 | MODULE_PARM_DESC(enable_hs, "Enable High Speed"); | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index f00faf0ac32f..5d0f92a948c2 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -44,8 +44,6 @@ | |||
44 | #include <net/bluetooth/bluetooth.h> | 44 | #include <net/bluetooth/bluetooth.h> |
45 | #include <net/bluetooth/hci_core.h> | 45 | #include <net/bluetooth/hci_core.h> |
46 | 46 | ||
47 | static bool enable_le; | ||
48 | |||
49 | /* Handle HCI Event packets */ | 47 | /* Handle HCI Event packets */ |
50 | 48 | ||
51 | static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) | 49 | static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) |
@@ -3545,6 +3543,3 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
3545 | kfree_skb(skb); | 3543 | kfree_skb(skb); |
3546 | hdev->stat.evt_rx++; | 3544 | hdev->stat.evt_rx++; |
3547 | } | 3545 | } |
3548 | |||
3549 | module_param(enable_le, bool, 0644); | ||
3550 | MODULE_PARM_DESC(enable_le, "Enable LE support"); | ||
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index bc71b45ef4e5..f7c2969d8829 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -34,6 +34,9 @@ | |||
34 | #include <net/bluetooth/mgmt.h> | 34 | #include <net/bluetooth/mgmt.h> |
35 | #include <net/bluetooth/smp.h> | 35 | #include <net/bluetooth/smp.h> |
36 | 36 | ||
37 | bool enable_hs; | ||
38 | bool enable_le; | ||
39 | |||
37 | #define MGMT_VERSION 1 | 40 | #define MGMT_VERSION 1 |
38 | #define MGMT_REVISION 0 | 41 | #define MGMT_REVISION 0 |
39 | 42 | ||
@@ -374,8 +377,13 @@ static u32 get_supported_settings(struct hci_dev *hdev) | |||
374 | settings |= MGMT_SETTING_LINK_SECURITY; | 377 | settings |= MGMT_SETTING_LINK_SECURITY; |
375 | } | 378 | } |
376 | 379 | ||
377 | if (hdev->features[4] & LMP_LE) | 380 | if (enable_hs) |
378 | settings |= MGMT_SETTING_LE; | 381 | settings |= MGMT_SETTING_HS; |
382 | |||
383 | if (enable_le) { | ||
384 | if (hdev->features[4] & LMP_LE) | ||
385 | settings |= MGMT_SETTING_LE; | ||
386 | } | ||
379 | 387 | ||
380 | return settings; | 388 | return settings; |
381 | } | 389 | } |
@@ -3421,3 +3429,9 @@ int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type) | |||
3421 | return mgmt_event(MGMT_EV_DEVICE_UNBLOCKED, hdev, &ev, sizeof(ev), | 3429 | return mgmt_event(MGMT_EV_DEVICE_UNBLOCKED, hdev, &ev, sizeof(ev), |
3422 | cmd ? cmd->sk : NULL); | 3430 | cmd ? cmd->sk : NULL); |
3423 | } | 3431 | } |
3432 | |||
3433 | module_param(enable_hs, bool, 0644); | ||
3434 | MODULE_PARM_DESC(enable_hs, "Enable High Speed support"); | ||
3435 | |||
3436 | module_param(enable_le, bool, 0644); | ||
3437 | MODULE_PARM_DESC(enable_le, "Enable Low Energy support"); | ||