Bluetooth: Use only 2 bits for controller type information
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 2 Oct 2013 05:59:20 +0000 (22:59 -0700)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 2 Oct 2013 06:09:54 +0000 (09:09 +0300)
The controller type is limited to BR/EDR/LE and AMP controllers. This
can be easily encoded with just 2 bits and still leave enough room
for future controller types.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_core.c

index 4549b5cbfac5aa5eaad080961ce29bb4803e6e0f..dd2528c5b6bc9012bc7540f9033948465d9948bf 100644 (file)
@@ -1610,7 +1610,7 @@ int hci_get_dev_info(void __user *arg)
 
        strcpy(di.name, hdev->name);
        di.bdaddr   = hdev->bdaddr;
-       di.type     = (hdev->bus & 0x0f) | (hdev->dev_type << 4);
+       di.type     = (hdev->bus & 0x0f) | ((hdev->dev_type & 0x03) << 4);
        di.flags    = hdev->flags;
        di.pkt_type = hdev->pkt_type;
        if (lmp_bredr_capable(hdev)) {