diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-03-23 15:57:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-30 14:15:19 -0400 |
commit | 845e03c93dda2c00ffb5c68a1f7c8efc412d7c1a (patch) | |
tree | 9c48d7b82ef167d9346ef1a3689f636a471c14f2 /drivers/net/wireless/ath/ath9k/htc_drv_init.c | |
parent | f9f84e96f6d642aa7b337c22cbb7d6f936039fda (diff) |
ath9k_hw: add a new register op for read-mask-write
Reduces the number of calls to register ops. On MIPS this reduces the
ath9k_hw binary size from 321k down to 310k
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_init.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 4e26946f7ab2..ca69e7ccfd80 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -430,6 +430,17 @@ static void ath9k_regwrite_flush(void *hw_priv) | |||
430 | mutex_unlock(&priv->wmi->multi_write_mutex); | 430 | mutex_unlock(&priv->wmi->multi_write_mutex); |
431 | } | 431 | } |
432 | 432 | ||
433 | static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) | ||
434 | { | ||
435 | u32 val; | ||
436 | |||
437 | val = ath9k_regread(hw_priv, reg_offset); | ||
438 | val &= ~clr; | ||
439 | val |= set; | ||
440 | ath9k_regwrite(hw_priv, val, reg_offset); | ||
441 | return val; | ||
442 | } | ||
443 | |||
433 | static void ath_usb_read_cachesize(struct ath_common *common, int *csz) | 444 | static void ath_usb_read_cachesize(struct ath_common *common, int *csz) |
434 | { | 445 | { |
435 | *csz = L1_CACHE_BYTES >> 2; | 446 | *csz = L1_CACHE_BYTES >> 2; |
@@ -655,6 +666,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, | |||
655 | ah->reg_ops.write = ath9k_regwrite; | 666 | ah->reg_ops.write = ath9k_regwrite; |
656 | ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; | 667 | ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; |
657 | ah->reg_ops.write_flush = ath9k_regwrite_flush; | 668 | ah->reg_ops.write_flush = ath9k_regwrite_flush; |
669 | ah->reg_ops.rmw = ath9k_reg_rmw; | ||
658 | priv->ah = ah; | 670 | priv->ah = ah; |
659 | 671 | ||
660 | common = ath9k_hw_common(ah); | 672 | common = ath9k_hw_common(ah); |