mac80211: add brcmfmac driver
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 840-b43-backport.patch
1 --- a/drivers/net/wireless/b43/bus.c
2 +++ b/drivers/net/wireless/b43/bus.c
3 @@ -107,11 +107,9 @@ struct b43_bus_dev *b43_bus_dev_bcma_ini
4 dev->dma_dev = core->dma_dev;
5 dev->irq = core->irq;
6
7 - /*
8 dev->board_vendor = core->bus->boardinfo.vendor;
9 dev->board_type = core->bus->boardinfo.type;
10 - dev->board_rev = core->bus->boardinfo.rev;
11 - */
12 + dev->board_rev = core->bus->sprom.board_rev;
13
14 dev->chip_id = core->bus->chipinfo.id;
15 dev->chip_rev = core->bus->chipinfo.rev;
16 @@ -210,7 +208,7 @@ struct b43_bus_dev *b43_bus_dev_ssb_init
17
18 dev->board_vendor = sdev->bus->boardinfo.vendor;
19 dev->board_type = sdev->bus->boardinfo.type;
20 - dev->board_rev = sdev->bus->boardinfo.rev;
21 + dev->board_rev = sdev->bus->sprom.board_rev;
22
23 dev->chip_id = sdev->bus->chip_id;
24 dev->chip_rev = sdev->bus->chip_rev;
25 --- a/drivers/net/wireless/b43/dma.c
26 +++ b/drivers/net/wireless/b43/dma.c
27 @@ -1109,7 +1109,7 @@ static bool b43_dma_translation_in_low_w
28 #ifdef CONFIG_B43_SSB
29 if (dev->dev->bus_type == B43_BUS_SSB &&
30 dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI &&
31 - !(dev->dev->sdev->bus->host_pci->is_pcie &&
32 + !(pci_is_pcie(dev->dev->sdev->bus->host_pci) &&
33 ssb_read32(dev->dev->sdev, SSB_TMSHIGH) & SSB_TMSHIGH_DMA64))
34 return 1;
35 #endif
36 --- a/drivers/net/wireless/b43/main.c
37 +++ b/drivers/net/wireless/b43/main.c
38 @@ -4834,8 +4834,14 @@ static int b43_op_start(struct ieee80211
39 out_mutex_unlock:
40 mutex_unlock(&wl->mutex);
41
42 - /* reload configuration */
43 - b43_op_config(hw, ~0);
44 + /*
45 + * Configuration may have been overwritten during initialization.
46 + * Reload the configuration, but only if initialization was
47 + * successful. Reloading the configuration after a failed init
48 + * may hang the system.
49 + */
50 + if (!err)
51 + b43_op_config(hw, ~0);
52
53 return err;
54 }
55 @@ -5279,10 +5285,10 @@ static void b43_sprom_fixup(struct ssb_b
56
57 /* boardflags workarounds */
58 if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL &&
59 - bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74)
60 + bus->chip_id == 0x4301 && bus->sprom.board_rev == 0x74)
61 bus->sprom.boardflags_lo |= B43_BFL_BTCOEXIST;
62 if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
63 - bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40)
64 + bus->boardinfo.type == 0x4E && bus->sprom.board_rev > 0x40)
65 bus->sprom.boardflags_lo |= B43_BFL_PACTRL;
66 if (bus->bustype == SSB_BUSTYPE_PCI) {
67 pdev = bus->host_pci;
68 --- a/drivers/net/wireless/b43/sdio.c
69 +++ b/drivers/net/wireless/b43/sdio.c
70 @@ -193,7 +193,7 @@ static struct sdio_driver b43_sdio_drive
71 .name = "b43-sdio",
72 .id_table = b43_sdio_ids,
73 .probe = b43_sdio_probe,
74 - .remove = b43_sdio_remove,
75 + .remove = __devexit_p(b43_sdio_remove),
76 };
77
78 int b43_sdio_init(void)
79 --- a/drivers/net/wireless/b43legacy/main.c
80 +++ b/drivers/net/wireless/b43legacy/main.c
81 @@ -1550,8 +1550,6 @@ static void b43legacy_request_firmware(s
82 const char *filename;
83 int err;
84
85 - /* do dummy read */
86 - ssb_read32(dev->dev, SSB_TMSHIGH);
87 if (!fw->ucode) {
88 if (rev == 2)
89 filename = "ucode2";
90 @@ -3758,7 +3756,7 @@ static void b43legacy_sprom_fixup(struct
91 /* boardflags workarounds */
92 if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
93 bus->boardinfo.type == 0x4E &&
94 - bus->boardinfo.rev > 0x40)
95 + bus->sprom.board_rev > 0x40)
96 bus->sprom.boardflags_lo |= B43legacy_BFL_PACTRL;
97 }
98
99 --- a/drivers/net/wireless/b43legacy/phy.c
100 +++ b/drivers/net/wireless/b43legacy/phy.c
101 @@ -408,7 +408,7 @@ static void b43legacy_phy_setupg(struct
102
103 if (is_bcm_board_vendor(dev) &&
104 (dev->dev->bus->boardinfo.type == 0x0416) &&
105 - (dev->dev->bus->boardinfo.rev == 0x0017))
106 + (dev->dev->bus->sprom.board_rev == 0x0017))
107 return;
108
109 b43legacy_ilt_write(dev, 0x5001, 0x0002);
110 @@ -424,7 +424,7 @@ static void b43legacy_phy_setupg(struct
111
112 if (is_bcm_board_vendor(dev) &&
113 (dev->dev->bus->boardinfo.type == 0x0416) &&
114 - (dev->dev->bus->boardinfo.rev == 0x0017))
115 + (dev->dev->bus->sprom.board_rev == 0x0017))
116 return;
117
118 b43legacy_ilt_write(dev, 0x0401, 0x0002);
119 --- a/drivers/net/wireless/b43legacy/radio.c
120 +++ b/drivers/net/wireless/b43legacy/radio.c
121 @@ -1998,7 +1998,7 @@ u16 b43legacy_default_radio_attenuation(
122 if (phy->type == B43legacy_PHYTYPE_G) {
123 if (is_bcm_board_vendor(dev) &&
124 dev->dev->bus->boardinfo.type == 0x421 &&
125 - dev->dev->bus->boardinfo.rev >= 30)
126 + dev->dev->bus->sprom.board_rev >= 30)
127 att = 3;
128 else if (is_bcm_board_vendor(dev) &&
129 dev->dev->bus->boardinfo.type == 0x416)
130 @@ -2008,7 +2008,7 @@ u16 b43legacy_default_radio_attenuation(
131 } else {
132 if (is_bcm_board_vendor(dev) &&
133 dev->dev->bus->boardinfo.type == 0x421 &&
134 - dev->dev->bus->boardinfo.rev >= 30)
135 + dev->dev->bus->sprom.board_rev >= 30)
136 att = 7;
137 else
138 att = 6;
139 @@ -2018,7 +2018,7 @@ u16 b43legacy_default_radio_attenuation(
140 if (phy->type == B43legacy_PHYTYPE_G) {
141 if (is_bcm_board_vendor(dev) &&
142 dev->dev->bus->boardinfo.type == 0x421 &&
143 - dev->dev->bus->boardinfo.rev >= 30)
144 + dev->dev->bus->sprom.board_rev >= 30)
145 att = 3;
146 else if (is_bcm_board_vendor(dev) &&
147 dev->dev->bus->boardinfo.type ==
148 @@ -2052,9 +2052,9 @@ u16 b43legacy_default_radio_attenuation(
149 }
150 if (is_bcm_board_vendor(dev) &&
151 dev->dev->bus->boardinfo.type == 0x421) {
152 - if (dev->dev->bus->boardinfo.rev < 0x43)
153 + if (dev->dev->bus->sprom.board_rev < 0x43)
154 att = 2;
155 - else if (dev->dev->bus->boardinfo.rev < 0x51)
156 + else if (dev->dev->bus->sprom.board_rev < 0x51)
157 att = 3;
158 }
159 if (att == 0xFFFF)