Commit eead27da authored by Andre Guedes's avatar Andre Guedes Committed by Gustavo F. Padovan

Bluetooth: Add lmp_host_le_capable() macro

Since we have the extended LMP features properly implemented, we
should check the LMP_HOST_LE bit to know if the host supports LE.
Signed-off-by: default avatarAndre Guedes <andre.guedes@openbossa.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent e6100a25
...@@ -219,6 +219,9 @@ enum { ...@@ -219,6 +219,9 @@ enum {
#define LMP_INQ_TX_PWR 0x02 #define LMP_INQ_TX_PWR 0x02
#define LMP_EXTFEATURES 0x80 #define LMP_EXTFEATURES 0x80
/* Extended LMP features */
#define LMP_HOST_LE 0x02
/* Connection modes */ /* Connection modes */
#define HCI_CM_ACTIVE 0x0000 #define HCI_CM_ACTIVE 0x0000
#define HCI_CM_HOLD 0x0001 #define HCI_CM_HOLD 0x0001
......
...@@ -578,6 +578,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn); ...@@ -578,6 +578,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
/* ----- Extended LMP capabilities ----- */
#define lmp_host_le_capable(dev) ((dev)->extfeatures[0] & LMP_HOST_LE)
/* ----- HCI protocols ----- */ /* ----- HCI protocols ----- */
struct hci_proto { struct hci_proto {
char *name; char *name;
......
...@@ -542,7 +542,7 @@ int hci_dev_open(__u16 dev) ...@@ -542,7 +542,7 @@ int hci_dev_open(__u16 dev)
ret = __hci_request(hdev, hci_init_req, 0, ret = __hci_request(hdev, hci_init_req, 0,
msecs_to_jiffies(HCI_INIT_TIMEOUT)); msecs_to_jiffies(HCI_INIT_TIMEOUT));
if (lmp_le_capable(hdev)) if (lmp_host_le_capable(hdev))
ret = __hci_request(hdev, hci_le_init_req, 0, ret = __hci_request(hdev, hci_le_init_req, 0,
msecs_to_jiffies(HCI_INIT_TIMEOUT)); msecs_to_jiffies(HCI_INIT_TIMEOUT));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment