diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2014-08-31 11:35:38 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-08-31 11:35:38 -0700 |
| commit | 1ea7622dd9ae7e45588e6acbde15839dd4f2d83b (patch) | |
| tree | 9c09427059309c04ec0be977e5033d4f7bff51c2 | |
| parent | d74d5a529e4fa51885908e8a31d89f9cbd47114d (diff) | |
| parent | 99279694c4f4bc4f57810d801faa9c7387529680 (diff) | |
Merge "Release 1.0.0.175 & 1.0.0.175A QCACLD WLAN Driver"
| -rw-r--r-- | CORE/MAC/inc/qwlan_version.h | 4 | ||||
| -rw-r--r-- | CORE/SERVICES/BMI/ol_fw.c | 35 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/ol_if_athvar.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c | 9 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 25 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 21 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 254 | ||||
| -rw-r--r-- | CORE/SVC/src/ptt/wlan_ptt_sock_svc.c | 128 |
9 files changed, 68 insertions, 412 deletions
diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 2125102cfbf8..071c2fc07e86 100644 --- a/CORE/MAC/inc/qwlan_version.h +++ b/CORE/MAC/inc/qwlan_version.h @@ -42,9 +42,9 @@ BRIEF DESCRIPTION: #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 0 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 174 +#define QWLAN_VERSION_BUILD 175 -#define QWLAN_VERSIONSTR "1.0.0.174" +#define QWLAN_VERSIONSTR "1.0.0.175A" #define AR6320_REV1_VERSION 0x5000000 diff --git a/CORE/SERVICES/BMI/ol_fw.c b/CORE/SERVICES/BMI/ol_fw.c index 085fec3bff33..920a26a7857b 100644 --- a/CORE/SERVICES/BMI/ol_fw.c +++ b/CORE/SERVICES/BMI/ol_fw.c @@ -857,7 +857,7 @@ int dump_CE_register(struct ol_softc *scn) } #endif -#if defined(CONFIG_CNSS) +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) static struct ol_softc *ramdump_scn; int ol_copy_ramdump(struct ol_softc *scn) @@ -879,7 +879,9 @@ out: static void ramdump_work_handler(struct work_struct *ramdump) { +#if !defined(HIF_SDIO) int ret; +#endif u_int32_t host_interest_address; u_int32_t dram_dump_values[4]; @@ -887,7 +889,7 @@ static void ramdump_work_handler(struct work_struct *ramdump) printk("No RAM dump will be collected since ramdump_scn is NULL!\n"); goto out_fail; } - +#if !defined(HIF_SDIO) #ifdef DEBUG ret = hif_pci_check_soc_status(ramdump_scn->hif_sc); if (ret) @@ -899,14 +901,17 @@ static void ramdump_work_handler(struct work_struct *ramdump) dump_CE_debug_register(ramdump_scn->hif_sc); #endif +#endif if (HIFDiagReadMem(ramdump_scn->hif_hdl, host_interest_item_address(ramdump_scn->target_type, offsetof(struct host_interest_s, hi_failure_state)), (A_UCHAR *)&host_interest_address, sizeof(u_int32_t)) != A_OK) { printk(KERN_ERR "HifDiagReadiMem FW Dump Area Pointer failed!\n"); +#if !defined(HIF_SDIO) dump_CE_register(ramdump_scn); dump_CE_debug_register(ramdump_scn->hif_sc); +#endif goto out_fail; } @@ -926,18 +931,28 @@ static void ramdump_work_handler(struct work_struct *ramdump) printk("%s: RAM dump collecting completed!\n", __func__); msleep(250); - +#if defined(HIF_SDIO) + panic("CNSS Ram dump collected\n"); +#else /* Notify SSR framework the target has crashed. */ cnss_device_crashed(); +#endif return; out_fail: /* Silent SSR on dump failure */ #ifdef CNSS_SELF_RECOVERY +#if !defined(HIF_SDIO) cnss_device_self_recovery(); +#endif +#else + +#if defined(HIF_SDIO) + panic("CNSS Ram dump collection failed \n"); #else cnss_device_crashed(); #endif +#endif return; } @@ -951,7 +966,9 @@ void ol_schedule_ramdump_work(struct ol_softc *scn) static void fw_indication_work_handler(struct work_struct *fw_indication) { +#if !defined(HIF_SDIO) cnss_device_self_recovery(); +#endif } static DECLARE_WORK(fw_indication_work, fw_indication_work_handler); @@ -1213,7 +1230,7 @@ void ol_target_failure(void *instance, A_STATUS status) } #endif -#if defined(CONFIG_CNSS) +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) /* Collect the RAM dump through a workqueue */ ol_schedule_ramdump_work(scn); #endif @@ -1956,7 +1973,7 @@ int ol_download_firmware(struct ol_softc *scn) return status; } -#ifdef HIF_PCI +#if defined(HIF_PCI) || defined(HIF_SDIO) int ol_diag_read(struct ol_softc *scn, u_int8_t *buffer, u_int32_t pos, size_t count) { @@ -1966,6 +1983,7 @@ int ol_diag_read(struct ol_softc *scn, u_int8_t *buffer, result = HIFDiagReadAccess(scn->hif_hdl, pos, (u_int32_t*)buffer); } else { +#ifdef HIF_PCI size_t amountRead = 0; size_t readSize = PCIE_READ_LIMIT; size_t remainder = 0; @@ -1983,9 +2001,12 @@ int ol_diag_read(struct ol_softc *scn, u_int8_t *buffer, } } } else { +#endif result = HIFDiagReadMem(scn->hif_hdl, pos, buffer, count); +#ifdef HIF_PCI } +#endif } if (!result) { @@ -1995,6 +2016,7 @@ int ol_diag_read(struct ol_softc *scn, u_int8_t *buffer, } } +#if defined(HIF_PCI) static int ol_ath_get_reg_table(A_UINT32 target_version, tgt_reg_table *reg_table) { @@ -2091,6 +2113,7 @@ static int ol_diag_read_reg_loc(struct ol_softc *scn, u_int8_t *buffer, out: return result; } +#endif /**--------------------------------------------------------------------------- * \brief ol_target_coredump @@ -2152,10 +2175,12 @@ int ol_target_coredump(void *inst, void *memoryBlock, u_int32_t blockLength) } if ((blockLength - amountRead) >= readLen) { +#if !defined(HIF_SDIO) if (pos == REGISTER_LOCATION) result = ol_diag_read_reg_loc(scn, bufferLoc, blockLength - amountRead); else +#endif result = ol_diag_read(scn, bufferLoc, pos, readLen); if (result != -EIO) { diff --git a/CORE/SERVICES/COMMON/ol_if_athvar.h b/CORE/SERVICES/COMMON/ol_if_athvar.h index 8b9408e8896e..967e2cc561e1 100644 --- a/CORE/SERVICES/COMMON/ol_if_athvar.h +++ b/CORE/SERVICES/COMMON/ol_if_athvar.h @@ -273,7 +273,7 @@ struct ol_softc { #elif defined(HIF_SDIO) struct ol_fw_files fw_files; #endif -#ifdef CONFIG_CNSS +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) void __iomem *ramdump_base; unsigned long ramdump_address; unsigned long ramdump_size; diff --git a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c index dbbe6a95a960..588fb89e431f 100644 --- a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c +++ b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c @@ -147,6 +147,13 @@ ath_hif_sdio_probe(void *context, void *hif_handle) ol_sc->max_no_of_peers = 1; ol_sc->hif_hdl = hif_handle; + + ol_sc->ramdump_base = ioremap(RAMDUMP_ADDR, RAMDUMP_SIZE); + ol_sc->ramdump_size = RAMDUMP_SIZE; + if (ol_sc->ramdump_base == NULL) { + ol_sc->ramdump_base = 0; + ol_sc->ramdump_size = 0; + } init_waitqueue_head(&ol_sc->sc_osdev->event_queue); if (athdiag_procfs_init(sc) != 0) { @@ -218,6 +225,8 @@ ath_hif_sdio_remove(void *context, void *hif_handle) athdiag_procfs_remove(); + iounmap(sc->ol_sc->ramdump_base); + #ifndef REMOVE_PKT_LOG if (vos_get_conparam() != VOS_FTM_MODE && !WLAN_IS_EPPING_ENABLED(vos_get_conparam())){ diff --git a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.h b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.h index 5512e6e33f04..8de7217ad844 100644 --- a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.h +++ b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.h @@ -46,6 +46,8 @@ #define ATH_DBG_DEFAULT 0 +#define RAMDUMP_ADDR 0x8F000000 +#define RAMDUMP_SIZE 0x700000 struct ath_hif_sdio_softc { struct device *dev; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index bd4441bb31af..51dbbd561af2 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -16630,6 +16630,8 @@ int wma_enable_wow_in_fw(WMA_HANDLE handle) struct ol_softc *scn; int host_credits; int wmi_pending_cmds; + tpAniSirGlobal pMac = (tpAniSirGlobal)vos_get_context(VOS_MODULE_ID_PE, + wma->vos_context); #ifdef FEATURE_WLAN_D0WOW if (wma->ap_client_cnt > 0) { @@ -16687,8 +16689,14 @@ int wma_enable_wow_in_fw(WMA_HANDLE handle) WMA_LOGE("Credits:%d; Pending_Cmds: %d", wmi_get_host_credits(wma->wmi_handle), wmi_get_pending_cmds(wma->wmi_handle)); - +#ifdef CONFIG_CNSS + if (pMac->sme.enableSelfRecovery) { + vos_set_logp_in_progress(VOS_MODULE_ID_HIF, TRUE); + cnss_schedule_recovery_work(); + } +#else VOS_BUG(0); +#endif wmi_set_target_suspend(wma->wmi_handle, FALSE); return VOS_STATUS_E_FAILURE; } @@ -17621,6 +17629,8 @@ static VOS_STATUS wma_send_host_wakeup_ind_to_fw(tp_wma_handle wma) VOS_STATUS vos_status = VOS_STATUS_SUCCESS; int32_t len; int ret; + tpAniSirGlobal pMac = (tpAniSirGlobal)vos_get_context(VOS_MODULE_ID_PE, + wma->vos_context); len = sizeof(wmi_wow_hostwakeup_from_sleep_cmd_fixed_param); @@ -17656,10 +17666,19 @@ static VOS_STATUS wma_send_host_wakeup_ind_to_fw(tp_wma_handle wma) WMA_LOGP("%s: Pending commands %d credits %d", __func__, wmi_get_pending_cmds(wma->wmi_handle), wmi_get_host_credits(wma->wmi_handle)); - if (!vos_is_logp_in_progress(VOS_MODULE_ID_HIF, NULL)) + if (!vos_is_logp_in_progress(VOS_MODULE_ID_HIF, NULL)) { +#ifdef CONFIG_CNSS + if (pMac->sme.enableSelfRecovery) { + vos_set_logp_in_progress(VOS_MODULE_ID_HIF, + TRUE); + cnss_schedule_recovery_work(); + } +#else VOS_BUG(0); - else +#endif + } else { WMA_LOGE("%s: SSR in progress, ignore resume timeout", __func__); + } } else { WMA_LOGD("Host wakeup received"); } diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 89a20898aaf6..07d7eac07651 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -1828,27 +1828,6 @@ VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, tpRrmNeighborReq pRrmNeighborReq, tpRrmNeighborRspCallbackInfo callbackInfo); #endif -//The following are debug APIs to support direct read/write register/memory -//They are placed in SME because HW cannot be access when in LOW_POWER state -//AND not connected. The knowledge and synchronization is done in SME - -//sme_DbgReadRegister -//Caller needs to validate the input values -VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue); - -//sme_DbgWriteRegister -//Caller needs to validate the input values -VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue); - -//sme_DbgReadMemory -//Caller needs to validate the input values -//pBuf caller allocated buffer has the length of nLen -VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen); - -//sme_DbgWriteMemory -//Caller needs to validate the input values -VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen); - VOS_STATUS sme_GetWcnssWlanCompiledVersion(tHalHandle hHal, tSirVersionType *pVersion); VOS_STATUS sme_GetWcnssWlanReportedVersion(tHalHandle hHal, diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 237baa79adb7..78b3d253eb07 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -5944,260 +5944,6 @@ VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, } #endif -//The following are debug APIs to support direct read/write register/memory -//They are placed in SME because HW cannot be access when in LOW_POWER state -//AND not connected. The knowledge and synchronization is done in SME - -//sme_DbgReadRegister -//Caller needs to validate the input values -VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue) -{ - VOS_STATUS status = VOS_STATUS_E_FAILURE; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - tPmcPowerState PowerState; - tANI_U32 sessionId = 0; - MTRACE(vos_trace(VOS_MODULE_ID_SME, - TRACE_CODE_SME_RX_HDD_DBG_READREG, NO_SESSION, 0)); - - /* 1) To make Quarky work in FTM mode **************************************/ - - if(eDRIVER_TYPE_MFG == pMac->gDriverType) - { - if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) - { - return VOS_STATUS_SUCCESS; - } - return VOS_STATUS_E_FAILURE; - } - - /* 2) NON FTM mode driver *************************************************/ - - /* Acquire SME global lock */ - if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) - { - return VOS_STATUS_E_FAILURE; - } - - if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) - { - /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ - if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) - { - if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) - { - status = VOS_STATUS_SUCCESS; - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - - /* This is a hack for Qualky/pttWniSocket - Current implementation doesn't allow pttWniSocket to inform Qualky an error */ - if ( VOS_STATUS_SUCCESS != status ) - { - *pRegValue = 0xDEADBEEF; - status = VOS_STATUS_SUCCESS; - } - - /* Release SME global lock */ - sme_ReleaseGlobalLock(&pMac->sme); - - return (status); -} - - -//sme_DbgWriteRegister -//Caller needs to validate the input values -VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue) -{ - VOS_STATUS status = VOS_STATUS_E_FAILURE; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - tPmcPowerState PowerState; - tANI_U32 sessionId = 0; - - /* 1) To make Quarky work in FTM mode **************************************/ - - MTRACE(vos_trace(VOS_MODULE_ID_SME, - TRACE_CODE_SME_RX_HDD_DBG_WRITEREG, NO_SESSION, 0)); - if(eDRIVER_TYPE_MFG == pMac->gDriverType) - { - if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) - { - return VOS_STATUS_SUCCESS; - } - return VOS_STATUS_E_FAILURE; - } - - /* 2) NON FTM mode driver *************************************************/ - - /* Acquire SME global lock */ - if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) - { - return VOS_STATUS_E_FAILURE; - } - - if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) - { - /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ - if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) - { - if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) - { - status = VOS_STATUS_SUCCESS; - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - - /* Release SME global lock */ - sme_ReleaseGlobalLock(&pMac->sme); - - return (status); -} - - - -//sme_DbgReadMemory -//Caller needs to validate the input values -//pBuf caller allocated buffer has the length of nLen -VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) -{ - VOS_STATUS status = VOS_STATUS_E_FAILURE; - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - tPmcPowerState PowerState; - tANI_U32 sessionId = 0; - tANI_U32 cmd = READ_MEMORY_DUMP_CMD; - tANI_U32 arg1 = memAddr; - tANI_U32 arg2 = nLen/4; - tANI_U32 arg3 = 4; - tANI_U32 arg4 = 0; - /* 1) To make Quarky work in FTM mode **************************************/ - - MTRACE(vos_trace(VOS_MODULE_ID_SME, - TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); - if(eDRIVER_TYPE_MFG == pMac->gDriverType) - { - if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8*)pBuf)) - { - return VOS_STATUS_SUCCESS; - } - return VOS_STATUS_E_FAILURE; - } - - /* 2) NON FTM mode driver *************************************************/ - - /* Acquire SME global lock */ - if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) - { - return VOS_STATUS_E_FAILURE; - } - - if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) - { - /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ - if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) - { - if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8 *)pBuf)) - { - status = VOS_STATUS_SUCCESS; - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - - /* This is a hack for Qualky/pttWniSocket - Current implementation doesn't allow pttWniSocket to inform Qualky an error */ - if (VOS_STATUS_SUCCESS != status) - { - vos_mem_set(pBuf, nLen, 0xCD); - status = VOS_STATUS_SUCCESS; - smsLog(pMac, LOGE, FL(" filled with 0xCD because it cannot access the hardware")); - } - - /* Release SME lock */ - sme_ReleaseGlobalLock(&pMac->sme); - - return (status); -} - - -//sme_DbgWriteMemory -//Caller needs to validate the input values -VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) -{ - VOS_STATUS status = VOS_STATUS_E_FAILURE; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - tPmcPowerState PowerState; - tANI_U32 sessionId = 0; - - /* 1) To make Quarky work in FTM mode **************************************/ - - MTRACE(vos_trace(VOS_MODULE_ID_SME, - TRACE_CODE_SME_RX_HDD_DBG_WRITEMEM, NO_SESSION, 0)); - if(eDRIVER_TYPE_MFG == pMac->gDriverType) - { - { - return VOS_STATUS_SUCCESS; - } - return VOS_STATUS_E_FAILURE; - } - - /* 2) NON FTM mode driver *************************************************/ - - /* Acquire SME global lock */ - if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) - { - return VOS_STATUS_E_FAILURE; - } - - if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) - { - /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ - if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) - { - if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteMemory(memAddr, (void *)pBuf, nLen)) - { - status = VOS_STATUS_SUCCESS; - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - else - { - status = VOS_STATUS_E_FAILURE; - } - } - - /* Release Global lock */ - sme_ReleaseGlobalLock(&pMac->sme); - - return (status); -} - - void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...) { VOS_TRACE_LEVEL vosDebugLevel; diff --git a/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c b/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c index 5914c733e2cd..d2ea4943f531 100644 --- a/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c +++ b/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -49,23 +49,7 @@ #endif // Global variables static struct hdd_context_s *pAdapterHandle; -//Utility function to perform endianess swap -static void ptt_sock_swap_32(void *pBuffer, unsigned int len) -{ - v_U32_t *pBuf32, data; - v_U8_t *pBuf8; - unsigned int i; - len &= ~(sizeof(v_U32_t)-1); - pBuf32 = (v_U32_t *) pBuffer; - pBuf8 = (v_U8_t *) pBuffer; - for (i = 0; i < len; i += 4, ++pBuf32, pBuf8 += 4) { - data = *pBuf32; - pBuf8[0] = (v_U8_t) ((data >> 24) & 0xff); - pBuf8[1] = (v_U8_t) ((data >> 16) & 0xff); - pBuf8[2] = (v_U8_t) ((data >> 8) & 0xff); - pBuf8[3] = (v_U8_t) ((data >> 0) & 0xff); - } -} + #ifdef PTT_SOCK_DEBUG_VERBOSE //Utility function to perform a hex dump static void ptt_sock_dump_buf(const unsigned char * pbuf, int cnt) @@ -171,109 +155,6 @@ static void ptt_proc_pumac_msg(struct sk_buff * skb, tAniHdr *wmsg, int radio) } } /* - * Process all the messages from the Quarky Client - */ -static void ptt_proc_quarky_msg(tAniNlHdr *wnl, tAniHdr *wmsg, int radio) -{ - u16 ani_msg_type = be16_to_cpu(wmsg->type); - v_U32_t reg_addr; - v_U32_t reg_val; - v_U32_t len_payload; - v_U8_t* buf; - unsigned int arg1, arg2, arg3, arg4, cmd; - VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - if (radio < 0 || radio > ANI_MAX_RADIOS) { - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: ANI Msg [0x%X] invalid radio id [%d]\n", - __func__, ani_msg_type, radio); - return; - } - if(ani_msg_type == ANI_MSG_APP_REG_REQ) - { - ptt_sock_proc_reg_req(wmsg, radio); - } - else - { - switch (ani_msg_type) - { - case PTT_MSG_READ_REGISTER: - reg_addr = *(v_U32_t*) ((char*)wmsg + 8); - PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: PTT_MSG_READ_REGISTER [0x%08X]\n", - __func__, reg_addr); - vosStatus = sme_DbgReadRegister(pAdapterHandle->hHal, reg_addr, ®_val); - *(v_U32_t*) ((char*)wmsg + 12) = reg_val; - if(vosStatus != VOS_STATUS_SUCCESS) - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: Read Register [0x%08X] failed!!\n", - __func__, reg_addr); - ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, wnl->nlh.nlmsg_pid); - break; - case PTT_MSG_WRITE_REGISTER: - reg_addr = *(v_U32_t*) ((const unsigned char*)wmsg + 8); - reg_val = *(v_U32_t*)((const unsigned char*)wmsg + 12); - PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: PTT_MSG_WRITE_REGISTER Addr [0x%08X] value [0x%08X]\n", - __func__, reg_addr, reg_val); - vosStatus = sme_DbgWriteRegister(pAdapterHandle->hHal, reg_addr, reg_val); - if(vosStatus != VOS_STATUS_SUCCESS) - { - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: Write Register [0x%08X] value [0x%08X] failed!!\n", - __func__, reg_addr, reg_val); - } - //send message to the app - ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, wnl->nlh.nlmsg_pid); - break; - case PTT_MSG_READ_MEMORY: - reg_addr = *(v_U32_t*) ((char*)wmsg + 8); - len_payload = *(v_U32_t*) ((char*)wmsg + 12); - PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: PTT_MSG_READ_MEMORY addr [0x%08X] bytes [0x%08X]\n", - __func__, reg_addr, len_payload); - buf = (v_U8_t*)wmsg + 16; - vosStatus = sme_DbgReadMemory(pAdapterHandle->hHal, reg_addr, buf, len_payload); - if(vosStatus != VOS_STATUS_SUCCESS) { - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: Memory read failed for [0x%08X]!!\n", - __func__, reg_addr); - } - ptt_sock_swap_32(buf, len_payload); - //send message to the app - ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, wnl->nlh.nlmsg_pid); - break; - case PTT_MSG_WRITE_MEMORY: - reg_addr = *(v_U32_t*) ((char*)wmsg + 8); - len_payload = *(v_U32_t*) ((char*)wmsg + 12); - PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: PTT_MSG_DBG_WRITE_MEMORY addr [0x%08X] bytes [0x%08X]\n", - __func__, reg_addr, len_payload); - buf = (v_U8_t*)wmsg + 16; - ptt_sock_swap_32(buf, len_payload); - vosStatus = sme_DbgWriteMemory(pAdapterHandle->hHal, reg_addr, buf, len_payload); - if(vosStatus != VOS_STATUS_SUCCESS) - { - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: Memory write failed for addr [0x%08X]!!\n", - __func__, reg_addr); - } - //send message to the app - ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, wnl->nlh.nlmsg_pid); - break; - case PTT_MSG_LOG_DUMP_DBG: - cmd = *(unsigned int *) ((char *)wmsg + 8); - arg1 = *(unsigned int *) ((char *)wmsg + 12); - arg2 = *(unsigned int *) ((char *)wmsg + 16); - arg3 = *(unsigned int *) ((char *)wmsg + 20); - arg4 = *(unsigned int *) ((char *)wmsg + 24); - PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: PTT_MSG_LOG_DUMP_DBG %d arg1 %d arg2 %d arg3 %d arg4 %d\n", - __func__, cmd, arg1, arg2, arg3, arg4); - //send message to the app - ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, wnl->nlh.nlmsg_pid); - break; - case PTT_MSG_FTM_CMDS_TYPE: - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: unsupported FTM msg cmd [0x%X], length [0x%X]\n", - __func__, ani_msg_type, be16_to_cpu(wmsg->length )); - break; - default: - PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: Unknown ANI Msg [0x%X], length [0x%X]\n", - __func__, ani_msg_type, be16_to_cpu(wmsg->length )); - break; - } - } -} -/* * Process all the Netlink messages from PTT Socket app in user space */ static int ptt_sock_rx_nlink_msg (struct sk_buff * skb) @@ -290,11 +171,6 @@ static int ptt_sock_rx_nlink_msg (struct sk_buff * skb) __func__, type); ptt_proc_pumac_msg(skb, &wnl->wmsg, radio); break; - case ANI_NL_MSG_PTT: //Message from Quarky GUI - PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: Received ANI_NL_MSG_PTT Msg [0x%X]\n", - __func__, type); - ptt_proc_quarky_msg(wnl, &wnl->wmsg, radio); - break; default: PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: Unknown NL Msg [0x%X]\n",__func__, type); break; |
