aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-hcd.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/uhci-hcd.h')
-rw-r--r--drivers/usb/host/uhci-hcd.h59
1 files changed, 37 insertions, 22 deletions
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 02255d69e1fe..bf9c5f9b508b 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -41,6 +41,7 @@
41#define USBFRNUM 6 41#define USBFRNUM 6
42#define USBFLBASEADD 8 42#define USBFLBASEADD 8
43#define USBSOF 12 43#define USBSOF 12
44#define USBSOF_DEFAULT 64 /* Frame length is exactly 1 ms */
44 45
45/* USB port status and control registers */ 46/* USB port status and control registers */
46#define USBPORTSC1 16 47#define USBPORTSC1 16
@@ -66,6 +67,8 @@
66/* Legacy support register */ 67/* Legacy support register */
67#define USBLEGSUP 0xc0 68#define USBLEGSUP 0xc0
68#define USBLEGSUP_DEFAULT 0x2000 /* only PIRQ enable set */ 69#define USBLEGSUP_DEFAULT 0x2000 /* only PIRQ enable set */
70#define USBLEGSUP_RWC 0x8f00 /* the R/WC bits */
71#define USBLEGSUP_RO 0x5040 /* R/O and reserved bits */
69 72
70#define UHCI_NULL_DATA_SIZE 0x7FF /* for UHCI controller TD */ 73#define UHCI_NULL_DATA_SIZE 0x7FF /* for UHCI controller TD */
71 74
@@ -111,7 +114,6 @@ struct uhci_qh {
111 /* Software fields */ 114 /* Software fields */
112 dma_addr_t dma_handle; 115 dma_addr_t dma_handle;
113 116
114 struct usb_device *dev;
115 struct urb_priv *urbp; 117 struct urb_priv *urbp;
116 118
117 struct list_head list; /* P: uhci->frame_list_lock */ 119 struct list_head list; /* P: uhci->frame_list_lock */
@@ -203,7 +205,6 @@ struct uhci_td {
203 /* Software fields */ 205 /* Software fields */
204 dma_addr_t dma_handle; 206 dma_addr_t dma_handle;
205 207
206 struct usb_device *dev;
207 struct urb *urb; 208 struct urb *urb;
208 209
209 struct list_head list; /* P: urb->lock */ 210 struct list_head list; /* P: urb->lock */
@@ -314,26 +315,32 @@ static inline int __interval_to_skel(int interval)
314} 315}
315 316
316/* 317/*
317 * Device states for the host controller. 318 * States for the root hub.
318 * 319 *
319 * To prevent "bouncing" in the presence of electrical noise, 320 * To prevent "bouncing" in the presence of electrical noise,
320 * we insist on a 1-second "grace" period, before switching to 321 * when there are no devices attached we delay for 1 second in the
321 * the RUNNING or SUSPENDED states, during which the state is 322 * RUNNING_NODEVS state before switching to the AUTO_STOPPED state.
322 * not allowed to change. 323 *
323 * 324 * (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 325 * 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 */ 326 */
329enum uhci_state { 327enum uhci_rh_state {
330 UHCI_RESET, 328 /* In the following states the HC must be halted.
331 UHCI_RUNNING_GRACE, /* Before RUNNING */ 329 * These two must come first */
332 UHCI_RUNNING, /* The normal state */ 330 UHCI_RH_RESET,
333 UHCI_SUSPENDING_GRACE, /* Before SUSPENDED */ 331 UHCI_RH_SUSPENDED,
334 UHCI_SUSPENDED = -10, /* When no devices are attached */ 332
335 UHCI_RESUMING_1, 333 UHCI_RH_AUTO_STOPPED,
336 UHCI_RESUMING_2 334 UHCI_RH_RESUMING,
335
336 /* In this state the HC changes from running to halted,
337 * so it can legally appear either way. */
338 UHCI_RH_SUSPENDING,
339
340 /* In the following states it's an error if the HC is halted.
341 * These two must come last */
342 UHCI_RH_RUNNING, /* The normal state */
343 UHCI_RH_RUNNING_NODEVS, /* Running with no devices attached */
337}; 344};
338 345
339/* 346/*
@@ -363,15 +370,16 @@ struct uhci_hcd {
363 int fsbr; /* Full-speed bandwidth reclamation */ 370 int fsbr; /* Full-speed bandwidth reclamation */
364 unsigned long fsbrtimeout; /* FSBR delay */ 371 unsigned long fsbrtimeout; /* FSBR delay */
365 372
366 enum uhci_state state; /* FIXME: needs a spinlock */ 373 enum uhci_rh_state rh_state;
367 unsigned long state_end; /* Time of next transition */ 374 unsigned long auto_stop_time; /* When to AUTO_STOP */
375
368 unsigned int frame_number; /* As of last check */ 376 unsigned int frame_number; /* As of last check */
369 unsigned int is_stopped; 377 unsigned int is_stopped;
370#define UHCI_IS_STOPPED 9999 /* Larger than a frame # */ 378#define UHCI_IS_STOPPED 9999 /* Larger than a frame # */
371 379
372 unsigned int scan_in_progress:1; /* Schedule scan is running */ 380 unsigned int scan_in_progress:1; /* Schedule scan is running */
373 unsigned int need_rescan:1; /* Redo the schedule scan */ 381 unsigned int need_rescan:1; /* Redo the schedule scan */
374 unsigned int resume_detect:1; /* Need a Global Resume */ 382 unsigned int hc_inaccessible:1; /* HC is suspended or dead */
375 383
376 /* Support for port suspend/resume/reset */ 384 /* Support for port suspend/resume/reset */
377 unsigned long port_c_suspend; /* Bit-arrays of ports */ 385 unsigned long port_c_suspend; /* Bit-arrays of ports */
@@ -451,4 +459,11 @@ struct urb_priv {
451 * #2 urb->lock 459 * #2 urb->lock
452 */ 460 */
453 461
462
463/* Some special IDs */
464
465#define PCI_VENDOR_ID_GENESYS 0x17a0
466#define PCI_DEVICE_ID_GL880S_UHCI 0x8083
467#define PCI_DEVICE_ID_GL880S_EHCI 0x8084
468
454#endif 469#endif