Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Nov 2008 02:31:04 +0000 (UTC)
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184610 - in head: lib/libusb20 share/man/man4 sys/conf sys/dev/sound/pcm sys/dev/usb2 sys/dev/usb2/bluetooth sys/dev/usb2/controller sys/dev/usb2/core sys/dev/usb2/ethernet sys/dev/usb...
Message-ID:  <200811040231.mA42V4EQ083516@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alfred
Date: Tue Nov  4 02:31:03 2008
New Revision: 184610
URL: http://svn.freebsd.org/changeset/base/184610

Log:
  Bring in USB4BSD, Hans Petter Selasky rework of the USB stack
  that includes significant features and SMP safety.
  
  This commit includes a more or less complete rewrite of the *BSD USB
  stack, including Host Controller and Device Controller drivers and
  updating all existing USB drivers to use the new USB API:
  
  1) A brief feature list:
  
    - A new and mutex enabled USB API.
  
    - Many USB drivers are now running Giant free.
  
    - Linux USB kernel compatibility layer.
  
    - New UGEN backend and libusb library, finally solves the "driver
      unloading" problem. The new BSD licensed libusb20 library is fully
      compatible with libusb-0.1.12 from sourceforge.
  
    - New "usbconfig" utility, for easy configuration of USB.
  
    - Full support for Split transactions, which means you can use your
      full speed USB audio device on a high speed USB HUB.
  
    - Full support for HS ISOC transactions, which makes writing drivers
      for various HS webcams possible, for example.
  
    - Full support for USB on embedded platforms, mostly cache flushing
      and buffer invalidating stuff.
  
    - Safer parsing of USB descriptors.
  
    - Autodetect of annoying USB install disks.
  
    - Support for USB device side mode, also called USB gadget mode,
      using the same API like the USB host side. In other words the new
      USB stack is symmetric with regard to host and device side.
  
    - Support for USB transfers like I/O vectors, means more throughput
      and less interrupts.
  
    - ... see the FreeBSD quarterly status reports under "USB project"
  
  2) To enable the driver in the default kernel build:
  
  2.a) Remove all existing USB device options from your kernel config
  file.
  
  2.b) Add the following USB device options to your kernel configuration
  file:
  
  # USB core support
  device          usb2_core
  
  # USB controller support
  device		usb2_controller
  device		usb2_controller_ehci
  device		usb2_controller_ohci
  device		usb2_controller_uhci
  
  # USB mass storage support
  device		usb2_storage
  device		usb2_storage_mass
  
  # USB ethernet support, requires miibus
  device		usb2_ethernet
  device		usb2_ethernet_aue
  device		usb2_ethernet_axe
  device		usb2_ethernet_cdce
  device		usb2_ethernet_cue
  device		usb2_ethernet_kue
  device		usb2_ethernet_rue
  device		usb2_ethernet_dav
  
  # USB wireless LAN support
  device		usb2_wlan
  device		usb2_wlan_rum
  device		usb2_wlan_ral
  device		usb2_wlan_zyd
  
  # USB serial device support
  device		usb2_serial
  device		usb2_serial_ark
  device		usb2_serial_bsa
  device		usb2_serial_bser
  device		usb2_serial_chcom
  device		usb2_serial_cycom
  device		usb2_serial_foma
  device		usb2_serial_ftdi
  device		usb2_serial_gensa
  device		usb2_serial_ipaq
  device		usb2_serial_lpt
  device		usb2_serial_mct
  device		usb2_serial_modem
  device		usb2_serial_moscom
  device		usb2_serial_plcom
  device		usb2_serial_visor
  device		usb2_serial_vscom
  
  # USB bluetooth support
  device		usb2_bluetooth
  device		usb2_bluetooth_ng
  
  # USB input device support
  device		usb2_input
  device		usb2_input_hid
  device		usb2_input_kbd
  device		usb2_input_ms
  
  # USB sound and MIDI device support
  device		usb2_sound
  
  2) To enable the driver at runtime:
  
  2.a) Unload all existing USB modules. If USB is compiled into the
  kernel then you might have to build a new kernel.
  
  2.b) Load the "usb2_xxx.ko" modules under /boot/kernel having the same
  base name like the kernel device option.
  
  Submitted by: Hans Petter Selasky hselasky at c2i dot net
  Reviewed by: imp, alfred

