constchar *product_desc; /* product/vendor string */ int speed; /* Speed for this roothub. *Maybedifferentfrom *hcd->driver->flags&HCD_MASK
*/ char irq_descr[24]; /* driver + bus # */
struct timer_list rh_timer; /* drives root-hub polling */ struct urb *status_urb; /* the current status urb */ #ifdef CONFIG_PM struct work_struct wakeup_work; /* for remote wakeup */ #endif struct work_struct died_work; /* for when the device dies */
/* Flags that need to be manipulated atomically because they can *changewhilethehostcontrollerisrunning.Alwaysuse *set_bit()orclear_bit()tochangetheirvalues.
*/ unsignedlong flags; #define HCD_FLAG_HW_ACCESSIBLE 0/* at full power */ #define HCD_FLAG_POLL_RH 2/* poll for rh status? */ #define HCD_FLAG_POLL_PENDING 3/* status has changed? */ #define HCD_FLAG_WAKEUP_PENDING 4/* root hub is resuming? */ #define HCD_FLAG_RH_RUNNING 5/* root hub is running? */ #define HCD_FLAG_DEAD 6/* controller has died? */ #define HCD_FLAG_INTF_AUTHORIZED 7/* authorize interfaces? */ #define HCD_FLAG_DEFER_RH_REGISTER 8/* Defer roothub registration */
/* The flags can be tested using these macros; they are likely to *beslightlyfasterthantest_bit().
*/ #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) #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)) #define HCD_DEFER_RH_REGISTER(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEFER_RH_REGISTER))
/* Flags that get set only during HCD registration or removal. */ unsigned rh_registered:1;/* is root hub registered? */ unsigned rh_pollable:1; /* may we poll the root hub? */ unsigned msix_enabled:1; /* driver has MSI-X enabled? */ unsigned msi_enabled:1; /* driver has MSI enabled? */ /* *donotmanagethePHYstateintheHCDcore,insteadletthedriver *handlethis(forexampleifthePHYcanonlybeturnedonaftera *specificevent)
*/ unsigned skip_phy_initialization:1;
/* The next flag is a stopgap, to be removed when all the HCDs
* support the new root-hub polling mechanism. */ unsigned uses_new_polling:1; unsigned has_tt:1; /* Integrated TT in root hub */ unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ unsigned can_do_streams:1; /* HC supports streams */ unsigned tpl_support:1; /* OTG & EH TPL support */ unsigned cant_recv_wakeups:1; /* wakeup requests from downstream aren't received */
/* memory pool for HCs having local memory, or %NULL */ struct gen_pool *localmem_pool;
/* more shared queuing code would be good; it should support *smarterscheduling,handletransactiontranslators,etc; *inputsizeofperiodictabletoaninterruptscheduler. *(ohci32,uhci1024,ehci256/512/1024).
*/
/* The HC driver's private data is stored at the end of *thisstructure.
*/ unsignedlong hcd_priv[]
__attribute__ ((aligned(sizeof(s64))));
};
/* 2.4 does this a bit differently ... */ staticinlinestruct usb_bus *hcd_to_bus(struct usb_hcd *hcd)
{ return &hcd->self;
}
int flags; #define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */ #define HCD_DMA 0x0002 /* HC uses DMA */ #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */ #define HCD_USB11 0x0010 /* USB 1.1 */ #define HCD_USB2 0x0020 /* USB 2.0 */ #define HCD_USB3 0x0040 /* USB 3.0 */ #define HCD_USB31 0x0050 /* USB 3.1 */ #define HCD_USB32 0x0060 /* USB 3.2 */ #define HCD_MASK 0x0070 #define HCD_BH 0x0100 /* URB complete in BH context */
/* called to init HCD and root hub */ int (*reset) (struct usb_hcd *hcd); int (*start) (struct usb_hcd *hcd);
/* NOTE: these suspend/resume calls relate to the HC as *awhole,notjusttheroothub;they'reforPCIbusglue.
*/ /* called after suspending the hub, before entering D3 etc */ int (*pci_suspend)(struct usb_hcd *hcd, bool do_wakeup);
/* called after entering D0 (etc), before resuming the hub */ int (*pci_resume)(struct usb_hcd *hcd, pm_message_t state);
/* called just before hibernate final D3 state, allows host to poweroff parts */ int (*pci_poweroff_late)(struct usb_hcd *hcd, bool do_wakeup);
/* cleanly make HCD stop writing memory and doing I/O */ void (*stop) (struct usb_hcd *hcd);
/* (optional) reset any endpoint state such as sequence number
and current window */ void (*endpoint_reset)(struct usb_hcd *hcd, struct usb_host_endpoint *ep);
/* root hub support */ int (*hub_status_data) (struct usb_hcd *hcd, char *buf); int (*hub_control) (struct usb_hcd *hcd,
u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength); int (*bus_suspend)(struct usb_hcd *); int (*bus_resume)(struct usb_hcd *); int (*start_port_reset)(struct usb_hcd *, unsigned port_num); unsignedlong (*get_resuming_ports)(struct usb_hcd *);
/* force handover of high-speed port to full-speed companion */ void (*relinquish_port)(struct usb_hcd *, int); /* has a port been handed over to a companion? */ int (*port_handed_over)(struct usb_hcd *, int);
/* xHCI specific functions */ /* Called by usb_alloc_dev to alloc HC device structures */ int (*alloc_dev)(struct usb_hcd *, struct usb_device *); /* Called by usb_disconnect to free HC device structures */ void (*free_dev)(struct usb_hcd *, struct usb_device *); /* Change a group of bulk endpoints to support multiple stream IDs */ int (*alloc_streams)(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint **eps, unsignedint num_eps, unsignedint num_streams, gfp_t mem_flags); /* Reverts a group of bulk endpoints back to not using stream IDs. *Canfailifwerunoutofmemory.
*/ int (*free_streams)(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint **eps, unsignedint num_eps,
gfp_t mem_flags);
/* Bandwidth computation functions */ /* Note that add_endpoint() can only be called once per endpoint before *check_bandwidth()orreset_bandwidth()mustbecalled. *drop_endpoint()canonlybecalledonceperendpointalso. *Acalltoxhci_drop_endpoint()followedbyacallto *xhci_add_endpoint()willaddtheendpointtotheschedulewith *possiblynewparametersdenotedbyadifferentendpointdescriptor *inusb_host_endpoint.Acalltoxhci_add_endpoint()followedbya *calltoxhci_drop_endpoint()isnotallowed.
*/ /* Allocate endpoint resources and add them to a new schedule */ int (*add_endpoint)(struct usb_hcd *, struct usb_device *, struct usb_host_endpoint *); /* Drop an endpoint from a new schedule */ int (*drop_endpoint)(struct usb_hcd *, struct usb_device *, struct usb_host_endpoint *); /* Check that a new hardware configuration, set using *endpoint_enableandendpoint_disable,doesnotexceedbus *bandwidth.Thismustbecalledbeforeanysetconfiguration *orsetinterfacerequestsaresenttothedevice.
*/ int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); /* Reset the device schedule to the last known good schedule, *whichwassetfromaprevioussuccessfulcallto *check_bandwidth().Thisrevertsanyadd_endpoint()and *drop_endpoint()callssincethatlastsuccessfulcall. *Usedforwhenacheck_bandwidth()callfailsduetoresource *orbandwidthconstraints.
*/ void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); /* Set the hardware-chosen device address */ int (*address_device)(struct usb_hcd *, struct usb_device *udev, unsignedint timeout_ms); /* prepares the hardware to send commands to the device */ int (*enable_device)(struct usb_hcd *, struct usb_device *udev); /* Notifies the HCD after a hub descriptor is fetched. *Willblock.
*/ int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, struct usb_tt *tt, gfp_t mem_flags); int (*reset_device)(struct usb_hcd *, struct usb_device *); /* Notifies the HCD after a device is connected and its *addressisset
*/ int (*update_device)(struct usb_hcd *, struct usb_device *); int (*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int); /* USB 3.0 Link Power Management */ /* Returns the USB3 hub-encoded value for the U1/U2 timeout. */ int (*enable_usb3_lpm_timeout)(struct usb_hcd *, struct usb_device *, enum usb3_link_state state); /* The xHCI host controller can still fail the command to *disabletheLPMtimeouts,sothiscanreturnanerrorcode.
*/ int (*disable_usb3_lpm_timeout)(struct usb_hcd *, struct usb_device *, enum usb3_link_state state); int (*find_raw_port_number)(struct usb_hcd *, int); /* Call for power on/off the port if necessary */ int (*port_power)(struct usb_hcd *hcd, int portnum, bool enable); /* Call for SINGLE_STEP_SET_FEATURE Test for USB2 EH certification */ #define EHSET_TEST_SINGLE_STEP_SET_FEATURE 0x06 int (*submit_single_step_set_feature)(struct usb_hcd *, struct urb *, int);
};
struct usb_tt { struct usb_device *hub; /* upstream highspeed hub */ int multi; /* true means one TT per port */ unsigned think_time; /* think time in ns */ void *hcpriv; /* HCD private data */
/* for control/bulk error recovery (CLEAR_TT_BUFFER) */
spinlock_t lock; struct list_head clear_list; /* of usb_tt_clear */ struct work_struct clear_work;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.