From 0475b5df81fd59f654b39c25ec6fe0d488f2ac4b Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 10 Jul 2018 17:11:43 +0000 Subject: Make legacy interrupts work in acpipci(4). ok patrick@ --- sys/dev/acpi/acpi.c | 17 ++++++++++++++++- sys/dev/acpi/acpivar.h | 4 +++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 62b33277e81..601bf9717dd 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.354 2018/07/05 19:25:38 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.355 2018/07/10 17:11:42 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -647,6 +647,21 @@ acpi_getpci(struct aml_node *node, void *arg) return (1); } +struct aml_node * +acpi_find_pci(pci_chipset_tag_t pc, pcitag_t tag) +{ + struct acpi_pci *pdev; + int bus, dev, fun; + + pci_decompose_tag(pc, tag, &bus, &dev, &fun); + TAILQ_FOREACH(pdev, &acpi_pcidevs, next) { + if (pdev->bus == bus && pdev->dev == dev && pdev->fun == fun) + return pdev->node; + } + + return NULL; +} + struct aml_node * acpi_pci_match(struct device *dev, struct pci_attach_args *pa) { diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h index 575b04d5986..23f9b5e9fcd 100644 --- a/sys/dev/acpi/acpivar.h +++ b/sys/dev/acpi/acpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivar.h,v 1.95 2018/07/04 20:46:22 kettenis Exp $ */ +/* $OpenBSD: acpivar.h,v 1.96 2018/07/10 17:11:42 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * @@ -388,6 +388,8 @@ int acpi_release_glk(uint32_t *); void acpi_pciroots_attach(struct device *, void *, cfprint_t); void acpi_attach_deps(struct acpi_softc *, struct aml_node *); +struct aml_node *acpi_find_pci(pci_chipset_tag_t, pcitag_t); + void *acpi_intr_establish(int, int, int, int (*)(void *), void *, const char *); -- cgit v1.2.3