mac80211: merge a number of upstream driver fixes/improvements
[openwrt.git] / package / kernel / mac80211 / patches / 045-bcma-from-4.1.patch
1 --- a/drivers/bcma/driver_pci.c
2 +++ b/drivers/bcma/driver_pci.c
3 @@ -282,39 +282,6 @@ void bcma_core_pci_power_save(struct bcm
4  }
5  EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
6  
7 -int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
8 -                         bool enable)
9 -{
10 -       struct pci_dev *pdev;
11 -       u32 coremask, tmp;
12 -       int err = 0;
13 -
14 -       if (bus->hosttype != BCMA_HOSTTYPE_PCI) {
15 -               /* This bcma device is not on a PCI host-bus. So the IRQs are
16 -                * not routed through the PCI core.
17 -                * So we must not enable routing through the PCI core. */
18 -               goto out;
19 -       }
20 -
21 -       pdev = bus->host_pci;
22 -
23 -       err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
24 -       if (err)
25 -               goto out;
26 -
27 -       coremask = BIT(core->core_index) << 8;
28 -       if (enable)
29 -               tmp |= coremask;
30 -       else
31 -               tmp &= ~coremask;
32 -
33 -       err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp);
34 -
35 -out:
36 -       return err;
37 -}
38 -EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl);
39 -
40  static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
41  {
42         u32 w;
43 --- a/drivers/bcma/host_pci.c
44 +++ b/drivers/bcma/host_pci.c
45 @@ -351,3 +351,37 @@ void bcma_host_pci_down(struct bcma_bus
46                 bcma_core_pci_down(&bus->drv_pci[0]);
47  }
48  EXPORT_SYMBOL_GPL(bcma_host_pci_down);
49 +
50 +/* See also si_pci_setup */
51 +int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
52 +                         bool enable)
53 +{
54 +       struct pci_dev *pdev;
55 +       u32 coremask, tmp;
56 +       int err = 0;
57 +
58 +       if (bus->hosttype != BCMA_HOSTTYPE_PCI) {
59 +               /* This bcma device is not on a PCI host-bus. So the IRQs are
60 +                * not routed through the PCI core.
61 +                * So we must not enable routing through the PCI core. */
62 +               goto out;
63 +       }
64 +
65 +       pdev = bus->host_pci;
66 +
67 +       err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
68 +       if (err)
69 +               goto out;
70 +
71 +       coremask = BIT(core->core_index) << 8;
72 +       if (enable)
73 +               tmp |= coremask;
74 +       else
75 +               tmp &= ~coremask;
76 +
77 +       err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp);
78 +
79 +out:
80 +       return err;
81 +}
82 +EXPORT_SYMBOL_GPL(bcma_host_pci_irq_ctl);
83 --- a/drivers/net/wireless/b43/main.c
84 +++ b/drivers/net/wireless/b43/main.c
85 @@ -4866,7 +4866,7 @@ static int b43_wireless_core_init(struct
86         switch (dev->dev->bus_type) {
87  #ifdef CPTCFG_B43_BCMA
88         case B43_BUS_BCMA:
89 -               bcma_core_pci_irq_ctl(dev->dev->bdev->bus,
90 +               bcma_host_pci_irq_ctl(dev->dev->bdev->bus,
91                                       dev->dev->bdev, true);
92                 bcma_host_pci_up(dev->dev->bdev->bus);
93                 break;
94 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
95 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
96 @@ -4959,7 +4959,7 @@ static int brcms_b_up_prep(struct brcms_
97          * Configure pci/pcmcia here instead of in brcms_c_attach()
98          * to allow mfg hotswap:  down, hotswap (chip power cycle), up.
99          */
100 -       bcma_core_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core,
101 +       bcma_host_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core,
102                               true);
103  
104         /*