ath5k:Remove __raw_read and __raw_write
authorJonathan Bither <jonbither@gmail.com>
Tue, 14 Feb 2012 02:47:45 +0000 (21:47 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Feb 2012 19:51:19 +0000 (14:51 -0500)
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>
drivers/net/wireless/ath/ath5k/ahb.c
drivers/net/wireless/ath/ath5k/ath5k.h
drivers/net/wireless/ath/ath5k/reset.c

index ee7ea572b065753c3271c184bb84c65bcf2908e2..8faa129da5a00b60c74dd255ae1692effb3d329d 100644 (file)
@@ -140,23 +140,23 @@ static int ath_ahb_probe(struct platform_device *pdev)
 
        if (bcfg->devid >= AR5K_SREV_AR2315_R6) {
                /* Enable WMAC AHB arbitration */
-               reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
+               reg = ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
                reg |= AR5K_AR2315_AHB_ARB_CTL_WLAN;
-               __raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
+               iowrite32(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
 
                /* Enable global WMAC swapping */
-               reg = __raw_readl((void __iomem *) AR5K_AR2315_BYTESWAP);
+               reg = ioread32((void __iomem *) AR5K_AR2315_BYTESWAP);
                reg |= AR5K_AR2315_BYTESWAP_WMAC;
-               __raw_writel(reg, (void __iomem *) AR5K_AR2315_BYTESWAP);
+               iowrite32(reg, (void __iomem *) AR5K_AR2315_BYTESWAP);
        } else {
                /* Enable WMAC DMA access (assuming 5312 or 231x*/
                /* TODO: check other platforms */
-               reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE);
+               reg = ioread32((void __iomem *) AR5K_AR5312_ENABLE);
                if (to_platform_device(ah->dev)->id == 0)
                        reg |= AR5K_AR5312_ENABLE_WLAN0;
                else
                        reg |= AR5K_AR5312_ENABLE_WLAN1;
-               __raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE);
+               iowrite32(reg, (void __iomem *) AR5K_AR5312_ENABLE);
 
                /*
                 * On a dual-band AR5312, the multiband radio is only
@@ -203,17 +203,17 @@ static int ath_ahb_remove(struct platform_device *pdev)
 
        if (bcfg->devid >= AR5K_SREV_AR2315_R6) {
                /* Disable WMAC AHB arbitration */
-               reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
+               reg = ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
                reg &= ~AR5K_AR2315_AHB_ARB_CTL_WLAN;
-               __raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
+               iowrite32(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
        } else {
                /*Stop DMA access */
-               reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE);
+               reg = ioread32((void __iomem *) AR5K_AR5312_ENABLE);
                if (to_platform_device(ah->dev)->id == 0)
                        reg &= ~AR5K_AR5312_ENABLE_WLAN0;
                else
                        reg &= ~AR5K_AR5312_ENABLE_WLAN1;
-               __raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE);
+               iowrite32(reg, (void __iomem *) AR5K_AR5312_ENABLE);
        }
 
        ath5k_deinit_ah(ah);
index c2b2518c2ecd30732c900ab3490d01765b0c35b9..6640326f70056d1af8074eb90699316d20d156e8 100644 (file)
@@ -1656,12 +1656,12 @@ static inline void __iomem *ath5k_ahb_reg(struct ath5k_hw *ah, u16 reg)
 
 static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
 {
-       return __raw_readl(ath5k_ahb_reg(ah, reg));
+       return ioread32(ath5k_ahb_reg(ah, reg));
 }
 
 static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
 {
-       __raw_writel(val, ath5k_ahb_reg(ah, reg));
+       iowrite32(val, ath5k_ahb_reg(ah, reg));
 }
 
 #else
index 250db40b751d1780b0c7937cb53c6de016973bdd..200f165c0c6d9c4a508ece1da7a2fd996b9df094 100644 (file)
@@ -473,14 +473,14 @@ ath5k_hw_wisoc_reset(struct ath5k_hw *ah, u32 flags)
        }
 
        /* Put BB/MAC into reset */
-       regval = __raw_readl(reg);
-       __raw_writel(regval | val, reg);
-       regval = __raw_readl(reg);
+       regval = ioread32(reg);
+       iowrite32(regval | val, reg);
+       regval = ioread32(reg);
        usleep_range(100, 150);
 
        /* Bring BB/MAC out of reset */
-       __raw_writel(regval & ~val, reg);
-       regval = __raw_readl(reg);
+       iowrite32(regval & ~val, reg);
+       regval = ioread32(reg);
 
        /*
         * Reset configuration register (for hw byte-swap). Note that this