int wifi_unload_driver();
/**
+ * Check if the Wi-Fi driver is loaded.
+ *
+ * @return 0 on success, < 0 on failure.
+ */
+int is_wifi_driver_loaded();
+
+
+/**
* Start supplicant.
*
* @return 0 on success, < 0 on failure.
return dhcp_lasterror();
}
-static int check_driver_loaded() {
+int is_wifi_driver_loaded() {
char driver_status[PROPERTY_VALUE_MAX];
FILE *proc;
char line[sizeof(DRIVER_MODULE_TAG)+10];
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for completion */
- if (check_driver_loaded()) {
+ if (is_wifi_driver_loaded()) {
return 0;
}
if (rmmod(DRIVER_MODULE_NAME) == 0) {
while (count-- > 0) {
- if (!check_driver_loaded())
+ if (!is_wifi_driver_loaded())
break;
usleep(500000);
}