Bluetooth: List powered down AMP controllers correctly
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 7 Oct 2013 07:58:34 +0000 (00:58 -0700)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 7 Oct 2013 08:08:42 +0000 (10:08 +0200)
Within the AMP discover response, list powered down AMP controllers
as powered down. No point in trying to make them look any different.

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

index 9410e272d8b66fc11824d79ffb41d46081005b09..b38d07477c20c40d7c2763d82f1e81c7d2a92397 100644 (file)
@@ -89,7 +89,10 @@ static void __a2mp_add_cl(struct amp_mgr *mgr, struct a2mp_cl *cl)
                if (hdev->dev_type == HCI_AMP) {
                        cl[i].id = hdev->id;
                        cl[i].type = hdev->amp_type;
-                       cl[i].status = hdev->amp_status;
+                       if (test_bit(HCI_UP, &hdev->flags))
+                               cl[i].status = hdev->amp_status;
+                       else
+                               cl[i].status = AMP_STATUS_POWERED_DOWN;
                        i++;
                }
        }