svn commit: r349851 - in head/sys: conf dev/usb modules/usb modules/usb/uacpi modules/usb/usb

Hans Petter Selasky hselasky at FreeBSD.org
Mon Jul 8 20:53:27 UTC 2019


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 <bsd.subdir.mk>

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 <bsd.kmod.mk>

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


More information about the svn-src-head mailing list