svn commit: r340338 - head/sys/dev/usb/input

Vladimir Kondratyev wulf at FreeBSD.org
Sat Nov 10 22:14:11 UTC 2018


Author: wulf
Date: Sat Nov 10 22:14:09 2018
New Revision: 340338
URL: https://svnweb.freebsd.org/changeset/base/340338

Log:
  wmt(4): Add PNP record so it could be picked by devd/devmatch.
  
  Fix uhid(4) conflict with blacklisting of multitouch HID-usages
  in uhid(4) probe handler.
  
  Reviewed by:		imp
  No objections from:	hps
  MFC after:		1 month
  Differential Revision:	https://reviews.freebsd.org/D17689

Modified:
  head/sys/dev/usb/input/uhid.c
  head/sys/dev/usb/input/wmt.c

Modified: head/sys/dev/usb/input/uhid.c
==============================================================================
--- head/sys/dev/usb/input/uhid.c	Sat Nov 10 21:02:32 2018	(r340337)
+++ head/sys/dev/usb/input/uhid.c	Sat Nov 10 22:14:09 2018	(r340338)
@@ -675,6 +675,8 @@ uhid_probe(device_t dev)
 {
 	struct usb_attach_arg *uaa = device_get_ivars(dev);
 	int error;
+	void *buf;
+	uint16_t len;
 
 	DPRINTFN(11, "\n");
 
@@ -700,6 +702,25 @@ uhid_probe(device_t dev)
 	     ((uaa->info.bInterfaceProtocol == UIPROTO_MOUSE) &&
 	      !usb_test_quirk(uaa, UQ_UMS_IGNORE))))
 		return (ENXIO);
+
+	/* Check for mandatory multitouch usages to give wmt(4) a chance */
+	if (!usb_test_quirk(uaa, UQ_WMT_IGNORE)) {
+		error = usbd_req_get_hid_desc(uaa->device, NULL,
+		    &buf, &len, M_USBDEV, uaa->info.bIfaceIndex);
+		/* Let HID decscriptor-less devices to be handled at attach */
+		if (!error) {
+			if (hid_locate(buf, len,
+			    HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACT_MAX),
+			    hid_feature, 0, NULL, NULL, NULL) &&
+			    hid_locate(buf, len,
+			    HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTID),
+			    hid_input, 0, NULL, NULL, NULL)) {
+				free(buf, M_USBDEV);
+				return (ENXIO);
+			}
+			free(buf, M_USBDEV);
+		}
+	}
 
 	return (BUS_PROBE_GENERIC);
 }

Modified: head/sys/dev/usb/input/wmt.c
==============================================================================
--- head/sys/dev/usb/input/wmt.c	Sat Nov 10 21:02:32 2018	(r340337)
+++ head/sys/dev/usb/input/wmt.c	Sat Nov 10 22:14:09 2018	(r340338)
@@ -856,6 +856,12 @@ wmt_cont_max_parse(struct wmt_softc *sc, const void *r
 	}
 }
 
+static const STRUCT_USB_HOST_ID wmt_devs[] = {
+	/* generic HID class w/o boot interface */
+	{USB_IFACE_CLASS(UICLASS_HID),
+	 USB_IFACE_SUBCLASS(0),},
+};
+
 static devclass_t wmt_devclass;
 
 static device_method_t wmt_methods[] = {
@@ -876,3 +882,4 @@ DRIVER_MODULE(wmt, uhub, wmt_driver, wmt_devclass, NUL
 MODULE_DEPEND(wmt, usb, 1, 1, 1);
 MODULE_DEPEND(wmt, evdev, 1, 1, 1);
 MODULE_VERSION(wmt, 1);
+USB_PNP_HOST_INFO(wmt_devs);


More information about the svn-src-all mailing list