Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
usb [2009/02/27 18:49] – AndrewThompsonusb [2020/05/17 20:27] (current) – the "new" USB stack has been in the tree for years now. MarkLinimon
Line 1: Line 1:
 ===== USB on FreeBSD ===== ===== USB on FreeBSD =====
  
-USB is short for Universial Serial BUS. There are currently five variants of USB. The new USB stack in %%FreeBSD%% -current supports Low, Full and High speed USB devices in Host- and Device Mode.+  * [[USB/USBPeriphAPI|USBPeriphAPI]] 
 + 
 +USB is short for Universial Serial BUS. There are currently five variants of USB. The USB stack in %%FreeBSD%% -current supports Low-, Full-, High- and Super- speed USB devices in Host- and Device Mode.
  
   * Low Speed USB   * Low Speed USB
   * Full Speed USB   * Full Speed USB
   * High Speed USB   * High Speed USB
-  * Super Speed USB (not supported yet)+  * Super Speed USB
   * Wireless USB (not supported yet)   * Wireless USB (not supported yet)
  
-This page describes HPSUSB/'USB2' which is available in %%FreeBSD%% 8-CURRENT.+===== Debugging USB =====
  
-===== HPSUSB FAQ =====+If you want very verbose messages, you can set the following variables in loader.conf
  
-  * Q: hald is using 100% CPU +<code> 
-  * A: Update to the latest hald port+hw.usb.ehci.iaadbug=1 
 +hw.usb.ehci.debug=1 
 +hw.usb.xhci.debug=1 
 +</code>
  
-  * Q: xsane does not detect my scanner +usbconfig gives you information on your devices.  If you run it with the list argument, or no argument it prints a list of your devices.
-  * A: You need to re-link xsane to use /usr/lib/libusb20.so which is now part of the base distribution. +
- +
-  * Q: Do I need to recompile the software before it can use libusb20 instead of libusb-0.1.x? +
-  * A: No, libusb20 is binary compatible with libusb-0.1.x. +
- +
-  * Q: How do I re-link an application to use libusb20? +
-  * A: Add "-lusb20" when linking or try one of the following two solutions:+
  
 <code> <code>
-# +$ sudo usbconfig 
-# Alternative 1 +ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) 
-# Add the following lines to "/etc/libmap.conf" +ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) 
-# +ugen1.2: <vendor 0x8087 product 0x8000> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) 
-libusb-0.1.so libusb20.so +ugen0.2: <Microsoft Wired Keyboard 600> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA) 
-libusb-0.1.so.8 libusb20.so.1+ugen0.3: <VXIS Inc FHD Webcamera> at usbus0, cfg=255 md=HOST spd=SUPER (5.0Gbps) pwr=ON (100mA)
 </code> </code>
 +
 +You can get more detailed information on your devices with the dump_all_desc command.  Note the addressing after the -d arg, this is the common format for most commands, you can use either ugen0.3, or just 0.3.
  
 <code> <code>
-# +$ sudo usbconfig -d 0.3 dump_all_desc 
-# Alternative 2 +ugen0.3: <VXIS Inc FHD Webcamera> at usbus0, cfg=255 md=HOST spd=SUPER (5.0Gbps) pwr=ON (100mA) 
-# Run the following commands like SuperUser: + 
-# +  bLength = 0x0012 
-mv -i /usr/local/lib/libusb-0.1.so.8 /root/ +  bDescriptorType = 0x0001 
-mv -i /usr/local/lib/libusb.a /root/ +  bcdUSB = 0x0310 
-ln -s /usr/lib/libusb20.so.1 /usr/local/lib/libusb-0.1.so.8 +  bDeviceClass = 0x00ef  <Miscellaneous device>  
-ln -s /usr/lib/libusb20.a /usr/local/lib/libusb.a+  bDeviceSubClass = 0x0002 
 +  bDeviceProtocol = 0x0001 
 +  bMaxPacketSize0 = 0x0009 
 +  idVendor = 0x1bcf 
 +  idProduct = 0x2c99 
 +  bcdDevice = 0x0200 
 +  iManufacturer = 0x0001  <VXIS Inc> 
 +  iProduct = 0x0002  <FHD Webcamera> 
 +  iSerialNumber = 0x0000  <no string> 
 +  bNumConfigurations = 0x0001
 </code> </code>
 +
 +The key take away points here (other than obvious things like the power setting) are:
 +
 +  * The cfg=255 from usbconfig indicates that the device was not initialized correctly.
 +  * idVendor and idProduct (not iProduct) are the vendor and product ids, used in a number of places like setting quirks
 +
 +===== HPSUSB FAQ =====
  
   * Q: I see the following error and USB stops working "Page offset was not preserved!"   * Q: I see the following error and USB stops working "Page offset was not preserved!"
Line 50: Line 66:
   * Q: I can't boot my Freesbie using USB2.   * Q: I can't boot my Freesbie using USB2.
   * A: Update your sources, this issue is fixed.   * A: Update your sources, this issue is fixed.
 +
 +  * Q: Screen updates in X11 are slow/broken/laggy
 +  * A: Ensure your kernel/world is up to date, old libs removed and the libpciaccess port is rebuilt.
  
   * Q: My mass storage device is not working, what can I do?   * Q: My mass storage device is not working, what can I do?
Line 55: Line 74:
  
 <code> <code>
-# 1) Unload "usb2_storage_mass" if it is loaded.+# 1) Unload "umass" if it is loaded.
 # 2) Plug your device. # 2) Plug your device.
 # 3) You might have to add a new entry for your device in /sys/dev/usb/usbdevs . # 3) You might have to add a new entry for your device in /sys/dev/usb/usbdevs .
Line 63: Line 82:
 usbconfig -u 4 -a 7 dump_device_desc usbconfig -u 4 -a 7 dump_device_desc
  
-# 5) Try adding an entry in the quirktable in /sys/dev/usb2/storage/umass2.c. +# 5) Try adding an entry in the quirktable in /sys/dev/usb/quirk/usb_quirk.c . 
 # Look at the other quirks for examples. # Look at the other quirks for examples.
 </code> </code>
  
  • usb.1235760559.txt.gz
  • Last modified: 2009/02/27 18:49
  • by AndrewThompson