aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-14 10:53:42 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-03-14 10:53:42 +0000
commit705d7a8aa438a21daa646e1dc8c5d0a45295de0c (patch)
treefc4abc713ed39e07d94d500e5f7d44cbc985f43e /package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
parent9b1e65073a8b1a571c390a1041bfe7fcd07d97ba (diff)
downloadupstream-705d7a8aa438a21daa646e1dc8c5d0a45295de0c.tar.gz
upstream-705d7a8aa438a21daa646e1dc8c5d0a45295de0c.tar.bz2
upstream-705d7a8aa438a21daa646e1dc8c5d0a45295de0c.zip
AA: mac80211: backport package from trunk r39886
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@39928 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch')
-rw-r--r--package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch125
1 files changed, 117 insertions, 8 deletions
diff --git a/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch b/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
index e55d4fe4aa..e76758ca63 100644
--- a/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
+++ b/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
@@ -19,7 +19,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
-@@ -1061,6 +1061,32 @@ static inline bool b43_using_pio_transfe
+@@ -1061,6 +1061,31 @@ static inline bool b43_using_pio_transfe
return dev->__using_pio_transfers;
}
@@ -34,8 +34,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+{
+ if (b43_bus_host_is_pci(dev->dev) &&
+ bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA &&
-+ (bcm47xx_bus.bcma.bus.chipinfo.id == 0x4716 ||
-+ bcm47xx_bus.bcma.bus.chipinfo.id == 0x5300)) {
++ bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4716) {
+ b43_write16(dev, offset, value);
+ b43_read16(dev, offset);
+ } else {
@@ -62,7 +61,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+{
+ if (dev->bus_type == B43_BUS_SSB)
+ return (dev->sdev->bus->bustype == SSB_BUSTYPE_PCI);
-+#ifdef CONFIG_B43_BCMA
++#ifdef CPTCFG_B43_BCMA
+ if (dev->bus_type == B43_BUS_BCMA)
+ return (dev->bdev->bus->hosttype == BCMA_HOSTTYPE_PCI);
+#endif
@@ -71,6 +70,30 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core);
struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev);
+--- a/drivers/net/wireless/b43/main.c
++++ b/drivers/net/wireless/b43/main.c
+@@ -4437,7 +4437,7 @@ static int b43_phy_versioning(struct b43
+ u16 radio24[3];
+
+ for (tmp = 0; tmp < 3; tmp++) {
+- b43_write16(dev, B43_MMIO_RADIO24_CONTROL, tmp);
++ b43_wflush16(dev, B43_MMIO_RADIO24_CONTROL, tmp);
+ radio24[tmp] = b43_read16(dev, B43_MMIO_RADIO24_DATA);
+ }
+
+@@ -4456,10 +4456,10 @@ static int b43_phy_versioning(struct b43
+ else
+ tmp = 0x5205017F;
+ } else {
+- b43_write16(dev, B43_MMIO_RADIO_CONTROL,
++ b43_wflush16(dev, B43_MMIO_RADIO_CONTROL,
+ B43_RADIOCTL_ID);
+ tmp = b43_read16(dev, B43_MMIO_RADIO_DATA_LOW);
+- b43_write16(dev, B43_MMIO_RADIO_CONTROL,
++ b43_wflush16(dev, B43_MMIO_RADIO_CONTROL,
+ B43_RADIOCTL_ID);
+ tmp |= (u32)b43_read16(dev, B43_MMIO_RADIO_DATA_HIGH)
+ << 16;
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -266,6 +266,12 @@ void b43_phy_write(struct b43_wldev *dev
@@ -86,9 +109,95 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
if (++dev->phy.writes_counter == B43_MAX_WRITES_IN_ROW) {
b43_read16(dev, B43_MMIO_PHY_VER);
dev->phy.writes_counter = 0;
+--- a/drivers/net/wireless/b43/phy_ht.c
++++ b/drivers/net/wireless/b43/phy_ht.c
+@@ -1073,20 +1073,20 @@ static unsigned int b43_phy_ht_op_get_de
+
+ static u16 b43_phy_ht_op_read(struct b43_wldev *dev, u16 reg)
+ {
+- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
+ return b43_read16(dev, B43_MMIO_PHY_DATA);
+ }
+
+ static void b43_phy_ht_op_write(struct b43_wldev *dev, u16 reg, u16 value)
+ {
+- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
+ b43_write16(dev, B43_MMIO_PHY_DATA, value);
+ }
+
+ static void b43_phy_ht_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask,
+ u16 set)
+ {
+- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
+ b43_write16(dev, B43_MMIO_PHY_DATA,
+ (b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set);
+ }
+@@ -1096,14 +1096,14 @@ static u16 b43_phy_ht_op_radio_read(stru
+ /* HT-PHY needs 0x200 for read access */
+ reg |= 0x200;
+
+- b43_write16(dev, B43_MMIO_RADIO24_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_RADIO24_CONTROL, reg);
+ return b43_read16(dev, B43_MMIO_RADIO24_DATA);
+ }
+
+ static void b43_phy_ht_op_radio_write(struct b43_wldev *dev, u16 reg,
+ u16 value)
+ {
+- b43_write16(dev, B43_MMIO_RADIO24_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_RADIO24_CONTROL, reg);
+ b43_write16(dev, B43_MMIO_RADIO24_DATA, value);
+ }
+
+--- a/drivers/net/wireless/b43/phy_lcn.c
++++ b/drivers/net/wireless/b43/phy_lcn.c
+@@ -845,20 +845,20 @@ static void b43_phy_lcn_op_adjust_txpowe
+
+ static u16 b43_phy_lcn_op_read(struct b43_wldev *dev, u16 reg)
+ {
+- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
+ return b43_read16(dev, B43_MMIO_PHY_DATA);
+ }
+
+ static void b43_phy_lcn_op_write(struct b43_wldev *dev, u16 reg, u16 value)
+ {
+- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
+ b43_write16(dev, B43_MMIO_PHY_DATA, value);
+ }
+
+ static void b43_phy_lcn_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask,
+ u16 set)
+ {
+- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
+ b43_write16(dev, B43_MMIO_PHY_DATA,
+ (b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set);
+ }
+@@ -868,14 +868,14 @@ static u16 b43_phy_lcn_op_radio_read(str
+ /* LCN-PHY needs 0x200 for read access */
+ reg |= 0x200;
+
+- b43_write16(dev, B43_MMIO_RADIO24_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_RADIO24_CONTROL, reg);
+ return b43_read16(dev, B43_MMIO_RADIO24_DATA);
+ }
+
+ static void b43_phy_lcn_op_radio_write(struct b43_wldev *dev, u16 reg,
+ u16 value)
+ {
+- b43_write16(dev, B43_MMIO_RADIO24_CONTROL, reg);
++ b43_wflush16(dev, B43_MMIO_RADIO24_CONTROL, reg);
+ b43_write16(dev, B43_MMIO_RADIO24_DATA, value);
+ }
+
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
-@@ -5417,14 +5417,14 @@ static inline void check_phyreg(struct b
+@@ -5418,14 +5418,14 @@ static inline void check_phyreg(struct b
static u16 b43_nphy_op_read(struct b43_wldev *dev, u16 reg)
{
check_phyreg(dev, reg);
@@ -105,7 +214,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
b43_write16(dev, B43_MMIO_PHY_DATA, value);
}
-@@ -5432,7 +5432,7 @@ static void b43_nphy_op_maskset(struct b
+@@ -5433,7 +5433,7 @@ static void b43_nphy_op_maskset(struct b
u16 set)
{
check_phyreg(dev, reg);
@@ -114,7 +223,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
b43_maskset16(dev, B43_MMIO_PHY_DATA, mask, set);
}
-@@ -5443,7 +5443,7 @@ static u16 b43_nphy_op_radio_read(struct
+@@ -5444,7 +5444,7 @@ static u16 b43_nphy_op_radio_read(struct
/* N-PHY needs 0x100 for read access */
reg |= 0x100;
@@ -123,7 +232,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
return b43_read16(dev, B43_MMIO_RADIO_DATA_LOW);
}
-@@ -5452,7 +5452,7 @@ static void b43_nphy_op_radio_write(stru
+@@ -5453,7 +5453,7 @@ static void b43_nphy_op_radio_write(stru
/* Register 1 is a 32-bit register. */
B43_WARN_ON(reg == 1);