Skip to content

Commit e2b0217

Browse files
mlankhorstSarah Sharp
authored andcommitted
xhci: Add defines for hardcoded slot states
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 <[email protected]> Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
1 parent 4819fef commit e2b0217

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

drivers/usb/host/xhci-dbg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,13 @@ char *xhci_get_slot_state(struct xhci_hcd *xhci,
438438
struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
439439

440440
switch (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state))) {
441-
case 0:
441+
case SLOT_STATE_ENABLED:
442442
return "enabled/disabled";
443-
case 1:
443+
case SLOT_STATE_DEFAULT:
444444
return "default";
445-
case 2:
445+
case SLOT_STATE_ADDRESSED:
446446
return "addressed";
447-
case 3:
447+
case SLOT_STATE_CONFIGURED:
448448
return "configured";
449449
default:
450450
return "reserved";

drivers/usb/host/xhci.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,11 @@ struct xhci_slot_ctx {
560560
#define SLOT_STATE (0x1f << 27)
561561
#define GET_SLOT_STATE(p) (((p) & (0x1f << 27)) >> 27)
562562

563+
#define SLOT_STATE_DISABLED 0
564+
#define SLOT_STATE_ENABLED SLOT_STATE_DISABLED
565+
#define SLOT_STATE_DEFAULT 1
566+
#define SLOT_STATE_ADDRESSED 2
567+
#define SLOT_STATE_CONFIGURED 3
563568

564569
/**
565570
* struct xhci_ep_ctx

0 commit comments

Comments
 (0)