Added:
  head/lib/libusb20/
  head/lib/libusb20/Makefile   (contents, props changed)
  head/lib/libusb20/libusb20.3   (contents, props changed)
  head/lib/libusb20/libusb20.c   (contents, props changed)
  head/lib/libusb20/libusb20.h   (contents, props changed)
  head/lib/libusb20/libusb20_compat01.c   (contents, props changed)
  head/lib/libusb20/libusb20_compat01.h   (contents, props changed)
  head/lib/libusb20/libusb20_compat10.c   (contents, props changed)
  head/lib/libusb20/libusb20_compat10.h   (contents, props changed)
  head/lib/libusb20/libusb20_desc.c   (contents, props changed)
  head/lib/libusb20/libusb20_desc.h   (contents, props changed)
  head/lib/libusb20/libusb20_int.h   (contents, props changed)
  head/lib/libusb20/libusb20_ugen20.c   (contents, props changed)
  head/share/man/man4/usb2_bluetooth.4   (contents, props changed)
  head/share/man/man4/usb2_controller.4   (contents, props changed)
  head/share/man/man4/usb2_core.4   (contents, props changed)
  head/share/man/man4/usb2_ethernet.4   (contents, props changed)
  head/share/man/man4/usb2_image.4   (contents, props changed)
  head/share/man/man4/usb2_input.4   (contents, props changed)
  head/share/man/man4/usb2_misc.4   (contents, props changed)
  head/share/man/man4/usb2_ndis.4   (contents, props changed)
  head/share/man/man4/usb2_quirk.4   (contents, props changed)
  head/share/man/man4/usb2_serial.4   (contents, props changed)
  head/share/man/man4/usb2_sound.4   (contents, props changed)
  head/share/man/man4/usb2_storage.4   (contents, props changed)
  head/share/man/man4/usb2_template.4   (contents, props changed)
  head/share/man/man4/usb2_wlan.4   (contents, props changed)
  head/sys/dev/usb2/
  head/sys/dev/usb2/bluetooth/
  head/sys/dev/usb2/bluetooth/TODO.TXT   (contents, props changed)
  head/sys/dev/usb2/bluetooth/ng_ubt2.c   (contents, props changed)
  head/sys/dev/usb2/bluetooth/ng_ubt2_var.h   (contents, props changed)
  head/sys/dev/usb2/bluetooth/ubtbcmfw2.c   (contents, props changed)
  head/sys/dev/usb2/bluetooth/usb2_bluetooth.c   (contents, props changed)
  head/sys/dev/usb2/bluetooth/usb2_bluetooth.h   (contents, props changed)
  head/sys/dev/usb2/controller/
  head/sys/dev/usb2/controller/at91dci.c   (contents, props changed)
  head/sys/dev/usb2/controller/at91dci.h   (contents, props changed)
  head/sys/dev/usb2/controller/at91dci_atmelarm.c   (contents, props changed)
  head/sys/dev/usb2/controller/ehci2.c   (contents, props changed)
  head/sys/dev/usb2/controller/ehci2.h   (contents, props changed)
  head/sys/dev/usb2/controller/ehci2_pci.c   (contents, props changed)
  head/sys/dev/usb2/controller/musb2_otg.c   (contents, props changed)
  head/sys/dev/usb2/controller/musb2_otg.h   (contents, props changed)
  head/sys/dev/usb2/controller/musb2_otg_atmelarm.c   (contents, props changed)
  head/sys/dev/usb2/controller/ohci2.c   (contents, props changed)
  head/sys/dev/usb2/controller/ohci2.h   (contents, props changed)
  head/sys/dev/usb2/controller/ohci2_atmelarm.c   (contents, props changed)
  head/sys/dev/usb2/controller/ohci2_pci.c   (contents, props changed)
  head/sys/dev/usb2/controller/uhci2.c   (contents, props changed)
  head/sys/dev/usb2/controller/uhci2.h   (contents, props changed)
  head/sys/dev/usb2/controller/uhci2_pci.c   (contents, props changed)
  head/sys/dev/usb2/controller/usb2_bus.h   (contents, props changed)
  head/sys/dev/usb2/controller/usb2_controller.c   (contents, props changed)
  head/sys/dev/usb2/controller/usb2_controller.h   (contents, props changed)
  head/sys/dev/usb2/controller/usb2_pci.h   (contents, props changed)
  head/sys/dev/usb2/controller/uss820dci.c   (contents, props changed)
  head/sys/dev/usb2/controller/uss820dci.h   (contents, props changed)
  head/sys/dev/usb2/controller/uss820dci_atmelarm.c   (contents, props changed)
  head/sys/dev/usb2/controller/uss820dci_pccard.c   (contents, props changed)
  head/sys/dev/usb2/core/
  head/sys/dev/usb2/core/README.TXT   (contents, props changed)
  head/sys/dev/usb2/core/usb2_busdma.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_busdma.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_compat_linux.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_compat_linux.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_config_td.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_config_td.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_core.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_core.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_debug.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_debug.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_dev.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_dev.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_device.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_device.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_dynamic.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_dynamic.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_error.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_generic.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_generic.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_handle_request.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_handle_request.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_hid.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_hid.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_hub.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_hub.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_if.m   (contents, props changed)
  head/sys/dev/usb2/core/usb2_lookup.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_lookup.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_mbuf.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_mbuf.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_msctest.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_msctest.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_parse.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_parse.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_process.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_process.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_request.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_request.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_sw_transfer.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_sw_transfer.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_transfer.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_transfer.h   (contents, props changed)
  head/sys/dev/usb2/core/usb2_util.c   (contents, props changed)
  head/sys/dev/usb2/core/usb2_util.h   (contents, props changed)
  head/sys/dev/usb2/core/usbdevs   (contents, props changed)
  head/sys/dev/usb2/ethernet/
  head/sys/dev/usb2/ethernet/if_aue2.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_aue2_reg.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_axe2.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_axe2_reg.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_cdce2.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_cdce2_reg.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_cue2.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_cue2_reg.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_kue2.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_kue2_fw.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_kue2_reg.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_rue2.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_rue2_reg.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_udav2.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/if_udav2_reg.h   (contents, props changed)
  head/sys/dev/usb2/ethernet/usb2_ethernet.c   (contents, props changed)
  head/sys/dev/usb2/ethernet/usb2_ethernet.h   (contents, props changed)
  head/sys/dev/usb2/image/
  head/sys/dev/usb2/image/usb2_image.c   (contents, props changed)
  head/sys/dev/usb2/image/usb2_image.h   (contents, props changed)
  head/sys/dev/usb2/image/uscanner2.c   (contents, props changed)
  head/sys/dev/usb2/include/
  head/sys/dev/usb2/include/Makefile   (contents, props changed)
  head/sys/dev/usb2/include/ufm2_ioctl.h   (contents, props changed)
  head/sys/dev/usb2/include/urio2_ioctl.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_cdc.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_defs.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_devid.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_devtable.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_endian.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_error.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_hid.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_ioctl.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_mfunc.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_revision.h   (contents, props changed)
  head/sys/dev/usb2/include/usb2_standard.h   (contents, props changed)
  head/sys/dev/usb2/input/
  head/sys/dev/usb2/input/uhid2.c   (contents, props changed)
  head/sys/dev/usb2/input/ukbd2.c   (contents, props changed)
  head/sys/dev/usb2/input/ums2.c   (contents, props changed)
  head/sys/dev/usb2/input/usb2_input.c   (contents, props changed)
  head/sys/dev/usb2/input/usb2_input.h   (contents, props changed)
  head/sys/dev/usb2/input/usb2_rdesc.h   (contents, props changed)
  head/sys/dev/usb2/misc/
  head/sys/dev/usb2/misc/udbp2.c   (contents, props changed)
  head/sys/dev/usb2/misc/udbp2.h   (contents, props changed)
  head/sys/dev/usb2/misc/ufm2.c   (contents, props changed)
  head/sys/dev/usb2/misc/usb2_misc.c   (contents, props changed)
  head/sys/dev/usb2/misc/usb2_misc.h   (contents, props changed)
  head/sys/dev/usb2/ndis/
  head/sys/dev/usb2/ndis/if_ndis_usb2.c   (contents, props changed)
  head/sys/dev/usb2/ndis/usb2_ndis.c   (contents, props changed)
  head/sys/dev/usb2/ndis/usb2_ndis.h   (contents, props changed)
  head/sys/dev/usb2/quirk/
  head/sys/dev/usb2/quirk/usb2_quirk.c   (contents, props changed)
  head/sys/dev/usb2/quirk/usb2_quirk.h   (contents, props changed)
  head/sys/dev/usb2/serial/
  head/sys/dev/usb2/serial/uark2.c   (contents, props changed)
  head/sys/dev/usb2/serial/ubsa2.c   (contents, props changed)
  head/sys/dev/usb2/serial/ubser2.c   (contents, props changed)
  head/sys/dev/usb2/serial/uchcom2.c   (contents, props changed)
  head/sys/dev/usb2/serial/ucycom2.c   (contents, props changed)
  head/sys/dev/usb2/serial/ufoma2.c   (contents, props changed)
  head/sys/dev/usb2/serial/uftdi2.c   (contents, props changed)
  head/sys/dev/usb2/serial/uftdi2_reg.h   (contents, props changed)
  head/sys/dev/usb2/serial/ugensa2.c   (contents, props changed)
  head/sys/dev/usb2/serial/uipaq2.c   (contents, props changed)
  head/sys/dev/usb2/serial/ulpt2.c   (contents, props changed)
  head/sys/dev/usb2/serial/umct2.c   (contents, props changed)
  head/sys/dev/usb2/serial/umodem2.c   (contents, props changed)
  head/sys/dev/usb2/serial/umoscom2.c   (contents, props changed)
  head/sys/dev/usb2/serial/uplcom2.c   (contents, props changed)
  head/sys/dev/usb2/serial/usb2_serial.c   (contents, props changed)
  head/sys/dev/usb2/serial/usb2_serial.h   (contents, props changed)
  head/sys/dev/usb2/serial/uvisor2.c   (contents, props changed)
  head/sys/dev/usb2/serial/uvscom2.c   (contents, props changed)
  head/sys/dev/usb2/sound/
  head/sys/dev/usb2/sound/uaudio2.c   (contents, props changed)
  head/sys/dev/usb2/sound/uaudio2.h   (contents, props changed)
  head/sys/dev/usb2/sound/uaudio2_pcm.c   (contents, props changed)
  head/sys/dev/usb2/sound/uaudio2_reg.h   (contents, props changed)
  head/sys/dev/usb2/sound/usb2_sound.c   (contents, props changed)
  head/sys/dev/usb2/sound/usb2_sound.h   (contents, props changed)
  head/sys/dev/usb2/storage/
  head/sys/dev/usb2/storage/ata-usb2.c   (contents, props changed)
  head/sys/dev/usb2/storage/umass2.c   (contents, props changed)
  head/sys/dev/usb2/storage/urio2.c   (contents, props changed)
  head/sys/dev/usb2/storage/usb2_storage.c   (contents, props changed)
  head/sys/dev/usb2/storage/usb2_storage.h   (contents, props changed)
  head/sys/dev/usb2/storage/ustorage2_fs.c   (contents, props changed)
  head/sys/dev/usb2/template/
  head/sys/dev/usb2/template/usb2_template.c   (contents, props changed)
  head/sys/dev/usb2/template/usb2_template.h   (contents, props changed)
  head/sys/dev/usb2/template/usb2_template_cdce.c   (contents, props changed)
  head/sys/dev/usb2/template/usb2_template_msc.c   (contents, props changed)
  head/sys/dev/usb2/template/usb2_template_mtp.c   (contents, props changed)
  head/sys/dev/usb2/wlan/
  head/sys/dev/usb2/wlan/if_rum2.c   (contents, props changed)
  head/sys/dev/usb2/wlan/if_rum2_fw.h   (contents, props changed)
  head/sys/dev/usb2/wlan/if_rum2_reg.h   (contents, props changed)
  head/sys/dev/usb2/wlan/if_rum2_var.h   (contents, props changed)
  head/sys/dev/usb2/wlan/if_ural2.c   (contents, props changed)
  head/sys/dev/usb2/wlan/if_ural2_reg.h   (contents, props changed)
  head/sys/dev/usb2/wlan/if_ural2_var.h   (contents, props changed)
  head/sys/dev/usb2/wlan/if_zyd2.c   (contents, props changed)
  head/sys/dev/usb2/wlan/if_zyd2_fw.h   (contents, props changed)
  head/sys/dev/usb2/wlan/if_zyd2_reg.h   (contents, props changed)
  head/sys/dev/usb2/wlan/usb2_wlan.c   (contents, props changed)
  head/sys/dev/usb2/wlan/usb2_wlan.h   (contents, props changed)
  head/sys/modules/usb2/
  head/sys/modules/usb2/Makefile   (contents, props changed)
  head/sys/modules/usb2/bluetooth/
  head/sys/modules/usb2/bluetooth/Makefile   (contents, props changed)
  head/sys/modules/usb2/bluetooth_fw/
  head/sys/modules/usb2/bluetooth_fw/Makefile   (contents, props changed)
  head/sys/modules/usb2/bluetooth_ng/
  head/sys/modules/usb2/bluetooth_ng/Makefile   (contents, props changed)
  head/sys/modules/usb2/controller/
  head/sys/modules/usb2/controller/Makefile   (contents, props changed)
  head/sys/modules/usb2/controller_at91dci/
  head/sys/modules/usb2/controller_at91dci/Makefile   (contents, props changed)
  head/sys/modules/usb2/controller_ehci/
  head/sys/modules/usb2/controller_ehci/Makefile   (contents, props changed)
  head/sys/modules/usb2/controller_musb/
  head/sys/modules/usb2/controller_musb/Makefile   (contents, props changed)
  head/sys/modules/usb2/controller_ohci/
  head/sys/modules/usb2/controller_ohci/Makefile   (contents, props changed)
  head/sys/modules/usb2/controller_uhci/
  head/sys/modules/usb2/controller_uhci/Makefile   (contents, props changed)
  head/sys/modules/usb2/controller_uss820dci/
  head/sys/modules/usb2/controller_uss820dci/Makefile   (contents, props changed)
  head/sys/modules/usb2/core/
  head/sys/modules/usb2/core/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet/
  head/sys/modules/usb2/ethernet/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet_aue/
  head/sys/modules/usb2/ethernet_aue/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet_axe/
  head/sys/modules/usb2/ethernet_axe/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet_cdce/
  head/sys/modules/usb2/ethernet_cdce/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet_cue/
  head/sys/modules/usb2/ethernet_cue/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet_dav/
  head/sys/modules/usb2/ethernet_dav/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet_kue/
  head/sys/modules/usb2/ethernet_kue/Makefile   (contents, props changed)
  head/sys/modules/usb2/ethernet_rue/
  head/sys/modules/usb2/ethernet_rue/Makefile   (contents, props changed)
  head/sys/modules/usb2/image/
  head/sys/modules/usb2/image/Makefile   (contents, props changed)
  head/sys/modules/usb2/input/
  head/sys/modules/usb2/input/Makefile   (contents, props changed)
  head/sys/modules/usb2/input_hid/
  head/sys/modules/usb2/input_hid/Makefile   (contents, props changed)
  head/sys/modules/usb2/input_kbd/
  head/sys/modules/usb2/input_kbd/Makefile   (contents, props changed)
  head/sys/modules/usb2/input_ms/
  head/sys/modules/usb2/input_ms/Makefile   (contents, props changed)
  head/sys/modules/usb2/misc/
  head/sys/modules/usb2/misc/Makefile   (contents, props changed)
  head/sys/modules/usb2/misc_dbp/
  head/sys/modules/usb2/misc_dbp/Makefile   (contents, props changed)
  head/sys/modules/usb2/misc_fm/
  head/sys/modules/usb2/misc_fm/Makefile   (contents, props changed)
  head/sys/modules/usb2/ndis/
  head/sys/modules/usb2/ndis/Makefile   (contents, props changed)
  head/sys/modules/usb2/quirk/
  head/sys/modules/usb2/quirk/Makefile   (contents, props changed)
  head/sys/modules/usb2/scanner/
  head/sys/modules/usb2/scanner/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial/
  head/sys/modules/usb2/serial/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_ark/
  head/sys/modules/usb2/serial_ark/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_bsa/
  head/sys/modules/usb2/serial_bsa/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_bser/
  head/sys/modules/usb2/serial_bser/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_chcom/
  head/sys/modules/usb2/serial_chcom/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_cycom/
  head/sys/modules/usb2/serial_cycom/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_foma/
  head/sys/modules/usb2/serial_foma/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_ftdi/
  head/sys/modules/usb2/serial_ftdi/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_gensa/
  head/sys/modules/usb2/serial_gensa/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_ipaq/
  head/sys/modules/usb2/serial_ipaq/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_lpt/
  head/sys/modules/usb2/serial_lpt/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_mct/
  head/sys/modules/usb2/serial_mct/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_modem/
  head/sys/modules/usb2/serial_modem/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_moscom/
  head/sys/modules/usb2/serial_moscom/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_plcom/
  head/sys/modules/usb2/serial_plcom/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_visor/
  head/sys/modules/usb2/serial_visor/Makefile   (contents, props changed)
  head/sys/modules/usb2/serial_vscom/
  head/sys/modules/usb2/serial_vscom/Makefile   (contents, props changed)
  head/sys/modules/usb2/sound/
  head/sys/modules/usb2/sound/Makefile   (contents, props changed)
  head/sys/modules/usb2/storage/
  head/sys/modules/usb2/storage/Makefile   (contents, props changed)
  head/sys/modules/usb2/storage_ata/
  head/sys/modules/usb2/storage_ata/Makefile   (contents, props changed)
  head/sys/modules/usb2/storage_fs/
  head/sys/modules/usb2/storage_fs/Makefile   (contents, props changed)
  head/sys/modules/usb2/storage_mass/
  head/sys/modules/usb2/storage_mass/Makefile   (contents, props changed)
  head/sys/modules/usb2/storage_rio/
  head/sys/modules/usb2/storage_rio/Makefile   (contents, props changed)
  head/sys/modules/usb2/template/
  head/sys/modules/usb2/template/Makefile   (contents, props changed)
  head/sys/modules/usb2/wlan/
  head/sys/modules/usb2/wlan/Makefile   (contents, props changed)
  head/sys/modules/usb2/wlan_ral/
  head/sys/modules/usb2/wlan_ral/Makefile   (contents, props changed)
  head/sys/modules/usb2/wlan_rum/
  head/sys/modules/usb2/wlan_rum/Makefile   (contents, props changed)
  head/sys/modules/usb2/wlan_zyd/
  head/sys/modules/usb2/wlan_zyd/Makefile   (contents, props changed)
  head/usr.sbin/usbconfig/
  head/usr.sbin/usbconfig/Makefile   (contents, props changed)
  head/usr.sbin/usbconfig/dump.c   (contents, props changed)
  head/usr.sbin/usbconfig/dump.h   (contents, props changed)
  head/usr.sbin/usbconfig/usbconfig.8   (contents, props changed)
  head/usr.sbin/usbconfig/usbconfig.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/sound/pcm/channel.c
  head/sys/dev/sound/pcm/channel.h
  head/sys/dev/sound/pcm/mixer.c
  head/sys/dev/sound/pcm/mixer.h
  head/sys/modules/Makefile

