wlan: Ignore set auto power save command in non-authenticated state.

Device should not enter power save mode until pairwise and group key
handshake is done. Otherwise it might introduce delay during EAPOL key
exchange(Pairwise and Group key). To avoid this accept enter bmps
command only in authenticated state.

Change-Id: I1a87dd305d5fa9d4d1bf58cadd811c52f84ea9c9
CRs-Fixed: 912523
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 13355ed..3462628 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -3855,6 +3855,7 @@
    struct statsContext context;
    eHalStatus status;
    hdd_context_t *pHddCtx;
+   hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
 
    if (NULL == pAdapter)
    {
@@ -3901,6 +3902,14 @@
    }
    else if (DRIVER_POWER_MODE_AUTO == mode)
    {
+       if (VOS_FALSE == pHddStaCtx->conn_info.uIsAuthenticated)
+       {
+           hddLog(VOS_TRACE_LEVEL_ERROR,
+                   "%s:station is in still not Authenticated ignore the "
+                   "power save mode", __func__);
+           return VOS_STATUS_E_AGAIN;
+       }
+
        if (pHddCtx->cfg_ini->fIsBmpsEnabled)
        {
            hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s:Wlan driver Entering Bmps ",