From d7dd13419efc920cd553dc59de013f2bde35f305 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Mon, 17 Sep 2012 19:06:35 +0000 Subject: [PATCH] Add UQ_UMS_IGNORE quirk. Wrap two long lines. Some minor spelling correction. PR: usb/171721 --- share/man/man4/usb_quirk.4 | 2 ++ sys/dev/usb/input/ums.c | 3 +++ sys/dev/usb/quirk/usb_quirk.c | 1 + sys/dev/usb/quirk/usb_quirk.h | 8 ++++++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4 index 23234956886..65deafad6eb 100644 --- a/share/man/man4/usb_quirk.4 +++ b/share/man/man4/usb_quirk.4 @@ -66,6 +66,8 @@ device should be ignored by hid class device should be ignored by kbd class .It UQ_KBD_BOOTPROTO device should set the boot protocol +.It UQ_UMS_IGNORE +device should be ignored by ums class .It UQ_MS_BAD_CLASS doesn't identify properly .It UQ_MS_LEADING_BYTE diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 2f1e67ba69d..c20c98674a8 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -381,6 +381,9 @@ ums_probe(device_t dev) if (uaa->info.bInterfaceClass != UICLASS_HID) return (ENXIO); + if (usb_test_quirk(uaa, UQ_UMS_IGNORE)) + return (ENXIO); + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) return (BUS_PROBE_DEFAULT); diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 87b9a1ec50e..303b613978f 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -494,6 +494,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = { [UQ_HID_IGNORE] = "UQ_HID_IGNORE", [UQ_KBD_IGNORE] = "UQ_KBD_IGNORE", [UQ_KBD_BOOTPROTO] = "UQ_KBD_BOOTPROTO", + [UQ_UMS_IGNORE] = "UQ_UMS_IGNORE", [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h index e012842282b..f2c10dd8d23 100644 --- a/sys/dev/usb/quirk/usb_quirk.h +++ b/sys/dev/usb/quirk/usb_quirk.h @@ -29,7 +29,7 @@ enum { /* - * Keep in sync with theusb_quirk_str usb_quirk.c, and with the + * Keep in sync with usb_quirk_str in usb_quirk.c, and with * share/man/man4/usb_quirk.4 */ UQ_NONE, /* not a valid quirk */ @@ -49,6 +49,7 @@ enum { UQ_HID_IGNORE, /* device should be ignored by hid class */ UQ_KBD_IGNORE, /* device should be ignored by kbd class */ UQ_KBD_BOOTPROTO, /* device should set the boot protocol */ + UQ_UMS_IGNORE, /* device should be ignored by ums class */ UQ_MS_BAD_CLASS, /* doesn't identify properly */ UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ @@ -64,7 +65,10 @@ enum { UQ_CFG_INDEX_0, /* select configuration index 0 by default */ UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ - /* USB Mass Storage Quirks. See "storage/umass.c" for a detailed description. */ + /* + * USB Mass Storage Quirks. See "storage/umass.c" for a + * detailed description. + */ UQ_MSC_NO_TEST_UNIT_READY, /* send start/stop instead of TUR */ UQ_MSC_NO_RS_CLEAR_UA, /* does not reset Unit Att. */ UQ_MSC_NO_START_STOP, /* does not support start/stop */