net: wireless: bcmdhd: update disconnect event to upper layer
Om Prakash Singh [Wed, 19 Aug 2015 06:43:43 +0000 (11:43 +0530)]
When driver receives back to back connect/disconnect events,
sometimes driver state gets stuck in DISCONNECTING state.
On next connect/disconnect cycle, disconnect is not propagated
to upper layers since driver is in DISCONNECTING state.
Originally DISCONNECTING state check was added to send DISASSOC
only if driver state is not DISCONNECTING but notification to
upper layers is also added in the condition. Moving the notification
out of the condition to resolve this issue.

Bug 200120612

Change-Id: Ibd3cc207e1f7558b9d2da7a524b4e2729e85ae8b
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: http://git-master/r/787926
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/net/wireless/bcmdhd/wl_cfg80211.c

index fbd75dd..d78522d 100644 (file)
@@ -8888,11 +8888,11 @@ wl_notify_connect_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
                                                WL_ERR(("WLC_DISASSOC error %d\n", err));
                                                err = 0;
                                        }
-                                       cfg80211_disconnected(ndev, reason, NULL, 0, GFP_KERNEL);
-                                       wl_link_down(cfg);
-                                       wl_init_prof(cfg, ndev);
                                        memset(&cfg->last_roamed_addr, 0, ETHER_ADDR_LEN);
                                }
+                               cfg80211_disconnected(ndev, reason, NULL, 0, GFP_KERNEL);
+                               wl_link_down(cfg);
+                               wl_init_prof(cfg, ndev);
                        }
                        else if (wl_get_drv_status(cfg, CONNECTING, ndev)) {
                                printk("link down, during connecting\n");