From owner-svn-src-head@freebsd.org Mon Mar 9 20:28:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CF8126C18A; Mon, 9 Mar 2020 20:28:47 +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 48bqYp60wpz3GQP; Mon, 9 Mar 2020 20:28:46 +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 9817618581; Mon, 9 Mar 2020 20:28:46 +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 029KSkcP061414; Mon, 9 Mar 2020 20:28:46 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 029KSktx061412; Mon, 9 Mar 2020 20:28:46 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202003092028.029KSktx061412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 9 Mar 2020 20:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358819 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 358819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 09 Mar 2020 20:28:47 -0000 Author: wulf Date: Mon Mar 9 20:28:45 2020 New Revision: 358819 URL: https://svnweb.freebsd.org/changeset/base/358819 Log: acpi: Export functions required by upcoming acpi_iicbus driver. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Mar 9 20:27:25 2020 (r358818) +++ head/sys/dev/acpica/acpi.c Mon Mar 9 20:28:45 2020 (r358819) @@ -150,7 +150,6 @@ static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, void *context, void **retval); static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev, int max_depth, acpi_scan_cb_t user_fn, void *arg); -static int acpi_set_powerstate(device_t child, int state); static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids); static void acpi_probe_children(device_t bus); @@ -162,7 +161,6 @@ static ACPI_STATUS acpi_sleep_disable(struct acpi_soft static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); -static BOOLEAN acpi_has_hid(ACPI_HANDLE handle); static void acpi_resync_clock(struct acpi_softc *sc); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate); @@ -883,14 +881,12 @@ acpi_child_location_str_method(device_t cbdev, device_ } /* PnP information for devctl(8) */ -static int -acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, - size_t buflen) +int +acpi_pnpinfo_str(ACPI_HANDLE handle, char *buf, size_t buflen) { - struct acpi_device *dinfo = device_get_ivars(child); ACPI_DEVICE_INFO *adinfo; - if (ACPI_FAILURE(AcpiGetObjectInfo(dinfo->ad_handle, &adinfo))) { + if (ACPI_FAILURE(AcpiGetObjectInfo(handle, &adinfo))) { snprintf(buf, buflen, "unknown"); return (0); } @@ -908,6 +904,15 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t return (0); } +static int +acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, + size_t buflen) +{ + struct acpi_device *dinfo = device_get_ivars(child); + + return (acpi_pnpinfo_str(dinfo->ad_handle, buf, buflen)); +} + /* * Handle device deletion. */ @@ -1840,7 +1845,7 @@ acpi_device_scan_children(device_t bus, device_t dev, * Even though ACPI devices are not PCI, we use the PCI approach for setting * device power states since it's close enough to ACPI. */ -static int +int acpi_set_powerstate(device_t child, int state) { ACPI_HANDLE h; @@ -2285,7 +2290,7 @@ acpi_BatteryIsPresent(device_t dev) /* * Returns true if a device has at least one valid device ID. */ -static BOOLEAN +BOOLEAN acpi_has_hid(ACPI_HANDLE h) { ACPI_DEVICE_INFO *devinfo; Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Mon Mar 9 20:27:25 2020 (r358818) +++ head/sys/dev/acpica/acpivar.h Mon Mar 9 20:28:45 2020 (r358819) @@ -371,6 +371,7 @@ int acpi_bus_alloc_gas(device_t dev, int *type, int * u_int flags); void acpi_walk_subtables(void *first, void *end, acpi_subtable_handler *handler, void *arg); +BOOLEAN acpi_has_hid(ACPI_HANDLE handle); int acpi_MatchHid(ACPI_HANDLE h, const char *hid); #define ACPI_MATCHHID_NOMATCH 0 #define ACPI_MATCHHID_HID 1 @@ -434,6 +435,7 @@ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state); int acpi_device_pwr_for_sleep(device_t bus, device_t dev, int *dstate); +int acpi_set_powerstate(device_t child, int state); /* APM emulation */ void acpi_apm_init(struct acpi_softc *); @@ -468,6 +470,7 @@ int acpi_wakeup_machdep(struct acpi_softc *sc, int st int sleep_result, int intr_enabled); int acpi_table_quirks(int *quirks); int acpi_machdep_quirks(int *quirks); +int acpi_pnpinfo_str(ACPI_HANDLE handle, char *buf, size_t buflen); uint32_t hpet_get_uid(device_t dev);