openssl: replace full recipe for 0.9.8 with a stripped-down libssl0.9.8 recipe contai...
[opendreambox.git] / meta-opendreambox / recipes-connectivity / madwifi / madwifi-ng / dm8000-nand-error-hack.patch
1 diff -Naur madwifi-ng-r3314-20080131.org/ath/if_ath_pci.c madwifi-ng-r3314-20080131/ath/if_ath_pci.c
2 --- madwifi-ng-r3314-20080131.org/ath/if_ath_pci.c      2013-03-21 14:27:45.536248136 +0100
3 +++ madwifi-ng-r3314-20080131/ath/if_ath_pci.c  2013-03-21 14:32:18.352245147 +0100
4 @@ -153,6 +153,11 @@
5         [0] = 2UL \
6  } }
7  
8 +#ifdef CONFIG_DREAMBOX_DM8000
9 +extern int g_pci_ebi_fastpath;
10 +extern struct mutex g_pci_ebi_lock;
11 +#endif
12 +
13  static int
14  ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
15  {
16 @@ -165,10 +170,16 @@
17         u32 val;
18         u16 vdevice;
19         int i;
20 +       int ret = -ENODEV;
21 +
22 +#ifdef CONFIG_DREAMBOX_DM8000
23 +       mutex_lock(&g_pci_ebi_lock);
24 +#endif
25  
26         if (pci_enable_device(pdev)) {
27                 printk(KERN_ERR "%s: failed to enable PCI device\n", dev_info);
28 -               return -EIO;
29 +               ret = -EIO;
30 +               goto error_out;
31         }
32  
33         /* XXX 32-bit addressing only */
34 @@ -285,6 +296,11 @@
35         }
36  #endif
37  
38 +#ifdef CONFIG_DREAMBOX_DM8000
39 +       mutex_unlock(&g_pci_ebi_lock);
40 +       g_pci_ebi_fastpath = 1;
41 +#endif
42 +
43         if ((i = ath_attach(vdevice, dev, NULL)) != 0) {
44                 printk(KERN_ERR "%s: ath_attach failed: %d\n", dev_info, i);
45                 goto bad4;
46 @@ -319,7 +335,16 @@
47         release_mem_region(phymem, pci_resource_len(pdev, 0));
48  bad:
49         pci_disable_device(pdev);
50 -       return (-ENODEV);
51 +
52 +error_out:
53 +#ifdef CONFIG_DREAMBOX_DM8000
54 +       if (!g_pci_ebi_fastpath) {
55 +               mutex_unlock(&g_pci_ebi_lock);
56 +               g_pci_ebi_fastpath = 1;
57 +       }
58 +#endif
59 +
60 +       return ret;
61  }
62  
63  static void
64 @@ -451,9 +476,16 @@
65  static void __exit
66  exit_ath_pci(void)
67  {
68 +#ifdef CONFIG_DREAMBOX_DM8000
69 +       mutex_lock(&g_pci_ebi_lock);
70 +#endif
71         ath_sysctl_unregister();
72         pci_unregister_driver(&ath_pci_driver);
73  
74 +#ifdef CONFIG_DREAMBOX_DM8000
75 +       mutex_unlock(&g_pci_ebi_lock);
76 +       g_pci_ebi_fastpath = 0;
77 +#endif
78         printk(KERN_INFO "%s: driver unloaded\n", dev_info);
79  }
80  module_exit(exit_ath_pci);