Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
usb.h File Reference
#include <linux/pm.h>
#include <linux/acpi.h>

Go to the source code of this file.

Macros

#define usb_autosuspend_device(udev)   do {} while (0)
 

Functions

int usb_create_sysfs_dev_files (struct usb_device *dev)
 
void usb_remove_sysfs_dev_files (struct usb_device *dev)
 
void usb_create_sysfs_intf_files (struct usb_interface *intf)
 
void usb_remove_sysfs_intf_files (struct usb_interface *intf)
 
int usb_create_ep_devs (struct device *parent, struct usb_host_endpoint *endpoint, struct usb_device *udev)
 
void usb_remove_ep_devs (struct usb_host_endpoint *endpoint)
 
void usb_enable_endpoint (struct usb_device *dev, struct usb_host_endpoint *ep, bool reset_toggle)
 
void usb_enable_interface (struct usb_device *dev, struct usb_interface *intf, bool reset_toggles)
 
void usb_disable_endpoint (struct usb_device *dev, unsigned int epaddr, bool reset_hardware)
 
void usb_disable_interface (struct usb_device *dev, struct usb_interface *intf, bool reset_hardware)
 
void usb_release_interface_cache (struct kref *ref)
 
void usb_disable_device (struct usb_device *dev, int skip_ep0)
 
int usb_deauthorize_device (struct usb_device *)
 
int usb_authorize_device (struct usb_device *)
 
void usb_detect_quirks (struct usb_device *udev)
 
void usb_detect_interface_quirks (struct usb_device *udev)
 
int usb_remove_device (struct usb_device *udev)
 
int usb_get_device_descriptor (struct usb_device *dev, unsigned int size)
 
int usb_get_bos_descriptor (struct usb_device *dev)
 
void usb_release_bos_descriptor (struct usb_device *dev)
 
charusb_cache_string (struct usb_device *udev, int index)
 
int usb_set_configuration (struct usb_device *dev, int configuration)
 
int usb_choose_configuration (struct usb_device *udev)
 
void usb_kick_khubd (struct usb_device *dev)
 
int usb_match_one_id_intf (struct usb_device *dev, struct usb_host_interface *intf, const struct usb_device_id *id)
 
int usb_match_device (struct usb_device *dev, const struct usb_device_id *id)
 
void usb_forced_unbind_intf (struct usb_interface *intf)
 
void usb_rebind_intf (struct usb_interface *intf)
 
int usb_hub_claim_port (struct usb_device *hdev, unsigned port, struct dev_state *owner)
 
int usb_hub_release_port (struct usb_device *hdev, unsigned port, struct dev_state *owner)
 
void usb_hub_release_all_ports (struct usb_device *hdev, struct dev_state *owner)
 
bool usb_device_is_owned (struct usb_device *udev)
 
int usb_hub_init (void)
 
void usb_hub_cleanup (void)
 
int usb_major_init (void)
 
void usb_major_cleanup (void)
 
void usbfs_conn_disc_event (void)
 
int usb_devio_init (void)
 
void usb_devio_cleanup (void)
 
void usb_notify_add_device (struct usb_device *udev)
 
void usb_notify_remove_device (struct usb_device *udev)
 
void usb_notify_add_bus (struct usb_bus *ubus)
 
void usb_notify_remove_bus (struct usb_bus *ubus)
 
enum usb_port_connect_type usb_get_hub_port_connect_type (struct usb_device *hdev, int port1)
 
void usb_set_hub_port_connect_type (struct usb_device *hdev, int port1, enum usb_port_connect_type type)
 

Variables

struct bus_type usb_bus_type
 
struct device_type usb_device_type
 
struct device_type usb_if_device_type
 
struct device_type usb_ep_device_type
 
struct device_type usb_port_device_type
 
struct usb_device_driver usb_generic_driver
 
const charusbcore_name
 
struct attribute_groupusb_device_groups []
 
struct attribute_groupusb_interface_groups []
 
struct mutex usbfs_mutex
 
struct usb_driver usbfs_driver
 
struct file_operations usbfs_devices_fops
 
struct file_operations usbdev_file_operations
 

Macro Definition Documentation

#define usb_autosuspend_device (   udev)    do {} while (0)

Definition at line 98 of file usb.h.

Function Documentation

int usb_authorize_device ( struct usb_device *  )

Definition at line 2326 of file hub.c.

