summaryrefslogtreecommitdiff
path: root/recipes/hostap/hostap-modules/mtx_hostap_deferred_irq.diff
blob: e979b72d93dc6899a52f09ca39820db082b571a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--- driver/modules/hostap_pci.c.orig	2004-11-30 06:41:48.000000000 +0100
+++ driver/modules/hostap_pci.c	2005-01-17 19:47:33.710400496 +0100
@@ -50,6 +50,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)
@@ -280,6 +287,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);
@@ -295,7 +306,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:
@@ -399,18 +410,43 @@
 };
 
 
+#ifdef DEFERRED_IRQ_INITIALIZATION
+static void deferred_init(int num_devices)
+{
+      int n;
+      for (n=0; n<num_devices && n<MAX_PARM_DEVICES; n++)
+      {
+              if (request_irq(devb[n]->irq, 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 (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
-	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;
 #else
 	return pci_register_driver(&prism2_pci_drv_id);