]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
Bluetooth: Add HCI Read Flow Control Mode function
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Thu, 24 Nov 2011 12:52:02 +0000 (14:52 +0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Fri, 2 Dec 2011 11:59:53 +0000 (20:59 +0900)
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>
include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
net/bluetooth/hci_event.c

index 376c57420abee46cd465ed45e9ea1012dc26c60e..ee83c36d35aaba705356d0822c10d2055da6d670 100644 (file)
@@ -677,6 +677,12 @@ struct hci_rp_read_local_oob_data {
 
 #define HCI_OP_READ_INQ_RSP_TX_POWER   0x0c58
 
+#define HCI_OP_READ_FLOW_CONTROL_MODE  0x0c66
+struct hci_rp_read_flow_control_mode {
+       __u8     status;
+       __u8     mode;
+} __packed;
+
 #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
 struct hci_cp_write_le_host_supported {
        __u8 le;
index e7b2e25397d7b93e42a1fa5278816ee19492fdcc..44f130f6fb5ebcec4e7878d89daf630f8b79818d 100644 (file)
@@ -170,6 +170,8 @@ struct hci_dev {
        __u32           amp_max_flush_to;
        __u32           amp_be_flush_to;
 
+       __u8            flow_ctl_mode;
+
        unsigned int    auto_accept_delay;
 
        unsigned long   quirks;
index 980da08e253eb8244a8f08c3cefba105b1ed6a85..ab4922831b9a9e60d1ed5a4e7185ad6772b80466 100644 (file)
@@ -717,6 +717,21 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
        hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status);
 }
 
+static void hci_cc_read_flow_control_mode(struct hci_dev *hdev,
+                                               struct sk_buff *skb)
+{
+       struct hci_rp_read_flow_control_mode *rp = (void *) skb->data;
+
+       BT_DBG("%s status 0x%x", hdev->name, rp->status);
+
+       if (rp->status)
+               return;
+
+       hdev->flow_ctl_mode = rp->mode;
+
+       hci_req_complete(hdev, HCI_OP_READ_FLOW_CONTROL_MODE, rp->status);
+}
+
 static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb)
 {
        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
                hci_cc_write_ca_timeout(hdev, skb);
                break;
 
+       case HCI_OP_READ_FLOW_CONTROL_MODE:
+               hci_cc_read_flow_control_mode(hdev, skb);
+               break;
+
        case HCI_OP_READ_LOCAL_AMP_INFO:
                hci_cc_read_local_amp_info(hdev, skb);
                break;