xref: /freebsd/share/man/man4/usb_quirk.4 (revision 067e471a24b23b64eb70790ddcba7c83d6eb6a6d)
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.\"
170ea0127aSNick Hibma.\" $FreeBSD$
180ea0127aSNick Hibma.\"
19*067e471aSHans Petter Selasky.Dd January 17, 2017
200ea0127aSNick Hibma.Dt USB_QUIRK 4
210ea0127aSNick Hibma.Os
220ea0127aSNick Hibma.Sh NAME
230ea0127aSNick Hibma.Nm usb_quirk
240ea0127aSNick Hibma.Nd USB quirks module
250ea0127aSNick Hibma.Sh SYNOPSIS
260ea0127aSNick HibmaTo compile this module into the kernel,
270ea0127aSNick Hibmaplace the following line in your
280ea0127aSNick Hibmakernel configuration file:
290ea0127aSNick Hibma.Bd -ragged -offset indent
30d4bb04f6SHans Petter Selasky.Cd "device usb"
310ea0127aSNick Hibma.Ed
320ea0127aSNick Hibma.Pp
330ea0127aSNick HibmaAlternatively, to load the module at boot
340ea0127aSNick Hibmatime, place the following line in
350ea0127aSNick Hibma.Xr loader.conf 5 :
360ea0127aSNick Hibma.Bd -literal -offset indent
370ea0127aSNick Hibmausb_quirk_load="YES"
380ea0127aSNick Hibma.Ed
390ea0127aSNick Hibma.Sh DESCRIPTION
400ea0127aSNick HibmaThe
410ea0127aSNick Hibma.Nm
420ea0127aSNick Hibmamodule provides support for dynamically adding and removing quirks for
430ea0127aSNick HibmaUSB devices with
44814b16baSGlen Barber.Xr usbconfig 8 .
450ea0127aSNick Hibma.Sh General quirks:
460ea0127aSNick Hibma.Bl -tag -width Ds
470ea0127aSNick Hibma.It UQ_AUDIO_SWAP_LR
480ea0127aSNick Hibmaswap left and right channels
490ea0127aSNick Hibma.It UQ_AU_INP_ASYNC
500ea0127aSNick Hibmainput is async despite claim of adaptive
510ea0127aSNick Hibma.It UQ_AU_NO_FRAC
521efb0053SChristian Bruefferdo not adjust for fractional samples
530ea0127aSNick Hibma.It UQ_AU_NO_XU
540ea0127aSNick Hibmaaudio device has broken extension unit
55*067e471aSHans Petter Selasky.It UQ_AU_VENDOR_CLASS
56*067e471aSHans Petter Selaskyaudio device uses vendor class to identify itself
57*067e471aSHans Petter Selasky.It UQ_AU_SET_SPDIF_CM6206
58*067e471aSHans Petter Selaskyaudio device needs special programming to enable S/PDIF audio output
590ea0127aSNick Hibma.It UQ_BAD_ADC
600ea0127aSNick Hibmabad audio spec version number
610ea0127aSNick Hibma.It UQ_BAD_AUDIO
621efb0053SChristian Bruefferdevice claims audio class, but is not
630ea0127aSNick Hibma.It UQ_BROKEN_BIDIR
640ea0127aSNick Hibmaprinter has broken bidir mode
650ea0127aSNick Hibma.It UQ_BUS_POWERED
660ea0127aSNick Hibmadevice is bus powered, despite claim
670ea0127aSNick Hibma.It UQ_HID_IGNORE
680ea0127aSNick Hibmadevice should be ignored by hid class
690ea0127aSNick Hibma.It UQ_KBD_IGNORE
700ea0127aSNick Hibmadevice should be ignored by kbd class
710ea0127aSNick Hibma.It UQ_KBD_BOOTPROTO
720ea0127aSNick Hibmadevice should set the boot protocol
73d7dd1341SHans Petter Selasky.It UQ_UMS_IGNORE
74d7dd1341SHans Petter Selaskydevice should be ignored by ums class
750ea0127aSNick Hibma.It UQ_MS_BAD_CLASS
761efb0053SChristian Bruefferdoes not identify properly
770ea0127aSNick Hibma.It UQ_MS_LEADING_BYTE
780ea0127aSNick Hibmamouse sends an unknown leading byte
790ea0127aSNick Hibma.It UQ_MS_REVZ
800ea0127aSNick Hibmamouse has Z-axis reversed
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
1010ea0127aSNick Hibma.El
1022310f718SDavid Malone.Sh USB Mass Storage quirks:
1030ea0127aSNick Hibma.Bl -tag -width Ds
1040ea0127aSNick Hibma.It UQ_MSC_NO_TEST_UNIT_READY
1050ea0127aSNick Hibmasend start/stop instead of TUR
1060ea0127aSNick Hibma.It UQ_MSC_NO_RS_CLEAR_UA
1070ea0127aSNick Hibmadoes not reset Unit Att.
1080ea0127aSNick Hibma.It UQ_MSC_NO_START_STOP
1090ea0127aSNick Hibmadoes not support start/stop
1100ea0127aSNick Hibma.It UQ_MSC_NO_GETMAXLUN
1110ea0127aSNick Hibmadoes not support get max LUN
1120ea0127aSNick Hibma.It UQ_MSC_NO_INQUIRY
1130ea0127aSNick Hibmafake generic inq response
1140ea0127aSNick Hibma.It UQ_MSC_NO_INQUIRY_EVPD
1150ea0127aSNick Hibmadoes not support inq EVPD
1160ea0127aSNick Hibma.It UQ_MSC_NO_SYNC_CACHE
1170ea0127aSNick Hibmadoes not support sync cache
1180ea0127aSNick Hibma.It UQ_MSC_SHUTTLE_INIT
1190ea0127aSNick Hibmarequires Shuttle init sequence
1200ea0127aSNick Hibma.It UQ_MSC_ALT_IFACE_1
1210ea0127aSNick Hibmaswitch to alternate interface 1
1220ea0127aSNick Hibma.It UQ_MSC_FLOPPY_SPEED
1230ea0127aSNick Hibmadoes floppy speeds (20kb/s)
1240ea0127aSNick Hibma.It UQ_MSC_IGNORE_RESIDUE
1250ea0127aSNick Hibmagets residue wrong
1260ea0127aSNick Hibma.It UQ_MSC_WRONG_CSWSIG
1270ea0127aSNick Hibmauses wrong CSW signature
1280ea0127aSNick Hibma.It UQ_MSC_RBC_PAD_TO_12
1290ea0127aSNick Hibmapad RBC requests to 12 bytes
1300ea0127aSNick Hibma.It UQ_MSC_READ_CAP_OFFBY1
1310ea0127aSNick Hibmareports sector count, not max sec.
1320ea0127aSNick Hibma.It UQ_MSC_FORCE_SHORT_INQ
1330ea0127aSNick Hibmadoes not support full inq.
1340ea0127aSNick Hibma.It UQ_MSC_FORCE_WIRE_BBB
1350ea0127aSNick Hibmaforce BBB wire protocol
1360ea0127aSNick Hibma.It UQ_MSC_FORCE_WIRE_CBI
1370ea0127aSNick Hibmaforce CBI wire protocol
1380ea0127aSNick Hibma.It UQ_MSC_FORCE_WIRE_CBI_I
1390ea0127aSNick Hibmaforce CBI with int. wire protocol
1400ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_SCSI
1410ea0127aSNick Hibmaforce SCSI command protocol
1420ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_ATAPI
1430ea0127aSNick Hibmaforce ATAPI command protocol
1440ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_UFI
1450ea0127aSNick Hibmaforce UFI command protocol
1460ea0127aSNick Hibma.It UQ_MSC_FORCE_PROTO_RBC
1470ea0127aSNick Hibmaforce RBC command protocol
1480ea0127aSNick Hibma.El
1492310f718SDavid Malone.Sh 3G Datacard (u3g) quirks:
1500ea0127aSNick Hibma.Bl -tag -width Ds
1510ea0127aSNick Hibma.It UQ_MSC_EJECT_HUAWEI
1520ea0127aSNick Hibmaejects after Huawei USB command
1530ea0127aSNick Hibma.It UQ_MSC_EJECT_SIERRA
1540ea0127aSNick Hibmaejects after Sierra USB command
1550ea0127aSNick Hibma.It UQ_MSC_EJECT_SCSIEJECT
1560ea0127aSNick Hibmaejects after SCSI eject command
1571efb0053SChristian Brueffer.Dv 0x1b0000000200
1580ea0127aSNick Hibma.It UQ_MSC_EJECT_REZERO
1590ea0127aSNick Hibmaejects after SCSI rezero command
1601efb0053SChristian Brueffer.Dv 0x010000000000
1610ea0127aSNick Hibma.It UQ_MSC_EJECT_ZTESTOR
1620ea0127aSNick Hibmaejects after ZTE SCSI command
1631efb0053SChristian Brueffer.Dv 0x850101011801010101010000
1640ea0127aSNick Hibma.It UQ_MSC_EJECT_CMOTECH
1650ea0127aSNick Hibmaejects after C-motech SCSI command
1661efb0053SChristian Brueffer.Dv 0xff52444556434847
1670ea0127aSNick Hibma.It UQ_MSC_EJECT_WAIT
1680ea0127aSNick Hibmawait for the device to eject
1690ea0127aSNick Hibma.It UQ_MSC_EJECT_SAEL_M460
1700ea0127aSNick Hibmaejects after Sael USB commands
1710ea0127aSNick Hibma.It UQ_MSC_EJECT_HUAWEISCSI
1720ea0127aSNick Hibmaejects after Huawei SCSI command
1731efb0053SChristian Brueffer.Dv 0x11060000000000000000000000000000
1740ea0127aSNick Hibma.It UQ_MSC_EJECT_TCT
1750ea0127aSNick Hibmaejects after TCT SCSI command
1761efb0053SChristian Brueffer.Dv 0x06f504025270
177415bcd89SHans Petter Selasky.It UQ_MSC_DYMO_EJECT
178415bcd89SHans Petter Selaskyejects after HID command
179415bcd89SHans Petter Selasky.Dv 0x1b5a01
1800ea0127aSNick Hibma.El
1811efb0053SChristian Brueffer.Pp
1820ea0127aSNick HibmaSee
1830ea0127aSNick Hibma.Pa /sys/dev/usb/quirk/usb_quirk.h
184a130076fSHans Petter Selaskyor run "usbconfig dump_quirk_names" for the complete list of supported quirks.
185a130076fSHans Petter Selasky.Sh LOADER TUNABLE
186a130076fSHans Petter SelaskyThe following tunable can be set at the
187a130076fSHans Petter Selasky.Xr loader 8
188a130076fSHans Petter Selaskyprompt before booting the kernel, or stored in
189a130076fSHans Petter Selasky.Xr loader.conf 5 .
190a130076fSHans Petter Selasky.Bl -tag -width indent
191a130076fSHans Petter Selasky.It Va hw.usb.quirk.%d
192a130076fSHans Petter SelaskyThe value is a string whose format is:
193a130076fSHans Petter Selasky.Bd -literal -offset indent
194a130076fSHans Petter Selasky.Qo VendorId ProductId LowRevision HighRevision UQ_QUIRK,... Qc
195a130076fSHans Petter Selasky.Ed
196a130076fSHans Petter Selasky.Pp
197a130076fSHans Petter SelaskyInstalls the quirks
198a130076fSHans Petter Selasky.Ic UQ_QUIRK,...
199a130076fSHans Petter Selaskyfor all USB devices matching
2002b56913eSHans Petter Selasky.Ic VendorId
2012b56913eSHans Petter Selaskyand
202a130076fSHans Petter Selasky.Ic ProductId
2032b56913eSHans Petter Selaskywhich have a hardware revision between and including
204a130076fSHans Petter Selasky.Ic LowRevision
205a130076fSHans Petter Selaskyand
206a130076fSHans Petter Selasky.Ic HighRevision .
207a130076fSHans Petter Selasky.Pp
208a130076fSHans Petter Selasky.Ic VendorId ,
209a130076fSHans Petter Selasky.Ic ProductId ,
210a130076fSHans Petter Selasky.Ic LowRevision
211a130076fSHans Petter Selaskyand
212a130076fSHans Petter Selasky.Ic HighRevision
213a130076fSHans Petter Selaskyare all 16 bits numbers which can be decimal or hexadecimal based.
214a130076fSHans Petter Selasky.Pp
215a130076fSHans Petter SelaskyA maximum of 100 variables
216a130076fSHans Petter Selasky.Ic hw.usb.quirk.0, .1, ..., .99
217a130076fSHans Petter Selaskycan be defined.
218a130076fSHans Petter Selasky.Pp
219a130076fSHans Petter SelaskyIf a matching entry is found in the kernel's internal quirks table, it
220a130076fSHans Petter Selaskyis replaced by the new definition.
221a130076fSHans Petter Selasky.Pp
222a130076fSHans Petter SelaskyElse a new entry is created given that the quirk table is not full.
223a130076fSHans Petter Selasky.Pp
224a130076fSHans Petter SelaskyThe kernel iterates over the
225a130076fSHans Petter Selasky.Ic hw.usb.quirk.N
226a130076fSHans Petter Selaskyvariables starting at
227a130076fSHans Petter Selasky.Ic N = 0
228a130076fSHans Petter Selaskyand stops at
229a130076fSHans Petter Selasky.Ic N = 99
230a130076fSHans Petter Selaskyor the first non-existing one.
231a130076fSHans Petter Selasky.El
2320ea0127aSNick Hibma.Sh EXAMPLES
2330ea0127aSNick HibmaAfter attaching a
2340ea0127aSNick Hibma.Nm u3g
2350ea0127aSNick Hibmadevice which appears as a USB device on
2360ea0127aSNick Hibma.Pa ugen0.3 :
2370ea0127aSNick Hibma.Bd -literal -offset indent
2380ea0127aSNick Hibmausbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
2390ea0127aSNick Hibma.Ed
240a130076fSHans Petter Selasky.Pp
241281a5e67SWarren BlockEnable a Holtec/Keep Out F85 gaming keyboard on
242281a5e67SWarren Block.Pa ugen1.4 :
243281a5e67SWarren Block.Bd -literal -offset indent
244281a5e67SWarren Blockusbconfig -d ugen1.4 add_quirk UQ_KBD_BOOTPROTO
245281a5e67SWarren Block.Ed
246281a5e67SWarren Block.Pp
247a130076fSHans Petter SelaskyTo install a quirk at boot time, place one or several lines like the
248a130076fSHans Petter Selaskyfollowing in
249a130076fSHans Petter Selasky.Xr loader.conf 5 :
250a130076fSHans Petter Selasky.Bd -literal -offset indent
251a130076fSHans Petter Selaskyhw.usb.quirk.0="0x04d9 0xfa50 0 0xffff UQ_KBD_IGNORE"
252a130076fSHans Petter Selasky.Ed
2530ea0127aSNick Hibma.Sh SEE ALSO
254814b16baSGlen Barber.Xr usbconfig 8
2550ea0127aSNick Hibma.Sh HISTORY
2560ea0127aSNick HibmaThe
2570ea0127aSNick Hibma.Nm
2580ea0127aSNick Hibmamodule appeared in
2590ea0127aSNick Hibma.Fx 8.0 ,
2600ea0127aSNick Hibmaand was written by
2616c899950SBaptiste Daroussin.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org .
2620ea0127aSNick HibmaThis manual page was written by
2636c899950SBaptiste Daroussin.An Nick Hibma Aq Mt n_hibma@FreeBSD.org .
264