char* usb_cache_string ( struct usb_device *  udev,
int  index 
)

usb_cache_string - read a string descriptor and cache it for later use : the device whose string descriptor is being read : the descriptor index

Returns a pointer to a kmalloc'ed buffer containing the descriptor string, or NULL if the index is 0 or the string could not be read.

Definition at line 859 of file message.c.

int usb_choose_configuration ( struct usb_device *  udev)

Definition at line 43 of file generic.c.

int usb_create_ep_devs ( struct device parent,
struct usb_host_endpoint *  endpoint,
struct usb_device *  udev 
)

Definition at line 176 of file endpoint.c.

int usb_create_sysfs_dev_files ( struct usb_device *  dev)

Definition at line 755 of file sysfs.c.

void usb_create_sysfs_intf_files ( struct usb_interface intf)

Definition at line 936 of file sysfs.c.

int usb_deauthorize_device ( struct usb_device *  usb_dev)

usb_deauthorize_device - deauthorize a device (usbcore-internal) : USB device

Move the USB device to a very basic state where interfaces are disabled and the device is in fact unconfigured and unusable.

We share a lock (that we have) with device_del(), so we need to defer its call.

Definition at line 2301 of file hub.c.

void usb_detect_interface_quirks ( struct usb_device *  udev)

Definition at line 217 of file quirks.c.

void usb_detect_quirks ( struct usb_device *  udev)

Definition at line 194 of file quirks.c.

bool usb_device_is_owned ( struct usb_device *  udev)

Definition at line 1778 of file hub.c.

void usb_devio_cleanup ( void  )

Definition at line 2263 of file devio.c.

int usb_devio_init ( void  )

Definition at line 2237 of file devio.c.

void usb_disable_device ( struct usb_device *  dev,
int  skip_ep0 
)

usb_disable_device - Disable all the endpoints for a USB device : the device whose endpoints are being disabled : 0 to disable endpoint 0, 1 to skip it.

Disables all the device's endpoints, potentially including endpoint 0. Deallocates hcd/hardware state for the endpoints (nuking all or most pending urbs) and usbcore state for the interfaces, so that usbcore must usb_set_configuration() before any interfaces could be used.

Definition at line 1138 of file message.c.

void usb_disable_endpoint ( struct usb_device *  dev,
unsigned int  epaddr,
bool  reset_hardware 
)

usb_disable_endpoint – Disable an endpoint by address : the device whose endpoint is being disabled : the endpoint's address. Endpoint number for output, endpoint number + USB_DIR_IN for input : flag to erase any endpoint state stored in the controller hardware

Disables the endpoint for URB submission and nukes all pending URBs. If is set then also deallocates hcd/hardware state for the endpoint.

Definition at line 1056 of file message.c.

void usb_disable_interface ( struct usb_device *  dev,
struct usb_interface intf,
bool  reset_hardware 
)

usb_disable_interface – Disable all endpoints for an interface : the device whose interface is being disabled : pointer to the interface descriptor : flag to erase any endpoint state stored in the controller hardware

Disables all the endpoints for the interface's current altsetting.

Definition at line 1115 of file message.c.

void usb_enable_endpoint ( struct usb_device *  dev,
struct usb_host_endpoint *  ep,
bool  reset_ep 
)

usb_enable_endpoint - Enable an endpoint for USB communications : the device whose interface is being enabled : the endpoint : flag to reset the endpoint state

Resets the endpoint state if asked, and sets dev->ep_{in,out} pointers. For control endpoints, both the input and output sides are handled.

Definition at line 1211 of file message.c.

void usb_enable_interface ( struct usb_device *  dev,
struct usb_interface intf,
bool  reset_eps 
)

usb_enable_interface - Enable all the endpoints for an interface : the device whose interface is being enabled : pointer to the interface descriptor : flag to reset the endpoints' state

Enables all the endpoints for the interface's current altsetting.

Definition at line 1235 of file message.c.

void usb_forced_unbind_intf ( struct usb_interface intf)

Definition at line 984 of file driver.c.

int usb_get_bos_descriptor ( struct usb_device *  dev)

Definition at line 771 of file config.c.

int usb_get_device_descriptor ( struct usb_device *  dev,
unsigned int  size 
)

Definition at line 900 of file message.c.

enum usb_port_connect_type usb_get_hub_port_connect_type ( struct usb_device *  hdev,
int  port1 
)

