Author: wmb Date: Tue Oct 4 02:05:46 2011 New Revision: 2572 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2572
Log: OLPC XO-1.75 - WLAN and LED selftest - reduced the overhead of the association test part of the WLAN selftest, and eliminated the console scanning messages that occur during the WLAN LED selftest.
Modified: cpu/arm/olpc/1.75/leds.fth dev/libertas.fth ofw/wifi/eapol.fth
Modified: cpu/arm/olpc/1.75/leds.fth ============================================================================== --- cpu/arm/olpc/1.75/leds.fth Mon Oct 3 23:36:09 2011 (r2571) +++ cpu/arm/olpc/1.75/leds.fth Tue Oct 4 02:05:46 2011 (r2572) @@ -19,7 +19,7 @@ ols-led-ec-control ols-assy-mode-on
- " /wlan" test-dev " /wlan" test-dev \ Twice for longer flashing + " /wlan:quiet" test-dev " /wlan:quiet" test-dev \ Twice for longer flashing
d# 20 0 do hdd-led-on d# 100 ms hdd-led-off d# 100 ms loop ols-assy-mode-off
Modified: dev/libertas.fth ============================================================================== --- dev/libertas.fth Mon Oct 3 23:36:09 2011 (r2571) +++ dev/libertas.fth Tue Oct 4 02:05:46 2011 (r2572) @@ -1865,11 +1865,14 @@ \ Normal operation should have force-open? be false. false instance value force-open? +false instance value quiet? + : parse-args ( $ -- ) false to use-promiscuous? begin ?dup while ascii , left-parse-string 2dup " debug" $= if debug-on then + 2dup " quiet" $= if true to quiet? then \ Used by LED selftest 2dup " promiscuous" $= if true to use-promiscuous? then " force" $= if true to force-open? then repeat drop @@ -2088,9 +2091,8 @@
: reset ( -- flag ) reset-nic ;
-: test-association ( -- error? ) - passive-scan - " OLPCOFW" " scan-ssid?" $call-supplicant if +: test-association ( adr len -- error? ) + " OLPCOFW" " select-ssid?" $call-supplicant if " (do-associate)" $call-supplicant if \ Success " target-mac$" $call-supplicant disassociate @@ -2103,7 +2105,6 @@ \ There is no OLPCOFW access point, so we don't try associating false then - active-scan ;
: (scan-wifi) ( -- error? ) @@ -2123,9 +2124,15 @@ ." ERROR: No access points seen" cr true then - else ( adr len ) - drop .ssids ( ) - test-association ( error? ) + else ( adr len ) + \ Quiet mode is for the benefit of the LEDs test, so we can flash + \ the WLAN LEDS without distracting messages appearing on the screen + quiet? if ( adr len ) + 2drop false ( error? ) + else + over .ssids ( adr len ) + test-association ( error? ) + then ( error? ) then then
Modified: ofw/wifi/eapol.fth ============================================================================== --- ofw/wifi/eapol.fth Mon Oct 3 23:36:09 2011 (r2571) +++ ofw/wifi/eapol.fth Tue Oct 4 02:05:46 2011 (r2572) @@ -581,7 +581,7 @@ swap /string ( adr' len' ) ( R: ie-type ) r> (find-ie) ( adr' len' true | false ) ; -: find-ssid ( ssid$ adr -- adr' true | false ) +: find-ssid ( ssid$ scanbuf-adr -- ap-adr' true | false ) false swap ( ssid$ flag adr ) dup 3 + ( ssid$ flag 'ap ) swap 2 + c@ ( ssid$ flag 'ap #ap ) @@ -725,7 +725,7 @@ kt-wep of wep-ok? endof ( default ) pmk-ok? swap endcase - dup if ." found" else ." Keys in wifi-cfg are not valid" then cr + dup 0= if ." Keys in wifi-cfg are not valid - " then ;
h# 0050.f201 constant wpa-tag @@ -777,19 +777,36 @@ valid? 0= or ;
+: (select-ssid?) ( ssid$ -- found? ) + scanbuf find-ssid 0= if false exit then ( ap-adr ) + init-common-rates ( ap-adr ) + ssid-valid? 0= if false exit then ( ) + true valid! ( ) + report-associate-info ( ) + true ( found? ) +; +: select-ssid? ( volatile-scanbuf-adr,len ssid$ -- found? ) + ssid! ( volatile-scanbuf$ ) + dup /buf > if ( volatile-scanbuf$ ) + ." Scan buffer too long" cr ( volatile-scanbuf$ ) + 2drop false exit ( -- found? ) + then ( volatile-scanbuf$ ) + scanbuf swap move ( ) + ssid$ (select-ssid?) ( found? ) +; + : scan-ssid? ( ssid$ -- found? ) - dup 0= if 2drop false exit then - ssid! - ssid$ " set-ssid" $call-parent - ??cr ." Scan for: " ssid$ type space - scanbuf /buf scan 0= if ." not found" cr false exit then - debug? if scanbuf .scan then - ssid$ scanbuf find-ssid 0= if ." not found" cr false exit then - init-common-rates - ssid-valid? 0= if exit then - true valid! - report-associate-info - true + dup 0= if 2drop false exit then ( ssid$ ) + ssid! ( ) + ssid$ " set-ssid" $call-parent ( ) + ??cr ." Scan for: " ssid$ type space ( ) + scanbuf /buf scan if ( ) + debug? if scanbuf .scan then ( ) + ssid$ (select-ssid?) ( found? ) + dup if ." found" else ." failed" then cr + else ( ) + ." not found" cr false ( found? ) + then ( found? ) ; : try-scan ( -- okay? ) wifi-ssid$ scan-ssid? if true exit then