xref: /freebsd/sys/dev/usb/quirk/usb_quirk.h (revision eb6d21b4ca6d668cf89afd99eef7baeafa712197)
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 	UQ_AUDIO_SWAP_LR,	/* left and right sound channels are swapped */
34 	UQ_AU_INP_ASYNC,	/* input is async despite claim of adaptive */
35 	UQ_AU_NO_FRAC,		/* don't adjust for fractional samples */
36 	UQ_AU_NO_XU,		/* audio device has broken extension unit */
37 	UQ_BAD_ADC,		/* bad audio spec version number */
38 	UQ_BAD_AUDIO,		/* device claims audio class, but isn't */
39 	UQ_BROKEN_BIDIR,	/* printer has broken bidir mode */
40 	UQ_BUS_POWERED,		/* device is bus powered, despite claim */
41 	UQ_HID_IGNORE,		/* device should be ignored by hid class */
42 	UQ_KBD_IGNORE,		/* device should be ignored by kbd class */
43 	UQ_MS_BAD_CLASS,	/* doesn't identify properly */
44 	UQ_MS_LEADING_BYTE,	/* mouse sends an unknown leading byte */
45 	UQ_MS_REVZ,		/* mouse has Z-axis reversed */
46 	UQ_NO_STRINGS,		/* string descriptors are broken */
47 	UQ_OPEN_CLEARSTALL,	/* device needs clear endpoint stall */
48 	UQ_POWER_CLAIM,		/* hub lies about power status */
49 	UQ_SPUR_BUT_UP,		/* spurious mouse button up events */
50 	UQ_SWAP_UNICODE,	/* has some Unicode strings swapped */
51 	UQ_CFG_INDEX_1,		/* select configuration index 1 by default */
52 	UQ_CFG_INDEX_2,		/* select configuration index 2 by default */
53 	UQ_CFG_INDEX_3,		/* select configuration index 3 by default */
54 	UQ_CFG_INDEX_4,		/* select configuration index 4 by default */
55 	UQ_CFG_INDEX_0,		/* select configuration index 0 by default */
56 	UQ_ASSUME_CM_OVER_DATA,	/* modem device breaks on cm over data */
57 	USB_QUIRK_MAX
58 };
59 
60 uint8_t	usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk);
61 
62 #endif					/* _USB_QUIRK_H_ */
63