usb_get_hub_port_connect_type - Get the port's connect type : USB device belonging to the usb hub : port num of the port

Return connect type of the port and if input params are invalid, return USB_PORT_CONNECT_TYPE_UNKNOWN.

Definition at line 5119 of file hub.c.

int usb_hub_claim_port ( struct usb_device *  hdev,
unsigned  port,
struct dev_state owner 
)

Definition at line 1735 of file hub.c.

void usb_hub_cleanup ( void  )

Definition at line 4693 of file hub.c.

int usb_hub_init ( void  )

Definition at line 4674 of file hub.c.

void usb_hub_release_all_ports ( struct usb_device *  hdev,
struct dev_state owner 
)

Definition at line 1765 of file hub.c.

int usb_hub_release_port ( struct usb_device *  hdev,
unsigned  port,
struct dev_state owner 
)

Definition at line 1750 of file hub.c.

void usb_kick_khubd ( struct usb_device *  dev)

Definition at line 641 of file hub.c.

void usb_major_cleanup ( void  )

Definition at line 135 of file file.c.

int usb_major_init ( void  )

Definition at line 123 of file file.c.

int usb_match_device ( struct usb_device *  dev,
const struct usb_device_id id 
)

Definition at line 573 of file driver.c.

int usb_match_one_id_intf ( struct usb_device *  dev,
struct usb_host_interface *  intf,
const struct usb_device_id id 
)

Definition at line 609 of file driver.c.

void usb_notify_add_bus ( struct usb_bus *  ubus)

Definition at line 61 of file notify.c.

void usb_notify_add_device ( struct usb_device *  udev)

Definition at line 47 of file notify.c.

void usb_notify_remove_bus ( struct usb_bus *  ubus)

Definition at line 66 of file notify.c.

void usb_notify_remove_device ( struct usb_device *  udev)

Definition at line 52 of file notify.c.

void usb_rebind_intf ( struct usb_interface intf)

Definition at line 1004 of file driver.c.

void usb_release_bos_descriptor ( struct usb_device *  dev)

Definition at line 761 of file config.c.

void usb_release_interface_cache ( struct kref ref)

Definition at line 288 of file config.c.

int usb_remove_device ( struct usb_device *  udev)

usb_remove_device - disable a device's port on its parent hub : device to be disabled and removed Context: locked, must be able to sleep.

After 's port has been disabled, khubd is notified and it will see that the device has been disconnected. When the device is physically unplugged and something is plugged in, the events will be received and processed normally.

Definition at line 928 of file hub.c.

void usb_remove_ep_devs ( struct usb_host_endpoint *  endpoint)

Definition at line 210 of file endpoint.c.

void usb_remove_sysfs_dev_files ( struct usb_device *  dev)

Definition at line 777 of file sysfs.c.

void usb_remove_sysfs_intf_files ( struct usb_interface intf)

Definition at line 951 of file sysfs.c.

int usb_set_configuration ( struct usb_device *  dev,
int  configuration 
)

Definition at line 1706 of file message.c.

void usb_set_hub_port_connect_type ( struct usb_device *  hdev,
int  port1,
enum usb_port_connect_type  type 
)

usb_set_hub_port_connect_type - set hub port connect type. : USB device belonging to the usb hub : port num of the port : connect type of the port

Definition at line 5102 of file hub.c.

void usbfs_conn_disc_event ( void  )

Definition at line 165 of file devices.c.

Variable Documentation

struct bus_type usb_bus_type

Definition at line 1805 of file driver.c.

struct attribute_group* usb_device_groups[]

Definition at line 702 of file sysfs.c.

struct device_type usb_device_type

Definition at line 338 of file usb.c.

struct device_type usb_ep_device_type

Definition at line 171 of file endpoint.c.

struct usb_device_driver usb_generic_driver

Definition at line 236 of file generic.c.

struct device_type usb_if_device_type

Definition at line 1586 of file message.c.

struct attribute_group* usb_interface_groups[]

Definition at line 930 of file sysfs.c.

struct device_type usb_port_device_type

Definition at line 1250 of file hub.c.

const char* usbcore_name

Definition at line 48 of file usb.c.

struct file_operations usbdev_file_operations

Definition at line 2184 of file devio.c.

struct file_operations usbfs_devices_fops

Definition at line 683 of file devices.c.

struct usb_driver usbfs_driver

Definition at line 622 of file devio.c.

struct mutex usbfs_mutex