воскресенье, 15 мая 2011 г.

13.6. Quick Reference

13.6. Quick Reference

This section summarizes the symbols introduced in the chapter:

#include

Header file where everything related to USB resides. It must be included by all

USB device drivers.

struct usb_driver;

Structure that describes a USB driver.

struct usb_device_id;

Structure that describes the types of USB devices this driver supports.

int usb_register(struct usb_driver *d);
void usb_deregister(struct usb_driver *d);

Functions used to register and unregister a USB driver from the USB core.
struct usb_device *interface_to_usbdev(struct usb_interface *intf);

Retrieves the controlling struct usb_device * out of a struct usb_interface *.

struct usb_device;

Structure that controls an entire USB device.

struct usb_interface;

Main USB device structure that all USB drivers use to communicate with the USB core.

void usb_set_intfdata(struct usb_interface *intf, void *data);
void *usb_get_intfdata(struct usb_interface *intf);

Functions to set and get access to the private data pointer section within the

struct usb_interface.
struct usb_class_driver;

A structure that describes a USB driver that wants to use the USB major number to communicate with user-space programs.

int usb_register_dev(struct usb_interface *intf, struct usb_class_driver
*class_driver);
void usb_deregister_dev(struct usb_interface *intf, struct usb_class_driver
*class_driver);

Functions used to register and unregister a specific struct usb_interface * structure with a struct usb_class_driver * structure.

struct urb;

Structure that describes a USB data transmission.

struct urb *usb_alloc_urb(int iso_packets, int mem_flags);
void usb_free_urb(struct urb *urb);

Functions used to create and destroy a struct usb urb *.

int usb_submit_urb(struct urb *urb, int mem_flags);
int usb_kill_urb(struct urb *urb);
int usb_unlink_urb(struct urb *urb);

Functions used to start and stop a USB data transmission.

void usb_fill_int_urb(struct urb *urb, struct usb_device *dev, unsigned int
pipe, void *transfer_buffer, int buffer_length, usb_complete_t complete,
void *context, int interval);
void usb_fill_bulk_urb(struct urb *urb, struct usb_device *dev, unsigned int
pipe, void *transfer_buffer, int buffer_length, usb_complete_t complete,
void *context);
void usb_fill_control_urb(struct urb *urb, struct usb_device *dev, unsigned
int pipe, unsigned char *setup_packet, void *transfer_buffer, int
buffer_ length, usb_complete_t complete, void *context);

Functions used to initialize a struct urb before it is submitted to the USB core.

int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, void *data,
int len, int *actual_length, int timeout);
int usb_control_msg(struct usb_device *dev, unsigned int pipe, _ _u8 request,
_ _u8 requesttype, _ _u16 value, _ _u16 index, void *data, _ _u16 size,
int timeout);

Functions used to send or receive USB data without having to use a struct urb.

Комментариев нет:

Отправить комментарий

Примечание. Отправлять комментарии могут только участники этого блога.