From owner-svn-src-head@freebsd.org Mon Jul 8 20:53:27 2019 Return-Path: Delivered-To: svn-src-head@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 626DA15E9999; Mon, 8 Jul 2019 20:53:27 +0000 (UTC) (envelope-from hselasky@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 03F518BC91; Mon, 8 Jul 2019 20:53:27 +0000 (UTC) (envelope-from hselasky@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 DEE551DC1D; Mon, 8 Jul 2019 20:53:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x68KrQx1020653; Mon, 8 Jul 2019 20:53:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x68KrPtm020649; Mon, 8 Jul 2019 20:53:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907082053.x68KrPtm020649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jul 2019 20:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349851 - in head/sys: conf dev/usb modules/usb modules/usb/uacpi modules/usb/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/usb modules/usb modules/usb/uacpi modules/usb/usb X-SVN-Commit-Revision: 349851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03F518BC91 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jul 2019 20:53:27 -0000 Author: hselasky Date: Mon Jul 8 20:53:25 2019 New Revision: 349851 URL: https://svnweb.freebsd.org/changeset/base/349851 Log: Put USB ACPI code into own module, uacpi.ko. The code needs more testing before being enabled by default. Sponsored by: Mellanox Technologies Added: head/sys/modules/usb/uacpi/ head/sys/modules/usb/uacpi/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/dev/usb/usb_hub_acpi.c head/sys/modules/usb/Makefile head/sys/modules/usb/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jul 8 20:26:56 2019 (r349850) +++ head/sys/conf/files Mon Jul 8 20:53:25 2019 (r349851) @@ -3221,7 +3221,7 @@ dev/usb/usb_generic.c optional usb dev/usb/usb_handle_request.c optional usb dev/usb/usb_hid.c optional usb dev/usb/usb_hub.c optional usb -dev/usb/usb_hub_acpi.c optional usb acpi +dev/usb/usb_hub_acpi.c optional uacpi acpi dev/usb/usb_if.m optional usb dev/usb/usb_lookup.c optional usb dev/usb/usb_mbuf.c optional usb Modified: head/sys/dev/usb/usb_hub_acpi.c ============================================================================== --- head/sys/dev/usb/usb_hub_acpi.c Mon Jul 8 20:26:56 2019 (r349850) +++ head/sys/dev/usb/usb_hub_acpi.c Mon Jul 8 20:53:25 2019 (r349851) @@ -440,6 +440,10 @@ static driver_t acpi_uhub_root_driver = { .baseclasses = uhub_baseclasses, }; -DRIVER_MODULE(acpi_uhub, uhub, acpi_uhub_driver, uhub_devclass, 0, 0); -MODULE_DEPEND(acpi_uhub, acpi, 1, 1, 1); -DRIVER_MODULE(acpi_uhub, usbus, acpi_uhub_root_driver, uhub_devclass, 0, 0); +DRIVER_MODULE(uacpi, uhub, acpi_uhub_driver, uhub_devclass, 0, 0); +DRIVER_MODULE(uacpi, usbus, acpi_uhub_root_driver, uhub_devclass, 0, 0); + +MODULE_DEPEND(uacpi, acpi, 1, 1, 1); +MODULE_DEPEND(uacpi, usb, 1, 1, 1); + +MODULE_VERSION(uacpi, 1); Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Jul 8 20:26:56 2019 (r349850) +++ head/sys/modules/usb/Makefile Mon Jul 8 20:53:25 2019 (r349851) @@ -55,6 +55,7 @@ SUBDIR += uether aue axe axge cdce cue ${_kue} mos rue SUBDIR += muge SUBDIR += ure urndis SUBDIR += usfs umass urio +SUBDIR += ${_uacpi} SUBDIR += quirk template SUBDIR += ${_g_audio} ${_g_keyboard} ${_g_modem} ${_g_mouse} @@ -100,6 +101,11 @@ _avr32dci= avr32dci .if ${MACHINE_CPUARCH} == "mips" _saf1761otg= saf1761otg +.endif + +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" +_uacpi= uacpi .endif .include Added: head/sys/modules/usb/uacpi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/uacpi/Makefile Mon Jul 8 20:53:25 2019 (r349851) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2019 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +.PATH: ${SRCTOP}/sys/dev/usb + +KMOD= uacpi +SRCS= bus_if.h device_if.h usb_if.h usb_if.c vnode_if.h \ + opt_usb.h opt_bus.h opt_ddb.h \ + opt_acpi.h acpi_if.h \ + usb_hub_acpi.c + +.include Modified: head/sys/modules/usb/usb/Makefile ============================================================================== --- head/sys/modules/usb/usb/Makefile Mon Jul 8 20:26:56 2019 (r349850) +++ head/sys/modules/usb/usb/Makefile Mon Jul 8 20:53:25 2019 (r349851) @@ -25,10 +25,8 @@ # SUCH DAMAGE. # -S= ${SRCTOP}/sys +.PATH: ${SRCTOP}/sys/dev/usb ${SRCTOP}/sys/dev/usb/controller -.PATH: $S/dev/usb $S/dev/usb/controller - KMOD= usb SRCS= bus_if.h device_if.h usb_if.h usb_if.c vnode_if.h \ opt_usb.h opt_bus.h opt_ddb.h \ @@ -38,11 +36,6 @@ SRCS= bus_if.h device_if.h usb_if.h usb_if.c vnode_if. usb_handle_request.c usb_hid.c usb_hub.c usb_lookup.c usb_mbuf.c \ usb_msctest.c usb_parse.c usb_pf.c usb_process.c usb_request.c \ usb_transfer.c usb_util.c - -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" -SRCS += opt_acpi.h usb_hub_acpi.c acpi_if.h -.endif .if !empty(OPT_FDT) SRCS+= usb_fdt_support.c ofw_bus_if.h