prima: Code refactoring in SAP start.
This fix contains following changes
1. Remove redundant vos_mem_zero and vos_mem_copy,
2. Add NULL check for function param and
3. Add Linux Version code for function call
Change-Id: I757a2e14358403b7950868fd81d8e58ab3f829df
CRs-Fixed: 796971
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 13a5d2f..4f98626 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -7423,10 +7423,10 @@
ENTER();
- if (NULL == dev)
+ if (NULL == dev || NULL == params)
{
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
- "%s: Device is Null", __func__);
+ "%s: Device or params is Null", __func__);
return -ENODEV;
}
@@ -7478,7 +7478,16 @@
return -EALREADY;
}
- status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, ¶ms->beacon, params->dtim_period);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+ status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,
+ &new,
+ ¶ms->beacon);
+#else
+ status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,
+ &new,
+ ¶ms->beacon,
+ params->dtim_period);
+#endif
if (status != 0)
{
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index 4d8a2c3..14c9e09 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -158,8 +158,6 @@
return VOS_STATUS_E_FAULT;
}
- vos_mem_zero(pSapCtx, sizeof(tSapContext));
-
/*------------------------------------------------------------------------
Clean up SAP control block, initialize all values
------------------------------------------------------------------------*/
@@ -603,9 +601,6 @@
//Set the BSSID to your "self MAC Addr" read the mac address from Configuation ITEM received from HDD
pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1;
- vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid,
- pSapCtx->self_mac_addr,
- sizeof( tCsrBssid ) );
//Save a copy to SAP context
vos_mem_copy(pSapCtx->csrRoamProfile.BSSIDs.bssid,