Commit Graph

69 Commits

Author SHA1 Message Date
Hans Petter Selasky
01923b399d Use an anonymous struct for generated string descriptors.
Submitted by:	Christoph Mallon
2013-01-30 15:49:37 +00:00
Hans Petter Selasky
23ab08715c Provide one global language string descriptor for
american english instead of giving each module its
own.

Submitted by:	Christoph Mallon
2013-01-30 15:46:26 +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
3750641271 Make several timing parameters of the USB enumeration sequence tuneable.
Also update the port reset time from 250ms to 50ms. Some USB devices
have a hard limit in hardware at 222ms for the port reset time and will
not enumerate unless this delay is closer to the usb.org defined value.
This patch can fix enumeration with some USB devices.

Tested by:	Guido van Rooij
Submitted by:	Nick Hibma
MFC after:	1 week
2012-10-24 07:23:29 +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
4563ba7a0d Add definitions and structures for USB 2.0 Link Power Management, LPM.
MFC after:	2 weeks
2012-04-02 07:51:30 +00:00
Hans Petter Selasky
4131f6fb60 - Try to fix support for USB 3.0 HUBs.
- Try to fix support for USB 3.0 suspend and resume.

MFC after:	1 week
2012-01-12 21:21:20 +00:00
Hans Petter Selasky
b3b1747a98 Fix size of USB 3.0 descriptor field.
MFC after:	3 days
2011-11-09 18:48:36 +00:00
Hans Petter Selasky
c089ba5ed7 Fix size of USB 3.0 descriptor field.
MFC after:	3 days
2011-11-09 18:11:29 +00:00
Hans Petter Selasky
3d09c7b327 Fix suspend and resume of FULL and HIGH speed USB devices
in the generic XHCI driver. There appears to be some minor
logic missing for this feature to work.

MFC after:	3 days
2011-10-26 17:43:27 +00:00
Hans Petter Selasky
7b039740b7 Add missing USB 3.0 definitions. Correct some wrong ones.
Approved by:    thompsa (mentor)
2010-10-04 21:38:10 +00:00
Andrew Thompson
4076dd2309 Add basic support for USB Network Control Model (NCM) v1.0 to if_cdce.c.
http://www.usb.org/developers/devclass_docs/NCM10.zip

Submitted by:	Hans Petter Selasky
2009-09-28 07:53:55 +00:00
Alfred Perlstein
ec1201a2c9 - Fix false positive uipaq probe
Reported by: Alexander Motin <mav@freebsd.org>

Submitted by:	hps
2009-08-24 05:01:06 +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
ae60fdfba2 Rename usb pipes to endpoints as it better represents what they are, and struct
usb_pipe may be used for a different purpose later on.
2009-06-07 19:41:11 +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
51ec16035f MFp4 //depot/projects/usb@159897
Add new endpoint direction values for use with usb2_config

Submitted by:	Hans Petter Selasky
2009-04-05 18:20:13 +00:00
Andrew Thompson
d7e3163d8c Reintroduce r188878, provide compat typedefs for usb1. 2009-02-23 19:06:47 +00:00
Andrew Thompson
02ac645488 Move the new USB stack into its new home. 2009-02-23 18:31:00 +00:00
Andrew Thompson
3975e3a1ea Move usb to a graveyard location under sys/legacy/dev, it is intended that the
new USB2 stack will fully replace this for 8.0.

Remove kernel modules, a subsequent commit will update conf/files. Unhook
usbdevs from the build.
2009-02-23 18:16:17 +00:00
Nick Hibma
ab72d59941 Add a reset device command to ugen.c.
This is needed to make some devices work that require a firmware upload
and a USB reset afterwards.
2008-11-13 21:34:34 +00:00
Kevin Lo
8671b38b6c Add isochronous transfer support for USB 2.0
Obtained from:	NetBSD
2008-08-18 04:49:58 +00:00
Warner Losh
0d5a50d6bf Add definition for UIPROTO_MOUSE.
Approved by: re@
2007-06-30 02:40:21 +00:00
Warner Losh
34f7cf9af5 Remove usb_port.h from usb.h, except for one or two useful things that
don't belong there (these moved into usb.h).
2007-06-18 22:30:53 +00:00
Warner Losh
a73530728e Move PWR_* from usb_port.h to usb.h 2007-06-14 16:12:04 +00:00
Warner Losh
058cc61a3e Move malloc definitions to usb.h.
Also, remove usb_malloc_type: it was unused.
Remove METHODS_NONE: it was unused.
Move include of opt_usb.h from usb_port.h to usb.h, since usb_port.h is
going away (there will be a usb_compat.h for out-of-tree drivers that want it).
2007-06-14 15:09:21 +00:00
Warner Losh
63ba0d2d76 Remove more __OtherBSD__ ifdefs that don't make sense, and haven't for
some time.
2007-06-13 05:45:48 +00:00
Christian Brueffer
578e607926 Remove compat ifdefs for version < 500014 from the rest of the USB files.
Approved by:	rwatson (mentor)
MFC after:	1 week
2007-06-07 09:29:37 +00:00
Warner Losh
56635f6bd3 s/Static/static/g
s/device_ptr_t/device_t/g

No md5 changes in the .o's

