Bluetooth: Rename AMP status constants and use them
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 5 Oct 2013 18:47:45 +0000 (11:47 -0700)
committerJohan Hedberg <johan.hedberg@intel.com>
Sun, 6 Oct 2013 08:24:30 +0000 (10:24 +0200)
The AMP controller status constants need to be actually used to avoid
crypted hardcoded numbers.

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

index 393eabc0d21fdb46a79eca9343f24bcedb35e596..9f8d1c1f0414121d90160d0ac525246de9ae0a36 100644 (file)
 #define AMP_TYPE_80211 0x01
 
 /* AMP controller status */
-#define AMP_CTRL_POWERED_DOWN                  0x00
-#define AMP_CTRL_BLUETOOTH_ONLY                        0x01
-#define AMP_CTRL_NO_CAPACITY                   0x02
-#define AMP_CTRL_LOW_CAPACITY                  0x03
-#define AMP_CTRL_MEDIUM_CAPACITY               0x04
-#define AMP_CTRL_HIGH_CAPACITY                 0x05
-#define AMP_CTRL_FULL_CAPACITY                 0x06
+#define AMP_STATUS_POWERED_DOWN                        0x00
+#define AMP_STATUS_BLUETOOTH_ONLY              0x01
+#define AMP_STATUS_NO_CAPACITY                 0x02
+#define AMP_STATUS_LOW_CAPACITY                        0x03
+#define AMP_STATUS_MEDIUM_CAPACITY             0x04
+#define AMP_STATUS_HIGH_CAPACITY               0x05
+#define AMP_STATUS_FULL_CAPACITY               0x06
 
 /* HCI device quirks */
 enum {
index 6d62d3140cf804b65aeb6528080c24f01cadb17c..6dfef731825f0b8858d9d02d7d6746487f65a239 100644 (file)
@@ -79,7 +79,7 @@ static inline void __a2mp_cl_bredr(struct a2mp_cl *cl)
 {
        cl->id = AMP_ID_BREDR;
        cl->type = AMP_TYPE_BREDR;
-       cl->status = 1;
+       cl->status = AMP_STATUS_BLUETOOTH_ONLY;
 }
 
 /* hci_dev_list shall be locked */
index aa63ebb114d4634d1f91c486873de81c7c73d6ba..0d5fe0843f5e9daf7a4671a6da679a5aa870de73 100644 (file)
@@ -1381,7 +1381,7 @@ static int hci_dev_do_close(struct hci_dev *hdev)
        }
 
        /* Controller radio is available but is currently powered down */
-       hdev->amp_status = 0;
+       hdev->amp_status = AMP_STATUS_POWERED_DOWN;
 
        memset(hdev->eir, 0, sizeof(hdev->eir));
        memset(hdev->dev_class, 0, sizeof(hdev->dev_class));