diff options
author | Jonathan Bither <jonbither@gmail.com> | 2012-02-13 21:47:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-22 14:51:19 -0500 |
commit | cede8b64808f543fb5ed4991af330a0ae6026805 (patch) | |
tree | 15598fd4d4b08629d1d3764f600d8d11d0656301 /drivers/net/wireless/ath/ath5k | |
parent | 8860020e0be1f03d83dc9e9e93e18a4ddbe01038 (diff) |
ath5k:Remove __raw_read and __raw_write
By swithing from our __raw_read and __raw_write functions to ioread32 and iowrite32,
benchmarks on my desk with iperf went from 11MBps to 18.1MBps using the AHB bus
on an EnGenius ECB3500 running OpenWRT.
Signed-off-by: Jonathan Bither <jonbither@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ahb.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reset.c | 10 |
3 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c index ee7ea572b06..8faa129da5a 100644 --- a/drivers/net/wireless/ath/ath5k/ahb.c +++ b/drivers/net/wireless/ath/ath5k/ahb.c | |||
@@ -140,23 +140,23 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
140 | 140 | ||
141 | if (bcfg->devid >= AR5K_SREV_AR2315_R6) { | 141 | if (bcfg->devid >= AR5K_SREV_AR2315_R6) { |
142 | /* Enable WMAC AHB arbitration */ | 142 | /* Enable WMAC AHB arbitration */ |
143 | reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | 143 | reg = ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); |
144 | reg |= AR5K_AR2315_AHB_ARB_CTL_WLAN; | 144 | reg |= AR5K_AR2315_AHB_ARB_CTL_WLAN; |
145 | __raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | 145 | iowrite32(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); |
146 | 146 | ||
147 | /* Enable global WMAC swapping */ | 147 | /* Enable global WMAC swapping */ |
148 | reg = __raw_readl((void __iomem *) AR5K_AR2315_BYTESWAP); | 148 | reg = ioread32((void __iomem *) AR5K_AR2315_BYTESWAP); |
149 | reg |= AR5K_AR2315_BYTESWAP_WMAC; | 149 | reg |= AR5K_AR2315_BYTESWAP_WMAC; |
150 | __raw_writel(reg, (void __iomem *) AR5K_AR2315_BYTESWAP); | 150 | iowrite32(reg, (void __iomem *) AR5K_AR2315_BYTESWAP); |
151 | } else { | 151 | } else { |
152 | /* Enable WMAC DMA access (assuming 5312 or 231x*/ | 152 | /* Enable WMAC DMA access (assuming 5312 or 231x*/ |
153 | /* TODO: check other platforms */ | 153 | /* TODO: check other platforms */ |
154 | reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE); | 154 | reg = ioread32((void __iomem *) AR5K_AR5312_ENABLE); |
155 | if (to_platform_device(ah->dev)->id == 0) | 155 | if (to_platform_device(ah->dev)->id == 0) |
156 | reg |= AR5K_AR5312_ENABLE_WLAN0; | 156 | reg |= AR5K_AR5312_ENABLE_WLAN0; |
157 | else | 157 | else |
158 | reg |= AR5K_AR5312_ENABLE_WLAN1; | 158 | reg |= AR5K_AR5312_ENABLE_WLAN1; |
159 | __raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE); | 159 | iowrite32(reg, (void __iomem *) AR5K_AR5312_ENABLE); |
160 | 160 | ||
161 | /* | 161 | /* |
162 | * On a dual-band AR5312, the multiband radio is only | 162 | * On a dual-band AR5312, the multiband radio is only |
@@ -203,17 +203,17 @@ static int ath_ahb_remove(struct platform_device *pdev) | |||
203 | 203 | ||
204 | if (bcfg->devid >= AR5K_SREV_AR2315_R6) { | 204 | if (bcfg->devid >= AR5K_SREV_AR2315_R6) { |
205 | /* Disable WMAC AHB arbitration */ | 205 | /* Disable WMAC AHB arbitration */ |
206 | reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | 206 | reg = ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); |
207 | reg &= ~AR5K_AR2315_AHB_ARB_CTL_WLAN; | 207 | reg &= ~AR5K_AR2315_AHB_ARB_CTL_WLAN; |
208 | __raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | 208 | iowrite32(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); |
209 | } else { | 209 | } else { |
210 | /*Stop DMA access */ | 210 | /*Stop DMA access */ |
211 | reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE); | 211 | reg = ioread32((void __iomem *) AR5K_AR5312_ENABLE); |
212 | if (to_platform_device(ah->dev)->id == 0) | 212 | if (to_platform_device(ah->dev)->id == 0) |
213 | reg &= ~AR5K_AR5312_ENABLE_WLAN0; | 213 | reg &= ~AR5K_AR5312_ENABLE_WLAN0; |
214 | else | 214 | else |
215 | reg &= ~AR5K_AR5312_ENABLE_WLAN1; | 215 | reg &= ~AR5K_AR5312_ENABLE_WLAN1; |
216 | __raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE); | 216 | iowrite32(reg, (void __iomem *) AR5K_AR5312_ENABLE); |
217 | } | 217 | } |
218 | 218 | ||
219 | ath5k_deinit_ah(ah); | 219 | ath5k_deinit_ah(ah); |
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index c2b2518c2ec..6640326f700 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -1656,12 +1656,12 @@ static inline void __iomem *ath5k_ahb_reg(struct ath5k_hw *ah, u16 reg) | |||
1656 | 1656 | ||
1657 | static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg) | 1657 | static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg) |
1658 | { | 1658 | { |
1659 | return __raw_readl(ath5k_ahb_reg(ah, reg)); | 1659 | return ioread32(ath5k_ahb_reg(ah, reg)); |
1660 | } | 1660 | } |
1661 | 1661 | ||
1662 | static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg) | 1662 | static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg) |
1663 | { | 1663 | { |
1664 | __raw_writel(val, ath5k_ahb_reg(ah, reg)); | 1664 | iowrite32(val, ath5k_ahb_reg(ah, reg)); |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | #else | 1667 | #else |
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index 250db40b751..200f165c0c6 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -473,14 +473,14 @@ ath5k_hw_wisoc_reset(struct ath5k_hw *ah, u32 flags) | |||
473 | } | 473 | } |
474 | 474 | ||
475 | /* Put BB/MAC into reset */ | 475 | /* Put BB/MAC into reset */ |
476 | regval = __raw_readl(reg); | 476 | regval = ioread32(reg); |
477 | __raw_writel(regval | val, reg); | 477 | iowrite32(regval | val, reg); |
478 | regval = __raw_readl(reg); | 478 | regval = ioread32(reg); |
479 | usleep_range(100, 150); | 479 | usleep_range(100, 150); |
480 | 480 | ||
481 | /* Bring BB/MAC out of reset */ | 481 | /* Bring BB/MAC out of reset */ |
482 | __raw_writel(regval & ~val, reg); | 482 | iowrite32(regval & ~val, reg); |
483 | regval = __raw_readl(reg); | 483 | regval = ioread32(reg); |
484 | 484 | ||
485 | /* | 485 | /* |
486 | * Reset configuration register (for hw byte-swap). Note that this | 486 | * Reset configuration register (for hw byte-swap). Note that this |