*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> usbdi (9)              



NAME    [Toc]    [Back]

     usbdi - USB device drivers interface

SYNOPSIS    [Toc]    [Back]

     #include <dev/usb/usb.h>
     #include <dev/usb/usbdi.h>

DESCRIPTION    [Toc]    [Back]

     Device driver access to the USB bus centers around transfers.  A transfer
     describes a communication with a USB device.  A transfer is an abstract
     concept that can result in several physical packets being transferred to
     or from a device.  A transfer is described by a usbd_xfer_handle.  It is
     allocated by usbd_alloc_xfer and the data describing the transfer is
     filled by usbd_setup_default_xfer for control pipe transfers, by
     usbd_setup_xfer for bulk and interrupt transfers, and by
     usbd_setup_isoc_xfer for isochronous transfers.

     describe usbd_do_request

     describe pipes

     describe usbd_status

   Functions offered by usbdi    [Toc]    [Back]

     usbd_status usbd_open_pipe(usbd_interface_handle iface, u_int8_t address,
                 u_int8_t flags,
                 usbd_pipe_handle *pipe)

     usbd_status usbd_close_pipe(usbd_pipe_handle pipe)

     usbd_status usbd_transfer(usbd_xfer_handle req)

     usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle)

     usbd_status usbd_free_xfer(usbd_xfer_handle xfer)

     void usbd_setup_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
                  usbd_private_handle priv, void *buffer,
                  u_int32_t length, u_int16_t flags, u_int32_t timeout,

     void usbd_setup_default_xfer(usbd_xfer_handle xfer,
                  usbd_device_handle dev,
                  usbd_private_handle priv, u_int32_t timeout,
                  usb_device_request_t *req,  void *buffer,
                  u_int32_t length, u_int16_t flags, usbd_callback)

     void usbd_setup_isoc_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
                  usbd_private_handle priv, u_int16_t *frlengths,
                  u_int32_t nframes, u_int16_t flags, usbd_callback)

     void usbd_get_xfer_status(usbd_xfer_handle xfer, usbd_private_handle
                  void **buffer, u_int32_t *count, usbd_status *status)

             *usbd_interface2endpoint_descriptor(usbd_interface_handle iface,
             u_int8_t address)

     usbd_status usbd_abort_pipe(usbd_pipe_handle pipe)

     usbd_status usbd_clear_endpoint_stall(usbd_pipe_handle pipe)

     usbd_status usbd_clear_endpoint_stall_async(usbd_pipe_handle pipe)

     usbd_status usbd_endpoint_count(usbd_interface_handle dev, u_int8_t

     usbd_status usbd_interface_count(usbd_device_handle dev, u_int8_t *count)

     usbd_status usbd_interface2device_handle(usbd_interface_handle iface,
             usbd_device_handle *dev)

     usbd_status usbd_device2interface_handle(usbd_device_handle dev, u_int8_t
             ifaceno, usbd_interface_handle *iface)

     usbd_device_handle usbd_pipe2device_handle(usbd_pipe_handle)

     void *usbd_alloc_buffer(usbd_xfer_handle req, u_int32_t size)

     void usbd_free_buffer(usbd_xfer_handle req)

     void *usbd_get_buffer(usbd_xfer_handle xfer)

     usbd_status usbd_sync_transfer(usbd_xfer_handle req)

     usbd_status usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t
                  u_int8_t flags, usbd_pipe_handle *pipe,
                  usbd_private_handle priv, void *buffer,
                  u_int32_t length, usbd_callback)

     usbd_status usbd_do_request(usbd_device_handle pipe, usb_device_request_t
             *req, void *data)

     usbd_status usbd_do_request_async(usbd_device_handle pipe,
             usb_device_request_t *req, void *data)

     usbd_status usbd_do_request_flags(usbd_device_handle pipe,
             usb_device_request_t *req,
                  void *data, u_int16_t flags, int *)

             *usbd_get_interface_descriptor(usbd_interface_handle iface)

     usb_config_descriptor_t *usbd_get_config_descriptor(usbd_device_handle

     usb_device_descriptor_t *usbd_get_device_descriptor(usbd_device_handle

     usbd_status usbd_set_interface(usbd_interface_handle, int)

     int usbd_get_no_alts(usb_config_descriptor_t *, int)

     usbd_status    usbd_get_interface(usbd_interface_handle iface, u_int8_t

     void usbd_fill_deviceinfo (usbd_device_handle dev, struct usb_device_info

     int usbd_get_interface_altindex(usbd_interface_handle iface)

     usb_interface_descriptor_t *usbd_find_idesc(usb_config_descriptor_t *cd,
             int iindex, int ano)

     usb_endpoint_descriptor_t *usbd_find_edesc(usb_config_descriptor_t *cd,
             int ifaceidx, int altidx,
                  int endptidx)

     const char *usbd_errstr(usbd_status err)

   Utilities from usbdi_util.h    [Toc]    [Back]
     Based on the routines in usbdi.h a number of utility functions have been
     defined that are accessible through usbdi_util.h

     usbd_status    usbd_get_desc(usbd_device_handle dev, int type,
                                    int index, int len, void *desc)

     usbd_status    usbd_get_config_desc(usbd_device_handle, int,
                                        usb_config_descriptor_t *)

     usbd_status    usbd_get_config_desc_full(usbd_device_handle, int,
                                             void *, int)

     usbd_status    usbd_get_device_desc(usbd_device_handle dev,
                                        usb_device_descriptor_t *d)

     usbd_status    usbd_set_address(usbd_device_handle dev, int addr)

     usbd_status    usbd_get_port_status(usbd_device_handle,
                                       int, usb_port_status_t *)

     usbd_status    usbd_set_hub_feature(usbd_device_handle dev, int)

     usbd_status    usbd_clear_hub_feature(usbd_device_handle, int)

     usbd_status    usbd_set_port_feature(usbd_device_handle dev, int, int)

     usbd_status    usbd_clear_port_feature(usbd_device_handle, int, int)

     usbd_status    usbd_get_device_status(usbd_device_handle,usb_status_t*)

     usbd_status    usbd_get_hub_status(usbd_device_handle dev,
                                       usb_hub_status_t *st)

     usbd_status    usbd_set_protocol(usbd_interface_handle dev, int report)

     usbd_status    usbd_get_report_descriptor
             (usbd_device_handle dev, int ifcno, int repid, int size, void *d)

     struct usb_hid_descriptor *usbd_get_hid_descriptor
             (usbd_interface_handle ifc)

     usbd_status    usbd_set_report
             (usbd_interface_handle iface,int type,int id,void *data,int len)

     usbd_status    usbd_set_report_async
             (usbd_interface_handle iface,int type,int id,void *data,int len)

     usbd_status    usbd_get_report
             (usbd_interface_handle iface,int type,int id,void *data,int len)

     usbd_status    usbd_set_idle
             (usbd_interface_handle iface, int duration, int id)

     usbd_status    usbd_alloc_report_desc
             (usbd_interface_handle ifc, void **descp, int *sizep, int mem)

     usbd_status    usbd_get_config
             (usbd_device_handle dev, u_int8_t *conf)

     usbd_status    usbd_get_string_desc
             (usbd_device_handle dev, int sindex, int langid,
             usb_string_descriptor_t *sdesc)

     void      usbd_delay_ms(usbd_device_handle, u_int)

     usbd_status usbd_set_config_no
             (usbd_device_handle dev, int no, int msg)

     usbd_status usbd_set_config_index
             (usbd_device_handle dev, int index, int msg)

     usbd_status usbd_bulk_transfer
             (usbd_xfer_handle xfer, usbd_pipe_handle pipe, u_int16_t flags,
                       u_int32_t timeout, void *buf, u_int32_t *size, char

     void usb_detach_wait(device_ptr_t)

     void usb_detach_wakeup(device_ptr_t)

SEE ALSO    [Toc]    [Back]


HISTORY    [Toc]    [Back]

     This usbdi interface first appeared in NetBSD 1.4.  The interface is
     based on an early definition from the OpenUSBDI group within the USB
     organisation.  Right after this definition the OpenUSBDI development got
     closed for open source developers, so this interface has not followed the
     further changes.  The OpenUSBDI specification is now available again, but
     looks different.

BUGS    [Toc]    [Back]

     This man page is under development, so its biggest shortcoming is incompleteness.

BSD                            December 3, 1999                            BSD
[ Back ]
 Similar pages
Name OS Title
scsi HP-UX Small Computer System Interface device drivers
lsdev HP-UX list device drivers in the system
fpa FreeBSD device drivers for DEC FDDI controllers
intro FreeBSD introduction to devices and device drivers
fea FreeBSD device drivers for DEC FDDI controllers
mouse FreeBSD mouse and pointing device drivers
ioctl NetBSD how to implement a new ioctl call to access device drivers
dlpi_drv HP-UX definitions of interfaces for device drivers to interact with DLPI
dlpi_drv.h HP-UX definitions of interfaces for device drivers to interact with DLPI
eucioctl Tru64 Interface to EUC-handling modules and drivers
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service