wlan: don't allow get/set okc/ccx,if ccx/okc/11r all supported

As per customer revised requirements,if the DUT supports 11R/CCX/OKC
simultaneously then GET/SET OKCMODE/CCXMODE operations are not
allowed. (it should return FAIL)

Change-Id: Id61decc51891c1225ffad345fa0b22f942b33a8e
CRs-Fixed: 509644
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index afdd38f..82f6da2 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -1176,6 +1176,19 @@
            char extra[32];
            tANI_U8 len = 0;
 
+           /* Check if the features OKC/CCX/11R are supported simultaneously,
+              then this operation is not permitted (return FAILURE) */
+           if (ccxMode &&
+               hdd_is_okc_mode_enabled(pHddCtx) &&
+               sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal)))
+           {
+               VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
+                  "%s: OKC/CCX/11R are supported simultaneously"
+                  " hence this operation is not permitted!", __func__);
+               ret = -EPERM;
+               goto exit;
+           }
+
            len = snprintf(extra, sizeof(extra), "%s %d", "GETCCXMODE", ccxMode);
            if (copy_to_user(priv_data.buf, &extra, len + 1))
            {
@@ -1191,6 +1204,19 @@
            char extra[32];
            tANI_U8 len = 0;
 
+           /* Check if the features OKC/CCX/11R are supported simultaneously,
+              then this operation is not permitted (return FAILURE) */
+           if (okcMode &&
+               sme_getIsCcxFeatureEnabled((tHalHandle)(pHddCtx->hHal)) &&
+               sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal)))
+           {
+               VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
+                  "%s: OKC/CCX/11R are supported simultaneously"
+                  " hence this operation is not permitted!", __func__);
+               ret = -EPERM;
+               goto exit;
+           }
+
            len = snprintf(extra, sizeof(extra), "%s %d", "GETOKCMODE", okcMode);
            if (copy_to_user(priv_data.buf, &extra, len + 1))
            {
@@ -1832,6 +1858,19 @@
            tANI_U8 *value = command;
            tANI_U8 ccxMode = CFG_CCX_FEATURE_ENABLED_DEFAULT;
 
+           /* Check if the features OKC/CCX/11R are supported simultaneously,
+              then this operation is not permitted (return FAILURE) */
+           if (sme_getIsCcxFeatureEnabled((tHalHandle)(pHddCtx->hHal)) &&
+               hdd_is_okc_mode_enabled(pHddCtx) &&
+               sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal)))
+           {
+               VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
+                  "%s: OKC/CCX/11R are supported simultaneously"
+                  " hence this operation is not permitted!", __func__);
+               ret = -EPERM;
+               goto exit;
+           }
+
            /* Move pointer to ahead of SETCCXMODE<delimiter> */
            value = value + 11;
            /* Convert the value from ascii to integer */
@@ -1903,6 +1942,19 @@
            tANI_U8 *value = command;
            tANI_U8 okcMode = CFG_OKC_FEATURE_ENABLED_DEFAULT;
 
+           /* Check if the features OKC/CCX/11R are supported simultaneously,
+              then this operation is not permitted (return FAILURE) */
+           if (sme_getIsCcxFeatureEnabled((tHalHandle)(pHddCtx->hHal)) &&
+               hdd_is_okc_mode_enabled(pHddCtx) &&
+               sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal)))
+           {
+               VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
+                  "%s: OKC/CCX/11R are supported simultaneously"
+                  " hence this operation is not permitted!", __func__);
+               ret = -EPERM;
+               goto exit;
+           }
+
            /* Move pointer to ahead of SETOKCMODE<delimiter> */
            value = value + 11;
            /* Convert the value from ascii to integer */