Added: head/lib/libusb20/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libusb20/Makefile	Tue Nov  4 02:31:03 2008	(r184610)
@@ -0,0 +1,24 @@
+#
+# $FreeBSD$
+#
+# Makefile for the FreeBSD specific LibUSB 2.0
+#
+
+LIB=		usb20
+SHLIB_MAJOR=	1
+SHLIB_MINOR=	0
+SRCS=		libusb20.c
+SRCS+=		libusb20_desc.c
+SRCS+=		libusb20_ugen20.c
+SRCS+=		libusb20_compat01.c
+SRCS+=		libusb20_compat10.c
+INCS+=		libusb20.h
+INCS+=		libusb20_desc.h
+INCS+=		libusb20_compat01.h
+INCS+=		libusb20_compat10.h
+MAN=		libusb20.3
+MKLINT=		no
+NOGCCERROR=
+
+.include <bsd.lib.mk>
+

Added: head/lib/libusb20/libusb20.3
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libusb20/libusb20.3	Tue Nov  4 02:31:03 2008	(r184610)
@@ -0,0 +1,893 @@
+.\"
+.\" Copyright (c) 2008 Hans Petter Selasky
+.\"
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd Oct 23, 2008
+.Dt LIBUSB20 3
+.Os
+.Sh NAME
+.Nm libusb20
+.
+.Nd "USB access library"
+.
+.
+.Sh LIBRARY
+.
+.
+USB access library (libusb20 -lusb20)
+.
+.
+.
+.Sh SYNOPSIS
+.
+.
+.In libusb20.h
+.
+.
+.Sh DESCRIPTION
+.
+The
+.Nm
+library implements functions to be able to easily access and control
+USB through the USB file system interface.
+.
+.
+.Sh USB TRANSFER OPERATIONS
+.
+.Pp
+.
+.Fn libusb20_tr_close
+This function will release all kernel resources associated with an USB
+.Fa xfer .
+.
+This function returns zero upon success.
+.
+Non-zero return values indicate a LIBUSB20_ERROR value.
+.
+.Pp
+.
+.Fn libusb20_tr_open
+This function will allocate kernel resources like
+.Fa MaxBufSize
+and
+.Fa MaxFrameCount
+associated with an USB
+.Fa xfer
+and bind the transfer to the specified
+.Fa ep_no .
+.
+This function returns zero upon success.
+.
+Non-zero return values indicate a LIBUSB20_ERROR value.
+.
+.Pp
+.
+.Fn libusb20_tr_get_pointer
+This function will return a pointer to the allocated USB transfer according to the
+.Fa pdev
+and
+.Fa tr_index
+arguments.
+.
+This function returns NULL in case of failure.
+.
+.Pp
+.
+.Fn libusb20_tr_get_time_complete
+This function will return the completion time of an USB transfer in
+millisecond units. This function is most useful for isochronous USB
+transfers when doing echo cancelling.
+.
+.Pp
+.
+.Fn libusb20_tr_get_actual_frames
+This function will return the actual number of USB frames after an USB
+transfer completed. A value of zero means that no data was transferred.
+.
+.Pp
+.
+.Fn libusb20_tr_get_actual_length
+This function will return the sum of the actual length for all
+transferred USB frames for the given USB transfer.
+.
+.Pp
+.
+.Fn libusb20_tr_get_max_frames
+This function will return the maximum number of USB frames that were
+allocated when an USB transfer was setup for the given USB transfer.
+.
+.Pp
+.
+.Fn libusb20_tr_get_max_packet_length
+This function will return the maximum packet length in bytes
+associated with the given USB transfer.
+.
+The packet length can be used round up buffer sizes so that short USB
+packets are avoided for proxy buffers.
+.
+.
+.Pp
+.
+.Fn libusb20_tr_get_max_total_length
+This function will return the maximum value for the length sum of all
+USB frames associated with an USB transfer.
+.
+.Pp
+.
+.Fn libusb20_tr_get_status
+This function will return the status of an USB transfer.
+.
+Status values are defined by a set of LIBUSB20_TRANSFER_XXX enums.
+.
+.Pp
+.
+.Fn libusb20_tr_pending
+This function will return non-zero if the given USB transfer is
+pending for completion.
+.
+Else this function returns zero.
+.
+.Pp
+.
+.Fn libusb20_tr_callback_wrapper
+This is an internal function used to wrap asynchronous USB callbacks.
+.
+.Pp
+.
+.Fn libusb20_tr_clear_stall_sync
+This is an internal function used to synchronously clear the stall on
+the given USB transfer.
+.
+Please see the USB specification for more information on stall
+clearing.
+.
+If the given USB transfer is pending when this function is called, the
+USB transfer will complete with an error after that this function has
+been called.
+.
+.Pp
+.
+.Fn libusb20_tr_drain
+This function will stop the given USB transfer and will not return
+until the USB transfer has been stopped in hardware.
+.
+.Pp
+.
+.Fn libusb20_tr_set_buffer
+This function is used to set the
+.Fa buffer
+pointer for the given USB transfer and
+.Fa fr_index .
+.
+Typically the frame index is zero.
+.
+.
+.Pp
+.
+.Fn libusb20_tr_set_callback
+This function is used to set the USB callback for asynchronous USB
+transfers.
+.
+The callback type is defined by libusb20_tr_callback_t.
+.
+.Pp
+.
+.Fn libusb20_tr_set_flags
+This function is used to set various USB flags for the given USB transfer.
+.Bl -tag
+.It LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK
+Report a short frame as error.
+.It LIBUSB20_TRANSFER_MULTI_SHORT_NOT_OK
+Multiple short frames are not allowed.
+.It LIBUSB20_TRANSFER_FORCE_SHORT
+All transmitted frames are short terminated.
+.It LIBUSB20_TRANSFER_DO_CLEAR_STALL
+Will do a clear-stall before starting the transfer.
+.El
+.
+.Pp
+.
+.Fn libusb20_tr_set_length
+This function sets the length of a given USB transfer and frame index.
+.
+.Pp
+.
+.Fn libusb20_tr_set_priv_sc0
+This function sets private driver pointer number zero.
+.
+.Pp
+.
+.Fn libusb20_tr_set_priv_sc1
+This function sets private driver pointer number one.
+.
+.Pp
+.
+.Fn libusb20_tr_set_timeout
+This function sets the timeout for the given USB transfer.
+.
+A timeout value of zero means no timeout.
+.
+The timeout is given in milliseconds.
+.
+.Pp
+.
+.Fn libusb20_tr_set_total_frames
+This function sets the total number of frames that should be executed when the USB transfer is submitted.
+.
+The total number of USB frames must be less than the maximum number of USB frames associated with the given USB transfer.
+.
+.Pp
+.
+.Fn libusb20_tr_setup_bulk
+This function is a helper function for setting up a single frame USB BULK transfer.
+.
+.Pp
+.
+.Fn libusb20_tr_setup_control
+This function is a helper function for setting up a single or dual
+frame USB CONTROL transfer depending on the control transfer length.
+.
+.Pp
+.
+.Fn libusb20_tr_setup_intr
+This function is a helper function for setting up a single frame USB INTERRUPT transfer.
+.
+.Pp
+.
+.Fn libusb20_tr_setup_isoc
+This function is a helper function for setting up a multi frame USB ISOCHRONOUS transfer.
+.
+.Pp
+.
+.Fn libusb20_tr_start
+This function will get the USB transfer started, if not already
+started.
+.
+This function will not get the transfer queued in hardware.
+.
+This function is non-blocking.
+.
+.Pp
+.
+.Fn libusb20_tr_stop
+This function will get the USB transfer stopped, if not already stopped.
+.
+This function is non-blocking, which means that the actual stop can
+happen after the return of this function.
+.
+.Pp
+.
+.Fn libusb20_tr_submit
+This function will get the USB transfer queued in hardware.
+.
+.
+.Pp
+.
+.Fn libusb20_tr_get_priv_sc0
+This function returns private driver pointer number zero associated
+with an USB transfer.
+.
+.
+.Pp
+.
+.Fn libusb20_tr_get_priv_sc1
+This function returns private driver pointer number one associated
+with an USB transfer.
+.
+.
+.Sh USB DEVICE OPERATIONS
+.
+.Pp
+.
+.Fn libusb20_dev_get_backend_name
+This function returns a zero terminated string describing the backend used.
+.
+.Pp
+.
+.Fn libusb20_dev_get_desc
+This function returns a zero terminated string describing the given USB device.
+.
+.Pp
+.
+.Fn libusb20_dev_claim_interface
+This function will try to claim the given USB interface given by
+.Fa iface_index .
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_close
+This function will close the given USB device.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_detach_kernel_driver
+This function will try to detach the kernel driver for the USB interface given by
+.Fa iface_index .
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_set_config_index
+This function will try to set the configuration index on an USB
+device.
+.
+The first configuration index is zero.
+.
+The un-configure index is 255.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is returned.
+.
+.Pp
+.
+.Fn libusb20_dev_get_debug
+This function returns the debug level of an USB device.
+.
+.Pp
+.
+.Fn libusb20_dev_get_fd
+This function returns the file descriptor of the given USB device.
+.
+A negative value is returned when no file descriptor is present.
+.
+The file descriptor can be used for polling purposes.
+.
+.Pp
+.
+.Fn libusb20_dev_kernel_driver_active
+This function returns a non-zero value if a kernel driver is active on
+the given USB interface.
+.
+Else zero is returned.
+.
+.Pp
+.
+.Fn libusb20_dev_open
+This function opens an USB device so that setting up USB transfers
+becomes possible.
+.
+The number of USB transfers can be zero which means only control
+transfers are allowed.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+A return value of LIBUSB20_ERROR_BUSY means that the device is already
+opened.
+.
+.Pp
+.
+.Fn libusb20_dev_process
+This function is called to sync kernel USB transfers with userland USB
+transfers.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned typically indicating that the given USB device has been
+detached.
+.
+.Pp
+.
+.Fn libusb20_dev_release_interface
+This function will try to release a claimed USB interface for the specified USB device.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_request_sync
+This function will perform a synchronous control request on the given
+USB device.
+.
+Before this call will succeed the USB device must be opened.
+.
+.Fa setup
+is a pointer to a decoded and host endian SETUP packet.
+.Fa data
+is a pointer to a data transfer buffer associated with the control transaction. This argument can be NULL.
+.Fa pactlen
+is a pointer to a variable that will hold the actual transfer length after the control transaction is complete.
+.Fa timeout
+is the transaction timeout given in milliseconds.
+A timeout of zero means no timeout.
+.Fa flags
+is used to specify transaction flags, for example LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_req_string_sync
+This function will synchronously request an USB string by language ID
+and string index into the given buffer limited by a maximum length.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_req_string_simple_sync
+This function will synchronously request an USB string using the
+default language ID and convert the string into ASCII before storing
+the string into the given buffer limited by a maximum length which
+includes the terminating zero.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.
+.Pp
+.
+.Fn libusb20_dev_reset
+This function will try to BUS reset the given USB device and restore
+the last set USB configuration.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_set_power_mode
+This function sets the power mode of the USB device.
+.
+Valid power modes:
+.Bl -tag
+.It LIBUSB20_POWER_OFF
+.It LIBUSB20_POWER_ON
+.It LIBUSB20_POWER_SAVE
+.It LIBUSB20_POWER_SUSPEND
+.It LIBUSB20_POWER_RESUME
+.El
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_get_power_mode
+This function returns the currently selected power mode for the given
+USB device.
+.
+.Pp
+.
+.Fn libusb20_dev_set_alt_index
+This function will try to set the given alternate index for the given
+USB interface index.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_set_owner
+This function will set the ownership of the given USB device.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_set_perm
+This function will set the permissions of the given USB device.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_set_iface_owner
+This function will set the ownership of the given USB interface.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_set_iface_perm
+This function will set the permissions of the given USB interface.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_get_owner
+This function will retrieve the current USB device ownership.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_get_perm
+This function will retrieve the current USB device permissions.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_get_iface_owner
+This function will retrieve the current USB interface ownership for
+the given USB interface.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_get_iface_perm
+This function will retrieve the current USB interface permissions for
+the given USB interface.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_dev_get_device_desc
+This function returns a pointer to the decoded and host endian version
+of the device descriptor.
+.
+The USB device need not be opened when calling this function.
+.
+.Pp
+.
+.Fn libusb20_dev_alloc_config
+This function will read out and decode the USB config descriptor for
+the given USB device and config index. This function returns a pointer
+to the decoded configuration which must eventually be passed to
+free(). NULL is returned in case of failure.
+.
+.Pp
+.
+.Fn libusb20_dev_alloc(void)
+This is an internal function to allocate a new USB device.
+.
+.Pp
+.
+.Fn libusb20_dev_get_address
+This function returns the internal and not necessarily the real
+hardware address of the given USB device.
+.
+.Pp
+.
+.Fn libusb20_dev_get_bus_number
+This function return the internal bus number which the given USB
+device belongs to.
+.
+.Pp
+.
+.Fn libusb20_dev_get_mode
+This function returns the current operation mode of the USB entity.
+.
+Valid return values are:
+.Bl -tag
+.It LIBUSB20_MODE_HOST
+.It LIBUSB20_MODE_DEVICE
+.El
+.
+.Pp
+.
+.Fn libusb20_dev_get_speed
+This function returns the current speed of the given USB device.
+.
+.Bl -tag
+.It LIBUSB20_SPEED_UNKNOWN
+.It LIBUSB20_SPEED_LOW
+.It LIBUSB20_SPEED_FULL
+.It LIBUSB20_SPEED_HIGH
+.It LIBUSB20_SPEED_VARIABLE
+.It LIBUSB20_SPEED_SUPER
+.El
+.
+.Pp
+.
+.Fn libusb20_dev_get_config_index
+This function returns the currently select config index for the given
+USB device.
+.
+.Pp
+.
+.Fn libusb20_dev_free
+This function will free the given USB device and all associated USB
+transfers.
+.
+.Pp
+.
+.Fn libusb20_dev_set_debug
+This function will set the debug level for the given USB device.
+.
+.Pp
+.
+.Fn libusb20_dev_wait_process
+This function will wait until a pending USB transfer has completed on
+the given USB device.
+.
+A timeout value can be specified which is passed on to the
+.Xr 2 poll
+function.
+.
+.Sh USB BUS OPERATIONS
+.
+.Fn libusb20_bus_set_owner
+This function will set the ownership for the given USB bus.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_bus_set_perm
+This function will set the permissions for the given USB bus.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_bus_get_owner
+This function will retrieve the ownership for the given USB bus.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_bus_get_perm
+This function will retrieve the permissions for the given USB bus.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.
+.Sh USB BACKEND OPERATIONS
+.
+.Fn libusb20_be_get_dev_quirk
+This function will return the device quirk according to
+.Fa index
+into the libusb20_quirk structure pointed to by
+.Fa pq .
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_get_quirk_name
+This function will return the quirk name according to
+.Fa index
+into the libusb20_quirk structure pointed to by
+.Fa pq .
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_add_dev_quirk
+This function will add the libusb20_quirk structure pointed to by the
+.Fa pq
+argument into the device quirk list.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+If the given quirk cannot be added LIBUSB20_ERROR_NO_MEM is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_remove_dev_quirk
+This function will remove the quirk matching the libusb20_quirk structure pointed to by the
+.Fa pq
+argument from the device quirk list.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_set_owner
+This function will set the ownership for the given backend.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_set_perm
+This function will set the permissions for the given backend.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_get_owner
+This function will retrieve the ownership of the given backend.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_get_perm
+This function will retrieve the permissions of the given backend.
+.
+.
+This function returns zero on success else a LIBUSB20_ERROR value is
+returned.
+.
+.Pp
+.
+.Fn libusb20_be_alloc
+This is an internal function to allocate a USB backend.
+.
+.Pp
+.Fn libusb20_be_alloc_default
+.Fn libusb20_be_alloc_freebsd
+.Fn libusb20_be_alloc_linux
+These functions are used to allocate a specific USB backend or the
+operating system default USB backend. Allocating a backend is a way to
+scan for currently present USB devices.
+.
+.Pp
+.
+.Fn libusb20_be_device_foreach
+This function is used to iterate USB devices present in a USB backend.
+.
+The starting value of
+.Fa pdev
+is NULL.
+.
+This function returns the next USB device in the list.
+.
+If NULL is returned the end of the USB device list has been reached.
+.
+.Pp
+.
+.Fn libusb20_be_dequeue_device
+This function will dequeue the given USB device pointer from the
+backend USB device list.
+.
+Dequeued USB devices will not be freed when the backend is freed.
+.
+.Pp
+.
+.Fn libusb20_be_enqueue_device
+This function will enqueue the given USB device pointer in the backend USB device list.
+.
+Enqueued USB devices will get freed when the backend is freed.
+.
+.Pp
+.
+.Fn libusb20_be_free
+This function will free the given backend and all USB devices in its device list.
+.
+.
+.Sh USB DESCRIPTOR PARSING
+.
+.Fn libusb20_me_get_1
+This function will return a byte at the given byte offset of a message
+entity.
+.
+This function is safe against invalid offsets.
+.
+.Pp
+.
+.Fn libusb20_me_get_2
+This function will return a little endian 16-bit value at the given byte offset of a message
+entity.
+.
+This function is safe against invalid offsets.
+.
+.Pp
+.
+.Fn libusb20_me_encode
+This function will encode a so-called *DECODED structure into binary
+format.
+.
+The total encoded length that will fit in the given buffer is
+returned.
+.
+If the buffer pointer is NULL no data will be written to the buffer
+location.
+.
+.Pp
+.
+.Fn libusb20_me_decode
+This function will decode a binary structure into a so-called *DECODED
+structure.
+.
+The total decoded length is returned.
+.
+The buffer pointer cannot be NULL.
+.
+.
+.Sh LIBUSB VERSION 0.1 COMPATIBILITY
+.
+.Fn usb_open
+.Fn usb_close
+.Fn usb_get_string
+.Fn usb_get_string_simple
+.Fn usb_get_descriptor_by_endpoint
+.Fn usb_get_descriptor
+.Fn usb_parse_descriptor
+.Fn usb_parse_configuration
+.Fn usb_destroy_configuration
+.Fn usb_fetch_and_parse_descriptors
+.Fn usb_bulk_write
+.Fn usb_bulk_read
+.Fn usb_interrupt_write
+.Fn usb_interrupt_read
+.Fn usb_control_msg
+.Fn usb_set_configuration
+.Fn usb_claim_interface
+.Fn usb_release_interface
+.Fn usb_set_altinterface
+.Fn usb_resetep
+.Fn usb_clear_halt
+.Fn usb_reset
+.Fn usb_strerror
+.Fn usb_init
+.Fn usb_set_debug
+.Fn usb_find_busses
+.Fn usb_find_devices
+.Fn usb_device
+.Fn usb_get_busses
+These functions are compliant with LibUSB version 0.1.12.
+.
+.Sh FILES
+.
+.
+/dev/usb
+.Sh SEE ALSO
+.Xr usb2_core 4 ,
+.Xr usbconfig 8
+.
+.
+.Sh HISTORY
+.
+.
+Some parts of the
+.Nm
+API derives from the libusb project at sourceforge.

