vserver 1.9.5.x5
[linux-2.6.git] / drivers / usb / host / uhci-hcd.h
index 785c0c2..fee7c52 100644 (file)
@@ -118,10 +118,20 @@ struct uhci_qh {
        struct list_head remove_list;   /* P: uhci->remove_list_lock */
 } __attribute__((aligned(16)));
 
+/*
+ * We need a special accessor for the element pointer because it is
+ * subject to asynchronous updates by the controller
+ */
+static __le32 inline qh_element(struct uhci_qh *qh) {
+       __le32 element = qh->element;
+
+       barrier();
+       return element;
+}
+
 /*
  * for TD <status>:
  */
-#define td_status(td)          le32_to_cpu((td)->status)
 #define TD_CTRL_SPD            (1 << 29)       /* Short Packet Detect */
 #define TD_CTRL_C_ERR_MASK     (3 << 27)       /* Error Counter bits */
 #define TD_CTRL_C_ERR_SHIFT    27
@@ -203,6 +213,18 @@ struct uhci_td {
        struct list_head fl_list;       /* P: uhci->frame_list_lock */
 } __attribute__((aligned(16)));
 
+/*
+ * We need a special accessor for the control/status word because it is
+ * subject to asynchronous updates by the controller
+ */
+static u32 inline td_status(struct uhci_td *td) {
+       __le32 status = td->status;
+
+       barrier();
+       return le32_to_cpu(status);
+}
+
+
 /*
  * The UHCI driver places Interrupt, Control and Bulk into QH's both
  * to group together TD's for one transfer, and also to faciliate queuing
@@ -314,9 +336,6 @@ enum uhci_state {
        UHCI_RESUMING_2
 };
 
-#define hcd_to_uhci(hcd_ptr) container_of(hcd_ptr, struct uhci_hcd, hcd)
-#define uhci_dev(u)    ((u)->hcd.self.controller)
-
 /*
  * This describes the full uhci information.
  *
@@ -324,12 +343,9 @@ enum uhci_state {
  * a subset of what the full implementation needs.
  */
 struct uhci_hcd {
-       struct usb_hcd hcd;
 
-#ifdef CONFIG_PROC_FS
-       /* procfs */
-       struct proc_dir_entry *proc_entry;
-#endif
+       /* debugfs */
+       struct dentry *dentry;
 
        /* Grabbed from PCI */
        unsigned long io_addr;
@@ -352,6 +368,12 @@ struct uhci_hcd {
        int resume_detect;                      /* Need a Global Resume */
        unsigned int saved_framenumber;         /* Save during PM suspend */
 
+       /* Support for port suspend/resume */
+       unsigned long port_c_suspend;           /* Bit-arrays of ports */
+       unsigned long suspended_ports;
+       unsigned long resuming_ports;
+       unsigned long resume_timeout;           /* Time to stop signalling */
+
        /* Main list of URB's currently controlled by this HC */
        struct list_head urb_list;              /* P: uhci->schedule_lock */
 
@@ -377,6 +399,18 @@ struct uhci_hcd {
        wait_queue_head_t waitqh;               /* endpoint_disable waiters */
 };
 
+/* Convert between a usb_hcd pointer and the corresponding uhci_hcd */
+static inline struct uhci_hcd *hcd_to_uhci(struct usb_hcd *hcd)
+{
+       return (struct uhci_hcd *) (hcd->hcd_priv);
+}
+static inline struct usb_hcd *uhci_to_hcd(struct uhci_hcd *uhci)
+{
+       return container_of((void *) uhci, struct usb_hcd, hcd_priv);
+}
+
+#define uhci_dev(u)    (uhci_to_hcd(u)->self.controller)
+
 struct urb_priv {
        struct list_head urb_list;
 
@@ -385,12 +419,12 @@ struct urb_priv {
        struct uhci_qh *qh;             /* QH for this URB */
        struct list_head td_list;       /* P: urb->lock */
 
-       int fsbr : 1;                   /* URB turned on FSBR */
-       int fsbr_timeout : 1;           /* URB timed out on FSBR */
-       int queued : 1;                 /* QH was queued (not linked in) */
-       int short_control_packet : 1;   /* If we get a short packet during */
-                                       /*  a control transfer, retrigger */
-                                       /*  the status phase */
+       unsigned fsbr : 1;              /* URB turned on FSBR */
+       unsigned fsbr_timeout : 1;      /* URB timed out on FSBR */
+       unsigned queued : 1;            /* QH was queued (not linked in) */
+       unsigned short_control_packet : 1;      /* If we get a short packet during */
+                                               /*  a control transfer, retrigger */
+                                               /*  the status phase */
 
        unsigned long inserttime;       /* In jiffies */
        unsigned long fsbrtime;         /* In jiffies */