Module Name:    src
Committed By:   macallan
Date:           Fri Oct  1 21:09:50 UTC 2021

Modified Files:
        src/sys/dev/usb: usb_quirks.c usb_quirks.h

Log Message:
add a quirk for devices that need ums::sc_alwayson


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/usb/usb_quirks.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/usb/usb_quirks.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usb_quirks.c
diff -u src/sys/dev/usb/usb_quirks.c:1.98 src/sys/dev/usb/usb_quirks.c:1.99
--- src/sys/dev/usb/usb_quirks.c:1.98	Tue Aug 17 22:00:32 2021
+++ src/sys/dev/usb/usb_quirks.c	Fri Oct  1 21:09:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_quirks.c,v 1.98 2021/08/17 22:00:32 andvar Exp $	*/
+/*	$NetBSD: usb_quirks.c,v 1.99 2021/10/01 21:09:50 macallan 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.98 2021/08/17 22:00:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.99 2021/10/01 21:09:50 macallan Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -383,6 +383,23 @@ Static const struct usbd_quirk_entry {
 	{ UQ_DESC_CORRUPT | UQ_MISS_OUT_ACK, desc_pn533 }},
  { USB_VENDOR_SHUTTLE,		USB_PRODUCT_SHUTTLE_SCL3712,		ANY,
 	{ UQ_DESC_CORRUPT | UQ_MISS_OUT_ACK, desc_pn533 }},
+
+/*
+ * These cheap mice will disconnect after 60 seconds,
+ * reconnect, and then disconnect again (ad nauseum)
+ * unless it's kept open.
+ */
+ { USB_VENDOR_CHICONY,		USB_PRODUCT_CHICONY_OPTMOUSE0939,	ANY,
+	{ UQ_ALWAYS_ON, NULL }},
+ { USB_VENDOR_PIXART,		USB_PRODUCT_PIXART_RPIMOUSE,		ANY,
+	{ UQ_ALWAYS_ON, NULL }},
+/*
+ * The HAILUCK USB Keyboard has a built-in touchpad, which
+ * needs to be active for the keyboard to function properly.
+ */
+ { USB_VENDOR_HAILUCK,		USB_PRODUCT_HAILUCK_KEYBOARD,		ANY,
+	{ UQ_ALWAYS_ON, NULL }},
+ 
  { 0, 0, 0, { 0, NULL } }
 };
 

Index: src/sys/dev/usb/usb_quirks.h
diff -u src/sys/dev/usb/usb_quirks.h:1.29 src/sys/dev/usb/usb_quirks.h:1.30
--- src/sys/dev/usb/usb_quirks.h:1.29	Thu Nov 15 02:35:23 2018
+++ src/sys/dev/usb/usb_quirks.h	Fri Oct  1 21:09:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_quirks.h,v 1.29 2018/11/15 02:35:23 manu Exp $	*/
+/*	$NetBSD: usb_quirks.h,v 1.30 2021/10/01 21:09:50 macallan Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_quirks.h,v 1.9 1999/11/12 23:31:03 n_hibma Exp $	*/
 
 /*
@@ -51,6 +51,7 @@ struct usbd_quirks {
 #define UQ_APPLE_ISO	0x20000	/* force ISO layout on Apple keyboards */
 #define UQ_DESC_CORRUPT	0x40000	/* may corrupt its config descriptors */
 #define UQ_MISS_OUT_ACK	0x80000	/* may fail to ack output */
+#define UQ_ALWAYS_ON   0x100000	/* for mice that keep disconnecting */
 	const usb_descriptor_t **desc;	/* Replacement for UQ_DESC_CORRUPT */
 };
 

Reply via email to