diff options
-rw-r--r-- | wifi/Android.mk | 9 | ||||
-rw-r--r-- | wifi/wifi.c | 23 |
2 files changed, 31 insertions, 1 deletions
diff --git a/wifi/Android.mk b/wifi/Android.mk index c06a39c..7fa595c 100644 --- a/wifi/Android.mk +++ b/wifi/Android.mk @@ -27,6 +27,15 @@ endif ifdef WIFI_DRIVER_FW_PATH_PARAM LOCAL_CFLAGS += -DWIFI_DRIVER_FW_PATH_PARAM=\"$(WIFI_DRIVER_FW_PATH_PARAM)\" endif +ifdef WIFI_EXT_MODULE_PATH +LOCAL_CFLAGS += -DWIFI_EXT_MODULE_PATH=\"$(WIFI_EXT_MODULE_PATH)\" +endif +ifdef WIFI_EXT_MODULE_ARG +LOCAL_CFLAGS += -DWIFI_EXT_MODULE_ARG=\"$(WIFI_EXT_MODULE_ARG)\" +endif +ifdef WIFI_EXT_MODULE_NAME +LOCAL_CFLAGS += -DWIFI_EXT_MODULE_NAME=\"$(WIFI_EXT_MODULE_NAME)\" +endif ifdef WIFI_DRIVER_STATE_CTRL_PARAM LOCAL_CFLAGS += -DWIFI_DRIVER_STATE_CTRL_PARAM=\"$(WIFI_DRIVER_STATE_CTRL_PARAM)\" diff --git a/wifi/wifi.c b/wifi/wifi.c index fcacfe5..14adf38 100644 --- a/wifi/wifi.c +++ b/wifi/wifi.c @@ -115,6 +115,18 @@ struct genl_family *nl80211; #define WIFI_DRIVER_FW_PATH_P2P NULL #endif +#ifdef WIFI_EXT_MODULE_NAME +static const char EXT_MODULE_NAME[] = WIFI_EXT_MODULE_NAME; +#ifdef WIFI_EXT_MODULE_ARG +static const char EXT_MODULE_ARG[] = WIFI_EXT_MODULE_ARG; +#else +static const char EXT_MODULE_ARG[] = ""; +#endif +#endif +#ifdef WIFI_EXT_MODULE_PATH +static const char EXT_MODULE_PATH[] = WIFI_EXT_MODULE_PATH; +#endif + #ifndef WIFI_DRIVER_FW_PATH_PARAM #define WIFI_DRIVER_FW_PATH_PARAM "/sys/module/wlan/parameters/fwpath" #endif @@ -309,7 +321,6 @@ int wifi_load_driver() char driver_status[PROPERTY_VALUE_MAX]; int count = 100; /* wait at most 20 seconds for completion */ char module_arg2[256]; - #ifdef SAMSUNG_WIFI char* type = get_samsung_wifi_type(); @@ -321,6 +332,13 @@ int wifi_load_driver() if (insmod(DRIVER_MODULE_PATH, module_arg2) < 0) { #else + +#ifdef WIFI_EXT_MODULE_PATH + if (insmod(EXT_MODULE_PATH, EXT_MODULE_ARG) < 0) + return -1; + usleep(200000); +#endif + if (insmod(DRIVER_MODULE_PATH, DRIVER_MODULE_ARG) < 0) { #endif @@ -382,6 +400,9 @@ int wifi_unload_driver() } usleep(500000); /* allow card removal */ if (count) { +#ifdef WIFI_EXT_MODULE_NAME + if (rmmod(EXT_MODULE_NAME) == 0) +#endif return 0; } return -1; |