aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-hcd.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-04-09 17:27:32 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:43 -0400
commitc8f4fe4358c5e0a79b4bd47b814d19f1d1d06f21 (patch)
tree0c12fec97ac524e77489d3e8460bd9bb4817c0d5 /drivers/usb/host/uhci-hcd.h
parentf5946f8220a866dcdb8edc6abe23c1443e252425 (diff)
[PATCH] USB UHCI: Add root hub states
This patch starts making some serious changes to the UHCI driver. There's a set of private states for the root hub, and the internal routines for suspending and resuming work completely differently, with transitions based on the new states. Now the driver distinguishes between a privately auto-stopped state and a publicly suspended state, and it will properly suspend controllers with broken resume-detect interrupts instead of resetting them. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-hcd.h')
-rw-r--r--drivers/usb/host/uhci-hcd.h49
1 files changed, 30 insertions, 19 deletions
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 02255d69e1fe..4bac57c74ec2 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -314,26 +314,29 @@ static inline int __interval_to_skel(int interval)
314} 314}
315 315
316/* 316/*
317 * Device states for the host controller. 317 * States for the root hub.
318 * 318 *
319 * To prevent "bouncing" in the presence of electrical noise, 319 * To prevent "bouncing" in the presence of electrical noise,
320 * we insist on a 1-second "grace" period, before switching to 320 * when there are no devices attached we delay for 1 second in the
321 * the RUNNING or SUSPENDED states, during which the state is 321 * RUNNING_NODEVS state before switching to the AUTO_STOPPED state.
322 * not allowed to change. 322 *
323 * 323 * (Note that the AUTO_STOPPED state won't be necessary once the hub
324 * The resume process is divided into substates in order to avoid 324 * driver learns to autosuspend.)
325 * potentially length delays during the timer handler.
326 *
327 * States in which the host controller is halted must have values <= 0.
328 */ 325 */
329enum uhci_state { 326enum uhci_rh_state {
330 UHCI_RESET, 327 /* In the next 4 states the HC must be halted */
331 UHCI_RUNNING_GRACE, /* Before RUNNING */ 328 UHCI_RH_RESET,
332 UHCI_RUNNING, /* The normal state */ 329 UHCI_RH_SUSPENDED,
333 UHCI_SUSPENDING_GRACE, /* Before SUSPENDED */ 330 UHCI_RH_AUTO_STOPPED,
334 UHCI_SUSPENDED = -10, /* When no devices are attached */ 331 UHCI_RH_RESUMING,
335 UHCI_RESUMING_1, 332
336 UHCI_RESUMING_2 333 /* In the next state the HC changes from running to halted, so it
334 * can legally appear either way */
335 UHCI_RH_SUSPENDING,
336
337 /* In the next two states it's an error if the HC is halted */
338 UHCI_RH_RUNNING, /* The normal state */
339 UHCI_RH_RUNNING_NODEVS, /* Running with no devices attached */
337}; 340};
338 341
339/* 342/*
@@ -363,8 +366,9 @@ struct uhci_hcd {
363 int fsbr; /* Full-speed bandwidth reclamation */ 366 int fsbr; /* Full-speed bandwidth reclamation */
364 unsigned long fsbrtimeout; /* FSBR delay */ 367 unsigned long fsbrtimeout; /* FSBR delay */
365 368
366 enum uhci_state state; /* FIXME: needs a spinlock */ 369 enum uhci_rh_state rh_state;
367 unsigned long state_end; /* Time of next transition */ 370 unsigned long auto_stop_time; /* When to AUTO_STOP */
371
368 unsigned int frame_number; /* As of last check */ 372 unsigned int frame_number; /* As of last check */
369 unsigned int is_stopped; 373 unsigned int is_stopped;
370#define UHCI_IS_STOPPED 9999 /* Larger than a frame # */ 374#define UHCI_IS_STOPPED 9999 /* Larger than a frame # */
@@ -451,4 +455,11 @@ struct urb_priv {
451 * #2 urb->lock 455 * #2 urb->lock
452 */ 456 */
453 457
458
459/* Some special IDs */
460
461#define PCI_VENDOR_ID_GENESYS 0x17a0
462#define PCI_DEVICE_ID_GL880S_UHCI 0x8083
463#define PCI_DEVICE_ID_GL880S_EHCI 0x8084
464
454#endif 465#endif