[B43LEGACY]: Change the hardware radio enable logic and cleanup code

This change cleans up the radio-related messages in several ways.

(1) The state of the rfkill switch is assumed to be on, rather than
    tested. Now, any user without such a switch will not see any
    messages. For devices with such a switch, a message will be
    logged only if the initial state is off, or if the switch is toggled.
(2) The routine for testing the switch state is no longer inline.
(3) The LED handling routine is simplified.
(4) The "Radio turned off" message that has confused some users has been
    changed to "Radio initialized".

This patch is patterned after a similar change to b43 by Michael Buesch.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Larry Finger
2007-09-20 20:10:07 -05:00
committed by David S. Miller
parent 42a9174f54
commit 1065de1562
4 changed files with 25 additions and 34 deletions

View File

@@ -97,26 +97,6 @@ int b43legacy_is_ofdm_rate(int rate)
return !b43legacy_is_cck_rate(rate);
}
static inline
int b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev)
{
/* function to return state of hardware enable of radio
* returns 0 if radio disabled, 1 if radio enabled
*/
struct b43legacy_phy *phy = &dev->phy;
if (phy->rev >= 3)
return ((b43legacy_read32(dev,
B43legacy_MMIO_RADIO_HWENABLED_HI)
& B43legacy_MMIO_RADIO_HWENABLED_HI_MASK)
== 0) ? 1 : 0;
else
return ((b43legacy_read16(dev,
B43legacy_MMIO_RADIO_HWENABLED_LO)
& B43legacy_MMIO_RADIO_HWENABLED_LO_MASK)
== 0) ? 0 : 1;
}
void b43legacy_tsf_read(struct b43legacy_wldev *dev, u64 *tsf);
void b43legacy_tsf_write(struct b43legacy_wldev *dev, u64 tsf);