diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/init.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index b855fe1adc39..ac5107172f94 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -197,6 +197,19 @@ static unsigned int ath9k_ioread32(void *hw_priv, u32 reg_offset) | |||
197 | return val; | 197 | return val; |
198 | } | 198 | } |
199 | 199 | ||
200 | static unsigned int __ath9k_reg_rmw(struct ath_softc *sc, u32 reg_offset, | ||
201 | u32 set, u32 clr) | ||
202 | { | ||
203 | u32 val; | ||
204 | |||
205 | val = ioread32(sc->mem + reg_offset); | ||
206 | val &= ~clr; | ||
207 | val |= set; | ||
208 | iowrite32(val, sc->mem + reg_offset); | ||
209 | |||
210 | return val; | ||
211 | } | ||
212 | |||
200 | static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) | 213 | static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) |
201 | { | 214 | { |
202 | struct ath_hw *ah = (struct ath_hw *) hw_priv; | 215 | struct ath_hw *ah = (struct ath_hw *) hw_priv; |
@@ -205,16 +218,12 @@ static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 cl | |||
205 | unsigned long uninitialized_var(flags); | 218 | unsigned long uninitialized_var(flags); |
206 | u32 val; | 219 | u32 val; |
207 | 220 | ||
208 | if (ah->config.serialize_regmode == SER_REG_MODE_ON) | 221 | if (ah->config.serialize_regmode == SER_REG_MODE_ON) { |
209 | spin_lock_irqsave(&sc->sc_serial_rw, flags); | 222 | spin_lock_irqsave(&sc->sc_serial_rw, flags); |
210 | 223 | val = __ath9k_reg_rmw(sc, reg_offset, set, clr); | |
211 | val = ioread32(sc->mem + reg_offset); | ||
212 | val &= ~clr; | ||
213 | val |= set; | ||
214 | iowrite32(val, sc->mem + reg_offset); | ||
215 | |||
216 | if (ah->config.serialize_regmode == SER_REG_MODE_ON) | ||
217 | spin_unlock_irqrestore(&sc->sc_serial_rw, flags); | 224 | spin_unlock_irqrestore(&sc->sc_serial_rw, flags); |
225 | } else | ||
226 | val = __ath9k_reg_rmw(sc, reg_offset, set, clr); | ||
218 | 227 | ||
219 | return val; | 228 | return val; |
220 | } | 229 | } |