diff options
author | Pavel Roskin <proski@gnu.org> | 2010-02-18 20:28:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-09 15:02:55 -0500 |
commit | ec182d976345b5eb671fe879ad73b90fe29a34e9 (patch) | |
tree | 0a2fdacabd6f428dfbda52ac79cd7bb2a7b17245 /drivers/net/wireless/ath/ath5k/ath5k.h | |
parent | a25d1e4cd7799570ecea6b5dcc4dbf5a6d5336bf (diff) |
ath5k: move ath5k_hw_register_timeout() into reset.c
ath5k_hw_register_timeout() was duplicated between phy.c and reset.c.
Since it is too big and too much used to be an inline function, move it
away from the ath5k.h header into reset.c. Remove _ATH5K_RESET and
_ATH5K_PHY defines.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/ath5k.h')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index f4e50ef84067..4de7fe03b9fc 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -1172,6 +1172,8 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial); | |||
1172 | int ath5k_hw_on_hold(struct ath5k_hw *ah); | 1172 | int ath5k_hw_on_hold(struct ath5k_hw *ah); |
1173 | int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | 1173 | int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, |
1174 | struct ieee80211_channel *channel, bool change_channel); | 1174 | struct ieee80211_channel *channel, bool change_channel); |
1175 | int ath5k_hw_register_timeout(struct ath5k_hw *ah, u32 reg, u32 flag, u32 val, | ||
1176 | bool is_set); | ||
1175 | /* Power management functions */ | 1177 | /* Power management functions */ |
1176 | 1178 | ||
1177 | /* DMA Related Functions */ | 1179 | /* DMA Related Functions */ |
@@ -1328,29 +1330,6 @@ static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg) | |||
1328 | iowrite32(val, ah->ah_iobase + reg); | 1330 | iowrite32(val, ah->ah_iobase + reg); |
1329 | } | 1331 | } |
1330 | 1332 | ||
1331 | #if defined(_ATH5K_RESET) || defined(_ATH5K_PHY) | ||
1332 | /* | ||
1333 | * Check if a register write has been completed | ||
1334 | */ | ||
1335 | static int ath5k_hw_register_timeout(struct ath5k_hw *ah, u32 reg, u32 flag, | ||
1336 | u32 val, bool is_set) | ||
1337 | { | ||
1338 | int i; | ||
1339 | u32 data; | ||
1340 | |||
1341 | for (i = AR5K_TUNE_REGISTER_TIMEOUT; i > 0; i--) { | ||
1342 | data = ath5k_hw_reg_read(ah, reg); | ||
1343 | if (is_set && (data & flag)) | ||
1344 | break; | ||
1345 | else if ((data & flag) == val) | ||
1346 | break; | ||
1347 | udelay(15); | ||
1348 | } | ||
1349 | |||
1350 | return (i <= 0) ? -EAGAIN : 0; | ||
1351 | } | ||
1352 | #endif | ||
1353 | |||
1354 | static inline u32 ath5k_hw_bitswap(u32 val, unsigned int bits) | 1333 | static inline u32 ath5k_hw_bitswap(u32 val, unsigned int bits) |
1355 | { | 1334 | { |
1356 | u32 retval = 0, bit, i; | 1335 | u32 retval = 0, bit, i; |