wlan: delay SSR when remain on channel is in progress

Supplicant can retry invitation request for 120 times
and may result in the device never returning to home
channel for the duration of these retries. Instead
of assuming this as unrecoverable scenario, let us
wait for around 70s before issuing SSR when we know
that "remain on channel" is in progress for
transmitting invitation requests.

Change-Id: Iaa425ddd12f35cb5079056524e93129cd6cdb9d5
CRs-Fixed: 796270
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 2f4ea8f..9060b91 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -10899,6 +10899,31 @@
     return VOS_STATUS_SUCCESS;
 }
 
+hdd_remain_on_chan_ctx_t *hdd_get_remain_on_channel_ctx(hdd_context_t *pHddCtx)
+{
+    hdd_adapter_t *pAdapter;
+    hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
+    hdd_cfg80211_state_t *cfgState;
+    hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL;
+    VOS_STATUS vosStatus;
+
+    vosStatus = hdd_get_front_adapter (pHddCtx, &pAdapterNode);
+    while (NULL != pAdapterNode && VOS_STATUS_E_EMPTY != vosStatus)
+    {
+        pAdapter = pAdapterNode->pAdapter;
+        if (NULL != pAdapter)
+        {
+            cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
+            pRemainChanCtx = cfgState->remain_on_chan_ctx;
+            if (pRemainChanCtx)
+                break;
+        }
+        vosStatus = hdd_get_next_adapter (pHddCtx, pAdapterNode, &pNext);
+        pAdapterNode = pNext;
+    }
+    return pRemainChanCtx;
+}
+
 void hdd_nullify_netdev_ops(hdd_context_t *pHddCtx)
 {
    VOS_STATUS status;