diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2011-11-24 07:52:02 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-02 06:59:53 -0500 |
commit | 1e89cffb44a94e1937e5ec16125ae866dbba7b2e (patch) | |
tree | 288bea7219b218620e2a9659e52c839ec4f7505f | |
parent | 4f957a76014fb63d193cd6c141bdd94aaff3a25e (diff) |
Bluetooth: Add HCI Read Flow Control Mode function
Upstream Code Aurora function with minor trivial fixes.
Origin: git://codeaurora.org/kernel/msm.git
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r-- | include/net/bluetooth/hci.h | 6 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 19 |
3 files changed, 27 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 376c57420abe..ee83c36d35aa 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -677,6 +677,12 @@ struct hci_rp_read_local_oob_data { | |||
677 | 677 | ||
678 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | 678 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 |
679 | 679 | ||
680 | #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 | ||
681 | struct hci_rp_read_flow_control_mode { | ||
682 | __u8 status; | ||
683 | __u8 mode; | ||
684 | } __packed; | ||
685 | |||
680 | #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d | 686 | #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d |
681 | struct hci_cp_write_le_host_supported { | 687 | struct hci_cp_write_le_host_supported { |
682 | __u8 le; | 688 | __u8 le; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index e7b2e25397d7..44f130f6fb5e 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -170,6 +170,8 @@ struct hci_dev { | |||
170 | __u32 amp_max_flush_to; | 170 | __u32 amp_max_flush_to; |
171 | __u32 amp_be_flush_to; | 171 | __u32 amp_be_flush_to; |
172 | 172 | ||
173 | __u8 flow_ctl_mode; | ||
174 | |||
173 | unsigned int auto_accept_delay; | 175 | unsigned int auto_accept_delay; |
174 | 176 | ||
175 | unsigned long quirks; | 177 | unsigned long quirks; |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 980da08e253e..ab4922831b9a 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -717,6 +717,21 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev, | |||
717 | hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status); | 717 | hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status); |
718 | } | 718 | } |
719 | 719 | ||
720 | static void hci_cc_read_flow_control_mode(struct hci_dev *hdev, | ||
721 | struct sk_buff *skb) | ||
722 | { | ||
723 | struct hci_rp_read_flow_control_mode *rp = (void *) skb->data; | ||
724 | |||
725 | BT_DBG("%s status 0x%x", hdev->name, rp->status); | ||
726 | |||
727 | if (rp->status) | ||
728 | return; | ||
729 | |||
730 | hdev->flow_ctl_mode = rp->mode; | ||
731 | |||
732 | hci_req_complete(hdev, HCI_OP_READ_FLOW_CONTROL_MODE, rp->status); | ||
733 | } | ||
734 | |||
720 | static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb) | 735 | static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb) |
721 | { | 736 | { |
722 | struct hci_rp_read_buffer_size *rp = (void *) skb->data; | 737 | struct hci_rp_read_buffer_size *rp = (void *) skb->data; |
@@ -1998,6 +2013,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk | |||
1998 | hci_cc_write_ca_timeout(hdev, skb); | 2013 | hci_cc_write_ca_timeout(hdev, skb); |
1999 | break; | 2014 | break; |
2000 | 2015 | ||
2016 | case HCI_OP_READ_FLOW_CONTROL_MODE: | ||
2017 | hci_cc_read_flow_control_mode(hdev, skb); | ||
2018 | break; | ||
2019 | |||
2001 | case HCI_OP_READ_LOCAL_AMP_INFO: | 2020 | case HCI_OP_READ_LOCAL_AMP_INFO: |
2002 | hci_cc_read_local_amp_info(hdev, skb); | 2021 | hci_cc_read_local_amp_info(hdev, skb); |
2003 | break; | 2022 | break; |