[PATCH] bcm43xx: Interrogate hardware-enable switch and update LEDs
The current bcm43xx driver ignores any wireless-enable switches on mini-PCI and mini-PCI-E cards. This patch implements a new routine to interrogate the radio hardware enabled bit in the interface, logs the initial state and any changes in the switch (if debugging enabled), activates the LED to show the state, and changes the periodic work handler to provide 1 second response to switch changes and to account for changes in the periodic work specs. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
Jeff Garzik

parent
33218ba1d1
commit
0191738286
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "bcm43xx_leds.h"
|
||||
#include "bcm43xx_radio.h"
|
||||
#include "bcm43xx.h"
|
||||
|
||||
#include <asm/bitops.h>
|
||||
@@ -108,6 +109,7 @@ static void bcm43xx_led_init_hardcoded(struct bcm43xx_private *bcm,
|
||||
switch (led_index) {
|
||||
case 0:
|
||||
led->behaviour = BCM43xx_LED_ACTIVITY;
|
||||
led->activelow = 1;
|
||||
if (bcm->board_vendor == PCI_VENDOR_ID_COMPAQ)
|
||||
led->behaviour = BCM43xx_LED_RADIO_ALL;
|
||||
break;
|
||||
@@ -199,20 +201,21 @@ void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity)
|
||||
turn_on = activity;
|
||||
break;
|
||||
case BCM43xx_LED_RADIO_ALL:
|
||||
turn_on = radio->enabled;
|
||||
turn_on = radio->enabled && bcm43xx_is_hw_radio_enabled(bcm);
|
||||
break;
|
||||
case BCM43xx_LED_RADIO_A:
|
||||
case BCM43xx_LED_BCM4303_2:
|
||||
turn_on = (radio->enabled && phy->type == BCM43xx_PHYTYPE_A);
|
||||
turn_on = (radio->enabled && bcm43xx_is_hw_radio_enabled(bcm) &&
|
||||
phy->type == BCM43xx_PHYTYPE_A);
|
||||
break;
|
||||
case BCM43xx_LED_RADIO_B:
|
||||
case BCM43xx_LED_BCM4303_1:
|
||||
turn_on = (radio->enabled &&
|
||||
turn_on = (radio->enabled && bcm43xx_is_hw_radio_enabled(bcm) &&
|
||||
(phy->type == BCM43xx_PHYTYPE_B ||
|
||||
phy->type == BCM43xx_PHYTYPE_G));
|
||||
break;
|
||||
case BCM43xx_LED_MODE_BG:
|
||||
if (phy->type == BCM43xx_PHYTYPE_G &&
|
||||
if (phy->type == BCM43xx_PHYTYPE_G && bcm43xx_is_hw_radio_enabled(bcm) &&
|
||||
1/*FIXME: using G rates.*/)
|
||||
turn_on = 1;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user