Commit Graph

18 Commits

Author SHA1 Message Date
Hans Petter Selasky
f9478f91fb Add new USB phone descriptor template for USB device side mode.
MFC after:	3 days
2014-08-05 07:03:16 +00:00
Hans Petter Selasky
62a963c5f5 - Try to fix build of 32-bit compatibility USB support for FreeBSD and
Linux targets without breaking the existing IOCTL API.

- Remove some not-needed header file inclusions.

- Wrap a long line.

MFC after:	1 week
Reported by:	Damjan Jovanovic <damjan.jov@gmail.com>
2013-08-12 09:17:48 +00:00
Hans Petter Selasky
c77a24c24a Add new USB API to get the port path of a USB device.
MFC after:	2 weeks
Requested by:	emaste @
2013-05-03 07:44:58 +00:00
Hans Petter Selasky
aafcb73207 Add USB API to read power draw on USB devices.
Update usbconfig to print power draw on USB devices.

MFC after:	2 weeks
Submitted by:	Matt Burke @ icritical.com
2013-02-14 12:22:40 +00:00
Hans Petter Selasky
d2b99310b1 Modify the FreeBSD USB kernel code so that it can be compiled directly
into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems
or embedded platforms. This is also useful for out of the system compilation
of the FreeBSD USB stack for various purposes. The USB kernel files can
now optionally include a global header file which should include all needed
definitions required to compile the FreeBSD USB stack. When the global USB
header file is included, no other USB header files will be included by
default.

Add new file containing the USB stack configuration for the
FreeBSD loader build.

Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all
USB files follow the same style.

Use cases:
 - console in loader via USB
 - loading kernel via USB

Discussed with:		Hiroki Sato, hrs @ EuroBSDCon
2013-01-30 15:26:04 +00:00
Hans Petter Selasky
e9cec01683 Rename new IOCTL to singular form of the noun "streams".
MFC after:	2 weeks
2012-08-13 18:09:19 +00:00
Hans Petter Selasky
a5cf1aaaff Add support for the so-called streams feature of BULK endpoints
in SUPER-speed mode, USB 3.0.

This feature has not been tested yet, due to lack of hardware.

This feature is useful when implementing protocols like UASP,
USB attached SCSI which promises higher USB mass storage throughput.

This patch also implements support for hardware processing of endpoints
for increased performance. The switching to hardware processing
of an endpoint is done via a callback to the USB controller driver. The
stream feature is implemented like a variant of a hardware USB protocol.

USB controller drivers implementing device mode needs to be updated to
implement the new "xfer_stall" USB controller method and remove the
"xfer" argument from the "set_stall" method.

The API's toward existing USB drivers are preserved. To setup a USB transfer
in stream mode, set the "stream_id" field of the USB config structure to
the desired value.

The maximum number of BULK streams is currently hardcoded and limited to 8
via a define in usb_freebsd.h.

All USB drivers should be re-compiled after this change.

LibUSB will be updated next week to support streams mode. A new IOCTL to
setup BULK streams as already been implemented. The ugen device nodes
currently only supports stream ID zero.

The FreeBSD version has been bumped.

MFC after:	2 weeks
2012-08-12 17:53:06 +00:00
Hans Petter Selasky
17c78d345c - This patch adds custom IOCTLs to read and write the 4 GPIO pins on the
cp2103 usb-to-serial chip.
- This patch also makes the line status polling asynchronous, to reduce
the time needed to change the GPIO pins.

Submitted by:	JD Louw
MFC after:	1 week
2011-11-12 08:40:52 +00:00
Hans Petter Selasky
399e6543b2 - Add more USB templates for various USB device classes
- Add basic template support for USB 3.0
- Export definition of template sysctl numbers through usb_ioctl.h

MFC after:	7 days
2011-06-23 07:54:03 +00:00
Hans Petter Selasky
1c49736857 - Add support for software pre-scaling of ISOCHRONOUS transfers.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-02-28 17:23:15 +00:00
Hans Petter Selasky
51fd3d75fe - Add support for LibUSB in 32-bit compatibility mode.
Approved by:    thompsa (mentor)
2010-10-14 20:38:18 +00:00
Andrew Thompson
ed6d949afd - Make struct usb_xfer opaque so that drivers can not access the internals
- Reduce the number of headers needed for a usb driver, the common case is just   usb.h and usbdi.h
2009-06-23 02:19:59 +00:00
Andrew Thompson
759736470c Fix _USB2_* refernces in the header protection defines. 2009-06-15 01:09:19 +00:00
Andrew Thompson
760bc48e7e s/usb2_/usb_/ on all C structs for the USB stack. 2009-05-28 17:36:36 +00:00
Andrew Thompson
ee3e3ff5c2 Change USB over to make_dev() for all device nodes, previously it hooked into
the devfs clone handler to open the (invisible) devices on the fly.

The /dev entries are layed out as follows,

 /dev/usbctl      = master device
 /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>)
 /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint

This also removes the custom permissions model from USB.  Bump
__FreeBSD_version to 800066.

Submitted by:	rink (earlier version)
2009-02-27 17:27:16 +00:00
Andrew Thompson
f78fa6b67e MFp4 //depot/projects/usb@157974
Add support for setting and getting the USB template value through libusb20 and
usbconfig.

Submitted by:	Hans Petter Selasky
2009-02-24 03:43:05 +00:00
Andrew Thompson
4a35cda731 MFp4 //depot/projects/usb@157853
Clean up old way of polling the USB hardware.  The existing polling support was
a bit hackish.

Submitted by:	Hans Petter Selasky
2009-02-24 03:39:13 +00:00
Andrew Thompson
02ac645488 Move the new USB stack into its new home. 2009-02-23 18:31:00 +00:00