USB_QUIRK(4)
β¨ usb_quirk β the USB quirks module β¨
okay bestie, pull up a chair π this is USB_QUIRK(4) from the Kernel Interfaces Manual, and it's literally the glow-up your janky USB hardware has been begging for π
πΈ NAME πΈ
usb_quirk β the USB quirks module, aka the "your device is lying but we still love it" module π«Ά
π¦ SYNOPSIS π¦
so to bake this module straight into the kernel, you drop this line into your kernel config file:
device usb
orrr, if you'd rather load it at boot time (very main character of you), you put this in loader.conf(5):
usb_quirk_load="YES"
π DESCRIPTION π
The usb_quirk module is the one that lets you dynamically add and remove quirks for USB devices, using usbconfig(8). no cap. it's giving fix-it energy β¨
π General quirks π
UQ_AUDIO_SWAP_LRβ swap left and right channels, because your ears deserve the correct sidesUQ_AU_INP_ASYNCβ the input is async, despite what it claims about being adaptiveUQ_AU_NO_FRACβ do not adjust for fractional samplesUQ_AU_NO_XUβ this audio device has a broken extension unit πUQ_AU_VENDOR_CLASSβ the audio device uses vendor class to identify itself (identity crisis, honestly)UQ_AU_SET_SPDIF_CM6206β this audio device needs special programming to enable S/PDIF audio outputUQ_BAD_ADCβ bad audio spec version numberUQ_BAD_AUDIOβ the device claims to be audio class, but it is NOT. liar behavior πUQ_BROKEN_BIDIRβ printer has broken bidir modeUQ_BUS_POWEREDβ the device is bus powered, despite its claimsUQ_HID_IGNOREβ this device should be ignored by the hid classUQ_KBD_IGNOREβ this device should be ignored by the kbd classUQ_KBD_BOOTPROTOβ this device should set the boot protocolUQ_UMS_IGNOREβ this device should be ignored by the ums classUQ_MS_BAD_CLASSβ does not identify properly (we've all been there π)UQ_MS_LEADING_BYTEβ the mouse sends an unknown leading byteUQ_MS_REVZβ the mouse has its Z-axis reversedUQ_NO_STRINGSβ string descriptors are brokenUQ_POWER_CLAIMβ the hub lies about its power statusUQ_SPUR_BUT_UPβ spurious mouse button up events (stop clicking at me!!)UQ_SWAP_UNICODEβ has some Unicode strings swappedUQ_CFG_INDEX_1β select configuration index 1 by defaultUQ_CFG_INDEX_2β select configuration index 2 by defaultUQ_CFG_INDEX_3β select configuration index 3 by defaultUQ_CFG_INDEX_4β select configuration index 4 by defaultUQ_CFG_INDEX_0β select configuration index 0 by defaultUQ_ASSUME_CM_OVER_DATAβ assume cm over data featureUQ_WMT_IGNOREβ this device should be ignored by the wmt driver
π USB Mass Storage quirks π
UQ_MSC_NO_TEST_UNIT_READYβ send start/stop instead of TURUQ_MSC_NO_RS_CLEAR_UAβ does not reset Unit Att.UQ_MSC_NO_START_STOPβ does not support start/stopUQ_MSC_NO_GETMAXLUNβ does not support get max LUNUQ_MSC_NO_INQUIRYβ fake generic inq responseUQ_MSC_NO_INQUIRY_EVPDβ does not support inq EVPDUQ_MSC_NO_SYNC_CACHEβ does not support sync cacheUQ_MSC_SHUTTLE_INITβ requires Shuttle init sequenceUQ_MSC_ALT_IFACE_1β switch to alternate interface 1UQ_MSC_FLOPPY_SPEEDβ does floppy speeds (20kb/s) π iconic retro momentUQ_MSC_IGNORE_RESIDUEβ gets residue wrongUQ_MSC_WRONG_CSWSIGβ uses wrong CSW signatureUQ_MSC_RBC_PAD_TO_12β pad RBC requests to 12 bytesUQ_MSC_READ_CAP_OFFBY1β reports sector count, not max sec.UQ_MSC_FORCE_SHORT_INQβ does not support full inq.UQ_MSC_FORCE_WIRE_BBBβ force BBB wire protocolUQ_MSC_FORCE_WIRE_CBIβ force CBI wire protocolUQ_MSC_FORCE_WIRE_CBI_Iβ force CBI with int. wire protocolUQ_MSC_FORCE_PROTO_SCSIβ force SCSI command protocolUQ_MSC_FORCE_PROTO_ATAPIβ force ATAPI command protocolUQ_MSC_FORCE_PROTO_UFIβ force UFI command protocolUQ_MSC_FORCE_PROTO_RBCβ force RBC command protocol
π 3G Datacard (u3g) quirks π
UQ_MSC_EJECT_HUAWEIβ ejects after Huawei USB commandUQ_MSC_EJECT_SIERRAβ ejects after Sierra USB commandUQ_MSC_EJECT_SCSIEJECTβ ejects after SCSI eject command0x1b0000000200UQ_MSC_EJECT_REZEROβ ejects after SCSI rezero command0x010000000000UQ_MSC_EJECT_ZTESTORβ ejects after ZTE SCSI command0x850101011801010101010000UQ_MSC_EJECT_CMOTECHβ ejects after C-motech SCSI command0xff52444556434847UQ_MSC_EJECT_WAITβ wait for the device to ejectUQ_MSC_EJECT_SAEL_M460β ejects after Sael USB commandsUQ_MSC_EJECT_HUAWEISCSIβ ejects after Huawei SCSI command0x11060000000000000000000000000000UQ_MSC_EJECT_TCTβ ejects after TCT SCSI command0x06f504025270UQ_MSC_DYMO_EJECTβ ejects after HID command0x1b5a01
psst π for the complete list of supported quirks, peek at/sys/dev/usb/quirk/usb_quirk.hor runusbconfig dump_quirk_names. slay.
π₯ LOADER TUNABLE π₯
you can set the following tunable at the loader(8) prompt before booting the kernel, or just store it in loader.conf(5). either way, it's valid π
hw.usb.quirk.%dβ the value is a string, and the format goes like this:
"VendorId ProductId LowRevision HighRevision UQ_QUIRK,..."
Installs the quirks UQ_QUIRK,... for all USB devices matching VendorId and ProductId which have a hardware revision between and including LowRevision and HighRevision.
VendorId, ProductId, LowRevision and HighRevision are all 16 bits numbers which can be decimal or hexadecimal based. math is math β¨
A maximum of 100 variables hw.usb.quirk.0, .1, ..., .99 can be defined.
If a matching entry is found in the kernel's internal quirks table, it is replaced by the new definition.
Else a new entry is created given that the quirk table is not full.
The kernel iterates over the hw.usb.quirk.N variables starting at N = 0 and stops at N = 99 or the first non-existing one.
β EXAMPLES β
After attaching a u3g device which appears as a USB device on ugen0.3:
usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
Enable a Holtec/Keep Out F85 gaming keyboard on ugen1.4:
usbconfig -d ugen1.4 add_quirk UQ_KBD_BOOTPROTO
To install a quirk at boot time, place one or several lines like the following in loader.conf(5):
hw.usb.quirk.0="0x04d9 0xfa50 0 0xffff UQ_KBD_IGNORE"
π SEE ALSO π
πΈ HISTORY πΈ
The usb_quirk module appeared in FreeBSD 8.0, and was written by Hans Petter Selasky <hselasky@FreeBSD.org>. This manual page was written by Nick Hibma <n_hibma@FreeBSD.org>. absolute legends, we stan π«Ά
and that's the whole page bestie π this one came from Debian, dated August 19, 2017, filed under USB_QUIRK(4) β go forth and quirk responsibly, periodt π
β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2010 AnyWi Technologies
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms