aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2015-09-24 17:37:30 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2015-09-24 17:37:30 +0000
commita130076f26370c9e1c5c9c7f1dbd21ccb83a72f0 (patch)
tree9d3d2d8aae15f4b3ad67f5f9a1a65623fc955f23 /share
parenta00dbfa82bdb95288b85b282d0d147d53c640cad (diff)
downloadsrc-a130076f26370c9e1c5c9c7f1dbd21ccb83a72f0.tar.gz
src-a130076f26370c9e1c5c9c7f1dbd21ccb83a72f0.zip
Implement support for reading USB quirks from the kernel environment.
Refer to the usb_quirk(4) manual page for more details on how to use this new feature. Submitted by: Maxime Soule <btik-fbsd@scoubidou.com> PR: 203249 MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=288180
Diffstat (limited to 'share')
-rw-r--r--share/man/man4/usb_quirk.457
1 files changed, 55 insertions, 2 deletions
diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4
index d7686fd8cf7e..9b059732f203 100644
--- a/share/man/man4/usb_quirk.4
+++ b/share/man/man4/usb_quirk.4
@@ -16,7 +16,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 7, 2015
+.Dd September 24, 2015
.Dt USB_QUIRK 4
.Os
.Sh NAME
@@ -177,7 +177,53 @@ ejects after HID command
.Pp
See
.Pa /sys/dev/usb/quirk/usb_quirk.h
-for the complete list of supported quirks.
+or run "usbconfig dump_quirk_names" for the complete list of supported quirks.
+.Sh LOADER TUNABLE
+The following tunable can be set at the
+.Xr loader 8
+prompt before booting the kernel, or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width indent
+.It Va hw.usb.quirk.%d
+The value is a string whose format is:
+.Bd -literal -offset indent
+.Qo VendorId ProductId LowRevision HighRevision UQ_QUIRK,... Qc
+.Ed
+.Pp
+Installs the quirks
+.Ic UQ_QUIRK,...
+for all USB devices matching
+.Ic VendorId ,
+.Ic ProductId
+and has a hardware revision between and including
+.Ic LowRevision
+and
+.Ic HighRevision .
+.Pp
+.Ic VendorId ,
+.Ic ProductId ,
+.Ic LowRevision
+and
+.Ic HighRevision
+are all 16 bits numbers which can be decimal or hexadecimal based.
+.Pp
+A maximum of 100 variables
+.Ic hw.usb.quirk.0, .1, ..., .99
+can be defined.
+.Pp
+If a matching entry is found in the kernel's internal quirks table, it
+is replaced by the new definition.
+.Pp
+Else a new entry is created given that the quirk table is not full.
+.Pp
+The kernel iterates over the
+.Ic hw.usb.quirk.N
+variables starting at
+.Ic N = 0
+and stops at
+.Ic N = 99
+or the first non-existing one.
+.El
.Sh EXAMPLES
After attaching a
.Nm u3g
@@ -186,6 +232,13 @@ device which appears as a USB device on
.Bd -literal -offset indent
usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
.Ed
+.Pp
+To install a quirk at boot time, place one or several lines like the
+following in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.usb.quirk.0="0x04d9 0xfa50 0 0xffff UQ_KBD_IGNORE"
+.Ed
.Sh SEE ALSO
.Xr usbconfig 8
.Sh HISTORY