Skip to content

Instantly share code, notes, and snippets.

@luca020400
Created September 8, 2016 09:43
Show Gist options
  • Save luca020400/82ec791c50f383aefa9e458e30443999 to your computer and use it in GitHub Desktop.
Save luca020400/82ec791c50f383aefa9e458e30443999 to your computer and use it in GitHub Desktop.
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c
index 9d207c2..bfd4f4e 100644
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c
@@ -5874,8 +5874,32 @@ VOS_STATUS hdd_release_firmware(char *pFileName,v_VOID_t *pCtx)
{
VOS_STATUS status = VOS_STATUS_SUCCESS;
hdd_context_t *pHddCtx = (hdd_context_t*)pCtx;
+ static char *WLAN_NV_FILE = NULL;
ENTER();
+ /* ze550kl and ze550kg have the same project id, but ze550kg only have 3G sku, and others belongs to ze550kl */
+ if (ASUS_ZE550KL == asus_PRJ_ID) {
+ /* RF SKU US:2 3G:3 TW:4 WW:5 CUCC:6 CMCC:7 */
+ if (0 == strncmp(asus_project_RFsku, "3", 2))
+ WLAN_NV_FILE = ZE550KG_WLAN_NV_FILE;
+ else if (0 == strncmp(asus_project_RFsku, "7", 2))
+ WLAN_NV_FILE = ZE550KL_CMCC_WLAN_NV_FILE;
+ /* ze551kl_US is LTE and FHD */
+ else if ((0 == strncmp(asus_project_lte, "1", 2)) && (0 == strncmp(asus_project_hd, "0", 2)) && (0 == strncmp(asus_project_RFsku, "2", 2)))
+ WLAN_NV_FILE = ZE551KL_WLAN_NV_FILE;
+ else
+ WLAN_NV_FILE = ZE550KL_WLAN_NV_FILE;
+ }
+ else if (ASUS_ZE600KL == asus_PRJ_ID)
+ WLAN_NV_FILE = ZE600KL_WLAN_NV_FILE;
+ else if (ASUS_ZX550KL == asus_PRJ_ID)
+ WLAN_NV_FILE = ZX550KL_WLAN_NV_FILE;
+ else if (ASUS_ZD550KL == asus_PRJ_ID) {
+ if (0 == strncmp(asus_project_RFsku, "7", 2))
+ WLAN_NV_FILE = ZD550KL_CMCC_WLAN_NV_FILE;
+ else
+ WLAN_NV_FILE = ZD550KL_CUCC_WLAN_NV_FILE;
+ }
if (!strcmp(WLAN_FW_FILE, pFileName)) {
@@ -5924,8 +5948,33 @@ VOS_STATUS hdd_request_firmware(char *pfileName,v_VOID_t *pCtx,v_VOID_t **ppfw_d
int status;
VOS_STATUS retval = VOS_STATUS_SUCCESS;
hdd_context_t *pHddCtx = (hdd_context_t*)pCtx;
+ static char *WLAN_NV_FILE = NULL;
ENTER();
+ /* ze550kl and ze550kg have the same project id, but ze550kg only have 3G sku, and others belongs to ze550kl */
+ if (ASUS_ZE550KL == asus_PRJ_ID) {
+ /* RF SKU US:2 3G:3 TW:4 WW:5 CUCC:6 CMCC:7 */
+ if (0 == strncmp(asus_project_RFsku, "3", 2))
+ WLAN_NV_FILE = ZE550KG_WLAN_NV_FILE;
+ else if (0 == strncmp(asus_project_RFsku, "7", 2))
+ WLAN_NV_FILE = ZE550KL_CMCC_WLAN_NV_FILE;
+ /* ze551kl_US is LTE and FHD */
+ else if ((0 == strncmp(asus_project_lte, "1", 2)) && (0 == strncmp(asus_project_hd, "0", 2)) && (0 == strncmp(asus_project_RFsku, "2", 2)))
+ WLAN_NV_FILE = ZE551KL_WLAN_NV_FILE;
+ else
+ WLAN_NV_FILE = ZE550KL_WLAN_NV_FILE;
+ }
+ else if (ASUS_ZE600KL == asus_PRJ_ID)
+ WLAN_NV_FILE = ZE600KL_WLAN_NV_FILE;
+ else if (ASUS_ZX550KL == asus_PRJ_ID)
+ WLAN_NV_FILE = ZX550KL_WLAN_NV_FILE;
+ else if (ASUS_ZD550KL == asus_PRJ_ID) {
+ if (0 == strncmp(asus_project_RFsku, "7", 2))
+ WLAN_NV_FILE = ZD550KL_CMCC_WLAN_NV_FILE;
+ else
+ WLAN_NV_FILE = ZD550KL_CUCC_WLAN_NV_FILE;
+ }
+
if( (!strcmp(WLAN_FW_FILE, pfileName)) ) {
status = request_firmware(&pHddCtx->fw, pfileName, pHddCtx->parent_dev);
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
index 56ee3fc..ea23028 100644
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
@@ -6219,6 +6219,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
*And currently it only checks P2P_CLIENT adapter.
*P2P_DEVICE and P2P_GO have not been added as of now.
*/
+#ifdef TRACE_RECORD
case WE_GET_STATES:
{
int buf = 0, len = 0;
@@ -6355,6 +6356,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
wrqu->data.length = strlen(extra)+1;
break;
}
+#endif
case WE_GET_CFG:
{
diff --git a/drivers/staging/prima/CORE/MAC/inc/macTrace.h b/drivers/staging/prima/CORE/MAC/inc/macTrace.h
index 2ee4c7f..a1c99d3 100644
--- a/drivers/staging/prima/CORE/MAC/inc/macTrace.h
+++ b/drivers/staging/prima/CORE/MAC/inc/macTrace.h
@@ -43,9 +43,6 @@
#include "aniGlobal.h"
-
-#ifdef TRACE_RECORD
-
#define MAC_TRACE_GET_MODULE_ID(data) ((data >> 8) & 0xff)
#define MAC_TRACE_GET_MSG_ID(data) (data & 0xffff)
@@ -80,5 +77,3 @@ tANI_U8* macTraceGetTLState(tANI_U16 tlState);
#endif
-#endif
-
diff --git a/drivers/staging/prima/CORE/SME/inc/smsDebug.h b/drivers/staging/prima/CORE/SME/inc/smsDebug.h
index ec5ae58..85d495b 100644
--- a/drivers/staging/prima/CORE/SME/inc/smsDebug.h
+++ b/drivers/staging/prima/CORE/SME/inc/smsDebug.h
@@ -45,10 +45,15 @@
#define __printf(a,b)
#endif
+#ifdef WLAN_DEBUG
void __printf(3,4)
smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...);
void __printf(3,4)
pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...);
+#else
+#define smsLog(arg...)
+#define pmcLog(arg...)
+#endif
#endif // __SMS_DEBUG_H__
diff --git a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c
index 6560b25..01ff33d 100644
--- a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c
+++ b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c
@@ -6389,6 +6389,7 @@ VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_
}
+#ifdef WLAN_DEBUG
void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...)
{
VOS_TRACE_LEVEL vosDebugLevel;
@@ -6409,7 +6410,6 @@ void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...)
void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...)
{
-#ifdef WLAN_DEBUG
// Verify against current log level
if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] )
return;
@@ -6423,8 +6423,8 @@ void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...)
va_end( marker ); /* Reset variable arguments. */
}
-#endif
}
+#endif
/* ---------------------------------------------------------------------------
\fn sme_GetWcnssWlanCompiledVersion
diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h b/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h
index a0c32f7..1a63199 100644
--- a/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h
+++ b/drivers/staging/prima/CORE/VOSS/inc/vos_trace.h
@@ -121,6 +121,7 @@ typedef enum
#else
#define MTRACE(p) { }
+#define CASE_RETURN_STRING( str ) { }
#endif
diff --git a/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h b/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h
index 7c2d62a..1286f68 100644
--- a/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h
+++ b/drivers/staging/prima/CORE/VOSS/inc/wlan_hdd_misc.h
@@ -33,7 +33,14 @@
#define WLAN_INI_FILE "wlan/prima/WCNSS_qcom_cfg.ini"
#define WLAN_CFG_FILE "wlan/prima/WCNSS_cfg.dat"
#define WLAN_FW_FILE ""
-#define WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv.bin"
+#define ZE550KL_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_ze550kl.bin"
+#define ZE550KL_CMCC_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_ze550kl_cmcc.bin"
+#define ZE600KL_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_ze600kl.bin"
+#define ZX550KL_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_zx550kl.bin"
+#define ZD550KL_CUCC_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_cucc_zd550kl.bin"
+#define ZD550KL_CMCC_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_cmcc_zd550kl.bin"
+#define ZE550KG_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_ze550kg.bin"
+#define ZE551KL_WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv_ze551kl.bin"
#define WLAN_DICT_FILE "wlan/prima/WCNSS_wlan_dictionary.dat"
#define WLAN_COUNTRY_INFO_FILE "wlan/prima/WCNSS_wlan_country_info.dat"
#define WLAN_HO_CFG_FILE "wlan/prima/WCNSS_wlan_ho_config"
diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c
index de581c1..ab3a22e 100644
--- a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c
+++ b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c
@@ -1106,6 +1106,7 @@ VOS_STATUS vos_nv_open(void)
v_U32_t dataOffset;
sHalNv *pnvData = NULL;
hdd_context_t *pHddCtx = NULL;
+ static char *WLAN_NV_FILE = NULL;
/*Get the global context */
pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL);
@@ -1115,6 +1116,30 @@ VOS_STATUS vos_nv_open(void)
return (eHAL_STATUS_FAILURE);
}
+ /* ze550kl and ze550kg have the same project id, but ze550kg only have 3G sku, and others belongs to ze550kl */
+ if (ASUS_ZE550KL == asus_PRJ_ID) {
+ /* RF SKU US:2 3G:3 TW:4 WW:5 CUCC:6 CMCC:7 */
+ if (0 == strncmp(asus_project_RFsku, "3", 2))
+ WLAN_NV_FILE = ZE550KG_WLAN_NV_FILE;
+ else if (0 == strncmp(asus_project_RFsku, "7", 2))
+ WLAN_NV_FILE = ZE550KL_CMCC_WLAN_NV_FILE;
+ /* ze551kl_US is LTE and FHD */
+ else if ((0 == strncmp(asus_project_lte, "1", 2)) && (0 == strncmp(asus_project_hd, "0", 2)) && (0 == strncmp(asus_project_RFsku, "2", 2)))
+ WLAN_NV_FILE = ZE551KL_WLAN_NV_FILE;
+ else
+ WLAN_NV_FILE = ZE550KL_WLAN_NV_FILE;
+ }
+ else if (ASUS_ZE600KL == asus_PRJ_ID)
+ WLAN_NV_FILE = ZE600KL_WLAN_NV_FILE;
+ else if (ASUS_ZX550KL == asus_PRJ_ID)
+ WLAN_NV_FILE = ZX550KL_WLAN_NV_FILE;
+ else if (ASUS_ZD550KL == asus_PRJ_ID) {
+ if (0 == strncmp(asus_project_RFsku, "7", 2))
+ WLAN_NV_FILE = ZD550KL_CMCC_WLAN_NV_FILE;
+ else
+ WLAN_NV_FILE = ZD550KL_CUCC_WLAN_NV_FILE;
+ }
+
status = hdd_request_firmware(WLAN_NV_FILE,
((VosContextType*)(pVosContext))->pHDDContext,
(v_VOID_t**)&pnvtmpBuf, &nvReadBufSize);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment