Advertising proprietary IE (IBSS only)

Populating the prop IE (Oxygen network) in Beacon and
probe response frames sent by IBSS network only. An option is
provided in ini file to enable/disable populating the IE.

CRs-fixed: 509388
Change-Id: Ia24dbdc6d9bd5e652f83e1516f174f0ebf2ede46
diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h
index f28227d..214e816 100644
--- a/CORE/MAC/src/pe/include/limSession.h
+++ b/CORE/MAC/src/pe/include/limSession.h
@@ -353,6 +353,8 @@
 #endif
     tANI_BOOLEAN fWaitForProbeRsp;
     tANI_BOOLEAN fIgnoreCapsChange;
+    tANI_U8    oxygenNwkIniFeatureEnabled;
+
 }tPESession, *tpPESession;
 
 #define LIM_MAX_ACTIVE_SESSIONS 4
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index f6f2b6e..612710f 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -648,6 +648,9 @@
         psessionEntry->txLdpcIniFeatureEnabled = 
                                     pSmeStartBssReq->txLdpcIniFeatureEnabled;
 
+        psessionEntry->oxygenNwkIniFeatureEnabled =
+                                    pSmeStartBssReq->oxygenNwkIniFeatureEnabled;
+
         palCopyMemory(pMac->hHdd, (void*)&psessionEntry->rateSet,
             (void*)&pSmeStartBssReq->operationalRateSet,
             sizeof(tSirMacRateSet));
diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
index dfee03d..9138561 100644
--- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c
+++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
@@ -646,6 +646,18 @@
     }
 #endif
 
+    if (psessionEntry->oxygenNwkIniFeatureEnabled &&
+       (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole)) {
+        if (wlan_cfgGetInt(pMac, WNI_CFG_OXYGEN_NETWORK_DATA,
+                                     &tmp) != eSIR_SUCCESS){
+            limLog(pMac, LOGW, FL("Unable to get WNI_CFG_OXYGEN_NETWORK_DATA"));
+        }
+        else {
+            pFrm->OxygenNetwork.present = 1;
+            pFrm->OxygenNetwork.data = (tmp & 0xffff);
+        }
+    }
+
     if ( psessionEntry->pLimStartBssReq ) 
     {
       PopulateDot11fWPA( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ),
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c
index 7990a69..5a85403 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.c
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c
@@ -674,6 +674,11 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
+    // Extract oxygenNwkIniFeatureEnabled
+    pStartBssReq->oxygenNwkIniFeatureEnabled = *pBuf++;
+    len--;
+    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
+       return eSIR_FAILURE;
 
     // Extract rsnIe
     pStartBssReq->rsnIE.length = limGetU16(pBuf);
@@ -1163,7 +1168,6 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
-
     // Extract Titan CB Neighbor BSS info
     pJoinReq->cbNeighbors.cbBssFoundPri = *pBuf;
     pBuf++;
diff --git a/CORE/MAC/src/pe/sch/schBeaconGen.c b/CORE/MAC/src/pe/sch/schBeaconGen.c
index 55940de..55c3292 100644
--- a/CORE/MAC/src/pe/sch/schBeaconGen.c
+++ b/CORE/MAC/src/pe/sch/schBeaconGen.c
@@ -362,6 +362,19 @@
     }
 #endif
 
+    if (psessionEntry->oxygenNwkIniFeatureEnabled &&
+       (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole)) {
+        if ((status = wlan_cfgGetInt(pMac, WNI_CFG_OXYGEN_NETWORK_DATA,
+                                     &tmp)) != eSIR_SUCCESS)
+        {
+            limLog(pMac, LOGW, FL("Unable to get WNI_CFG_OXYGEN_NETWORK_DATA"));
+        }
+        else {
+            pBcn2->OxygenNetwork.present = 1;
+            pBcn2->OxygenNetwork.data = (tmp & 0xffff);
+        }
+    }
+
     PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL,
                                 &pBcn2->ExtSuppRates, psessionEntry );