From 1065de1562b1552a24f83e379bcb5fed351a8bc4 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 20 Sep 2007 20:10:07 -0500 Subject: [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 Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- drivers/net/wireless/b43legacy/leds.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'drivers/net/wireless/b43legacy/leds.c') diff --git a/drivers/net/wireless/b43legacy/leds.c b/drivers/net/wireless/b43legacy/leds.c index 498912ddeddb..a584ea810502 100644 --- a/drivers/net/wireless/b43legacy/leds.c +++ b/drivers/net/wireless/b43legacy/leds.c @@ -182,6 +182,7 @@ void b43legacy_leds_update(struct b43legacy_wldev *dev, int activity) unsigned long interval = 0; u16 ledctl; unsigned long flags; + bool radio_enabled = (phy->radio_on && dev->radio_hw_enable); spin_lock_irqsave(&dev->wl->leds_lock, flags); ledctl = b43legacy_read16(dev, B43legacy_MMIO_GPIO_CONTROL); @@ -201,20 +202,15 @@ void b43legacy_leds_update(struct b43legacy_wldev *dev, int activity) turn_on = activity; break; case B43legacy_LED_RADIO_ALL: - turn_on = phy->radio_on && - b43legacy_is_hw_radio_enabled(dev); + turn_on = radio_enabled; break; case B43legacy_LED_RADIO_A: break; case B43legacy_LED_RADIO_B: - turn_on = (phy->radio_on && - b43legacy_is_hw_radio_enabled(dev) && - (phy->type == B43legacy_PHYTYPE_B || - phy->type == B43legacy_PHYTYPE_G)); + turn_on = radio_enabled; break; case B43legacy_LED_MODE_BG: - if (phy->type == B43legacy_PHYTYPE_G && - b43legacy_is_hw_radio_enabled(dev)) + if (phy->type == B43legacy_PHYTYPE_G && radio_enabled) turn_on = 1; break; case B43legacy_LED_TRANSFER: -- cgit v1.2.2