Skip to content

Commit

Permalink
wifi.c: update for mr1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Daz Jones committed Feb 15, 2013
1 parent c4b7301 commit e6dbd2f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libhardware_legacy/wifi/wifi.c
Expand Up @@ -920,11 +920,19 @@ int wifi_start_supplicant(int p2p_supported)
return -1;
}

int wifi_stop_supplicant()
int wifi_stop_supplicant(int p2p_supported)
{
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
int count = 50; /* wait at most 5 seconds for completion */

if (p2p_supported) {
strcpy(supplicant_name, P2P_SUPPLICANT_NAME);
strcpy(supplicant_prop_name, P2P_PROP_NAME);
} else {
strcpy(supplicant_name, SUPPLICANT_NAME);
strcpy(supplicant_prop_name, SUPP_PROP_NAME);
}

/* Check whether supplicant already stopped */
if (property_get(supplicant_prop_name, supp_status, NULL)
&& strcmp(supp_status, "stopped") == 0) {
Expand All @@ -941,6 +949,7 @@ int wifi_stop_supplicant()
}
usleep(100000);
}
ALOGE("Failed to stop supplicant");
return -1;
}

Expand Down

0 comments on commit e6dbd2f

Please sign in to comment.