xref: /freebsd/sys/dev/usb/quirk/usb_quirk.h (revision 7aa383846770374466b1dcb2cefd71bde9acf463)
1 /* $FreeBSD$ */
2 /*-
3  * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  */
26 
27 #ifndef _USB_QUIRK_H_
28 #define	_USB_QUIRK_H_
29 
30 /* NOTE: UQ_NONE is not a valid quirk */
31 enum {	/* keep in sync with usb_quirk_str table */
32 	UQ_NONE,
33 
34 	UQ_MATCH_VENDOR_ONLY,
35 
36 	/* Various quirks */
37 
38 	UQ_AUDIO_SWAP_LR,	/* left and right sound channels are swapped */
39 	UQ_AU_INP_ASYNC,	/* input is async despite claim of adaptive */
40 	UQ_AU_NO_FRAC,		/* don't adjust for fractional samples */
41 	UQ_AU_NO_XU,		/* audio device has broken extension unit */
42 	UQ_BAD_ADC,		/* bad audio spec version number */
43 	UQ_BAD_AUDIO,		/* device claims audio class, but isn't */
44 	UQ_BROKEN_BIDIR,	/* printer has broken bidir mode */
45 	UQ_BUS_POWERED,		/* device is bus powered, despite claim */
46 	UQ_HID_IGNORE,		/* device should be ignored by hid class */
47 	UQ_KBD_IGNORE,		/* device should be ignored by kbd class */
48 	UQ_KBD_BOOTPROTO,	/* device should set the boot protocol */
49 	UQ_MS_BAD_CLASS,	/* doesn't identify properly */
50 	UQ_MS_LEADING_BYTE,	/* mouse sends an unknown leading byte */
51 	UQ_MS_REVZ,		/* mouse has Z-axis reversed */
52 	UQ_NO_STRINGS,		/* string descriptors are broken */
53 	UQ_OPEN_CLEARSTALL,	/* device needs clear endpoint stall */
54 	UQ_POWER_CLAIM,		/* hub lies about power status */
55 	UQ_SPUR_BUT_UP,		/* spurious mouse button up events */
56 	UQ_SWAP_UNICODE,	/* has some Unicode strings swapped */
57 	UQ_CFG_INDEX_1,		/* select configuration index 1 by default */
58 	UQ_CFG_INDEX_2,		/* select configuration index 2 by default */
59 	UQ_CFG_INDEX_3,		/* select configuration index 3 by default */
60 	UQ_CFG_INDEX_4,		/* select configuration index 4 by default */
61 	UQ_CFG_INDEX_0,		/* select configuration index 0 by default */
62 	UQ_ASSUME_CM_OVER_DATA,	/* modem device breaks on cm over data */
63 
64 	/* USB Mass Storage Quirks. See "storage/umass.c" for a detailed description. */
65 	UQ_MSC_NO_TEST_UNIT_READY,
66 	UQ_MSC_NO_RS_CLEAR_UA,
67 	UQ_MSC_NO_START_STOP,
68 	UQ_MSC_NO_GETMAXLUN,
69 	UQ_MSC_NO_INQUIRY,
70 	UQ_MSC_NO_INQUIRY_EVPD,
71 	UQ_MSC_NO_SYNC_CACHE,
72 	UQ_MSC_SHUTTLE_INIT,
73 	UQ_MSC_ALT_IFACE_1,
74 	UQ_MSC_FLOPPY_SPEED,
75 	UQ_MSC_IGNORE_RESIDUE,
76 	UQ_MSC_WRONG_CSWSIG,
77 	UQ_MSC_RBC_PAD_TO_12,
78 	UQ_MSC_READ_CAP_OFFBY1,
79 	UQ_MSC_FORCE_SHORT_INQ,
80 	UQ_MSC_FORCE_WIRE_BBB,
81 	UQ_MSC_FORCE_WIRE_CBI,
82 	UQ_MSC_FORCE_WIRE_CBI_I,
83 	UQ_MSC_FORCE_PROTO_SCSI,
84 	UQ_MSC_FORCE_PROTO_ATAPI,
85 	UQ_MSC_FORCE_PROTO_UFI,
86 	UQ_MSC_FORCE_PROTO_RBC,
87 
88 	USB_QUIRK_MAX
89 };
90 
91 uint8_t	usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk);
92 
93 #endif					/* _USB_QUIRK_H_ */
94