Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb add quirk for CDC-ACM devices that do not have a...
details: https://anonhg.NetBSD.org/src/rev/7fd813d02ff9
branches: trunk
changeset: 755901:7fd813d02ff9
user: kardel <kardel%NetBSD.org@localhost>
date: Sun Jun 27 10:41:26 2010 +0000
description:
add quirk for CDC-ACM devices that do not have a CDC UNION interface descriptor.
idea gleened from Linux cdc-acm implementation (which has a long list of these devices)
first tested/added device is MTK GPS receiver.
diffstat:
sys/dev/usb/umodem_common.c | 9 +++++++--
sys/dev/usb/usb_quirks.c | 5 +++--
sys/dev/usb/usb_quirks.h | 3 ++-
3 files changed, 12 insertions(+), 5 deletions(-)
diffs (73 lines):
diff -r 75f8bd7b5f46 -r 7fd813d02ff9 sys/dev/usb/umodem_common.c
--- a/sys/dev/usb/umodem_common.c Sun Jun 27 10:32:13 2010 +0000
+++ b/sys/dev/usb/umodem_common.c Sun Jun 27 10:41:26 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umodem_common.c,v 1.17 2009/11/12 19:58:27 dyoung Exp $ */
+/* $NetBSD: umodem_common.c,v 1.18 2010/06/27 10:41:26 kardel Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.17 2009/11/12 19:58:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.18 2010/06/27 10:41:26 kardel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -372,6 +372,11 @@
*cm = *acm = 0;
+ if (usbd_get_quirks(dev)->uq_flags & UQ_NO_UNION_NRM) {
+ DPRINTF(("umodem_get_caps: NO_UNION_NRM quirk - returning 0\n"));
+ return 0;
+ }
+
cmd = (const usb_cdc_cm_descriptor_t *)usb_find_desc_if(dev,
UDESC_CS_INTERFACE,
UDESCSUB_CDC_CM, id);
diff -r 75f8bd7b5f46 -r 7fd813d02ff9 sys/dev/usb/usb_quirks.c
--- a/sys/dev/usb/usb_quirks.c Sun Jun 27 10:32:13 2010 +0000
+++ b/sys/dev/usb/usb_quirks.c Sun Jun 27 10:41:26 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_quirks.c,v 1.66 2010/03/14 08:44:46 explorer Exp $ */
+/* $NetBSD: usb_quirks.c,v 1.67 2010/06/27 10:41:26 kardel Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.30 2003/01/02 04:15:55 imp Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.66 2010/03/14 08:44:46 explorer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.67 2010/06/27 10:41:26 kardel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -111,6 +111,7 @@
{ USB_VENDOR_HP, USB_PRODUCT_HP_840C, ANY, { UQ_BROKEN_BIDIR }},
{ USB_VENDOR_HP, USB_PRODUCT_HP_816C, ANY, { UQ_BROKEN_BIDIR }},
{ USB_VENDOR_HP, USB_PRODUCT_HP_959C, ANY, { UQ_BROKEN_BIDIR }},
+ { USB_VENDOR_MTK, USB_PRODUCT_MTK_GPS_RECEIVER, ANY, { UQ_NO_UNION_NRM }},
{ USB_VENDOR_NEC, USB_PRODUCT_NEC_PICTY900, ANY, { UQ_BROKEN_BIDIR }},
{ USB_VENDOR_NEC, USB_PRODUCT_NEC_PICTY760, ANY, { UQ_BROKEN_BIDIR }},
{ USB_VENDOR_NEC, USB_PRODUCT_NEC_PICTY920, ANY, { UQ_BROKEN_BIDIR }},
diff -r 75f8bd7b5f46 -r 7fd813d02ff9 sys/dev/usb/usb_quirks.h
--- a/sys/dev/usb/usb_quirks.h Sun Jun 27 10:32:13 2010 +0000
+++ b/sys/dev/usb/usb_quirks.h Sun Jun 27 10:41:26 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_quirks.h,v 1.23 2008/04/28 20:24:00 martin Exp $ */
+/* $NetBSD: usb_quirks.h,v 1.24 2010/06/27 10:41:26 kardel Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_quirks.h,v 1.9 1999/11/12 23:31:03 n_hibma Exp $ */
/*
@@ -46,6 +46,7 @@
#define UQ_ASSUME_CM_OVER_DATA 0x1000 /* modem device breaks on cm over data */
#define UQ_BROKEN_BIDIR 0x2000 /* printer has broken bidir mode */
#define UQ_HID_IGNORE 0x4000 /* device should be ignored by hid class */
+#define UQ_NO_UNION_NRM 0x8000 /* has no normal UNION descriptor */
};
extern const struct usbd_quirks usbd_no_quirk;
Home |
Main Index |
Thread Index |
Old Index