xhci: Add defines for hardcoded slot states
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>
Wed, 1 Jun 2011 21:27:49 +0000 (23:27 +0200)
committerSteve Conklin <sconklin@canonical.com>
Fri, 15 Jul 2011 17:21:13 +0000 (12:21 -0500)
BugLink: http://bugs.launchpad.net/bugs/802541

This needs to be added to the stable trees back to 2.6.34 to support an
upcoming bug fix.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
(backported from commit e2b0217715c6d10379d94bdfe5560af96eecbb7c)
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

drivers/usb/host/xhci-dbg.c
drivers/usb/host/xhci.h

index 0231814..99ac7de 100644 (file)
@@ -436,14 +436,14 @@ char *xhci_get_slot_state(struct xhci_hcd *xhci,
 {
        struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
 
-       switch (GET_SLOT_STATE(slot_ctx->dev_state)) {
-       case 0:
+       switch (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state))) {
+       case SLOT_STATE_ENABLED:
                return "enabled/disabled";
-       case 1:
+       case SLOT_STATE_DEFAULT:
                return "default";
-       case 2:
+       case SLOT_STATE_ADDRESSED:
                return "addressed";
-       case 3:
+       case SLOT_STATE_CONFIGURED:
                return "configured";
        default:
                return "reserved";
index 62bc1bc..1d9943e 100644 (file)
@@ -556,6 +556,11 @@ struct xhci_slot_ctx {
 #define SLOT_STATE     (0x1f << 27)
 #define GET_SLOT_STATE(p)      (((p) & (0x1f << 27)) >> 27)
 
+#define SLOT_STATE_DISABLED    0
+#define SLOT_STATE_ENABLED     SLOT_STATE_DISABLED
+#define SLOT_STATE_DEFAULT     1
+#define SLOT_STATE_ADDRESSED   2
+#define SLOT_STATE_CONFIGURED  3
 
 /**
  * struct xhci_ep_ctx