summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/usb_quirk.4 3.html
blob: e1db85150866f557fb6923cbaa2f05795b49465f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<table class="head">
  <tr>
    <td class="head-ltitle">USB_QUIRK(4)</td>
    <td class="head-vol">Device Drivers Manual</td>
    <td class="head-rtitle">USB_QUIRK(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">usb_quirk</code> &#x2014; <span class="Nd">USB
    quirks module</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp">To compile this module into the kernel, place the following line
    in your kernel configuration file:</p>
<div class="Bd Pp Bd-indent"><code class="Cd">device usb</code></div>
<p class="Pp">Alternatively, to load the module at boot time, place the
    following line in <a class="Xr">loader.conf(5)</a>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>usb_quirk_load=&quot;YES&quot;</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">usb_quirk</code> module provides support for
    dynamically adding and removing quirks for USB devices with
    <a class="Xr">usbconfig(8)</a>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="General_quirks:"><a class="permalink" href="#General_quirks:">General
  quirks:</a></h1>
<dl class="Bl-tag">
  <dt>UQ_AUDIO_SWAP_LR</dt>
  <dd>swap left and right channels</dd>
  <dt>UQ_AU_INP_ASYNC</dt>
  <dd>input is async despite claim of adaptive</dd>
  <dt>UQ_AU_NO_FRAC</dt>
  <dd>do not adjust for fractional samples</dd>
  <dt>UQ_AU_NO_XU</dt>
  <dd>audio device has broken extension unit</dd>
  <dt>UQ_AU_VENDOR_CLASS</dt>
  <dd>audio device uses vendor class to identify itself</dd>
  <dt>UQ_AU_SET_SPDIF_CM6206</dt>
  <dd>audio device needs special programming to enable S/PDIF audio output</dd>
  <dt>UQ_BAD_ADC</dt>
  <dd>bad audio spec version number</dd>
  <dt>UQ_BAD_AUDIO</dt>
  <dd>device claims audio class, but is not</dd>
  <dt>UQ_BROKEN_BIDIR</dt>
  <dd>printer has broken bidir mode</dd>
  <dt>UQ_BUS_POWERED</dt>
  <dd>device is bus powered, despite claim</dd>
  <dt>UQ_HID_IGNORE</dt>
  <dd>device should be ignored by hid class</dd>
  <dt>UQ_KBD_IGNORE</dt>
  <dd>device should be ignored by kbd class</dd>
  <dt>UQ_KBD_BOOTPROTO</dt>
  <dd>device should set the boot protocol</dd>
  <dt>UQ_UMS_IGNORE</dt>
  <dd>device should be ignored by ums class</dd>
  <dt>UQ_MS_BAD_CLASS</dt>
  <dd>does not identify properly</dd>
  <dt>UQ_MS_LEADING_BYTE</dt>
  <dd>mouse sends an unknown leading byte</dd>
  <dt>UQ_MS_REVZ</dt>
  <dd>mouse has Z-axis reversed</dd>
  <dt>UQ_MS_VENDOR_BTN</dt>
  <dd>mouse has buttons in vendor usage page</dd>
  <dt>UQ_NO_STRINGS</dt>
  <dd>string descriptors are broken</dd>
  <dt>UQ_POWER_CLAIM</dt>
  <dd>hub lies about power status</dd>
  <dt>UQ_SPUR_BUT_UP</dt>
  <dd>spurious mouse button up events</dd>
  <dt>UQ_SWAP_UNICODE</dt>
  <dd>has some Unicode strings swapped</dd>
  <dt>UQ_CFG_INDEX_1</dt>
  <dd>select configuration index 1 by default</dd>
  <dt>UQ_CFG_INDEX_2</dt>
  <dd>select configuration index 2 by default</dd>
  <dt>UQ_CFG_INDEX_3</dt>
  <dd>select configuration index 3 by default</dd>
  <dt>UQ_CFG_INDEX_4</dt>
  <dd>select configuration index 4 by default</dd>
  <dt>UQ_CFG_INDEX_0</dt>
  <dd>select configuration index 0 by default</dd>
  <dt>UQ_ASSUME_CM_OVER_DATA</dt>
  <dd>assume cm over data feature</dd>
  <dt>UQ_IGNORE_CDC_CM</dt>
  <dd>ignore cm descriptor</dd>
  <dt>UQ_WMT_IGNORE</dt>
  <dd>device should be ignored by wmt driver</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="USB_Mass_Storage_quirks:"><a class="permalink" href="#USB_Mass_Storage_quirks:">USB
  Mass Storage quirks:</a></h1>
<dl class="Bl-tag">
  <dt>UQ_MSC_NO_TEST_UNIT_READY</dt>
  <dd>send start/stop instead of TUR</dd>
  <dt>UQ_MSC_NO_RS_CLEAR_UA</dt>
  <dd>does not reset Unit Att.</dd>
  <dt>UQ_MSC_NO_START_STOP</dt>
  <dd>does not support start/stop</dd>
  <dt>UQ_MSC_NO_GETMAXLUN</dt>
  <dd>does not support get max LUN</dd>
  <dt>UQ_MSC_NO_INQUIRY</dt>
  <dd>fake generic inq response</dd>
  <dt>UQ_MSC_NO_INQUIRY_EVPD</dt>
  <dd>does not support inq EVPD</dd>
  <dt>UQ_MSC_NO_SYNC_CACHE</dt>
  <dd>does not support sync cache</dd>
  <dt>UQ_MSC_SHUTTLE_INIT</dt>
  <dd>requires Shuttle init sequence</dd>
  <dt>UQ_MSC_ALT_IFACE_1</dt>
  <dd>switch to alternate interface 1</dd>
  <dt>UQ_MSC_FLOPPY_SPEED</dt>
  <dd>does floppy speeds (20kb/s)</dd>
  <dt>UQ_MSC_IGNORE_RESIDUE</dt>
  <dd>gets residue wrong</dd>
  <dt>UQ_MSC_WRONG_CSWSIG</dt>
  <dd>uses wrong CSW signature</dd>
  <dt>UQ_MSC_RBC_PAD_TO_12</dt>
  <dd>pad RBC requests to 12 bytes</dd>
  <dt>UQ_MSC_READ_CAP_OFFBY1</dt>
  <dd>reports sector count, not max sec.</dd>
  <dt>UQ_MSC_FORCE_SHORT_INQ</dt>
  <dd>does not support full inq.</dd>
  <dt>UQ_MSC_FORCE_WIRE_BBB</dt>
  <dd>force BBB wire protocol</dd>
  <dt>UQ_MSC_FORCE_WIRE_CBI</dt>
  <dd>force CBI wire protocol</dd>
  <dt>UQ_MSC_FORCE_WIRE_CBI_I</dt>
  <dd>force CBI with int. wire protocol</dd>
  <dt>UQ_MSC_FORCE_PROTO_SCSI</dt>
  <dd>force SCSI command protocol</dd>
  <dt>UQ_MSC_FORCE_PROTO_ATAPI</dt>
  <dd>force ATAPI command protocol</dd>
  <dt>UQ_MSC_FORCE_PROTO_UFI</dt>
  <dd>force UFI command protocol</dd>
  <dt>UQ_MSC_FORCE_PROTO_RBC</dt>
  <dd>force RBC command protocol</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="3G_Datacard_(u3g)_quirks:"><a class="permalink" href="#3G_Datacard_(u3g)_quirks:">3G
  Datacard (u3g) quirks:</a></h1>
<dl class="Bl-tag">
  <dt>UQ_MSC_EJECT_HUAWEI</dt>
  <dd>ejects after Huawei USB command</dd>
  <dt>UQ_MSC_EJECT_SIERRA</dt>
  <dd>ejects after Sierra USB command</dd>
  <dt>UQ_MSC_EJECT_SCSIEJECT</dt>
  <dd>ejects after SCSI eject command
    <code class="Dv">0x1b0000000200</code></dd>
  <dt>UQ_MSC_EJECT_REZERO</dt>
  <dd>ejects after SCSI rezero command
    <code class="Dv">0x010000000000</code></dd>
  <dt>UQ_MSC_EJECT_ZTESTOR</dt>
  <dd>ejects after ZTE SCSI command
      <code class="Dv">0x850101011801010101010000</code></dd>
  <dt>UQ_MSC_EJECT_CMOTECH</dt>
  <dd>ejects after C-motech SCSI command
      <code class="Dv">0xff52444556434847</code></dd>
  <dt>UQ_MSC_EJECT_WAIT</dt>
  <dd>wait for the device to eject</dd>
  <dt>UQ_MSC_EJECT_SAEL_M460</dt>
  <dd>ejects after Sael USB commands</dd>
  <dt>UQ_MSC_EJECT_HUAWEISCSI</dt>
  <dd>ejects after Huawei SCSI command
      <code class="Dv">0x11060000000000000000000000000000</code></dd>
  <dt>UQ_MSC_EJECT_TCT</dt>
  <dd>ejects after TCT SCSI command <code class="Dv">0x06f504025270</code></dd>
  <dt>UQ_MSC_DYMO_EJECT</dt>
  <dd>ejects after HID command <code class="Dv">0x1b5a01</code></dd>
</dl>
<p class="Pp">See <span class="Pa">/sys/dev/usb/quirk/usb_quirk.h</span> or run
    &quot;usbconfig dump_quirk_names&quot; for the complete list of supported
    quirks.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="LOADER_TUNABLE"><a class="permalink" href="#LOADER_TUNABLE">LOADER
  TUNABLE</a></h1>
<p class="Pp">The following tunable can be set at the
    <a class="Xr">loader(8)</a> prompt before booting the kernel, or stored in
    <a class="Xr">loader.conf(5)</a>.</p>
<dl class="Bl-tag">
  <dt id="hw.usb.quirk._d"><var class="Va">hw.usb.quirk.%d</var></dt>
  <dd>The value is a string whose format is:
    <div class="Bd Pp Bd-indent Li">
    <pre>&quot;VendorId ProductId LowRevision HighRevision UQ_QUIRK,...&quot;</pre>
    </div>
    <p class="Pp">Installs the quirks <code class="Ic">UQ_QUIRK,...</code> for
        all USB devices matching <code class="Ic">VendorId</code> and
        <code class="Ic">ProductId</code> which have a hardware revision between
        and including <code class="Ic">LowRevision</code> and
        <code class="Ic">HighRevision</code>.</p>
    <p class="Pp"><code class="Ic">VendorId</code>,
        <code class="Ic">ProductId</code>, <code class="Ic">LowRevision</code>
        and <code class="Ic">HighRevision</code> are all 16 bits numbers which
        can be decimal or hexadecimal based.</p>
    <p class="Pp">A maximum of 100 variables <code class="Ic">hw.usb.quirk.0,
        .1, ..., .99</code> can be defined.</p>
    <p class="Pp">If a matching entry is found in the kernel's internal quirks
        table, it is replaced by the new definition.</p>
    <p class="Pp">Else a new entry is created given that the quirk table is not
        full.</p>
    <p class="Pp">The kernel iterates over the
        <code class="Ic">hw.usb.quirk.N</code> variables starting at
        <code class="Ic">N = 0</code> and stops at <code class="Ic">N =
        99</code> or the first non-existing one.</p>
  </dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">After attaching a <code class="Nm">u3g</code> device which appears
    as a USB device on <span class="Pa">ugen0.3</span>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT</pre>
</div>
<p class="Pp">Enable a Holtec/Keep Out F85 gaming keyboard on
    <span class="Pa">ugen1.4</span>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>usbconfig -d ugen1.4 add_quirk UQ_KBD_BOOTPROTO</pre>
</div>
<p class="Pp">To install a quirk at boot time, place one or several lines like
    the following in <a class="Xr">loader.conf(5)</a>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>hw.usb.quirk.0=&quot;0x04d9 0xfa50 0 0xffff UQ_KBD_IGNORE&quot;</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">usbconfig(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">usb_quirk</code> module appeared in
    <span class="Ux">FreeBSD 8.0</span>, and was written by
    <span class="An">Hans Petter Selasky</span>
    &lt;<a class="Mt" href="mailto:hselasky@FreeBSD.org">hselasky@FreeBSD.org</a>&gt;.
    This manual page was written by <span class="An">Nick Hibma</span>
    &lt;<a class="Mt" href="mailto:n_hibma@FreeBSD.org">n_hibma@FreeBSD.org</a>&gt;.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">August 19, 2017</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>