acpibat.c revision 1.3
1/* $OpenBSD: acpibat.c,v 1.3 2005/12/16 04:16:59 marco Exp $ */ 2/* 3 * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18#include <sys/param.h> 19#include <sys/systm.h> 20#include <sys/device.h> 21#include <sys/malloc.h> 22 23#include <machine/bus.h> 24 25#include <dev/acpi/acpireg.h> 26#include <dev/acpi/acpivar.h> 27#include <dev/acpi/acpidev.h> 28 29int acpibat_match(struct device *, void *, void *); 30void acpibat_attach(struct device *, struct device *, void *); 31 32struct acpibat_softc { 33 struct device sc_dev; 34 35 bus_space_tag_t sc_iot; 36 bus_space_handle_t sc_ioh; 37}; 38 39struct cfattach acpibat_ca = { 40 sizeof(struct acpibat_softc), acpibat_match, acpibat_attach 41}; 42 43struct cfdriver acpibat_cd = { 44 NULL, "acpibat", DV_DULL 45}; 46 47int 48acpibat_match(struct device *parent, void *match, void *aux) 49{ 50 struct acpi_attach_args *aa = aux; 51 struct cfdata *cf = match; 52 53 /* sanity */ 54 if (aa->aaa_name == NULL || 55 strcmp(aa->aaa_name, cf->cf_driver->cd_name) != 0 || 56 aa->aaa_table != NULL) 57 return (0); 58 59 return (1); 60} 61 62void 63acpibat_attach(struct device *parent, struct device *self, void *aux) 64{ 65/* 66 struct acpibat_softc *sc = (struct acpibat_softc *) self; 67 struct acpi_softc *psc = (struct acpi_softc *) parent; 68 struct acpi_attach_args *aa = aux; 69 bus_addr_t address; 70 bus_size_t size; 71*/ 72 73 printf("\n"); 74} 75