summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2009-12-02 13:08:02 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-02 13:08:02 -0800
commit093f0bbd73cb23b0056406ef51673a0b3925841c (patch)
tree08744c3f9fd7d66c89676277480f0ea1c1013bce
parentfae9b297ca58cb7b1d274fe31a7ba7263aac902a (diff)
parent08111ea8c525690e7cb10a5ca121e7659dd0ffec (diff)
downloadhardware_replicant_wlan-093f0bbd73cb23b0056406ef51673a0b3925841c.tar.gz
hardware_replicant_wlan-093f0bbd73cb23b0056406ef51673a0b3925841c.tar.bz2
hardware_replicant_wlan-093f0bbd73cb23b0056406ef51673a0b3925841c.zip
am 08111ea8: bcm4329: Fix watchdog timer race conditions (b/2249878) Fix "garbage" scan results processing
Merge commit '08111ea8c525690e7cb10a5ca121e7659dd0ffec' into eclair-mr2-plus-aosp * commit '08111ea8c525690e7cb10a5ca121e7659dd0ffec': bcm4329: Fix watchdog timer race conditions (b/2249878)
-rw-r--r--bcm4329/src/dhd/sys/dhd_linux.c30
-rw-r--r--bcm4329/src/wl/sys/wl_iw.c7
2 files changed, 9 insertions, 28 deletions
diff --git a/bcm4329/src/dhd/sys/dhd_linux.c b/bcm4329/src/dhd/sys/dhd_linux.c
index 2afefef..fe1072c 100644
--- a/bcm4329/src/dhd/sys/dhd_linux.c
+++ b/bcm4329/src/dhd/sys/dhd_linux.c
@@ -1173,8 +1173,7 @@ dhd_watchdog(ulong data)
/* Reschedule the watchdog */
#if defined(CONTINUOUS_WATCHDOG)
- dhd->timer.expires = jiffies + dhd_watchdog_ms * HZ / 1000;
- add_timer(&dhd->timer);
+ mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
#else
if (dhd->wd_timer_valid)
mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
@@ -2278,15 +2277,8 @@ dhd_os_wd_timer(void *bus, uint wdtick)
#endif /* !defined(CONTINUOUS_WATCHDOG) */
#if defined(CONTINUOUS_WATCHDOG)
- /* Stop timer and restart at new value */
- if (dhd->wd_timer_valid == TRUE) {
- del_timer_sync(&dhd->timer);
- dhd->wd_timer_valid = FALSE;
- }
-
dhd_watchdog_ms = (uint)wdtick;
- dhd->timer.expires = jiffies + dhd_watchdog_ms * HZ / 1000;
- add_timer(&dhd->timer);
+ mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
dhd->wd_timer_valid = TRUE;
#else
@@ -2300,21 +2292,9 @@ dhd_os_wd_timer(void *bus, uint wdtick)
if (wdtick) {
dhd_watchdog_ms = (uint)wdtick;
- if (save_dhd_watchdog_ms != dhd_watchdog_ms){
-
- if (dhd->wd_timer_valid == TRUE)
- /* Stop timer and restart at new value */
- del_timer_sync(&dhd->timer);
-
- /* Create timer again when watchdog period is
- dynamically changed or in the first instance
- */
- dhd->timer.expires = jiffies + dhd_watchdog_ms * HZ / 1000;
- add_timer(&dhd->timer);
- }else {
- /* Re arm the timer, at last watchdog period */
- mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
- }
+
+ /* Re arm the timer, at last watchdog period */
+ mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
dhd->wd_timer_valid = TRUE;
save_dhd_watchdog_ms = wdtick;
diff --git a/bcm4329/src/wl/sys/wl_iw.c b/bcm4329/src/wl/sys/wl_iw.c
index 061e51a..4d713d6 100644
--- a/bcm4329/src/wl/sys/wl_iw.c
+++ b/bcm4329/src/wl/sys/wl_iw.c
@@ -216,7 +216,7 @@ wl_iw_get_scan_prep(
wl_scan_results_t *list,
struct iw_request_info *info,
char *extra,
- __u16 max_size
+ short max_size
);
@@ -2307,7 +2307,7 @@ wl_iw_get_scan_prep(
wl_scan_results_t *list,
struct iw_request_info *info,
char *extra,
- __u16 max_size)
+ short max_size)
{
int i, j;
struct iw_event iwe;
@@ -2580,10 +2580,11 @@ wl_iw_iscan_get_scan(
while (p_buf != iscan->list_cur) {
list = &((wl_iscan_results_t*)p_buf->iscan_buf)->results;
- counter += list->count;
+ counter += list->count;
if (list->version != WL_BSS_INFO_VERSION) {
WL_ERROR(("list->version %d != WL_BSS_INFO_VERSION\n", list->version));
+ return -EINVAL; /* if WL_BSS_INFO_VERSION is corrupted iscan results are garbage */
}
bi = NULL;