[openfirmware] r1342 - dev
svn at openfirmware.info
svn at openfirmware.info
Thu Sep 3 07:11:27 CEST 2009
Author: wmb
Date: 2009-09-03 07:11:26 +0200 (Thu, 03 Sep 2009)
New Revision: 1342
Modified:
dev/libertas.fth
Log:
Libertas driver - eliminate or at least greatly reduce
"marvel-get-mac-address failed" messages by retrying
that command, and by not calling it after the mac address
is already known. Also deassociate on a force open, so
find-multinand-server works correctly after the driver
has already been opened once in normal association mode.
Modified: dev/libertas.fth
===================================================================
--- dev/libertas.fth 2009-09-02 23:40:15 UTC (rev 1341)
+++ dev/libertas.fth 2009-09-03 05:11:26 UTC (rev 1342)
@@ -580,12 +580,21 @@
\ MAC address
\ =========================================================================
-: marvel-get-mac-address ( -- )
+\ This command has an annoying tendency to fail to sometimes - wait-cmd-resp
+\ times out. Retrying usually fixes it.
+: (marvel-get-mac-address) ( -- error? )
8 h# 4d ( CMD_802_11_MAC_ADDRESS ) prepare-cmd
ACTION_GET +xw
- outbuf-wait if ." marvel-get-mac-address failed" cr exit then
+ outbuf-wait if true exit then
respbuf >fw-data 2 + mac-adr$ move
+ false
;
+: marvel-get-mac-address ( -- )
+ 4 0 do
+ (marvel-get-mac-address) 0= if unloop exit then
+ loop
+ ." marvel-get-mac-address failed" cr
+;
: marvel-set-mac-address ( -- )
8 h# 4d ( CMD_802_11_MAC_ADDRESS ) prepare-cmd
@@ -1516,6 +1525,7 @@
: ?make-mac-address-property ( -- )
driver-state ds-ready < if exit then
" mac-address" get-my-property if
+ marvel-get-mac-address
mac-adr$ encode-bytes " local-mac-address" property
mac-address encode-bytes " mac-address" property
else
@@ -1531,7 +1541,6 @@
;
: init-net ( -- )
- marvel-get-mac-address
?make-mac-address-property
;
@@ -1576,7 +1585,9 @@
my-args " supplicant" $open-package to supplicant-ih
supplicant-ih 0= if release-bus-resources free-buf false exit then
nonce-cmd
- force-open? 0= if
+ force-open? if
+ ds-disconnected reset-driver-state
+ else
link-up? 0= if
['] 2drop to ?process-eapol
do-associate 0= if free-buf false exit then
More information about the openfirmware
mailing list