diff options
author | jhb <jhb@FreeBSD.org> | 2007-05-16 23:40:08 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-05-16 23:40:08 +0000 |
commit | 69b332354e66fde4a92590f07764005892e1897f (patch) | |
tree | 658f371e758d5e909a24f53e146a693066d3edd3 /sys/dev/cardbus | |
parent | 0dfe831a4ec243f8d06721735a55ac5b3f667a3b (diff) | |
download | FreeBSD-src-69b332354e66fde4a92590f07764005892e1897f.zip FreeBSD-src-69b332354e66fde4a92590f07764005892e1897f.tar.gz |
Fix interrupt routing for some cards after the previous fix to clear BARs
in cardbus cards: update the saved copy of the PCIR_INTLINE register in
the PCI ivars in addition to the actual register.
Reviewed by: imp
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 7c02796..cb85837 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -75,7 +75,7 @@ static int cardbus_attach(device_t cbdev); static int cardbus_attach_card(device_t cbdev); static int cardbus_detach(device_t cbdev); static int cardbus_detach_card(device_t cbdev); -static void cardbus_device_setup_regs(device_t dev); +static void cardbus_device_setup_regs(pcicfgregs *cfg); static void cardbus_driver_added(device_t cbdev, driver_t *driver); static int cardbus_probe(device_t cbdev); static int cardbus_read_ivar(device_t cbdev, device_t child, int which, @@ -136,8 +136,9 @@ cardbus_resume(device_t self) /************************************************************************/ static void -cardbus_device_setup_regs(device_t dev) +cardbus_device_setup_regs(pcicfgregs *cfg) { + device_t dev = cfg->dev; int i; /* @@ -147,9 +148,9 @@ cardbus_device_setup_regs(device_t dev) for (i = 0; i < PCI_MAX_BAR_0; i++) pci_write_config(dev, PCIR_BAR(i), 0, 4); - /* XXXimp is getting the interrpt like this right? */ - pci_write_config(dev, PCIR_INTLINE, - pci_get_irq(device_get_parent(device_get_parent(dev))), 1); + cfg->intline = + pci_get_irq(device_get_parent(device_get_parent(dev))); + pci_write_config(dev, PCIR_INTLINE, cfg->intline, 1); pci_write_config(dev, PCIR_CACHELNSZ, 0x08, 1); pci_write_config(dev, PCIR_LATTIMER, 0xa8, 1); pci_write_config(dev, PCIR_MINGNT, 0x14, 1); @@ -194,7 +195,7 @@ cardbus_attach_card(device_t cbdev) DEVPRINTF((cbdev, "Warning: Bogus CIS ignored\n")); pci_cfg_save(dinfo->pci.cfg.dev, &dinfo->pci, 0); pci_cfg_restore(dinfo->pci.cfg.dev, &dinfo->pci); - cardbus_device_setup_regs(dinfo->pci.cfg.dev); + cardbus_device_setup_regs(&dinfo->pci.cfg); pci_add_resources(cbdev, child, 1, dinfo->mprefetchable); pci_print_verbose(&dinfo->pci); if (device_probe_and_attach(child) == 0) |