summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorR. Andrew Ohana <andrew.ohana@gmail.com>2012-05-05 03:17:02 -0700
committerR. Andrew Ohana <andrew.ohana@gmail.com>2012-12-17 19:38:53 -0800
commit5d93191d7227c3e891677871ad3d3bc6de544cbc (patch)
tree399db72807e1eb25a324809affd433a7f4ab0b1f
parentc813f1497eda7ac94cf50ba7376157513e5c0ba6 (diff)
downloadhardware_libhardware_legacy-5d93191d7227c3e891677871ad3d3bc6de544cbc.zip
hardware_libhardware_legacy-5d93191d7227c3e891677871ad3d3bc6de544cbc.tar.gz
hardware_libhardware_legacy-5d93191d7227c3e891677871ad3d3bc6de544cbc.tar.bz2
wifi.c: allow devices to specify driver delay
This is necessary on the Samsung smdk4210 tablets. Without the delay, it takes roughly 30 seconds to enable wifi. Change-Id: I6a3419e66958fc72ae60e5294f52124b1180d752
-rw-r--r--wifi/Android.mk3
-rw-r--r--wifi/wifi.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/wifi/Android.mk b/wifi/Android.mk
index d9225bd..387f9ce 100644
--- a/wifi/Android.mk
+++ b/wifi/Android.mk
@@ -15,6 +15,9 @@ endif
ifdef WIFI_FIRMWARE_LOADER
LOCAL_CFLAGS += -DWIFI_FIRMWARE_LOADER=\"$(WIFI_FIRMWARE_LOADER)\"
endif
+ifdef WIFI_DRIVER_LOADER_DELAY
+LOCAL_CFLAGS += -DWIFI_DRIVER_LOADER_DELAY=$(WIFI_DRIVER_LOADER_DELAY)
+endif
ifdef WIFI_DRIVER_FW_PATH_STA
LOCAL_CFLAGS += -DWIFI_DRIVER_FW_PATH_STA=\"$(WIFI_DRIVER_FW_PATH_STA)\"
endif
diff --git a/wifi/wifi.c b/wifi/wifi.c
index 68e51ca..1231a99 100644
--- a/wifi/wifi.c
+++ b/wifi/wifi.c
@@ -105,8 +105,6 @@ struct genl_family *nl80211;
#define WIFI_DRIVER_FW_PATH_PARAM "/sys/module/wlan/parameters/fwpath"
#endif
-#define WIFI_DRIVER_LOADER_DELAY 1000000
-
static const char IFACE_DIR[] = "/data/system/wpa_supplicant";
#ifdef WIFI_DRIVER_MODULE_PATH
static const char DRIVER_MODULE_NAME[] = WIFI_DRIVER_MODULE_NAME;
@@ -290,7 +288,9 @@ int wifi_load_driver()
}
if (strcmp(FIRMWARE_LOADER,"") == 0) {
- /* usleep(WIFI_DRIVER_LOADER_DELAY); */
+#ifdef WIFI_DRIVER_LOADER_DELAY
+ usleep(WIFI_DRIVER_LOADER_DELAY);
+#endif
property_set(DRIVER_PROP_NAME, "ok");
}
else {