net: wireless: bcmdhd: Add FW reloading in case of FW hang
Dmitry Shmidt [Fri, 2 Dec 2011 21:10:47 +0000 (13:10 -0800)]
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

drivers/net/wireless/bcmdhd/dhd_linux.c

index 5ce510a..7afd0b8 100644 (file)
@@ -2297,7 +2297,6 @@ dhd_stop(struct net_device *net)
        if (ifidx == 0 && !dhd_download_fw_on_driverload)
                wl_android_wifi_off(net);
 #endif
-       dhd->pub.hang_was_sent = 0;
        dhd->pub.rxcnt_timeout = 0;
        dhd->pub.txcnt_timeout = 0;
        OLD_MOD_DEC_USE_COUNT;
@@ -2326,6 +2325,8 @@ dhd_open(struct net_device *net)
                firmware_path[0] = '\0';
        }
 
+       dhd->pub.hang_was_sent = 0;
+
 #if !defined(WL_CFG80211)
        /*
         * Force start if ifconfig_up gets called before START command
@@ -4284,6 +4285,8 @@ int net_os_send_hang_message(struct net_device *dev)
 #endif
 #if defined(WL_CFG80211)
                        ret = wl_cfg80211_hang(dev, WLAN_REASON_UNSPECIFIED);
+                       dev_close(dev);
+                       dev_open(dev);
 #endif
                }
        }