xref: /freebsd/share/man/man4/usb_quirk.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
10ea0127aSNick Hibma.\"
20ea0127aSNick Hibma.\" Copyright (c) 2010 AnyWi Technologies
30ea0127aSNick Hibma.\" All rights reserved.
40ea0127aSNick Hibma.\"
50ea0127aSNick Hibma.\" Permission to use, copy, modify, and distribute this software for any
60ea0127aSNick Hibma.\" purpose with or without fee is hereby granted, provided that the above
70ea0127aSNick Hibma.\" copyright notice and this permission notice appear in all copies.
80ea0127aSNick Hibma.\"
90ea0127aSNick Hibma.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
100ea0127aSNick Hibma.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
110ea0127aSNick Hibma.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
120ea0127aSNick Hibma.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
130ea0127aSNick Hibma.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
140ea0127aSNick Hibma.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
150ea0127aSNick Hibma.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
160ea0127aSNick Hibma.\"
1776136d20SVladimir Kondratyev.Dd August 19, 2017
180ea0127aSNick Hibma.Dt USB_QUIRK 4
190ea0127aSNick Hibma.Os
200ea0127aSNick Hibma.Sh NAME
210ea0127aSNick Hibma.Nm usb_quirk
220ea0127aSNick Hibma.Nd USB quirks module
230ea0127aSNick Hibma.Sh SYNOPSIS
240ea0127aSNick HibmaTo compile this module into the kernel,
250ea0127aSNick Hibmaplace the following line in your
260ea0127aSNick Hibmakernel configuration file:
270ea0127aSNick Hibma.Bd -ragged -offset indent
28d4bb04f6SHans Petter Selasky.Cd "device usb"
290ea0127aSNick Hibma.Ed
300ea0127aSNick Hibma.Pp
310ea0127aSNick HibmaAlternatively, to load the module at boot
320ea0127aSNick Hibmatime, place the following line in
330ea0127aSNick Hibma.Xr loader.conf 5 :
340ea0127aSNick Hibma.Bd -literal -offset indent
350ea0127aSNick Hibmausb_quirk_load="YES"
360ea0127aSNick Hibma.Ed
370ea0127aSNick Hibma.Sh DESCRIPTION
380ea0127aSNick HibmaThe
390ea0127aSNick Hibma.Nm
400ea0127aSNick Hibmamodule provides support for dynamically adding and removing quirks for
410ea0127aSNick HibmaUSB devices with
42814b16baSGlen Barber.Xr usbconfig 8 .
430ea0127aSNick Hibma.Sh General quirks:
440ea0127aSNick Hibma.Bl -tag -width Ds
450ea0127aSNick Hibma.It UQ_AUDIO_SWAP_LR
460ea0127aSNick Hibmaswap left and right channels
470ea0127aSNick Hibma.It UQ_AU_INP_ASYNC
480ea0127aSNick Hibmainput is async despite claim of adaptive
490ea0127aSNick Hibma.It UQ_AU_NO_FRAC
501efb0053SChristian Bruefferdo not adjust for fractional samples
510ea0127aSNick Hibma.It UQ_AU_NO_XU
520ea0127aSNick Hibmaaudio device has broken extension unit
53067e471aSHans Petter Selasky.It UQ_AU_VENDOR_CLASS
54067e471aSHans Petter Selaskyaudio device uses vendor class to identify itself
55067e471aSHans Petter Selasky.It UQ_AU_SET_SPDIF_CM6206
56067e471aSHans Petter Selaskyaudio device needs special programming to enable S/PDIF audio output
570ea0127aSNick Hibma.It UQ_BAD_ADC
580ea0127aSNick Hibmabad audio spec version number
590ea0127aSNick Hibma.It UQ_BAD_AUDIO
601efb0053SChristian Bruefferdevice claims audio class, but is not
610ea0127aSNick Hibma.It UQ_BROKEN_BIDIR
620ea0127aSNick Hibmaprinter has broken bidir mode
630ea0127aSNick Hibma.It UQ_BUS_POWERED
640ea0127aSNick Hibmadevice is bus powered, despite claim
650ea0127aSNick Hibma.It UQ_HID_IGNORE
660ea0127aSNick Hibmadevice should be ignored by hid class
670ea0127aSNick Hibma.It UQ_KBD_IGNORE
680ea0127aSNick Hibmadevice should be ignored by kbd class
690ea0127aSNick Hibma.It UQ_KBD_BOOTPROTO
700ea0127aSNick Hibmadevice should set the boot protocol
71d7dd1341SHans Petter Selasky.It UQ_UMS_IGNORE
72d7dd1341SHans Petter Selaskydevice should be ignored by ums class
730ea0127aSNick Hibma.It UQ_MS_BAD_CLASS
741efb0053SChristian Bruefferdoes not identify properly
750ea0127aSNick Hibma.It UQ_MS_LEADING_BYTE
760ea0127aSNick Hibmamouse sends an unknown leading byte
770ea0127aSNick Hibma.It UQ_MS_REVZ
780ea0127aSNick Hibmamouse has Z-axis reversed
79ab4f740bSVladimir Kondratyev.It UQ_MS_VENDOR_BTN
80ab4f740bSVladimir Kondratyevmouse has buttons in vendor usage page
810ea0127aSNick Hibma.It UQ_NO_STRINGS
820ea0127aSNick Hibmastring descriptors are broken
830ea0127aSNick Hibma.It UQ_POWER_CLAIM
840ea0127aSNick Hibmahub lies about power status
850ea0127aSNick Hibma.It UQ_SPUR_BUT_UP
860ea0127aSNick Hibmaspurious mouse button up events
870ea0127aSNick Hibma.It UQ_SWAP_UNICODE
880ea0127aSNick Hibmahas some Unicode strings swapped
890ea0127aSNick Hibma.It UQ_CFG_INDEX_1
900ea0127aSNick Hibmaselect configuration index 1 by default
910ea0127aSNick Hibma.It UQ_CFG_INDEX_2
920ea0127aSNick Hibmaselect configuration index 2 by default
930ea0127aSNick Hibma.It UQ_CFG_INDEX_3
940ea0127aSNick Hibmaselect configuration index 3 by default
950ea0127aSNick Hibma.It UQ_CFG_INDEX_4
960ea0127aSNick Hibmaselect configuration index 4 by default
970ea0127aSNick Hibma.It UQ_CFG_INDEX_0
980ea0127aSNick Hibmaselect configuration index 0 by default
990ea0127aSNick Hibma.It UQ_ASSUME_CM_OVER_DATA
1000ea0127aSNick Hibmaassume cm over data feature
101*73c3e8b1SSteffen Dirkwinkel.It UQ_IGNORE_CDC_CM
102*73c3e8b1SSteffen Dirkwinkelignore cm descriptor
10376136d20SVladimir Kondratyev.It UQ_WMT_IGNORE
10476136d20SVladimir Kondratyevdevice should be ignored by wmt driver
1050ea0127aSNick Hibma.El
1062310f718SDavid Malone.Sh USB Mass Storage quirks:
1070ea0127aSNick Hibma.Bl -tag -width Ds
1080ea0127aSNick Hibma.It UQ_MSC_NO_TEST_UNIT_READY
1090ea0127aSNick Hibmasend start/stop instead of TUR
1100ea0127aSNick Hibma.It UQ_MSC_NO_RS_CLEAR_UA
1110ea0127aSNick Hibmadoes not reset Unit Att.
1120ea0127aSNick Hibma.It UQ_MSC_NO_START_STOP
1130ea0127aSNick Hibmadoes not support start/stop
1140ea0127aSNick Hibma.It UQ_MSC_NO_GETMAXLUN
1150ea0127aSNick Hibmadoes not support get max LUN
1160ea0127aSNick Hibma.It UQ_MSC_NO_INQUIRY
1170ea0127aSNick Hibmafake generic inq response
1180ea0127aSNick Hibma.It UQ_MSC_NO_INQUIRY_EVPD
1190ea0127aSNick Hibmadoes not support inq EVPD
1200ea0127aSNick Hibma.It UQ_MSC_NO_SYNC_CACHE
1210ea0127aSNick Hibmadoes not support sync cache
1220ea0127aSNick Hibma.It UQ_MSC_SHUTTLE_INIT
1230ea0127aSNick Hibmarequires Shuttle init sequence
1240ea0127aSNick Hibma.It UQ_MSC_ALT_IFACE_1
1250ea0127aSNick Hibmaswitch to alternate interface 1
1260ea0127aSNick Hibma.It UQ_MSC_FLOPPY_SPEED
1270ea0127aSNick Hibmadoes floppy speeds (20kb/s)
1280ea0127aSNick Hibma.It UQ_MSC_IGNORE_RESIDUE
1290ea0127aSNick Hibmagets residue wrong
1300ea0127aSNick Hibma.It UQ_MSC_WRONG_CSWSIG
1310ea0127aSNick Hibmauses wrong CSW signature
1320ea0127aSNick Hibma.It UQ_MSC_RBC_PAD_TO_12
1330ea0127aSNick Hibmapad RBC requests to 12 bytes
1340ea0127aSNick Hibma.It UQ_MSC_READ_CAP_OFFBY1
1350ea0127aSNick Hibmareports sector count, not max sec.
1360ea0127aSNick Hibma.It UQ_MSC_FORCE_SHORT_INQ
1370ea0127aSNick Hibmadoes not support full inq.
1380ea0127aSNick Hibma.It UQ_MSC_FORCE_WIRE_BBB
1390ea0127aSNick Hibmaforce BBB wire protocol
1400ea0127aSNick Hibma.It UQ_MSC_FORCE_WIRE_CBI
1410ea0127aSNick Hibmaforce CBI wire protocol
1420ea0127aSNick Hibma.It UQ_MSC_FORCE_WIRE_CBI_I
1430ea0127aSNick Hibmaforce CBI with int. wire protocol
1440ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_SCSI
1450ea0127aSNick Hibmaforce SCSI command protocol
1460ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_ATAPI
1470ea0127aSNick Hibmaforce ATAPI command protocol
1480ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_UFI
1490ea0127aSNick Hibmaforce UFI command protocol
1500ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_RBC
1510ea0127aSNick Hibmaforce RBC command protocol
1520ea0127aSNick Hibma.El
1532310f718SDavid Malone.Sh 3G Datacard (u3g) quirks:
1540ea0127aSNick Hibma.Bl -tag -width Ds
1550ea0127aSNick Hibma.It UQ_MSC_EJECT_HUAWEI
1560ea0127aSNick Hibmaejects after Huawei USB command
1570ea0127aSNick Hibma.It UQ_MSC_EJECT_SIERRA
1580ea0127aSNick Hibmaejects after Sierra USB command
1590ea0127aSNick Hibma.It UQ_MSC_EJECT_SCSIEJECT
1600ea0127aSNick Hibmaejects after SCSI eject command
1611efb0053SChristian Brueffer.Dv 0x1b0000000200
1620ea0127aSNick Hibma.It UQ_MSC_EJECT_REZERO
1630ea0127aSNick Hibmaejects after SCSI rezero command
1641efb0053SChristian Brueffer.Dv 0x010000000000
1650ea0127aSNick Hibma.It UQ_MSC_EJECT_ZTESTOR
1660ea0127aSNick Hibmaejects after ZTE SCSI command
1671efb0053SChristian Brueffer.Dv 0x850101011801010101010000
1680ea0127aSNick Hibma.It UQ_MSC_EJECT_CMOTECH
1690ea0127aSNick Hibmaejects after C-motech SCSI command
1701efb0053SChristian Brueffer.Dv 0xff52444556434847
1710ea0127aSNick Hibma.It UQ_MSC_EJECT_WAIT
1720ea0127aSNick Hibmawait for the device to eject
1730ea0127aSNick Hibma.It UQ_MSC_EJECT_SAEL_M460
1740ea0127aSNick Hibmaejects after Sael USB commands
1750ea0127aSNick Hibma.It UQ_MSC_EJECT_HUAWEISCSI
1760ea0127aSNick Hibmaejects after Huawei SCSI command
1771efb0053SChristian Brueffer.Dv 0x11060000000000000000000000000000
1780ea0127aSNick Hibma.It UQ_MSC_EJECT_TCT
1790ea0127aSNick Hibmaejects after TCT SCSI command
1801efb0053SChristian Brueffer.Dv 0x06f504025270
181415bcd89SHans Petter Selasky.It UQ_MSC_DYMO_EJECT
182415bcd89SHans Petter Selaskyejects after HID command
183415bcd89SHans Petter Selasky.Dv 0x1b5a01
1840ea0127aSNick Hibma.El
1851efb0053SChristian Brueffer.Pp
1860ea0127aSNick HibmaSee
1870ea0127aSNick Hibma.Pa /sys/dev/usb/quirk/usb_quirk.h
188a130076fSHans Petter Selaskyor run "usbconfig dump_quirk_names" for the complete list of supported quirks.
189a130076fSHans Petter Selasky.Sh LOADER TUNABLE
190a130076fSHans Petter SelaskyThe following tunable can be set at the
191a130076fSHans Petter Selasky.Xr loader 8
192a130076fSHans Petter Selaskyprompt before booting the kernel, or stored in
193a130076fSHans Petter Selasky.Xr loader.conf 5 .
194a130076fSHans Petter Selasky.Bl -tag -width indent
195a130076fSHans Petter Selasky.It Va hw.usb.quirk.%d
196a130076fSHans Petter SelaskyThe value is a string whose format is:
197a130076fSHans Petter Selasky.Bd -literal -offset indent
198a130076fSHans Petter Selasky.Qo VendorId ProductId LowRevision HighRevision UQ_QUIRK,... Qc
199a130076fSHans Petter Selasky.Ed
200a130076fSHans Petter Selasky.Pp
201a130076fSHans Petter SelaskyInstalls the quirks
202a130076fSHans Petter Selasky.Ic UQ_QUIRK,...
203a130076fSHans Petter Selaskyfor all USB devices matching
2042b56913eSHans Petter Selasky.Ic VendorId
2052b56913eSHans Petter Selaskyand
206a130076fSHans Petter Selasky.Ic ProductId
2072b56913eSHans Petter Selaskywhich have a hardware revision between and including
208a130076fSHans Petter Selasky.Ic LowRevision
209a130076fSHans Petter Selaskyand
210a130076fSHans Petter Selasky.Ic HighRevision .
211a130076fSHans Petter Selasky.Pp
212a130076fSHans Petter Selasky.Ic VendorId ,
213a130076fSHans Petter Selasky.Ic ProductId ,
214a130076fSHans Petter Selasky.Ic LowRevision
215a130076fSHans Petter Selaskyand
216a130076fSHans Petter Selasky.Ic HighRevision
217a130076fSHans Petter Selaskyare all 16 bits numbers which can be decimal or hexadecimal based.
218a130076fSHans Petter Selasky.Pp
219a130076fSHans Petter SelaskyA maximum of 100 variables
220a130076fSHans Petter Selasky.Ic hw.usb.quirk.0, .1, ..., .99
221a130076fSHans Petter Selaskycan be defined.
222a130076fSHans Petter Selasky.Pp
223a130076fSHans Petter SelaskyIf a matching entry is found in the kernel's internal quirks table, it
224a130076fSHans Petter Selaskyis replaced by the new definition.
225a130076fSHans Petter Selasky.Pp
226a130076fSHans Petter SelaskyElse a new entry is created given that the quirk table is not full.
227a130076fSHans Petter Selasky.Pp
228a130076fSHans Petter SelaskyThe kernel iterates over the
229a130076fSHans Petter Selasky.Ic hw.usb.quirk.N
230a130076fSHans Petter Selaskyvariables starting at
231a130076fSHans Petter Selasky.Ic N = 0
232a130076fSHans Petter Selaskyand stops at
233a130076fSHans Petter Selasky.Ic N = 99
234a130076fSHans Petter Selaskyor the first non-existing one.
235a130076fSHans Petter Selasky.El
2360ea0127aSNick Hibma.Sh EXAMPLES
2370ea0127aSNick HibmaAfter attaching a
2380ea0127aSNick Hibma.Nm u3g
2390ea0127aSNick Hibmadevice which appears as a USB device on
2400ea0127aSNick Hibma.Pa ugen0.3 :
2410ea0127aSNick Hibma.Bd -literal -offset indent
2420ea0127aSNick Hibmausbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
2430ea0127aSNick Hibma.Ed
244a130076fSHans Petter Selasky.Pp
245281a5e67SWarren BlockEnable a Holtec/Keep Out F85 gaming keyboard on
246281a5e67SWarren Block.Pa ugen1.4 :
247281a5e67SWarren Block.Bd -literal -offset indent
248281a5e67SWarren Blockusbconfig -d ugen1.4 add_quirk UQ_KBD_BOOTPROTO
249281a5e67SWarren Block.Ed
250281a5e67SWarren Block.Pp
251a130076fSHans Petter SelaskyTo install a quirk at boot time, place one or several lines like the
252a130076fSHans Petter Selaskyfollowing in
253a130076fSHans Petter Selasky.Xr loader.conf 5 :
254a130076fSHans Petter Selasky.Bd -literal -offset indent
255a130076fSHans Petter Selaskyhw.usb.quirk.0="0x04d9 0xfa50 0 0xffff UQ_KBD_IGNORE"
256a130076fSHans Petter Selasky.Ed
2570ea0127aSNick Hibma.Sh SEE ALSO
258814b16baSGlen Barber.Xr usbconfig 8
2590ea0127aSNick Hibma.Sh HISTORY
2600ea0127aSNick HibmaThe
2610ea0127aSNick Hibma.Nm
2620ea0127aSNick Hibmamodule appeared in
2630ea0127aSNick Hibma.Fx 8.0 ,
2640ea0127aSNick Hibmaand was written by
2656c899950SBaptiste Daroussin.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org .
2660ea0127aSNick HibmaThis manual page was written by
2676c899950SBaptiste Daroussin.An Nick Hibma Aq Mt n_hibma@FreeBSD.org .
268