--- driver/modules/hostap_pci.c.orig 2004-02-09 20:54:07.000000000 +0100 +++ driver/modules/hostap_pci.c 2004-08-09 17:18:49.591216712 +0200 @@ -49,6 +49,13 @@ }; +#define DEFERRED_IRQ_INITIALIZATION + +#ifdef DEFERRED_IRQ_INITIALIZATION +struct net_device *devb[MAX_PARM_DEVICES]; +#endif + + #ifdef PRISM2_IO_DEBUG static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v) @@ -277,6 +284,10 @@ pci_set_drvdata(pdev, dev); +#ifdef DEFERRED_IRQ_INITIALIZATION + printk("%s: deferred initialization of IRQs\n", dev_info); + devb[cards_found-1] = dev; +#else if (request_irq(dev->irq, prism2_interrupt, SA_SHIRQ, dev->name, dev)) { printk(KERN_WARNING "%s: request_irq failed\n", dev->name); @@ -292,7 +303,7 @@ printk(KERN_INFO "%s: Intersil Prism2.5 PCI: " "mem=0x%lx, irq=%d\n", dev->name, phymem, dev->irq); - +#endif return hostap_hw_ready(dev); fail: @@ -390,17 +401,43 @@ }; +#ifdef DEFERRED_IRQ_INITIALIZATION +static void deferred_init(int num_devices) +{ + int n; + for (n=0; nirq, prism2_interrupt, SA_SHIRQ, devb[n]->name, + devb[n])) { + printk(KERN_WARNING "%s: request_irq failed\n", devb[n]->name); + } + + if (prism2_hw_config(devb[n], 1)) { + printk(KERN_DEBUG "%s: hardware initialization failed\n", devb[n]->name); + } + + printk(KERN_INFO "%s: Intersil Prism2.5 PCI: irq=%d\n", devb[n]->name, devb[n]->irq); + } +} +#endif + + static int __init init_prism2_pci(void) { printk(KERN_INFO "%s: %s\n", dev_info, version); - if (pci_register_driver(&prism2_pci_drv_id) <= 0) { + int n; + if ((n=pci_register_driver(&prism2_pci_drv_id)) <= 0) { printk("hostap_pci: No devices found, driver not " "installed.\n"); pci_unregister_driver(&prism2_pci_drv_id); return -ENODEV; } +#ifdef DEFERRED_IRQ_INITIALIZATION + deferred_init(n); +#endif + return 0; }