From owner-svn-src-all@freebsd.org Fri Jan 18 20:59:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C17971482193; Fri, 18 Jan 2019 20:59:07 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67F9D73229; Fri, 18 Jan 2019 20:59:07 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 446557EF0; Fri, 18 Jan 2019 20:59:07 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IKx7nO018548; Fri, 18 Jan 2019 20:59:07 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IKx6df018546; Fri, 18 Jan 2019 20:59:06 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201901182059.x0IKx6df018546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Fri, 18 Jan 2019 20:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343155 - stable/12/sys/dev/usb/input X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/12/sys/dev/usb/input X-SVN-Commit-Revision: 343155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67F9D73229 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2019 20:59:08 -0000 Author: wulf Date: Fri Jan 18 20:59:06 2019 New Revision: 343155 URL: https://svnweb.freebsd.org/changeset/base/343155 Log: MFC r340338: 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 Differential Revision: https://reviews.freebsd.org/D17689 Modified: stable/12/sys/dev/usb/input/uhid.c stable/12/sys/dev/usb/input/wmt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/input/uhid.c ============================================================================== --- stable/12/sys/dev/usb/input/uhid.c Fri Jan 18 20:35:24 2019 (r343154) +++ stable/12/sys/dev/usb/input/uhid.c Fri Jan 18 20:59:06 2019 (r343155) @@ -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: stable/12/sys/dev/usb/input/wmt.c ============================================================================== --- stable/12/sys/dev/usb/input/wmt.c Fri Jan 18 20:35:24 2019 (r343154) +++ stable/12/sys/dev/usb/input/wmt.c Fri Jan 18 20:59:06 2019 (r343155) @@ -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);