aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2011-06-30 18:20:52 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-07-06 18:10:27 -0400
commit971e3a4bbcbf7378315b85150853d86be59cffe0 (patch)
tree4c93a5a8411893e4b21522eca4b28f532e9bbe41 /net/bluetooth
parent02f1b641060486df8eecd66b060ae6551f398593 (diff)
Bluetooth: Add extfeatures to struct hci_dev
This new field holds the extended LMP features value. Some LE mechanism such as discovery procedure needs to read the extended LMP features to work properly. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_event.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ac2c5e89617c..93d528cddaa7 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -542,6 +542,14 @@ static void hci_setup(struct hci_dev *hdev)
542 542
543 if (hdev->features[7] & LMP_INQ_TX_PWR) 543 if (hdev->features[7] & LMP_INQ_TX_PWR)
544 hci_send_cmd(hdev, HCI_OP_READ_INQ_RSP_TX_POWER, 0, NULL); 544 hci_send_cmd(hdev, HCI_OP_READ_INQ_RSP_TX_POWER, 0, NULL);
545
546 if (hdev->features[7] & LMP_EXTFEATURES) {
547 struct hci_cp_read_local_ext_features cp;
548
549 cp.page = 0x01;
550 hci_send_cmd(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES,
551 sizeof(cp), &cp);
552 }
545} 553}
546 554
547static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb) 555static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb)
@@ -658,6 +666,21 @@ static void hci_cc_read_local_features(struct hci_dev *hdev, struct sk_buff *skb
658 hdev->features[6], hdev->features[7]); 666 hdev->features[6], hdev->features[7]);
659} 667}
660 668
669static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
670 struct sk_buff *skb)
671{
672 struct hci_rp_read_local_ext_features *rp = (void *) skb->data;
673
674 BT_DBG("%s status 0x%x", hdev->name, rp->status);
675
676 if (rp->status)
677 return;
678
679 memcpy(hdev->extfeatures, rp->features, 8);
680
681 hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status);
682}
683
661static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb) 684static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb)
662{ 685{
663 struct hci_rp_read_buffer_size *rp = (void *) skb->data; 686 struct hci_rp_read_buffer_size *rp = (void *) skb->data;
@@ -1826,6 +1849,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
1826 hci_cc_read_local_features(hdev, skb); 1849 hci_cc_read_local_features(hdev, skb);
1827 break; 1850 break;
1828 1851
1852 case HCI_OP_READ_LOCAL_EXT_FEATURES:
1853 hci_cc_read_local_ext_features(hdev, skb);
1854 break;
1855
1829 case HCI_OP_READ_BUFFER_SIZE: 1856 case HCI_OP_READ_BUFFER_SIZE:
1830 hci_cc_read_buffer_size(hdev, skb); 1857 hci_cc_read_buffer_size(hdev, skb);
1831 break; 1858 break;