From 5df15c81a631d3a4d42e693c761934d5b1e483df Mon Sep 17 00:00:00 2001 From: Vincent Chang Date: Mon, 12 Aug 2013 11:22:20 +0800 Subject: [PATCH] Bug 903859 - [WiFi] setWifiEnabled tries to configure the WiFi operation mode before any driver being loaded. r=mwu --- dom/wifi/WifiWorker.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dom/wifi/WifiWorker.js b/dom/wifi/WifiWorker.js index cd6c74a1970d..2f7fe5bf6a9f 100644 --- a/dom/wifi/WifiWorker.js +++ b/dom/wifi/WifiWorker.js @@ -1226,16 +1226,15 @@ var WifiManager = (function() { null); prepareForStartup(function() { - gNetworkManager.setWifiOperationMode(ifname, - WIFI_FIRMWARE_STATION, - function (status) { + loadDriver(function (status) { if (status) { callback(status); manager.state = "UNINITIALIZED"; return; } - - loadDriver(function (status) { + gNetworkManager.setWifiOperationMode(ifname, + WIFI_FIRMWARE_STATION, + function (status) { if (status < 0) { callback(status); manager.state = "UNINITIALIZED"; @@ -1264,7 +1263,7 @@ var WifiManager = (function() { // to return from loadDriver, so wait 2 seconds before starting // the supplicant to give it a chance to start. createWaitForDriverReadyTimer(doStartSupplicant); - }); + }); }); }); });