diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2010-12-15 15:47:14 -0500 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-03-13 21:23:36 -0400 |
commit | 20b67cf51fa606442bb343afad0ee1a393a6afb3 (patch) | |
tree | 1d85e8b93aff185211d065a5113beaeb68cfcb26 /drivers/usb/host/xhci-ring.c | |
parent | 5308a91b9fc1a8f94b860c2589b06908a97cba7e (diff) |
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 <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 582537689ebc..7cea2483e593 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, | |||
1166 | unsigned int faked_port_index; | 1166 | unsigned int faked_port_index; |
1167 | u32 __iomem *port_array[15 + USB_MAXCHILDREN]; | 1167 | u32 __iomem *port_array[15 + USB_MAXCHILDREN]; |
1168 | int i; | 1168 | int i; |
1169 | struct xhci_bus_state *bus_state; | ||
1169 | 1170 | ||
1171 | bus_state = &xhci->bus_state[0]; | ||
1170 | /* Port status change events always have a successful completion code */ | 1172 | /* Port status change events always have a successful completion code */ |
1171 | if (GET_COMP_CODE(event->generic.field[2]) != COMP_SUCCESS) { | 1173 | if (GET_COMP_CODE(event->generic.field[2]) != COMP_SUCCESS) { |
1172 | xhci_warn(xhci, "WARN: xHC returned failed port status event\n"); | 1174 | xhci_warn(xhci, "WARN: xHC returned failed port status event\n"); |
@@ -1225,10 +1227,10 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
1225 | xhci_writel(xhci, temp, port_array[faked_port_index]); | 1227 | xhci_writel(xhci, temp, port_array[faked_port_index]); |
1226 | } else { | 1228 | } else { |
1227 | xhci_dbg(xhci, "resume HS port %d\n", port_id); | 1229 | xhci_dbg(xhci, "resume HS port %d\n", port_id); |
1228 | xhci->resume_done[port_id - 1] = jiffies + | 1230 | bus_state->resume_done[port_id - 1] = jiffies + |
1229 | msecs_to_jiffies(20); | 1231 | msecs_to_jiffies(20); |
1230 | mod_timer(&hcd->rh_timer, | 1232 | mod_timer(&hcd->rh_timer, |
1231 | xhci->resume_done[port_id - 1]); | 1233 | bus_state->resume_done[port_id - 1]); |
1232 | /* Do the rest in GetPortStatus */ | 1234 | /* Do the rest in GetPortStatus */ |
1233 | } | 1235 | } |
1234 | } | 1236 | } |