diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2011-12-07 08:56:51 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-18 18:34:56 -0500 |
commit | 350ee4cfc0ea620bd1126ad4daa295586d6aa3a9 (patch) | |
tree | 61088ecc044fea570c635cf5429f53b2be385d2d /net/bluetooth/hci_event.c | |
parent | c9c2659f1ea84f860af82cac504cc58f17067523 (diff) |
Bluetooth: Add HCI Read Data Block Size function
Implement block size read function. Use different variables for
packet-based and block-based flow control.
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>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 74f758363c2d..48796832fdf0 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -767,6 +767,28 @@ static void hci_cc_read_bd_addr(struct hci_dev *hdev, struct sk_buff *skb) | |||
767 | hci_req_complete(hdev, HCI_OP_READ_BD_ADDR, rp->status); | 767 | hci_req_complete(hdev, HCI_OP_READ_BD_ADDR, rp->status); |
768 | } | 768 | } |
769 | 769 | ||
770 | static void hci_cc_read_data_block_size(struct hci_dev *hdev, | ||
771 | struct sk_buff *skb) | ||
772 | { | ||
773 | struct hci_rp_read_data_block_size *rp = (void *) skb->data; | ||
774 | |||
775 | BT_DBG("%s status 0x%x", hdev->name, rp->status); | ||
776 | |||
777 | if (rp->status) | ||
778 | return; | ||
779 | |||
780 | hdev->block_mtu = __le16_to_cpu(rp->max_acl_len); | ||
781 | hdev->block_len = __le16_to_cpu(rp->block_len); | ||
782 | hdev->num_blocks = __le16_to_cpu(rp->num_blocks); | ||
783 | |||
784 | hdev->block_cnt = hdev->num_blocks; | ||
785 | |||
786 | BT_DBG("%s blk mtu %d cnt %d len %d", hdev->name, hdev->block_mtu, | ||
787 | hdev->block_cnt, hdev->block_len); | ||
788 | |||
789 | hci_req_complete(hdev, HCI_OP_READ_DATA_BLOCK_SIZE, rp->status); | ||
790 | } | ||
791 | |||
770 | static void hci_cc_write_ca_timeout(struct hci_dev *hdev, struct sk_buff *skb) | 792 | static void hci_cc_write_ca_timeout(struct hci_dev *hdev, struct sk_buff *skb) |
771 | { | 793 | { |
772 | __u8 status = *((__u8 *) skb->data); | 794 | __u8 status = *((__u8 *) skb->data); |
@@ -2018,6 +2040,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk | |||
2018 | hci_cc_read_bd_addr(hdev, skb); | 2040 | hci_cc_read_bd_addr(hdev, skb); |
2019 | break; | 2041 | break; |
2020 | 2042 | ||
2043 | case HCI_OP_READ_DATA_BLOCK_SIZE: | ||
2044 | hci_cc_read_data_block_size(hdev, skb); | ||
2045 | break; | ||
2046 | |||
2021 | case HCI_OP_WRITE_CA_TIMEOUT: | 2047 | case HCI_OP_WRITE_CA_TIMEOUT: |
2022 | hci_cc_write_ca_timeout(hdev, skb); | 2048 | hci_cc_write_ca_timeout(hdev, skb); |
2023 | break; | 2049 | break; |