A little test code answered my own question.  I don't know if this is 
the best way to do it, but this patch fixes the problem.

Ehud

--- drivers/net/wireless/b43/rfkill.c.orig      2007-12-17 
22:39:31.000000000 -0700
+++ drivers/net/wireless/b43/rfkill.c   2007-12-17 22:39:54.000000000 -0700
@@ -68,6 +68,7 @@ static void b43_rfkill_poll(struct input
        /* send the radio switch event to the system - note both a key press
         * and a release are required */
        if (unlikely(report_change)) {
+               msleep(1);      /* sleep 400usec to allow slow hardware 
to enable the LED */
                input_report_key(poll_dev->input, KEY_WLAN, 1);
                input_report_key(poll_dev->input, KEY_WLAN, 0);
        }


Ehud Gavron wrote:
> We worked out the SPROM is the same... but here are some interesting twists.
>
> When switched off
> 1. The LED is switched off by hardware, not b43
> 2. B43 does send the event as expected but the LED is already off
>
> When switch on
> 1. The LED is not switched on by hardware
> 2. B43 does send the event as expected but the LED does not turn on
>
> When the code to pop the LED is triggered more often as in
> When I changed in rfkill.c
> if (unlikely(report_change)) {
>
> to
> if (!unlikely(report_change)) {
>
> Then the LED came on and off every two seconds or so until I set the 
> switch to OFF at which point the LED stayed off but the events kept 
> happening.  (I put debug messages before and after also spitting out 
> poll_dev->input to check its value for corruption.  It was all good).
>
> I can manually trigger the event (on or off) using setkeycodes, so I suspect
> a possible DELAY of the LED coming on after a B43 enable event... for 
> hardware that needs it... would fix it.
>
> Thoughts?
>
> Ehud
>
>
> Larry Finger wrote:
>   
>> Ehud,
>>
>> One possibility that I didn't think about before is that your LED mapping in 
>> the SPROM has some
>> quirk that is not handled properly. Please run the following two commands
>>
>> SSB_SPROM=$(find /sys -name ssb_sprom)
>> sudo cat $SSB_SPROM > sprom.txt
>>
>> and mail me the file sprom.txt that results.
>>
>> Thanks,
>>
>> Larry
>>   
>>     
> _______________________________________________
> Bcm43xx-dev mailing list
> Bcm43xx-dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
>   
_______________________________________________
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to