acpi_acad.c (83173) | acpi_acad.c (85556) |
---|---|
1/*- 2 * Copyright (c) 2000 Takanori Watanabe 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2000 Takanori Watanabe 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/acpica/acpi_acad.c 83173 2001-09-06 23:33:22Z msmith $ | 26 * $FreeBSD: head/sys/dev/acpica/acpi_acad.c 85556 2001-10-26 17:43:05Z iwasaki $ |
27 */ 28 29#include "opt_acpi.h" 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/bus.h> 33 34#include <machine/bus.h> --- 167 unchanged lines hidden (view full) --- 202 return(0); 203} 204 205static int 206acpi_acad_sysctl(SYSCTL_HANDLER_ARGS) 207{ 208 int val; 209 int error; | 27 */ 28 29#include "opt_acpi.h" 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/bus.h> 33 34#include <machine/bus.h> --- 167 unchanged lines hidden (view full) --- 202 return(0); 203} 204 205static int 206acpi_acad_sysctl(SYSCTL_HANDLER_ARGS) 207{ 208 int val; 209 int error; |
210 device_t dev; | 210 211 if (acpi_acad_get_acline(&val)) { 212 return (ENXIO); 213 } 214 215 val = *(u_int *)oidp->oid_arg1; 216 error = sysctl_handle_int(oidp, &val, 0, req); 217 return (error); 218} 219 220/* 221 * Public interfaces. 222 */ 223 224int 225acpi_acad_get_acline(int *status) 226{ 227 device_t dev; |
211 struct acpi_acad_softc *sc; 212 213 if ((dev = devclass_get_device(acpi_acad_devclass, 0)) == NULL) { 214 return (ENXIO); 215 } | 228 struct acpi_acad_softc *sc; 229 230 if ((dev = devclass_get_device(acpi_acad_devclass, 0)) == NULL) { 231 return (ENXIO); 232 } |
233 |
|
216 if ((sc = device_get_softc(dev)) == NULL) { 217 return (ENXIO); 218 } | 234 if ((sc = device_get_softc(dev)) == NULL) { 235 return (ENXIO); 236 } |
237 |
|
219 acpi_acad_get_status(dev); | 238 acpi_acad_get_status(dev); |
220 val = *(u_int *)oidp->oid_arg1; 221 error = sysctl_handle_int(oidp, &val, 0, req); 222 return (error); | 239 *status = sc->status; 240 241 return (0); |
223} 224 | 242} 243 |