diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2012-07-25 18:07:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-08-06 14:56:35 -0400 |
commit | 0f941777c696e43e773b713a0078599aa22b3551 (patch) | |
tree | 123225ebd7ace0d74d9c2d26eacba64cd9417e25 /drivers/net/wireless/b43/phy_common.c | |
parent | 6e6a2cd510351502064c3e2a56f411a19530cd57 (diff) |
b43: add helper waiting for given value in radio reg
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/phy_common.c')
-rw-r--r-- | drivers/net/wireless/b43/phy_common.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c index f627cef33227..f01676ac481b 100644 --- a/drivers/net/wireless/b43/phy_common.c +++ b/drivers/net/wireless/b43/phy_common.c | |||
@@ -240,6 +240,21 @@ void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set) | |||
240 | (b43_radio_read16(dev, offset) & mask) | set); | 240 | (b43_radio_read16(dev, offset) & mask) | set); |
241 | } | 241 | } |
242 | 242 | ||
243 | bool b43_radio_wait_value(struct b43_wldev *dev, u16 offset, u16 mask, | ||
244 | u16 value, int delay, int timeout) | ||
245 | { | ||
246 | u16 val; | ||
247 | int i; | ||
248 | |||
249 | for (i = 0; i < timeout; i += delay) { | ||
250 | val = b43_radio_read(dev, offset); | ||
251 | if ((val & mask) == value) | ||
252 | return true; | ||
253 | udelay(delay); | ||
254 | } | ||
255 | return false; | ||
256 | } | ||
257 | |||
243 | u16 b43_phy_read(struct b43_wldev *dev, u16 reg) | 258 | u16 b43_phy_read(struct b43_wldev *dev, u16 reg) |
244 | { | 259 | { |
245 | assert_mac_suspended(dev); | 260 | assert_mac_suspended(dev); |