#ifndef __USB_CORE_HCD_H
#define __USB_CORE_HCD_H
#ifdef __KERNEL__
#include <linux/rwsem.h>
#include <linux/interrupt.h>
#include <linux/idr.h>
#define MAX_TOPO_LEVEL …
#define USB_PID_EXT …
#define USB_PID_OUT …
#define USB_PID_ACK …
#define USB_PID_DATA0 …
#define USB_PID_PING …
#define USB_PID_SOF …
#define USB_PID_NYET …
#define USB_PID_DATA2 …
#define USB_PID_SPLIT …
#define USB_PID_IN …
#define USB_PID_NAK …
#define USB_PID_DATA1 …
#define USB_PID_PREAMBLE …
#define USB_PID_ERR …
#define USB_PID_SETUP …
#define USB_PID_STALL …
#define USB_PID_MDATA …
struct giveback_urb_bh { … };
enum usb_dev_authorize_policy { … };
struct usb_hcd { … };
static inline struct usb_bus *hcd_to_bus(struct usb_hcd *hcd)
{ … }
static inline struct usb_hcd *bus_to_hcd(struct usb_bus *bus)
{ … }
struct hc_driver { … };
static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd)
{ … }
static inline bool hcd_periodic_completion_in_progress(struct usb_hcd *hcd,
struct usb_host_endpoint *ep)
{ … }
static inline bool hcd_uses_dma(struct usb_hcd *hcd)
{ … }
extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
int status);
extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb);
extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags);
extern int usb_hcd_unlink_urb(struct urb *urb, int status);
extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb,
int status);
extern int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
gfp_t mem_flags);
extern void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *, struct urb *);
extern void usb_hcd_unmap_urb_for_dma(struct usb_hcd *, struct urb *);
extern void usb_hcd_flush_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep);
extern void usb_hcd_disable_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep);
extern void usb_hcd_reset_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep);
extern void usb_hcd_synchronize_unlinks(struct usb_device *udev);
extern int usb_hcd_alloc_bandwidth(struct usb_device *udev,
struct usb_host_config *new_config,
struct usb_host_interface *old_alt,
struct usb_host_interface *new_alt);
extern int usb_hcd_get_frame_number(struct usb_device *udev);
struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
struct device *sysdev, struct device *dev, const char *bus_name,
struct usb_hcd *primary_hcd);
extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
struct device *dev, const char *bus_name);
extern struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
struct device *dev, const char *bus_name,
struct usb_hcd *shared_hcd);
extern struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd);
extern void usb_put_hcd(struct usb_hcd *hcd);
extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd);
extern int usb_add_hcd(struct usb_hcd *hcd,
unsigned int irqnum, unsigned long irqflags);
extern void usb_remove_hcd(struct usb_hcd *hcd);
extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1);
int usb_hcd_setup_local_mem(struct usb_hcd *hcd, phys_addr_t phys_addr,
dma_addr_t dma, size_t size);
struct platform_device;
extern void usb_hcd_platform_shutdown(struct platform_device *dev);
#ifdef CONFIG_USB_HCD_TEST_MODE
extern int ehset_single_step_set_feature(struct usb_hcd *hcd, int port);
#else
static inline int ehset_single_step_set_feature(struct usb_hcd *hcd, int port)
{
return 0;
}
#endif
#ifdef CONFIG_USB_PCI
struct pci_dev;
struct pci_device_id;
extern int usb_hcd_pci_probe(struct pci_dev *dev,
const struct hc_driver *driver);
extern void usb_hcd_pci_remove(struct pci_dev *dev);
extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
#ifdef CONFIG_USB_PCI_AMD
extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev);
static inline bool usb_hcd_amd_resume_bug(struct pci_dev *dev,
const struct hc_driver *driver)
{ … }
#else
static inline bool usb_hcd_amd_resume_bug(struct pci_dev *dev,
const struct hc_driver *driver)
{
return false;
}
#endif
extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
#endif
void usb_init_pool_max(void);
int hcd_buffer_create(struct usb_hcd *hcd);
void hcd_buffer_destroy(struct usb_hcd *hcd);
void *hcd_buffer_alloc(struct usb_bus *bus, size_t size,
gfp_t mem_flags, dma_addr_t *dma);
void hcd_buffer_free(struct usb_bus *bus, size_t size,
void *addr, dma_addr_t dma);
void *hcd_buffer_alloc_pages(struct usb_hcd *hcd,
size_t size, gfp_t mem_flags, dma_addr_t *dma);
void hcd_buffer_free_pages(struct usb_hcd *hcd,
size_t size, void *addr, dma_addr_t dma);
extern irqreturn_t usb_hcd_irq(int irq, void *__hcd);
extern void usb_hc_died(struct usb_hcd *hcd);
extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd);
extern void usb_wakeup_notification(struct usb_device *hdev,
unsigned int portnum);
extern void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum);
extern void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum);
#define usb_gettoggle(dev, ep, out) …
#define usb_dotoggle(dev, ep, out) …
#define usb_settoggle(dev, ep, out, bit) …
extern struct usb_device *usb_alloc_dev(struct usb_device *parent,
struct usb_bus *, unsigned port);
extern int usb_new_device(struct usb_device *dev);
extern void usb_disconnect(struct usb_device **);
extern int usb_get_configuration(struct usb_device *dev);
extern void usb_destroy_configuration(struct usb_device *dev);
#include <linux/usb/ch11.h>
struct usb_device;
struct usb_tt { … };
struct usb_tt_clear { … };
extern int usb_hub_clear_tt_buffer(struct urb *urb);
extern void usb_ep0_reinit(struct usb_device *);
#define DeviceRequest …
#define DeviceOutRequest …
#define InterfaceRequest …
#define EndpointRequest …
#define EndpointOutRequest …
#define HUB_CLASS_REQ(dir, type, request) …
#define ClearHubFeature …
#define ClearPortFeature …
#define GetHubDescriptor …
#define GetHubStatus …
#define GetPortStatus …
#define SetHubFeature …
#define SetPortFeature …
#define ClearTTBuffer …
#define ResetTT …
#define GetTTState …
#define StopTT …
#define SetHubDepth …
#define GetPortErrorCount …
#define FRAME_TIME_USECS …
#define BitTime(bytecount) …
#define NS_TO_US(ns) …
#define BW_HOST_DELAY …
#define BW_HUB_LS_SETUP …
#define FRAME_TIME_BITS …
#define FRAME_TIME_MAX_BITS_ALLOC …
#define FRAME_TIME_MAX_USECS_ALLOC …
#define USB2_HOST_DELAY …
#define HS_NSECS(bytes) …
#define HS_NSECS_ISO(bytes) …
#define HS_USECS(bytes) …
#define HS_USECS_ISO(bytes) …
extern long usb_calc_bus_time(int speed, int is_input,
int isoc, int bytecount);
extern void usb_set_device_state(struct usb_device *udev,
enum usb_device_state new_state);
extern struct idr usb_bus_idr;
extern struct mutex usb_bus_idr_lock;
extern wait_queue_head_t usb_kill_urb_queue;
#define usb_endpoint_out(ep_dir) …
#ifdef CONFIG_PM
extern unsigned usb_wakeup_enabled_descendants(struct usb_device *udev);
extern void usb_root_hub_lost_power(struct usb_device *rhdev);
extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);
extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);
extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);
#else
static inline unsigned usb_wakeup_enabled_descendants(struct usb_device *udev)
{
return 0;
}
static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
{
return;
}
#endif
#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
struct usb_mon_operations { … };
extern const struct usb_mon_operations *mon_ops;
static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb)
{ … }
static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
int error)
{ … }
static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
int status)
{ … }
int usb_mon_register(const struct usb_mon_operations *ops);
void usb_mon_deregister(void);
#else
static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) {}
static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
int error) {}
static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
int status) {}
#endif
extern struct rw_semaphore ehci_cf_port_reset_rwsem;
#define USB_UHCI_LOADED …
#define USB_OHCI_LOADED …
#define USB_EHCI_LOADED …
extern unsigned long usb_hcds_loaded;
#endif
#endif