struct usb_hcd

来源:互联网 发布:windows 更改用户账户 编辑:程序博客网 时间:2024/06/07 22:50
struct usb_hcd {/* * housekeeping */struct usb_busself;/* hcd is-a bus */struct krefkref;/* reference counter */const char*product_desc;/* product/vendor string */intspeed;/* Speed for this roothub. * May be different from * hcd->driver->flags & HCD_MASK */charirq_descr[24];/* driver + bus # */struct timer_listrh_timer;/* drives root-hub polling */struct urb*status_urb;/* the current status urb */#ifdef CONFIG_USB_SUSPENDstruct work_structwakeup_work;/* for remote wakeup */#endif/* * hardware info/state */const struct hc_driver*driver;/* hw-specific hooks *//* Flags that need to be manipulated atomically because they can * change while the host controller is running.  Always use * set_bit() or clear_bit() to change their values. */unsigned longflags;#define HCD_FLAG_HW_ACCESSIBLE0/* at full power */#define HCD_FLAG_SAW_IRQ1#define HCD_FLAG_POLL_RH2/* poll for rh status? */#define HCD_FLAG_POLL_PENDING3/* status has changed? */#define HCD_FLAG_WAKEUP_PENDING4/* root hub is resuming? */#define HCD_FLAG_RH_RUNNING5/* root hub is running? */#define HCD_FLAG_DEAD6/* controller has died? *//* The flags can be tested using these macros; they are likely to * be slightly faster than test_bit(). */#define HCD_HW_ACCESSIBLE(hcd)((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE))#define HCD_SAW_IRQ(hcd)((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ))#define HCD_POLL_RH(hcd)((hcd)->flags & (1U << HCD_FLAG_POLL_RH))#define HCD_POLL_PENDING(hcd)((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))#define HCD_WAKEUP_PENDING(hcd)((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))#define HCD_RH_RUNNING(hcd)((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))#define HCD_DEAD(hcd)((hcd)->flags & (1U << HCD_FLAG_DEAD))/* Flags that get set only during HCD registration or removal. */unsignedrh_registered:1;/* is root hub registered? */unsignedrh_pollable:1;/* may we poll the root hub? */unsignedmsix_enabled:1;/* driver has MSI-X enabled? *//* The next flag is a stopgap, to be removed when all the HCDs * support the new root-hub polling mechanism. */unsigneduses_new_polling:1;unsignedwireless:1;/* Wireless USB HCD */unsignedauthorized_default:1;unsignedhas_tt:1;/* Integrated TT in root hub */intirq;/* irq allocated */void __iomem*regs;/* device memory/io */u64rsrc_start;/* memory/io resource start */u64rsrc_len;/* memory/io resource length */unsignedpower_budget;/* in mA, 0 = no limit *//* bandwidth_mutex should be taken before adding or removing * any new bus bandwidth constraints: *   1. Before adding a configuration for a new device. *   2. Before removing the configuration to put the device into *      the addressed state. *   3. Before selecting a different configuration. *   4. Before selecting an alternate interface setting. * * bandwidth_mutex should be dropped after a successful control message * to the device, or resetting the bandwidth after a failed attempt. */struct mutex*bandwidth_mutex;struct usb_hcd*shared_hcd;struct usb_hcd*primary_hcd;#define HCD_BUFFER_POOLS4struct dma_pool*pool[HCD_BUFFER_POOLS];intstate;#define__ACTIVE0x01#define__SUSPEND0x04#define__TRANSIENT0x80#defineHC_STATE_HALT0#defineHC_STATE_RUNNING(__ACTIVE)#defineHC_STATE_QUIESCING(__SUSPEND|__TRANSIENT|__ACTIVE)#defineHC_STATE_RESUMING(__SUSPEND|__TRANSIENT)#defineHC_STATE_SUSPENDED(__SUSPEND)#defineHC_IS_RUNNING(state) ((state) & __ACTIVE)#defineHC_IS_SUSPENDED(state) ((state) & __SUSPEND)/* more shared queuing code would be good; it should support * smarter scheduling, handle transaction translators, etc; * input size of periodic table to an interrupt scheduler. * (ohci 32, uhci 1024, ehci 256/512/1024). *//* The HC driver's private data is stored at the end of * this structure. */unsigned long hcd_priv[0]__attribute__ ((aligned(sizeof(unsigned long))));};

0 0
原创粉丝点击