aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2011-06-30 18:20:53 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-07-06 18:10:32 -0400
commitf9b49306dc0b9f514ffb275ae853c50d7ccd6856 (patch)
tree0c3f369861279638dc680251325a5aa520b5fd63
parent971e3a4bbcbf7378315b85150853d86be59cffe0 (diff)
Bluetooth: Write LE Host Supported command
This patch adds a handler to Write LE Host Supported command complete events. Once this commands has completed successfully, we should read the extended LMP features and update the extfeatures field in hci_dev. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r--include/net/bluetooth/hci.h6
-rw-r--r--net/bluetooth/hci_event.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 741a2d658ad4..ed1de1b68a30 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -654,6 +654,12 @@ struct hci_rp_read_local_oob_data {
654 654
655#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 655#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58
656 656
657#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
658struct hci_cp_write_le_host_supported {
659 __u8 le;
660 __u8 simul;
661} __packed;
662
657#define HCI_OP_READ_LOCAL_VERSION 0x1001 663#define HCI_OP_READ_LOCAL_VERSION 0x1001
658struct hci_rp_read_local_version { 664struct hci_rp_read_local_version {
659 __u8 status; 665 __u8 status;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 93d528cddaa7..4ed59a8a383e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -915,6 +915,21 @@ static void hci_cc_le_ltk_neg_reply(struct hci_dev *hdev, struct sk_buff *skb)
915 hci_req_complete(hdev, HCI_OP_LE_LTK_NEG_REPLY, rp->status); 915 hci_req_complete(hdev, HCI_OP_LE_LTK_NEG_REPLY, rp->status);
916} 916}
917 917
918static inline void hci_cc_write_le_host_supported(struct hci_dev *hdev,
919 struct sk_buff *skb)
920{
921 struct hci_cp_read_local_ext_features cp;
922 __u8 status = *((__u8 *) skb->data);
923
924 BT_DBG("%s status 0x%x", hdev->name, status);
925
926 if (status)
927 return;
928
929 cp.page = 0x01;
930 hci_send_cmd(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, sizeof(cp), &cp);
931}
932
918static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) 933static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
919{ 934{
920 BT_DBG("%s status 0x%x", hdev->name, status); 935 BT_DBG("%s status 0x%x", hdev->name, status);
@@ -1921,6 +1936,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
1921 hci_cc_le_ltk_neg_reply(hdev, skb); 1936 hci_cc_le_ltk_neg_reply(hdev, skb);
1922 break; 1937 break;
1923 1938
1939 case HCI_OP_WRITE_LE_HOST_SUPPORTED:
1940 hci_cc_write_le_host_supported(hdev, skb);
1941 break;
1942
1924 default: 1943 default:
1925 BT_DBG("%s opcode 0x%x", hdev->name, opcode); 1944 BT_DBG("%s opcode 0x%x", hdev->name, opcode);
1926 break; 1945 break;