acpi_pci_link.c (138233) | acpi_pci_link.c (138248) |
---|---|
1/*- 2 * Copyright (c) 2002 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_pci_link.c 138233 2004-11-30 17:48:10Z njl $"); | 28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_pci_link.c 138248 2004-12-01 04:34:08Z obrien $"); |
29 30#include "opt_acpi.h" 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/limits.h> 35#include <sys/malloc.h> 36#include <sys/module.h> --- 228 unchanged lines hidden (view full) --- 265} 266 267static void 268acpi_pci_link_dump(struct acpi_pci_link_softc *sc) 269{ 270 struct link *link; 271 int i, j; 272 | 29 30#include "opt_acpi.h" 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/limits.h> 35#include <sys/malloc.h> 36#include <sys/module.h> --- 228 unchanged lines hidden (view full) --- 265} 266 267static void 268acpi_pci_link_dump(struct acpi_pci_link_softc *sc) 269{ 270 struct link *link; 271 int i, j; 272 |
273#ifdef SMP 274 ACPI_SERIAL_ASSERT(pci_link); 275#endif |
|
273 printf("Index IRQ Rtd Ref IRQs\n"); 274 for (i = 0; i < sc->pl_num_links; i++) { 275 link = &sc->pl_links[i]; 276 printf("%5d %3d %c %3d ", i, link->l_irq, 277 link->l_routed ? 'Y' : 'N', link->l_references); 278 if (link->l_num_irqs == 0) 279 printf(" none"); 280 else for (j = 0; j < link->l_num_irqs; j++) --- 7 unchanged lines hidden (view full) --- 288{ 289 struct acpi_pci_link_softc *sc; 290 struct link_res_request req; 291 ACPI_STATUS status; 292 int i; 293 int prslinks; 294 295 sc = device_get_softc(dev); | 276 printf("Index IRQ Rtd Ref IRQs\n"); 277 for (i = 0; i < sc->pl_num_links; i++) { 278 link = &sc->pl_links[i]; 279 printf("%5d %3d %c %3d ", i, link->l_irq, 280 link->l_routed ? 'Y' : 'N', link->l_references); 281 if (link->l_num_irqs == 0) 282 printf(" none"); 283 else for (j = 0; j < link->l_num_irqs; j++) --- 7 unchanged lines hidden (view full) --- 291{ 292 struct acpi_pci_link_softc *sc; 293 struct link_res_request req; 294 ACPI_STATUS status; 295 int i; 296 int prslinks; 297 298 sc = device_get_softc(dev); |
299#ifdef SMP 300 ACPI_SERIAL_BEGIN(pci_link); 301#endif |
|
296 297 /* 298 * Count the number of current resources so we know how big of 299 * a link array to allocate. 300 */ 301 status = AcpiWalkResources(acpi_get_handle(dev), "_CRS", 302 acpi_count_irq_resources, &sc->pl_num_links); 303 if (ACPI_FAILURE(status)) --- 68 unchanged lines hidden (view full) --- 372 else 373 for (i = 0; i < sc->pl_num_links; i++) 374 if (PCI_INTERRUPT_VALID(sc->pl_links[i].l_irq)) 375 sc->pl_links[i].l_routed = 1; 376 if (bootverbose) { 377 device_printf(dev, "Links after disable:\n"); 378 acpi_pci_link_dump(sc); 379 } | 302 303 /* 304 * Count the number of current resources so we know how big of 305 * a link array to allocate. 306 */ 307 status = AcpiWalkResources(acpi_get_handle(dev), "_CRS", 308 acpi_count_irq_resources, &sc->pl_num_links); 309 if (ACPI_FAILURE(status)) --- 68 unchanged lines hidden (view full) --- 378 else 379 for (i = 0; i < sc->pl_num_links; i++) 380 if (PCI_INTERRUPT_VALID(sc->pl_links[i].l_irq)) 381 sc->pl_links[i].l_routed = 1; 382 if (bootverbose) { 383 device_printf(dev, "Links after disable:\n"); 384 acpi_pci_link_dump(sc); 385 } |
386#ifdef SMP 387 ACPI_SERIAL_END(pci_link); 388#endif |
|
380 return (0); 381 382fail: | 389 return (0); 390 391fail: |
392#ifdef SMP 393 ACPI_SERIAL_END(pci_link); 394#endif |
|
383 for (i = 0; i < sc->pl_num_links; i++) 384 if (sc->pl_links[i].l_irqs != NULL) 385 free(sc->pl_links[i].l_irqs, M_PCI_LINK); 386 free(sc->pl_links, M_PCI_LINK); 387 return (ENXIO); 388} 389 390 --- 392 unchanged lines hidden --- | 395 for (i = 0; i < sc->pl_num_links; i++) 396 if (sc->pl_links[i].l_irqs != NULL) 397 free(sc->pl_links[i].l_irqs, M_PCI_LINK); 398 free(sc->pl_links, M_PCI_LINK); 399 return (ENXIO); 400} 401 402 --- 392 unchanged lines hidden --- |