[NEUS7920-133][9610][7885][7872][7570] wlbt: p2p state to be set to scanning in slsi_scan
authorKavitha Velayutham <k.velayutham@samsung.com>
Fri, 15 Mar 2019 14:26:14 +0000 (19:56 +0530)
committerYoungmin Nam <youngmin.nam@samsung.com>
Tue, 21 May 2019 10:45:22 +0000 (19:45 +0900)
p2p state is not set to proper state when there is a race condition between disconnect handle and full scan.

SCSC-Bug-Id: SSB-50669

Change-Id: Iee95bd09d30b6f2de058abda022f74c78887bb1c
Signed-off-by: Kavitha Velayutham <k.velayutham@samsung.com>
drivers/net/wireless/scsc/cfg80211_ops.c

index 87ffdc6b7f7141ce552dcb36fa7877492fd9dac7..e3d2eff6ec7d5cf3d9226c2548ebcde0869760c3 100755 (executable)
@@ -443,7 +443,6 @@ int slsi_scan(struct wiphy *wiphy, struct net_device *dev,
        struct slsi_dev           *sdev = SDEV_FROM_WIPHY(wiphy);
        u16                       scan_type = FAPI_SCANTYPE_FULL_SCAN;
        int                       r = 0;
-       u16                       p2p_state = sdev->p2p_state;
        u8                        *scan_ie;
        size_t                    scan_ie_len;
        bool                      strip_wsc = false;
@@ -510,7 +509,6 @@ int slsi_scan(struct wiphy *wiphy, struct net_device *dev,
                                }
                }
                if (request->n_channels == SLSI_P2P_SOCIAL_CHAN_COUNT || request->n_channels == 1) {
-                       p2p_state = P2P_SCANNING;
                        scan_type = FAPI_SCANTYPE_P2P_SCAN_SOCIAL;
                        ndev_vif->unsync.slsi_p2p_continuous_fullscan = false;
                } else if (request->n_channels > SLSI_P2P_SOCIAL_CHAN_COUNT) {
@@ -637,7 +635,8 @@ int slsi_scan(struct wiphy *wiphy, struct net_device *dev,
 
                /* Update State only for scan in Device role */
                if (SLSI_IS_VIF_INDEX_P2P(ndev_vif) && (!SLSI_IS_P2P_GROUP_STATE(sdev))) {
-                       SLSI_P2P_STATE_CHANGE(sdev, p2p_state);
+                       if (scan_type == FAPI_SCANTYPE_P2P_SCAN_SOCIAL)
+                               SLSI_P2P_STATE_CHANGE(sdev, P2P_SCANNING);
                } else if (!SLSI_IS_VIF_INDEX_P2P(ndev_vif) && scan_ie_len) {
                        kfree(ndev_vif->probe_req_ies);
                        ndev_vif->probe_req_ies = kmalloc(request->ie_len, GFP_KERNEL);