Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

am aea96d8: WEXT: Add "HANGED" processing

Merge commit 'aea96d8d72b9ced7f60b9de38e2e87e6a4a6125a' into eclair-mr2-plus-aosp

* commit 'aea96d8d72b9ced7f60b9de38e2e87e6a4a6125a':
  WEXT: Add "HANGED" processing
  • Loading branch information...
commit 0080c796226f35669a2b7ed0e58e4485323692ff 2 parents 78eb90b + aea96d8
Dmitry Shmidt authored Android Git Automerger committed
Showing with 17 additions and 3 deletions.
  1. +16 −3 driver_wext.c
  2. +1 −0  driver_wext.h
View
19 driver_wext.c
@@ -84,6 +84,7 @@ struct wpa_driver_wext_data {
char mlmedev[IFNAMSIZ + 1];
int scan_complete_events;
+ int errors;
};
@@ -1001,6 +1002,7 @@ void * wpa_driver_wext_init(void *ctx, const char *ifname)
drv->mlme_sock = -1;
+ drv->errors = 0;
wpa_driver_wext_finish_drv_init(drv);
return drv;
@@ -2542,11 +2544,15 @@ static int wpa_driver_priv_driver_cmd(void *priv, char *cmd, char *buf, size_t b
else if (os_strcasecmp(cmd, "STOP") == 0) {
if ((wpa_driver_wext_get_ifflags(drv, &flags) == 0) &&
(flags & IFF_UP)) {
- wpa_printf(MSG_ERROR, "WEXT: %s when iface is UP",
- cmd);
+ wpa_printf(MSG_ERROR, "WEXT: %s when iface is UP", cmd);
wpa_driver_wext_set_ifflags(drv, flags & ~IFF_UP);
}
}
+ else if( os_strcasecmp(cmd, "RELOAD") == 0 ) {
+ wpa_printf(MSG_DEBUG,"Reload command");
+ wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED");
+ return ret;
+ }
os_memset(&iwr, 0, sizeof(iwr));
os_strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
@@ -2558,9 +2564,16 @@ static int wpa_driver_priv_driver_cmd(void *priv, char *cmd, char *buf, size_t b
perror("ioctl[SIOCSIWPRIV]");
}
- if (ret < 0)
+ if (ret < 0) {
wpa_printf(MSG_ERROR, "%s failed", __func__);
+ drv->errors++;
+ if (drv->errors > WEXT_NUMBER_SEQUENTIAL_ERRORS) {
+ drv->errors = 0;
+ wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED");
+ }
+ }
else {
+ drv->errors = 0;
ret = 0;
if ((os_strcasecmp(cmd, "RSSI") == 0) ||
(os_strcasecmp(cmd, "LINKSPEED") == 0) ||
View
1  driver_wext.h
@@ -52,6 +52,7 @@ int wpa_driver_wext_get_version(struct wpa_driver_wext_data *drv);
#define WPA_DRIVER_WEXT_WAIT_US 400000
#define MAX_DRV_CMD_SIZE 248
+#define WEXT_NUMBER_SEQUENTIAL_ERRORS 4
#endif
#endif /* DRIVER_WEXT_H */
Please sign in to comment.
Something went wrong with that request. Please try again.