Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
driver.c File Reference
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/usb.h>
#include <linux/usb/quirks.h>
#include <linux/usb/hcd.h>
#include "usb.h"

Go to the source code of this file.

Functions

int usb_driver_claim_interface (struct usb_driver *driver, struct usb_interface *iface, void *priv)
 
 EXPORT_SYMBOL_GPL (usb_driver_claim_interface)
 
void usb_driver_release_interface (struct usb_driver *driver, struct usb_interface *iface)
 
 EXPORT_SYMBOL_GPL (usb_driver_release_interface)
 
int usb_match_device (struct usb_device *dev, const struct usb_device_id *id)
 
int usb_match_one_id_intf (struct usb_device *dev, struct usb_host_interface *intf, const struct usb_device_id *id)
 
int usb_match_one_id (struct usb_interface *interface, const struct usb_device_id *id)
 
 EXPORT_SYMBOL_GPL (usb_match_one_id)
 
struct usb_device_idusb_match_id (struct usb_interface *interface, const struct usb_device_id *id)
 
 EXPORT_SYMBOL_GPL (usb_match_id)
 
int usb_register_device_driver (struct usb_device_driver *new_udriver, struct module *owner)
 
 EXPORT_SYMBOL_GPL (usb_register_device_driver)
 
void usb_deregister_device_driver (struct usb_device_driver *udriver)
 
 EXPORT_SYMBOL_GPL (usb_deregister_device_driver)
 
int usb_register_driver (struct usb_driver *new_driver, struct module *owner, const char *mod_name)
 
 EXPORT_SYMBOL_GPL (usb_register_driver)
 
void usb_deregister (struct usb_driver *driver)
 
 EXPORT_SYMBOL_GPL (usb_deregister)
 
void usb_forced_unbind_intf (struct usb_interface *intf)
 
void usb_rebind_intf (struct usb_interface *intf)
 

Variables

struct bus_type usb_bus_type
 

Function Documentation

EXPORT_SYMBOL_GPL ( usb_driver_claim_interface  )
EXPORT_SYMBOL_GPL ( usb_driver_release_interface  )
EXPORT_SYMBOL_GPL ( usb_match_one_id  )
EXPORT_SYMBOL_GPL ( usb_match_id  )
EXPORT_SYMBOL_GPL ( usb_register_device_driver  )
EXPORT_SYMBOL_GPL ( usb_deregister_device_driver  )
EXPORT_SYMBOL_GPL ( usb_register_driver  )
EXPORT_SYMBOL_GPL ( usb_deregister  )
void usb_deregister ( struct usb_driver *  driver)

usb_deregister - unregister a USB interface driver : USB operations of the interface driver to unregister Context: must be able to sleep

Unlinks the specified driver from the internal USB driver list.

NOTE: If you called usb_register_dev(), you still need to call usb_deregister_dev() to clean up your driver's allocated minor numbers, this * call will no longer do it for you.

Definition at line 966 of file driver.c.

void usb_deregister_device_driver ( struct usb_device_driver *  udriver)

usb_deregister_device_driver - unregister a USB device (not interface) driver : USB operations of the device driver to unregister Context: must be able to sleep

Unlinks the specified driver from the internal USB driver list.

Definition at line 889 of file driver.c.

int usb_driver_claim_interface ( struct usb_driver *  driver,
struct usb_interface iface,
void priv 
)

usb_driver_claim_interface - bind a driver to an interface : the driver to be bound : the interface to which it will be bound; must be in the usb device's active configuration : driver data associated with that interface

This is used by usb device drivers that need to claim more than one interface on a device when probing (audio and acm are current examples). No device driver should directly modify internal usb_interface or usb_device structure members.

Few drivers should need to use this routine, since the most natural way to bind to an interface is to return the private data from the driver's probe() method.

Callers must own the device lock, so driver probe() entries don't need extra locking, but other call contexts may need to explicitly claim that lock.

Definition at line 477 of file driver.c.

void usb_driver_release_interface ( struct usb_driver *  driver,
struct usb_interface iface 
)

usb_driver_release_interface - unbind a driver from an interface : the driver to be unbound : the interface from which it will be unbound

This can be used by drivers to release an interface without waiting for their disconnect() methods to be called. In typical cases this also causes the driver disconnect() method to be called.

This call is synchronous, and may not be used in an interrupt context. Callers must own the device lock, so driver disconnect() entries don't need extra locking, but other call contexts may need to explicitly claim that lock.

Definition at line 544 of file driver.c.

void usb_forced_unbind_intf ( struct usb_interface intf)

Definition at line 984 of file driver.c.

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

Definition at line 573 of file driver.c.

struct usb_device_id* usb_match_id ( struct usb_interface interface,
const struct usb_device_id id 
)
read

Definition at line 735 of file driver.c.

int usb_match_one_id ( struct usb_interface interface,
const struct usb_device_id id 
)

Definition at line 644 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_rebind_intf ( struct usb_interface intf)

Definition at line 1004 of file driver.c.

int usb_register_device_driver ( struct usb_device_driver *  new_udriver,
struct module owner 
)

usb_register_device_driver - register a USB device (not interface) driver : USB operations for the device driver : module owner of this driver.

Registers a USB device driver with the USB core. The list of unattached devices will be rescanned whenever a new driver is added, allowing the new driver to attach to any recognized devices. Returns a negative error code on failure and 0 on success.

Definition at line 853 of file driver.c.

int usb_register_driver ( struct usb_driver *  new_driver,
struct module owner,
const char mod_name 
)

usb_register_driver - register a USB interface driver : USB operations for the interface driver : module owner of this driver. : module name string

Registers a USB interface driver with the USB core. The list of unattached interfaces will be rescanned whenever a new driver is added, allowing the new driver to attach to any recognized interfaces. Returns a negative error code on failure and 0 on success.

NOTE: if you want your driver to use the USB major number, you must call usb_register_dev() to enable that functionality. This function no longer takes care of that.

Definition at line 913 of file driver.c.

Variable Documentation

struct bus_type usb_bus_type
Initial value:
= {
.name = "usb",
.match = usb_device_match,
.uevent = usb_uevent,
}

Definition at line 1805 of file driver.c.