net: wireless: bcmdhd: Turn interface down (only) in case of FW crash
Dmitry Shmidt [Thu, 23 Feb 2012 18:36:40 +0000 (10:36 -0800)]
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

drivers/net/wireless/bcmdhd/dhd_linux.c

index a04c88f..bd479ac 100644 (file)
@@ -4392,17 +4392,23 @@ int net_os_send_hang_message(struct net_device *dev)
 {
        dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
        int ret = 0;
+       int need_unlock = 0;
 
        if (dhd) {
                if (!dhd->pub.hang_was_sent) {
                        dhd->pub.hang_was_sent = 1;
+                       if (!rtnl_is_locked()) {
+                               need_unlock = 1;
+                               rtnl_lock();
+                       }
+                       dev_close(dev);
+                       if (need_unlock)
+                               rtnl_unlock();
 #if defined(CONFIG_BCMDHD_WEXT)
                        ret = wl_iw_send_priv_event(dev, "HANG");
 #endif
 #if defined(WL_CFG80211)
                        ret = wl_cfg80211_hang(dev, WLAN_REASON_UNSPECIFIED);
-                       dev_close(dev);
-                       dev_open(dev);
 #endif
                }
        }