# Note to the md5 tracking club: $FreeBSD$ changes md5 after every commit
# so you need to checkout -kk to get $FreeBSD$ instead of the actual value
# of the keyword.
2006-09-06 23:44:25 +00:00
Maxime Henrion
0cb0bc8808 Add support for Xbox 360 gamepads. They are HID-capable devices, but
lack a report descriptor and don't use the standard interface class.
This patch works around these deficiencies so that the uhid(4) driver
can recognize and use those broken devices.

PR:		usb/90141
Submitted by:	Ed Schouten <ed@fxq.nl> (with minor mods from me)
MFC after:	1 week
2005-12-31 04:22:34 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Josef Karthauser
8ecdcb3ff3 Packed structures are defined differently in older gcc's, like the one
currently in -stable.  Put the exception into usb.h instead of having it
hard coded in the sound code.
2002-11-06 21:37:21 +00:00
Josef Karthauser
0fbf938869 MFNetBSD: Increasre the reset recovery time. (rev 1.69) 2002-09-27 19:55:37 +00:00
Josef Karthauser
33e8332333 MFNetBSD: Update class codes. (rev 1.68) 2002-09-27 19:52:42 +00:00
Josef Karthauser
8bca50af6b MFNetBSD: Add Bluetooth related classes etc. (rev 1.67) 2002-09-27 19:45:37 +00:00
Josef Karthauser
fef80c2cba MFNetBSD: revision 1.66
Get rid of trailing white space.
2002-09-27 19:42:29 +00:00
Alfred Perlstein
ebc82cbbf0 s/__attribute__((__packed__))/__packed/g 2002-09-23 06:25:08 +00:00
Josef Karthauser
dae0af0c83 Revert part of the last commit. A couple of defines were removed
by NetBSD because they don't use them (they've no usbd), but we do.
2002-02-26 10:00:32 +00:00
Josef Karthauser
648b06a6ed Merge from NetBSD:
usb.h (rev 1.61):

    date: 2002/01/01 14:23:37;  author: augustss;
    Add a missing subclass definition.

usb.h (rev 1.63) and usb_port.h (rev 1.52):

    date: 2002/02/25 00:46:37;  author: augustss;
    Some portability improvement.
    Add define for usb.h version.
2002-02-26 01:15:08 +00:00
Alfred Perlstein
5bcd0580d7 Prefix structure members to protect them against clashes with eg.
c++ keywords.

This keeps us in sync with NetBSD because they actually committed
my delta first.

Ok'd by: lennard
2002-02-20 20:47:21 +00:00
Josef Karthauser
4d0649fbad Merge from NetBSD:
Pave the way for USB2, by replacing 'lowspeed' with 'speed', so
that it can take the values USB_SPEED_LOW, USB_SPEED_FULL or in
time USB_SPEED_HIGH.
2002-02-16 00:51:26 +00:00
Josef Karthauser
a07e9d4af3 Merge from NetBSD.
uhub.c:     revision 1.37
    usb.4:      revision 1.30
    usb.c:      revision 1.38
    usb.h:      revision 1.40
    usb_port.h: revision 1.21
    usb_subr.c: revision 1.65
    usbdi.h:    revision 1.40

Split the attach/detach events up into device, driver and controller
attach and detach events.

The commit message from NetBSD was:
        date: 2000/02/02 07:34:00;  author: augustss;  state: Exp;
        Change the USB event mechanism to include more information
        about devices and drivers.  Partly from FreeBSD.

Also rework usbd to take these new event types into account.
2002-01-28 01:03:19 +00:00
Josef Karthauser
2ba633961e Sync usb.h with NetBSD, apart from usb_device_info.speed, which
requires logic changes.  For now leave it as usb_device_info.lowspeed.
It will get addressed when the usb.c code is sync'd.
2002-01-02 20:16:53 +00:00
Josef Karthauser
0b4a107145 Revert part of the last commit. UIPROTO_MASS_BBB was renamed to
UIPROTO_MASS_BULK _after_ the previous change was made in NetBSD.
2002-01-02 18:36:46 +00:00
Josef Karthauser
5440b9801c Sync with NetBSD:
date: 2000/02/29 21:37:01;  author: augustss;  state: Exp;
	Distinguish between device and interface classes.
	(I finally found a document that said that they were different.)
2002-01-02 18:28:45 +00:00
Nick Hibma
5bfc478e32 Don't check for ohci/uhci to be loaded, check for the usb module. 2000-09-02 10:17:58 +00:00
Nick Hibma
028d28adb8 From NetBSD:
Make it possible to move a device to its unconfigured state by
using config #0.

Add some comments.

Change error reporting in port reset function.

usbd_devinfo_vp(): search the know devs array also if the device doesn't
return product description (e.g. Kye's Genius NetScroll mouse returns
vendor, but not product); the strings returned by device are still
preferred to those in the array, though
2000-08-13 18:39:24 +00:00
Nick Hibma
4b268ed3a9 Sync with NetBSD:
Make the behaviour more similar to what the Microsoft uhub driver
does.
2000-05-14 19:39:10 +00:00
Nick Hibma
23f027a0bc Sync with NetBSD:
Add USB_SET_REPORT ioctl.
Add FIOASYNC, TIOCSPGRP ioctl.
Change some debugging output
2000-05-14 17:43:59 +00:00