Added: head/lib/libusb20/libusb20.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libusb20/libusb20.c	Tue Nov  4 02:31:03 2008	(r184610)
@@ -0,0 +1,1245 @@
+/* $FreeBSD$ */
+/*-
+ * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <poll.h>
+#include <ctype.h>
+#include <sys/queue.h>
+
+#include "libusb20.h"
+#include "libusb20_desc.h"
+#include "libusb20_int.h"
+
+static int
+dummy_int(void)
+{
+	return (LIBUSB20_ERROR_NOT_SUPPORTED);
+}
+
+static void
+dummy_void(void)
+{
+	return;
+}
+
+static void
+dummy_callback(struct libusb20_transfer *xfer)
+{
+	;				/* style fix */
+	switch (libusb20_tr_get_status(xfer)) {
+	case LIBUSB20_TRANSFER_START:
+		libusb20_tr_submit(xfer);
+		break;
+	default:
+		/* complete or error */
+		break;
+	}
+	return;
+}
+
+#define	dummy_get_config_desc_full (void *)dummy_int
+#define	dummy_get_config_index (void *)dummy_int
+#define	dummy_set_config_index (void *)dummy_int
+#define	dummy_claim_interface (void *)dummy_int
+#define	dummy_release_interface (void *)dummy_int
+#define	dummy_set_alt_index (void *)dummy_int
+#define	dummy_reset_device (void *)dummy_int
+#define	dummy_set_power_mode (void *)dummy_int
+#define	dummy_get_power_mode (void *)dummy_int
+#define	dummy_kernel_driver_active (void *)dummy_int

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811040231.mA42V4EQ083516>