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.h | |
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.h')
-rw-r--r-- | drivers/usb/host/xhci.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index daa88581ad66..c15470eb121a 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1161,6 +1161,22 @@ struct s3_save { | |||
1161 | u64 erst_dequeue; | 1161 | u64 erst_dequeue; |
1162 | }; | 1162 | }; |
1163 | 1163 | ||
1164 | struct xhci_bus_state { | ||
1165 | unsigned long bus_suspended; | ||
1166 | unsigned long next_statechange; | ||
1167 | |||
1168 | /* Port suspend arrays are indexed by the portnum of the fake roothub */ | ||
1169 | /* ports suspend status arrays - max 31 ports for USB2, 15 for USB3 */ | ||
1170 | u32 port_c_suspend; | ||
1171 | u32 suspended_ports; | ||
1172 | unsigned long resume_done[USB_MAXCHILDREN]; | ||
1173 | }; | ||
1174 | |||
1175 | static inline unsigned int hcd_index(struct usb_hcd *hcd) | ||
1176 | { | ||
1177 | return 0; | ||
1178 | } | ||
1179 | |||
1164 | /* There is one ehci_hci structure per controller */ | 1180 | /* There is one ehci_hci structure per controller */ |
1165 | struct xhci_hcd { | 1181 | struct xhci_hcd { |
1166 | struct usb_hcd *main_hcd; | 1182 | struct usb_hcd *main_hcd; |
@@ -1225,9 +1241,6 @@ struct xhci_hcd { | |||
1225 | /* Host controller watchdog timer structures */ | 1241 | /* Host controller watchdog timer structures */ |
1226 | unsigned int xhc_state; | 1242 | unsigned int xhc_state; |
1227 | 1243 | ||
1228 | unsigned long bus_suspended; | ||
1229 | unsigned long next_statechange; | ||
1230 | |||
1231 | u32 command; | 1244 | u32 command; |
1232 | struct s3_save s3; | 1245 | struct s3_save s3; |
1233 | /* Host controller is dying - not responding to commands. "I'm not dead yet!" | 1246 | /* Host controller is dying - not responding to commands. "I'm not dead yet!" |
@@ -1249,11 +1262,10 @@ struct xhci_hcd { | |||
1249 | #define XHCI_LINK_TRB_QUIRK (1 << 0) | 1262 | #define XHCI_LINK_TRB_QUIRK (1 << 0) |
1250 | #define XHCI_RESET_EP_QUIRK (1 << 1) | 1263 | #define XHCI_RESET_EP_QUIRK (1 << 1) |
1251 | #define XHCI_NEC_HOST (1 << 2) | 1264 | #define XHCI_NEC_HOST (1 << 2) |
1252 | /* port suspend change*/ | 1265 | /* There's only one roothub to keep track of bus suspend info for |
1253 | u32 port_c_suspend; | 1266 | * (right now). |
1254 | /* which ports are suspended */ | 1267 | */ |
1255 | u32 suspended_ports; | 1268 | struct xhci_bus_state bus_state[1]; |
1256 | unsigned long resume_done[USB_MAXCHILDREN]; | ||
1257 | /* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */ | 1269 | /* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */ |
1258 | u8 *port_array; | 1270 | u8 *port_array; |
1259 | /* Array of pointers to USB 3.0 PORTSC registers */ | 1271 | /* Array of pointers to USB 3.0 PORTSC registers */ |