From 20b67cf51fa606442bb343afad0ee1a393a6afb3 Mon Sep 17 00:00:00 2001 From: Sarah Sharp Date: Wed, 15 Dec 2010 12:47:14 -0800 Subject: xhci: Refactor bus suspend state into a struct. There are several variables in the xhci_hcd structure that are related to bus suspend and resume state. There are a couple different port status arrays that are accessed by port index. Move those variables into a separate structure, xhci_bus_state. Stash that structure in xhci_hcd. When we have two roothhubs that can be suspended and resumed separately, we can have two xhci_bus_states, and index into the port arrays in each structure with the fake roothub port index (not the real hardware port index). Signed-off-by: Sarah Sharp --- drivers/usb/host/xhci-ring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/usb/host/xhci-ring.c') diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 5825376..7cea248 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1166,7 +1166,9 @@ static void handle_port_status(struct xhci_hcd *xhci, unsigned int faked_port_index; u32 __iomem *port_array[15 + USB_MAXCHILDREN]; int i; + struct xhci_bus_state *bus_state; + bus_state = &xhci->bus_state[0]; /* Port status change events always have a successful completion code */ if (GET_COMP_CODE(event->generic.field[2]) != COMP_SUCCESS) { xhci_warn(xhci, "WARN: xHC returned failed port status event\n"); @@ -1225,10 +1227,10 @@ static void handle_port_status(struct xhci_hcd *xhci, xhci_writel(xhci, temp, port_array[faked_port_index]); } else { xhci_dbg(xhci, "resume HS port %d\n", port_id); - xhci->resume_done[port_id - 1] = jiffies + + bus_state->resume_done[port_id - 1] = jiffies + msecs_to_jiffies(20); mod_timer(&hcd->rh_timer, - xhci->resume_done[port_id - 1]); + bus_state->resume_done[port_id - 1]); /* Do the rest in GetPortStatus */ } } -- cgit v1.1