Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Remove the acpiwmi(4) dump from the ACPIVERBOSE module. ...
details: https://anonhg.NetBSD.org/src/rev/fbd70acc2feb
branches: trunk
changeset: 756879:fbd70acc2feb
user: jruoho <jruoho%NetBSD.org@localhost>
date: Fri Aug 06 22:45:00 2010 +0000
description:
Remove the acpiwmi(4) dump from the ACPIVERBOSE module. Instead of this
complex solution, just use aprint_debug(9) in the driver.
diffstat:
sys/dev/acpi/acpi.c | 30 ++++--------------
sys/dev/acpi/acpi_verbose.c | 12 ++-----
sys/dev/acpi/acpivar.h | 9 ++---
sys/dev/acpi/wmi/files.wmi | 3 +-
sys/dev/acpi/wmi/wmi_acpi.c | 31 ++++++++++++++++--
sys/dev/acpi/wmi/wmi_dump.c | 64 ----------------------------------------
sys/modules/acpiverbose/Makefile | 5 +--
7 files changed, 44 insertions(+), 110 deletions(-)
diffs (truncated from 320 to 300 lines):
diff -r 879b3874b19c -r fbd70acc2feb sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c Fri Aug 06 19:39:26 2010 +0000
+++ b/sys/dev/acpi/acpi.c Fri Aug 06 22:45:00 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.209 2010/08/06 18:10:40 jruoho Exp $ */
+/* $NetBSD: acpi.c,v 1.210 2010/08/06 22:45:00 jruoho Exp $ */
/*-
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.209 2010/08/06 18:10:40 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.210 2010/08/06 22:45:00 jruoho Exp $");
#include "opt_acpi.h"
#include "opt_pcifixup.h"
@@ -199,31 +199,23 @@
extern struct cfdriver acpi_cd;
-/* Handle routine vectors and loading for acpiverbose module */
-void acpi_null(void);
+/*
+ * Handle routine vectors and loading for acpiverbose module.
+ */
+int acpi_verbose_loaded = 0;
void acpi_print_devnodes_stub(struct acpi_softc *);
void acpi_print_tree_stub(struct acpi_devnode *, uint32_t);
void acpi_print_dev_stub(const char *);
-void acpi_wmidump_stub(void *);
void (*acpi_print_devnodes)(struct acpi_softc *) = acpi_print_devnodes_stub;
-void (*acpi_print_tree)(struct acpi_devnode *, uint32_t) = acpi_print_tree_stub;
+void (*acpi_print_tree)(struct acpi_devnode *,uint32_t) = acpi_print_tree_stub;
void (*acpi_print_dev)(const char *) = acpi_print_dev_stub;
-void (*acpi_wmidump)(void *) = acpi_wmidump_stub;
-
-int acpi_verbose_loaded = 0;
/*
* Support for ACPIVERBOSE.
*/
void
-acpi_null(void)
-{
- /* Nothing to do. */
-}
-
-void
acpi_load_verbose(void)
{
if (acpi_verbose_loaded == 0) {
@@ -257,14 +249,6 @@
acpi_print_dev(pnpstr);
}
-void
-acpi_wmidump_stub(void *arg)
-{
- acpi_load_verbose();
- if (acpi_verbose_loaded)
- acpi_wmidump(arg);
-}
-
CFATTACH_DECL2_NEW(acpi, sizeof(struct acpi_softc),
acpi_match, acpi_attach, acpi_detach, NULL, acpi_rescan, acpi_childdet);
diff -r 879b3874b19c -r fbd70acc2feb sys/dev/acpi/acpi_verbose.c
--- a/sys/dev/acpi/acpi_verbose.c Fri Aug 06 19:39:26 2010 +0000
+++ b/sys/dev/acpi/acpi_verbose.c Fri Aug 06 22:45:00 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_verbose.c,v 1.4 2010/07/25 12:54:46 pgoyette Exp $ */
+/* $NetBSD: acpi_verbose.c,v 1.5 2010/08/06 22:45:00 jruoho Exp $ */
/*-
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_verbose.c,v 1.4 2010/07/25 12:54:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_verbose.c,v 1.5 2010/08/06 22:45:00 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -81,9 +81,9 @@
void acpi_print_tree_real(struct acpi_devnode *, uint32_t);
void acpi_print_dev_real(const char *);
-MODULE(MODULE_CLASS_MISC, acpiverbose, NULL);
+extern int acpi_verbose_loaded;
-__weak_alias(acpi_wmidump_real, acpi_null);
+MODULE(MODULE_CLASS_MISC, acpiverbose, NULL);
static int
acpiverbose_modcmd(modcmd_t cmd, void *arg)
@@ -91,25 +91,21 @@
static void (*saved_print_devnodes)(struct acpi_softc *);
static void (*saved_print_tree)(struct acpi_devnode *, uint32_t);
static void (*saved_print_dev)(const char *);
- static void (*saved_wmidump)(void *);
switch (cmd) {
case MODULE_CMD_INIT:
saved_print_devnodes = acpi_print_devnodes;
saved_print_tree = acpi_print_tree;
saved_print_dev = acpi_print_dev;
- saved_wmidump = acpi_wmidump;
acpi_print_devnodes = acpi_print_devnodes_real;
acpi_print_tree = acpi_print_tree_real;
acpi_print_dev = acpi_print_dev_real;
- acpi_wmidump = acpi_wmidump_real;
acpi_verbose_loaded = 1;
return 0;
case MODULE_CMD_FINI:
acpi_print_devnodes = saved_print_devnodes;
acpi_print_tree = saved_print_tree;
acpi_print_dev = saved_print_dev;
- acpi_wmidump = saved_wmidump;
acpi_verbose_loaded = 0;
return 0;
default:
diff -r 879b3874b19c -r fbd70acc2feb sys/dev/acpi/acpivar.h
--- a/sys/dev/acpi/acpivar.h Fri Aug 06 19:39:26 2010 +0000
+++ b/sys/dev/acpi/acpivar.h Fri Aug 06 22:45:00 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpivar.h,v 1.57 2010/06/08 16:55:02 jruoho Exp $ */
+/* $NetBSD: acpivar.h,v 1.58 2010/08/06 22:45:00 jruoho Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -322,13 +322,12 @@
void acpi_debug_init(void);
#endif
-/* Misc routines with vectors updated by acpiverbose module */
+/*
+ * Misc routines with vectors updated by acpiverbose module.
+ */
extern void (*acpi_print_devnodes)(struct acpi_softc *);
extern void (*acpi_print_tree)(struct acpi_devnode *, uint32_t);
extern void (*acpi_print_dev)(const char *);
-extern void (*acpi_wmidump)(void *);
-
-void acpi_wmidump_real(void *);
void acpi_null(void);
diff -r 879b3874b19c -r fbd70acc2feb sys/dev/acpi/wmi/files.wmi
--- a/sys/dev/acpi/wmi/files.wmi Fri Aug 06 19:39:26 2010 +0000
+++ b/sys/dev/acpi/wmi/files.wmi Fri Aug 06 22:45:00 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.wmi,v 1.5 2010/07/19 18:22:53 jakllsch Exp $
+# $NetBSD: files.wmi,v 1.6 2010/08/06 22:45:00 jruoho Exp $
define acpiwmibus { }
@@ -6,7 +6,6 @@
device acpiwmi: acpiwmibus
attach acpiwmi at acpinodebus
file dev/acpi/wmi/wmi_acpi.c acpiwmi
-file dev/acpi/wmi/wmi_dump.c acpiwmi & acpiverbose
# Dell WMI mappings
device wmidell: sysmon_power
diff -r 879b3874b19c -r fbd70acc2feb sys/dev/acpi/wmi/wmi_acpi.c
--- a/sys/dev/acpi/wmi/wmi_acpi.c Fri Aug 06 19:39:26 2010 +0000
+++ b/sys/dev/acpi/wmi/wmi_acpi.c Fri Aug 06 22:45:00 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wmi_acpi.c,v 1.6 2010/07/29 07:10:39 jruoho Exp $ */
+/* $NetBSD: wmi_acpi.c,v 1.7 2010/08/06 22:45:00 jruoho Exp $ */
/*-
* Copyright (c) 2009, 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.6 2010/07/29 07:10:39 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.7 2010/08/06 22:45:00 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -58,6 +58,7 @@
static bool acpi_wmi_init(struct acpi_wmi_softc *);
static bool acpi_wmi_add(struct acpi_wmi_softc *, ACPI_OBJECT *);
static void acpi_wmi_del(struct acpi_wmi_softc *);
+static void acpi_wmi_dump(struct acpi_wmi_softc *);
static ACPI_STATUS acpi_wmi_guid_get(struct acpi_wmi_softc *,
const char *, struct wmi_t **);
@@ -107,8 +108,7 @@
if (acpi_wmi_init(sc) != true)
return;
- acpi_wmidump(sc);
-
+ acpi_wmi_dump(sc);
acpi_wmi_event_add(sc);
sc->sc_child = config_found_ia(self, "acpiwmibus",
@@ -244,6 +244,29 @@
}
}
+static void
+acpi_wmi_dump(struct acpi_wmi_softc *sc)
+{
+ struct wmi_t *wmi;
+
+ KASSERT(SIMPLEQ_EMPTY(&sc->wmi_head) == 0);
+
+ SIMPLEQ_FOREACH(wmi, &sc->wmi_head, wmi_link) {
+
+ aprint_debug_dev(sc->sc_dev, "{%08X-%04X-%04X-",
+ wmi->guid.data1, wmi->guid.data2, wmi->guid.data3);
+
+ aprint_debug("%02X%02X-%02X%02X%02X%02X%02X%02X} ",
+ wmi->guid.data4[0], wmi->guid.data4[1],
+ wmi->guid.data4[2], wmi->guid.data4[3],
+ wmi->guid.data4[4], wmi->guid.data4[5],
+ wmi->guid.data4[6], wmi->guid.data4[7]);
+
+ aprint_debug("oid %04X count %02X flags %02X\n",
+ UGET16(wmi->guid.oid), wmi->guid.count, wmi->guid.flags);
+ }
+}
+
static ACPI_STATUS
acpi_wmi_guid_get(struct acpi_wmi_softc *sc,
const char *src, struct wmi_t **out)
diff -r 879b3874b19c -r fbd70acc2feb sys/dev/acpi/wmi/wmi_dump.c
--- a/sys/dev/acpi/wmi/wmi_dump.c Fri Aug 06 19:39:26 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/* $NetBSD: wmi_dump.c,v 1.1 2010/05/31 20:32:29 pgoyette Exp $ */
-
-/*-
- * Copyright (c) 2009, 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
- * 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.
- */
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmi_dump.c,v 1.1 2010/05/31 20:32:29 pgoyette Exp $");
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/endian.h>
-#include <sys/kmem.h>
-#include <sys/systm.h>
-
-#include <dev/acpi/acpireg.h>
-#include <dev/acpi/acpivar.h>
-#include <dev/acpi/wmi/wmi_acpivar.h>
-
-void
-acpi_wmidump_real(void *arg)
-{
- struct wmi_t *wmi;
- struct acpi_wmi_softc *sc = (struct acpi_wmi_softc *)arg;
-
- KASSERT(SIMPLEQ_EMPTY(&sc->wmi_head) == 0);
-
- SIMPLEQ_FOREACH(wmi, &sc->wmi_head, wmi_link) {
-
- aprint_normal_dev(sc->sc_dev, "{%08X-%04X-%04X-",
- wmi->guid.data1, wmi->guid.data2, wmi->guid.data3);
-
- aprint_normal("%02X%02X-%02X%02X%02X%02X%02X%02X} ",
- wmi->guid.data4[0], wmi->guid.data4[1],
- wmi->guid.data4[2], wmi->guid.data4[3],
- wmi->guid.data4[4], wmi->guid.data4[5],
- wmi->guid.data4[6], wmi->guid.data4[7]);
-
- aprint_normal("oid %04X count %02X flags %02X\n",
Home |
Main Index |
Thread Index |
Old Index