diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2009-12-08 11:13:01 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2009-12-08 11:13:01 -0800 |
commit | bca3fd8dcf16fed7aa8d55ce4a9968fb3e05dcad (patch) | |
tree | 46035e06b198764db91819d8b7a7347a90f96e2e | |
parent | 846ab564179d28a39ac88e3fba6813c8ae520aff (diff) | |
download | ti-android-2.1_r2.1p.tar.gz |
tnetw1271: Add "HANGED" processing (b/2310372) (DO NOT MERGE)android-sdk-2.1_r1android-2.1_r2.1sandroid-2.1_r2.1p2android-2.1_r2.1pandroid-2.1_r2android-2.1_r1eclair-sholes-release2eclair-releaseeclair-passion-release
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | wilink_6_1/wpa_supplicant_lib/driver_ti.c | 25 | ||||
-rw-r--r-- | wilink_6_1/wpa_supplicant_lib/driver_ti.h | 3 |
2 files changed, 24 insertions, 4 deletions
diff --git a/wilink_6_1/wpa_supplicant_lib/driver_ti.c b/wilink_6_1/wpa_supplicant_lib/driver_ti.c index a579be1..74a2d59 100644 --- a/wilink_6_1/wpa_supplicant_lib/driver_ti.c +++ b/wilink_6_1/wpa_supplicant_lib/driver_ti.c @@ -134,12 +134,17 @@ static int wpa_driver_tista_private_send( void *priv, u32 ioctl_cmd, void *bufIn iwr.u.data.flags = 0; res = ioctl(drv->ioctl_sock, SIOCIWFIRSTPRIV, &iwr); - if(res != 0) + if (0 != res) { wpa_printf(MSG_ERROR, "ERROR - wpa_driver_tista_private_send - error sending Wext private IOCTL to STA driver (ioctl_cmd = %x, res = %d, errno = %d)", ioctl_cmd, res, errno); + drv->errors++; + if (drv->errors > MAX_NUMBER_SEQUENTIAL_ERRORS) { + drv->errors = 0; + wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED"); + } return -1; } - + drv->errors = 0; wpa_printf(MSG_DEBUG, "wpa_driver_tista_private_send ioctl_cmd = %x res = %d", ioctl_cmd, res); return 0; @@ -153,8 +158,10 @@ static int wpa_driver_tista_driver_start( void *priv ) res = wpa_driver_tista_private_send(priv, DRIVER_START_PARAM, &uDummyBuf, sizeof(uDummyBuf), NULL, 0); - if(0 != res) + if (0 != res) { wpa_printf(MSG_ERROR, "ERROR - Failed to start driver!"); + wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED"); + } else { os_sleep(0, WPA_DRIVER_WEXT_WAIT_US); /* delay 400 ms */ wpa_printf(MSG_DEBUG, "wpa_driver_tista_driver_start success"); @@ -170,8 +177,10 @@ static int wpa_driver_tista_driver_stop( void *priv ) res = wpa_driver_tista_private_send(priv, DRIVER_STOP_PARAM, &uDummyBuf, sizeof(uDummyBuf), NULL, 0); - if(0 != res) + if (0 != res) { wpa_printf(MSG_ERROR, "ERROR - Failed to stop driver!"); + wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED"); + } else wpa_printf(MSG_DEBUG, "wpa_driver_tista_driver_stop success"); @@ -593,6 +602,11 @@ static int wpa_driver_tista_driver_cmd( void *priv, char *cmd, char *buf, size_t wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED"); } } + if( os_strcasecmp(cmd, "reload") == 0 ) { + wpa_printf(MSG_DEBUG,"Reload command"); + ret = 0; + wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED"); + } else if( os_strcasecmp(cmd, "macaddr") == 0 ) { wpa_driver_tista_get_mac_addr(priv); wpa_printf(MSG_DEBUG, "Macaddr command"); @@ -834,6 +848,9 @@ void * wpa_driver_tista_init(void *ctx, const char *ifname) /* BtCoex mode is read from tiwlan.ini file */ drv->btcoex_mode = 0; /* SG_DISABLE */ + + /* Number of sequential errors */ + drv->errors = 0; return drv; } diff --git a/wilink_6_1/wpa_supplicant_lib/driver_ti.h b/wilink_6_1/wpa_supplicant_lib/driver_ti.h index ab36ab3..6f36119 100644 --- a/wilink_6_1/wpa_supplicant_lib/driver_ti.h +++ b/wilink_6_1/wpa_supplicant_lib/driver_ti.h @@ -53,6 +53,8 @@ #define RX_IPV4_MULTICAST_FILTER 2 #define RX_IPV6_MULTICAST_FILTER 3 +#define MAX_NUMBER_SEQUENTIAL_ERRORS 4 + typedef enum { BLUETOOTH_COEXISTENCE_MODE_ENABLED = 0, BLUETOOTH_COEXISTENCE_MODE_DISABLED, @@ -73,5 +75,6 @@ struct wpa_driver_ti_data { u32 btcoex_mode; /* BtCoex Mode */ int last_scan; /* Last scan type */ SHLIST scan_merge_list; /* Previous scan list */ + int errors; /* Number of sequential errors */ }; #endif |