Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193651
b: refs/heads/master
c: ec182d9
h: refs/heads/master
i:
  193649: dbc22f3
  193647: 05832bd
v: v3
  • Loading branch information
Pavel Roskin authored and John W. Linville committed Mar 9, 2010
1 parent d740466 commit fded3cf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a25d1e4cd7799570ecea6b5dcc4dbf5a6d5336bf
refs/heads/master: ec182d976345b5eb671fe879ad73b90fe29a34e9
25 changes: 2 additions & 23 deletions trunk/drivers/net/wireless/ath/ath5k/ath5k.h
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,8 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial);
int ath5k_hw_on_hold(struct ath5k_hw *ah);
int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
struct ieee80211_channel *channel, bool change_channel);
int ath5k_hw_register_timeout(struct ath5k_hw *ah, u32 reg, u32 flag, u32 val,
bool is_set);
/* Power management functions */

/* DMA Related Functions */
Expand Down Expand Up @@ -1328,29 +1330,6 @@ static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
iowrite32(val, ah->ah_iobase + reg);
}

#if defined(_ATH5K_RESET) || defined(_ATH5K_PHY)
/*
* Check if a register write has been completed
*/
static int ath5k_hw_register_timeout(struct ath5k_hw *ah, u32 reg, u32 flag,
u32 val, bool is_set)
{
int i;
u32 data;

for (i = AR5K_TUNE_REGISTER_TIMEOUT; i > 0; i--) {
data = ath5k_hw_reg_read(ah, reg);
if (is_set && (data & flag))
break;
else if ((data & flag) == val)
break;
udelay(15);
}

return (i <= 0) ? -EAGAIN : 0;
}
#endif

static inline u32 ath5k_hw_bitswap(u32 val, unsigned int bits)
{
u32 retval = 0, bit, i;
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/wireless/ath/ath5k/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*
*/

#define _ATH5K_PHY

#include <linux/delay.h>

#include "ath5k.h"
Expand Down Expand Up @@ -3144,5 +3142,3 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower)

return ath5k_hw_txpower(ah, channel, ee_mode, txpower);
}

#undef _ATH5K_PHY
25 changes: 21 additions & 4 deletions trunk/drivers/net/wireless/ath/ath5k/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*
*/

#define _ATH5K_RESET

/*****************************\
Reset functions and helpers
\*****************************/
Expand All @@ -34,6 +32,27 @@
#include "base.h"
#include "debug.h"

/*
* Check if a register write has been completed
*/
int ath5k_hw_register_timeout(struct ath5k_hw *ah, u32 reg, u32 flag, u32 val,
bool is_set)
{
int i;
u32 data;

for (i = AR5K_TUNE_REGISTER_TIMEOUT; i > 0; i--) {
data = ath5k_hw_reg_read(ah, reg);
if (is_set && (data & flag))
break;
else if ((data & flag) == val)
break;
udelay(15);
}

return (i <= 0) ? -EAGAIN : 0;
}

/**
* ath5k_hw_write_ofdm_timings - set OFDM timings on AR5212
*
Expand Down Expand Up @@ -1386,5 +1405,3 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,

return 0;
}

#undef _ATH5K_RESET

0 comments on commit fded3cf

Please sign in to comment.