Bluetooth: Add lmp_host_le_capable() macro
authorAndre Guedes <andre.guedes@openbossa.org>
Thu, 30 Jun 2011 22:20:55 +0000 (19:20 -0300)
committerJaikumar Ganesh <jaikumar@google.com>
Mon, 11 Jul 2011 18:59:33 +0000 (11:59 -0700)
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: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c

index 443320072a864e73fd8c2c500db0153e08fb75d0..b68cd61f296062a702da0bd2e36a55a293a82ef7 100644 (file)
@@ -221,6 +221,9 @@ enum {
 #define LMP_INQ_TX_PWR 0x02
 #define LMP_EXTFEATURES        0x80
 
+/* Extended LMP features */
+#define LMP_HOST_LE    0x02
+
 /* Connection modes */
 #define HCI_CM_ACTIVE  0x0000
 #define HCI_CM_HOLD    0x0001
index 7b4bd049673ebaa8ce61e4a06fb5e66fd280368a..695ef3b869890c95a40e0d470ddc2a38b3a72dd4 100644 (file)
@@ -580,6 +580,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 #define lmp_no_flush_capable(dev)  ((dev)->features[6] & LMP_NO_FLUSH)
 #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 ----- */
 struct hci_proto {
        char            *name;
index cd59b849d0556af22e2bbd4848fe36e87f3f618c..886cc44e1717e6b7bf4807fb7a9548593597bb7c 100644 (file)
@@ -542,7 +542,7 @@ int hci_dev_open(__u16 dev)
                ret = __hci_request(hdev, hci_init_req, 0,
                                        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,
                                        msecs_to_jiffies(HCI_INIT_TIMEOUT));