Bluetooth: Fix LE MTU reporting for HCIGETDEVINFO
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 19 Oct 2012 17:57:46 +0000 (20:57 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 24 Oct 2012 13:11:21 +0000 (11:11 -0200)
This patch fixes the use of le_mtu and le_pkts values in the
HCIGETDEVINFO ioctl for LE-only controllers.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/hci_core.c

index 854202679c492057cc263368e459e4196961043c..5a3400d8a6e5c078e37c154daa2bdb376086fbb8 100644 (file)
@@ -992,10 +992,17 @@ int hci_get_dev_info(void __user *arg)
        di.type     = (hdev->bus & 0x0f) | (hdev->dev_type << 4);
        di.flags    = hdev->flags;
        di.pkt_type = hdev->pkt_type;
-       di.acl_mtu  = hdev->acl_mtu;
-       di.acl_pkts = hdev->acl_pkts;
-       di.sco_mtu  = hdev->sco_mtu;
-       di.sco_pkts = hdev->sco_pkts;
+       if (lmp_bredr_capable(hdev)) {
+               di.acl_mtu  = hdev->acl_mtu;
+               di.acl_pkts = hdev->acl_pkts;
+               di.sco_mtu  = hdev->sco_mtu;
+               di.sco_pkts = hdev->sco_pkts;
+       } else {
+               di.acl_mtu  = hdev->le_mtu;
+               di.acl_pkts = hdev->le_pkts;
+               di.sco_mtu  = 0;
+               di.sco_pkts = 0;
+       }
        di.link_policy = hdev->link_policy;
        di.link_mode   = hdev->link_mode;