/drivers/net/wireless/tiwlan1251/common/src/hal/hw_ctrl/whalHwMboxConfig.c
C | 1752 lines | 730 code | 269 blank | 753 comment | 29 complexity | 8ab634802b35f8f1f4e647ac025d420f MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
Large files files are truncated, but you can click here to view the full file
- /****************************************************************************
- **+-----------------------------------------------------------------------+**
- **| |**
- **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
- **| All rights reserved. |**
- **| |**
- **| Redistribution and use in source and binary forms, with or without |**
- **| modification, are permitted provided that the following conditions |**
- **| are met: |**
- **| |**
- **| * Redistributions of source code must retain the above copyright |**
- **| notice, this list of conditions and the following disclaimer. |**
- **| * Redistributions in binary form must reproduce the above copyright |**
- **| notice, this list of conditions and the following disclaimer in |**
- **| the documentation and/or other materials provided with the |**
- **| distribution. |**
- **| * Neither the name Texas Instruments nor the names of its |**
- **| contributors may be used to endorse or promote products derived |**
- **| from this software without specific prior written permission. |**
- **| |**
- **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
- **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
- **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
- **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |**
- **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
- **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |**
- **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
- **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
- **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
- **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
- **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
- **| |**
- **+-----------------------------------------------------------------------+**
- ****************************************************************************/
- /****************************************************************************
- *
- * MODULE: whalHwMboxConfig.c
- * PURPOSE: Handle the wlan hardware information elements:
- *
- ****************************************************************************/
- #include "whalCommon.h"
- #include "whalHwDefs.h"
- #include "public_infoele.h"
- #include "CmdQueue_api.h"
- #include "whalHwMboxConfig.h"
- /****************************************************************************
- * whal_hwMboxConfig_Create()
- ****************************************************************************
- * DESCRIPTION: Create the mailbox configuration commands object
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: The Created object
- ****************************************************************************/
- HwMboxConfig_T* whal_hwMboxConfig_Create (TI_HANDLE hOs)
- {
- HwMboxConfig_T* pObj;
- pObj = os_memoryAlloc (hOs, sizeof(HwMboxConfig_T));
- if (pObj == NULL)
- return NULL;
- os_memoryZero (hOs, (void *)pObj, sizeof(HwMboxConfig_T));
- pObj->hOs = hOs;
- return(pObj);
- }
- /****************************************************************************
- * whal_hwMboxConfig_Destroy()
- ****************************************************************************
- * DESCRIPTION: Destroy the object
- *
- * INPUTS:
- * pHwMboxConfig The object to free
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwMboxConfig_Destroy (HwMboxConfig_T* pHwMboxConfig)
- {
- if (pHwMboxConfig)
- os_memoryFree(pHwMboxConfig->hOs, pHwMboxConfig, sizeof(HwMboxConfig_T));
- return (OK);
- }
- /****************************************************************************
- * whal_hwMboxConfig_Config()
- ****************************************************************************
- * DESCRIPTION: Configure the object
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwMboxConfig_Config (HwMboxConfig_T* pHwMboxConfig,TI_HANDLE hCmdMboxQueue, TI_HANDLE hReport)
- {
- pHwMboxConfig->hReport = hReport;
- pHwMboxConfig->hCmdMboxQueue = hCmdMboxQueue;
- return (OK);
- }
- /****************************************************************************
- * whal_hwInfoElemConfigMemorySet()
- ****************************************************************************
- * DESCRIPTION: Configure wlan hardware memory
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemConfigMemorySet (HwMboxConfig_T* pHwMboxConfig, DmaParams_T *pDmaParams)
- {
- ACXConfigMemoryStruct_t AcxElm_ConfigMemory;
- ACXConfigMemoryStruct_t *pCfg = &AcxElm_ConfigMemory;
- int Qid;
-
- os_memoryZero(pHwMboxConfig->hOs, (void *)pCfg, sizeof(*pCfg));
- /*
- * Set information element header
- */
- pCfg->memConfig.EleHdr.id = ACX_MEM_CFG;
- pCfg->memConfig.EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /*
- * Set configuration fields
- */
- pCfg->memConfig.numStations = ENDIAN_HANDLE_WORD(pDmaParams->NumStations); /*(1)*/
- pCfg->memConfig.rxMemblockNumber = pDmaParams->rxMemBlkNumber; /*(60)*/
- pCfg->memConfig.txMinimumMemblockNumber = pDmaParams->txMinMemBlkNumber; /*(60)*/
- pCfg->memConfig.numTxQueues = pDmaParams->NumTxQueues; /*(4)*/
- pCfg->memConfig.hostifOptions = 3; /*(3 - HOST_IF_PKT_RING)*/
- pCfg->memConfig.numSsidProfiles = 1;
- pCfg->memConfig.debugBufferSize = ENDIAN_HANDLE_WORD(pDmaParams->TraceBufferSize/4); /*(4)*/
-
- /*
- * Rx queue config
- */
- pCfg->RxQueueConfig.dmaAddress = 0;
- pCfg->RxQueueConfig.numDescs = (UINT8)pDmaParams->RxNumDesc;
- pCfg->RxQueueConfig.Priority = (UINT8)pDmaParams->RxQPriority;
- pCfg->RxQueueConfig.Type = pDmaParams->RxQueue_Type;
- /*
- * Tx queue config
- */
- for (Qid=0; Qid<pDmaParams->NumTxQueues; Qid++)
- {
- pCfg->TxQueueConfig[Qid].numDescs = pDmaParams->TxNumDesc[Qid];
- pCfg->TxQueueConfig[Qid].attributes = pDmaParams->TxQPriority[Qid];
- }
- /* The structure contain array of TxQueueConfig_T
- * The size of the array is QUEUE_CONFIG_MAX_TX_QUEUES buf the actual number of
- * Queues are pCfg->NumTxQueues so the structure length must be fixed */
- pCfg->memConfig.EleHdr.len -= (NUM_ACCESS_CATEGORIES_QUEUES - pDmaParams->NumTxQueues) * sizeof(ACXtxQueueConfig);
- /*
- * Send the configuration command
- */
- return CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- }
- /****************************************************************************
- * whal_hwInfoElemDataPathParamsSet()
- ****************************************************************************
- * DESCRIPTION: configure Data path and TX complete parameters
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemDataPathParamsSet (HwMboxConfig_T* pHwMboxConfig,UINT16 rxPacketRingChunkSize,
- UINT16 txPacketRingChunkSize, UINT8 rxPacketRingChunkNum,
- UINT8 txPacketRingChunkNum, UINT8 txCompleteThreshold,
- UINT8 txCompleteRingDepth, UINT32 txCompleteTimeOut)
- {
- ACXDataPathParams_t DataPathParams;
- ACXDataPathParams_t* pCfg = &DataPathParams;
- /*
- * Set information element header
- */
- pCfg->EleHdr.id = ACX_DATA_PATH_PARAMS;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /*
- * Set configuration fields
- */
- pCfg->rxPacketRingChunkSize = ENDIAN_HANDLE_WORD(rxPacketRingChunkSize);
- pCfg->txPacketRingChunkSize = ENDIAN_HANDLE_WORD(txPacketRingChunkSize );
- pCfg->rxPacketRingChunkNum = rxPacketRingChunkNum;
- pCfg->txPacketRingChunkNum = txPacketRingChunkNum;
- pCfg->txCompleteThreshold = txCompleteThreshold;
- pCfg->txCompleteRingDepth = txCompleteRingDepth;
- pCfg->txCompleteTimeOut = txCompleteTimeOut;
- /* Send the configuration command*/
- return CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- }
- /****************************************************************************
- * whal_hwInfoElemDataPathParamsGet()
- ****************************************************************************
- * DESCRIPTION: Get data path specific parameters
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemDataPathParamsGet (HwMboxConfig_T* pHwMboxConfig, ACXDataPathParamsResp_t* pCfg, void *fCb, TI_HANDLE hCb)
- {
- int rc;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_DATA_PATH_PARAMS;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Send the interrogation command*/
- if ((rc = CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg), fCb, hCb, pCfg)) == OK)
- {
- }
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemQueueHeadGet()
- ****************************************************************************
- * DESCRIPTION: Read the Queue addresses after memory init
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemQueueHeadGet (HwMboxConfig_T* pHwMboxConfig, int NumTxQueues, int pElem, void *fCb, TI_HANDLE hCb)
- {
- #if 0 /*Benzy: should be fixed after the firmware/driver integration*/
- int Qid;
- int Stt;
- /* only interrogate is enabled to this info element */
- if (aAction != INTERROGATE_ACTION)
- return (NOK);
- /*
- * Set information element header
- */
- pElem->EleHdr.id = ACX_QUEUE_HEAD;
- pElem->EleHdr.len = sizeof(*pElem) - sizeof(EleHdrStruct);
- /*
- * Send the interrogation command, and fill the structure
- */
- if ((Stt=CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue, pElem, sizeof(*pElem), fCb, hCb, pElem)) != OK)
- return (Stt);
- /*
- * Solve endian problem
- */
- pElem->rxMemBlkQ = (UINT32 *)ENDIAN_HANDLE_LONG((UINT32)(pElem->rxMemBlkQ));
- pElem->txMemBlkQ = (UINT32 *)ENDIAN_HANDLE_LONG((UINT32)(pElem->txMemBlkQ));
- pElem->rxQueueHead.addr = ENDIAN_HANDLE_LONG(pElem->rxQueueHead.addr);
- for (Qid=0; Qid<NumTxQueues; Qid++)
- {
- pElem->txQueueHead[Qid].addr = ENDIAN_HANDLE_LONG(pElem->txQueueHead[Qid].addr);
- }
- #endif
- WLAN_OS_REPORT(("Command Disabled: whal_hwInfoElemQueueHeadGet\n"));
- return OK;
- }
- /****************************************************************************
- * whal_hwInfoElemSlotTimeSet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate the Slot Time
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemSlotTimeSet (HwMboxConfig_T* pHwMboxConfig, UINT8* apSlotTime)
- {
- int rc;
- ACXSlot_t AcxElm_SlotTime;
- ACXSlot_t *pCfg = &AcxElm_SlotTime;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_SLOT;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set configuration fields */
- /* woneIndex is not relevant to station implementation */
- pCfg->woneIndex = STATION_WONE_INDEX;
- pCfg->slotTime = *apSlotTime;
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: Sending info elem to firmware, Slot Time = %d\n", __FUNCTION__, (UINT8)pCfg->slotTime));
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemPreambleSet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate the Preamble
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemPreambleSet (HwMboxConfig_T* pHwMboxConfig, UINT8* apPreamble)
- {
- int rc;
- ACXPreamble_t AcxElm_Preamble;
- ACXPreamble_t *pCfg = &AcxElm_Preamble;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_PREAMBLE_TYPE;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set configuration fields */
- /* woneIndex is not relevant to station implementation */
- pCfg->preamble = *apPreamble;
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemGeneraedFrameRate()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate the rate
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemGeneratedFrameRateSet (HwMboxConfig_T *pHwMboxConfig,
- UINT8 *txCtrlFrmRate,
- UINT8 *txCtrlFrmMod,
- UINT8 *txMgmtFrmRate,
- UINT8 *txMgmtFrmMod)
- {
- int rc;
- ACXFwGeneratedFrameRates_t AcxElm_FrameRate;
- ACXFwGeneratedFrameRates_t *pCfg = &AcxElm_FrameRate;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_FW_GEN_FRAME_RATES;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set configuration fields */
- /* woneIndex is not relevant to station implementation */
- pCfg->txCtrlFrmRate = *txCtrlFrmRate;
- pCfg->txCtrlFrmMod = *txCtrlFrmMod;
- pCfg->txMgmtFrmRate = *txMgmtFrmRate;
- pCfg->txMgmtFrmMod = *txMgmtFrmMod;
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemRxConfigSet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate RxConfig information element
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemRxConfigSet (HwMboxConfig_T* pHwMboxConfig, UINT32* apRxConfigOption, UINT32* apRxFilterOption)
- {
- int rc;
- ACXRxConfig_t AcxElm_RxConfig;
- ACXRxConfig_t* pCfg = &AcxElm_RxConfig;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_RX_CFG;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set configuration fields */
- pCfg->ConfigOptions = ENDIAN_HANDLE_LONG(*apRxConfigOption);
- pCfg->FilterOptions = ENDIAN_HANDLE_LONG(*apRxFilterOption);
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemBETSet()
- ****************************************************************************
- * DESCRIPTION: Configures Beacon Early Termination information element
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemBETSet(HwMboxConfig_T* pHwMboxConfig, UINT8 Enable, UINT8 MaximumConsecutiveET)
- {
- int rc;
- ACXBet_Enable_t ACXBet_Enable;
- ACXBet_Enable_t* pCfg = &ACXBet_Enable;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_BET_ENABLE;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set configuration fields */
- pCfg->Enable = Enable;
- pCfg->MaximumConsecutiveET = MaximumConsecutiveET;
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: Sending info elem to firmware, Enable=%d, MaximumConsecutiveET=%d\n",
- __FUNCTION__, (UINT8)pCfg->Enable, (UINT8)pCfg->MaximumConsecutiveET));
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemSetRxDataFiltersParams()
- *****************************************************************************
- * DESCRIPTION: Enables or disables Rx data filtering.
- *
- * INPUTS: enabled - 0 to disable data filtering, any other value to enable
- * defaultAction - The default action to take on non-matching packets.
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemSetRxDataFiltersParams(HwMboxConfig_T * pHwMboxConfig, BOOL enabled, filter_e defaultAction)
- {
- DataFilterDefault_t dataFilterDefault;
- DataFilterDefault_t * pCfg = &dataFilterDefault;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_ENABLE_RX_DATA_FILTER;
- pCfg->EleHdr.len = 0;
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: Rx Data Filter configuration:\n", __FUNCTION__));
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: enabled = %d, defaultAction = %d\n", __FUNCTION__, enabled, defaultAction));
- /* Set information element configuration fields */
- pCfg->enable = enabled;
- pCfg->action = defaultAction;
- pCfg->EleHdr.len += sizeof(pCfg->enable) + sizeof(pCfg->action);
- WLAN_REPORT_HEX_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG, (UINT8 *) pCfg, sizeof(dataFilterDefault));
- return CmdQueue_CmdConfigure(pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- }
- /****************************************************************************
- * whal_hwInfoElemSetRxDataFilter()
- *****************************************************************************
- * DESCRIPTION: Add/remove Rx Data filter information element.
- *
- * INPUTS: index - Index of the Rx Data filter
- * command - Add or remove the filter
- * action - Action to take on packets matching the pattern
- * numFieldPatterns - Number of field patterns in the filter
- * lenFieldPatterns - Length of the field pattern series
- * fieldPatterns - Series of field patterns
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemSetRxDataFilter(HwMboxConfig_T * pHwMboxConfig, UINT8 index, UINT8 command, filter_e action, UINT8 numFieldPatterns, UINT8 lenFieldPatterns, UINT8 * fieldPatterns)
- {
- UINT8 dataFilterConfig[sizeof(DataFilterConfig_t) + MAX_DATA_FILTER_SIZE];
- DataFilterConfig_t * pCfg = (DataFilterConfig_t *) &dataFilterConfig;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_SET_RX_DATA_FILTER;
- pCfg->EleHdr.len = 0;
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: Rx Data Filter configuration:\n", __FUNCTION__));
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: command = %d, index = %d, action = %d, numFieldPatterns = %d\n", __FUNCTION__,
- command, index, action, numFieldPatterns));
- /* Set information element configuration fields */
- pCfg->command = command;
- pCfg->index = index;
- pCfg->EleHdr.len += sizeof(pCfg->command) + sizeof(pCfg->index);
- /* When removing a filter only the index and command are to be sent */
- if (command == ADD_FILTER)
- {
- pCfg->action = action;
- pCfg->numOfFields = numFieldPatterns;
- pCfg->EleHdr.len += sizeof(pCfg->action) + sizeof(pCfg->numOfFields);
- if (fieldPatterns == NULL)
- {
- WLAN_REPORT_ERROR(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: Null pattern table argument received!\n", __FUNCTION__));
- return PARAM_VALUE_NOT_VALID;
- }
- os_memoryCopy(pHwMboxConfig->hOs, &pCfg->FPTable, fieldPatterns, lenFieldPatterns);
- pCfg->EleHdr.len += lenFieldPatterns;
- }
- WLAN_REPORT_HEX_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG, (UINT8 *) pCfg, sizeof(dataFilterConfig));
- return CmdQueue_CmdConfigure(pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(dataFilterConfig));
- }
- /****************************************************************************
- * whal_hwInfoElemGetRxDataFiltersStatistics()
- ****************************************************************************
- * DESCRIPTION: Get the ACX GWSI counters
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemGetRxDataFiltersStatistics(HwMboxConfig_T * pHwMboxConfig,
- void * CB_Func,
- TI_HANDLE CB_handle,
- void * CB_Buf)
- {
- ACXDataFilteringStatistics_t acx;
- ACXDataFilteringStatistics_t * pCfg = &acx;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_GET_DATA_FILTER_STATISTICS;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- WLAN_REPORT_HEX_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG, (UINT8 *) pCfg, sizeof(ACXDataFilteringStatistics_t));
- /* Send the interrogation command */
- return CmdQueue_CmdInterrogateWithCb(pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg), CB_Func, CB_handle, CB_Buf);
- }
- /****************************************************************************
- * whalCtrl_getConsumptionStatistics()
- ****************************************************************************
- * DESCRIPTION: Get the ACX Power consumption statistics
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whalCtrl_getConsumptionStatistics(HwMboxConfig_T * pHwMboxConfig, void * CB_Func, TI_HANDLE CB_handle, void * CB_Buf)
- {
- ACXPowerConsumptionTimeStat_t acx;
- ACXPowerConsumptionTimeStat_t * pCfg = &acx;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_PWR_CONSUMPTION_STATISTICS;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
-
- /* Send the interrogation command */
- return CmdQueue_CmdInterrogateWithCb(pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg), CB_Func, CB_handle, CB_Buf);
- }
- /****************************************************************************
- * whal_hwInfoElemarpIpAddressesTableSet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate ARP addr table information element for
- * ipV4 only
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemarpIpAddressesTableSet (HwMboxConfig_T* pHwMboxConfig,
- IpAddress_t *IP_addr,
- UINT32 isFilteringEnabled)
- {
- int rc;
- ACXConfigureIP_t AcxElm_CmdConfigureIP;
- ACXConfigureIP_t *pCfg = &AcxElm_CmdConfigureIP;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_ARP_IP_FILTER;
- pCfg->EleHdr.len = sizeof(ACXConfigureIP_t) - sizeof(EleHdrStruct);
- pCfg->arpFilterEnable = isFilteringEnabled;
-
- /* IP address */
- /* Note that in the case of IPv4 it is assumed that the extra two bytes are zero */
- os_memoryCopy (pHwMboxConfig->hOs, (PVOID)pCfg->address, (PVOID)IP_addr->addr, IP_V4_ADDR_LEN);
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,("ip filtering : %d.%d.%d.%d Enabled = %d \n" , pCfg->address[0] , pCfg->address[1] , pCfg->address[2] , pCfg->address[3] , isFilteringEnabled)) ;
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(ACXConfigureIP_t));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemGroupAdressesTableSet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate Group addr table information element
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemGroupAdressesTableSet (HwMboxConfig_T* pHwMboxConfig,
- UINT8* numGroupAddrs,
- macAddress_t *Group_addr,
- UINT8* isEnabled)
- {
- int i = 0;
- int rc = OK;
- UINT8 *tmpLoc = NULL;
- dot11MulticastGroupAddrStart_t AcxElm_CmdConfigureMulticastIp;
- dot11MulticastGroupAddrStart_t* pCfg = &AcxElm_CmdConfigureMulticastIp;
-
- if ( NULL == pHwMboxConfig )
- {
- return PARAM_VALUE_NOT_VALID;
- }
-
- os_memoryZero (pHwMboxConfig->hOs, (void *)pCfg, sizeof(dot11MulticastGroupAddrStart_t));
- /* Set information element header */
- pCfg->EleHdr.id = DOT11_GROUP_ADDRESS_TBL;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
-
- pCfg->numOfGroups = *numGroupAddrs;
- pCfg->fltrState = *isEnabled;
- tmpLoc = pCfg->dataLocation;
-
- if (NULL != Group_addr)
- {
- for (i=0; i<*numGroupAddrs; i++)
- {
- os_memoryCopy(pHwMboxConfig->hOs, (PVOID)&(tmpLoc[MAC_ADDR_SIZE*i]), (PVOID)&(Group_addr->addr[MAC_ADDR_SIZE*i]), MAC_ADDR_SIZE);
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwInfoElemGroupAdressesTable: MAC %x: %x:%x:%x:%x:%x:%x\n",
- i,
- tmpLoc[MAC_ADDR_SIZE*i+0] ,
- tmpLoc[MAC_ADDR_SIZE*i+1] ,
- tmpLoc[MAC_ADDR_SIZE*i+2] ,
- tmpLoc[MAC_ADDR_SIZE*i+3] ,
- tmpLoc[MAC_ADDR_SIZE*i+4] ,
- tmpLoc[MAC_ADDR_SIZE*i+5]));
- }
- }
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(dot11MulticastGroupAddrStart_t));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemStationIdSet ()
- ****************************************************************************
- * DESCRIPTION: Configure StationId information element to/from
- * the wlan hardware.
- * This information element specifies the MAC Address assigned to the
- * STATION or AP.
- * This default value is the permanent MAC address that is stored in the
- * adaptor's non-volatile memory.
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemStationIdSet
- (
- HwMboxConfig_T *pHwMboxConfig,
- UINT8 *apStationId
- )
- {
- int i;
- int rc;
- dot11StationIDStruct AcxElm_StationId;
- dot11StationIDStruct* pCfg = &AcxElm_StationId;
- /* Set information element header*/
- pCfg->EleHdr.id = DOT11_STATION_ID;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set configuration field (reversed order, see docs)*/
- for (i = 0; i < 6; i++)
- pCfg->dot11StationID[i] = apStationId[5-i];
- /* Send the configuration command*/
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemStationIdGet ()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate StationId information element to/from
- * the wlan hardware.
- * This information element specifies the MAC Address assigned to the
- * STATION or AP.
- * This default value is the permanent MAC address that is stored in the
- * adaptor's non-volatile memory.
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemStationIdGet
- (
- HwMboxConfig_T* pHwMboxConfig,
- void* fCb,
- TI_HANDLE hCb,
- void* pCb
- )
- {
- int rc;
- dot11StationIDStruct AcxElm_StationId;
- dot11StationIDStruct* pCfg = &AcxElm_StationId;
- /* Set information element header*/
- pCfg->EleHdr.id = DOT11_STATION_ID;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- if ((rc = CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue,
- pCfg,
- sizeof(*pCfg),
- fCb,
- hCb,
- pCb)) == OK)
- {
- }
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemStationIdForRecoveryGet ()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate StationId information element to/from
- * the wlan hardware.
- * This information element specifies the MAC Address assigned to the
- * STATION or AP.
- * This default value is the permanent MAC address that is stored in the
- * adaptors non-volatile memory.
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemStationIdForRecoveryGet (HwMboxConfig_T* pHwMboxConfig,
- void *CB_Func, TI_HANDLE CB_handle, dot11StationIDStruct* CB_Buf)
- {
- dot11StationIDStruct AcxElm_StationId;
- dot11StationIDStruct* pCfg = &AcxElm_StationId;
- /* Set information element header*/
- pCfg->EleHdr.id = DOT11_STATION_ID;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg), CB_Func, CB_handle, CB_Buf);
- return OK;
- }
- /****************************************************************************
- * whal_hwInfoElemRSSIGet ()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate StationId information element to/from
- * the wlan hardware.
- * This information element specifies the MAC Address assigned to the
- * STATION or AP.
- * This default value is the permanent MAC address that is stored in the
- * adaptor's non-volatile memory.
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemRSSIGet (HwMboxConfig_T* pHwMboxConfig, void *CB_Func, TI_HANDLE CB_handle, PUINT8 CB_Buf)
- {
- int rc;
- ACXRoamingStatisticsTable_t AcxElm_GetAverageRSSI;
- ACXRoamingStatisticsTable_t* pCfg = &AcxElm_GetAverageRSSI;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_ROAMING_STATISTICS_TBL;
- pCfg->EleHdr.len = sizeof(ACXRoamingStatisticsTable_t) - sizeof(EleHdrStruct);
-
- rc = CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(ACXRoamingStatisticsTable_t), CB_Func, CB_handle, CB_Buf);
- /* Send the configuration command */
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemACIConfigurationSet()
- ****************************************************************************
- * DESCRIPTION: Configure the hardware ACI parameters
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemACIConfigurationSet (HwMboxConfig_T* pHwMboxConfig, UINT8 ACIMode,
- UINT8 inputCCA, UINT8 qualifiedCCA,
- UINT8 stompForRx, UINT8 stompForTx,
- UINT8 txCCA)
- {
- int rc;
- ACXConfigACI_t AcxElm_AciConfig;
- ACXConfigACI_t* pCfg = &AcxElm_AciConfig;
- /* Set information element header */
- pCfg->EleHdr.id = ACX_ACI_OPTION_CFG;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set sequence number */
- pCfg->ACIMode = ACIMode;
- pCfg->inputCCA = inputCCA;
- pCfg->qualifiedCCA = qualifiedCCA;
- pCfg->stompForRx = stompForRx;
- pCfg->stompForTx = stompForTx;
- pCfg->txCCA = txCCA;
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
-
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemBssPowerSaveGet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate the Bss in/not power save
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemBssPowerSaveGet (HwMboxConfig_T* pHwMboxConfig, UINT8* apBssInPs_Val)
- {
- int rc;
- ACXBSSPowerSave_t AcxElm_BssPowerSave;
- ACXBSSPowerSave_t *pCfg = &AcxElm_BssPowerSave;
- /* Set information element heade r*/
- pCfg->EleHdr.id = ACX_BSS_IN_PS;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set configuration fields */
- pCfg->BSSinPowerSave = *apBssInPs_Val;
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemSoftGeminiEnableSet()
- ****************************************************************************
- * DESCRIPTION: Enable/Disable the BTH-WLAN
- *
- * INPUTS: Enable flag
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemSoftGeminiEnableSet (HwMboxConfig_T* pHwMboxConfig, SoftGeminiEnableModes_e SoftGeminiEnableModes)
- {
- ACXBluetoothWlanCoEnableStruct AcxElm_BluetoothWlanEnable;
- ACXBluetoothWlanCoEnableStruct* pCfg = &AcxElm_BluetoothWlanEnable;
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwInfoElemSoftGeminiEnableSet: Enable flag = %d\n", SoftGeminiEnableModes));
- /* Set information element header */
- pCfg->EleHdr.id = ACX_SG_ENABLE;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Set enable field */
- pCfg->Enable = (UINT8)SoftGeminiEnableModes;
- /* Send the configuration command */
- return CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- }
- /****************************************************************************
- * whal_hwInfoElemSoftGeminiParamsSet()
- ****************************************************************************
- * DESCRIPTION: Configure the BTH-WLAN co-exsistance
- *
- * INPUTS: Configuration structure pointer
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemSoftGeminiParamsSet (HwMboxConfig_T* pHwMboxConfig, SoftGeminiParam_t *SoftGeminiParam)
- {
- ACXBluetoothWlanCoParamsStruct AcxElm_BluetoothWlanEnable;
- ACXBluetoothWlanCoParamsStruct* pCfg = &AcxElm_BluetoothWlanEnable;
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwInfoElemSoftGeminiParamsSet. \n"));
- /* Set information element header */
- pCfg->EleHdr.id = ACX_SG_CFG;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- pCfg->afhLeverageOn = SoftGeminiParam->afhLeverageOn;
- pCfg->btHpMaxTime = SoftGeminiParam->btHpMaxTime;
- pCfg->maxNumCts = SoftGeminiParam->maxNumCts;
- pCfg->numberOfBtPackets = SoftGeminiParam->numberOfBtPackets;
- pCfg->numberOfWlanPackets = SoftGeminiParam->numberOfWlanPackets;
- pCfg->numberQuietCycle = SoftGeminiParam->numberQuietCycle;
- pCfg->protectiveRxTimeBeforeBtHp = SoftGeminiParam->protectiveRxTimeBeforeBtHp;
- pCfg->protectiveTxTimeBeforeBtHp = SoftGeminiParam->protectiveTxTimeBeforeBtHp;
- pCfg->protectiveRxTimeBeforeBtHpFastAp = SoftGeminiParam->protectiveRxTimeBeforeBtHpFastAp;
- pCfg->protectiveTxTimeBeforeBtHpFastAp = SoftGeminiParam->protectiveTxTimeBeforeBtHpFastAp;
- pCfg->protectiveWlanCycleTimeForFastAp = SoftGeminiParam->protectiveWlanCycleTimeForFastAp;
- pCfg->senseDisableTimer = SoftGeminiParam->senseDisableTimer;
- pCfg->sgAntennaType = SoftGeminiParam->sgAntennaType;
- pCfg->signalingType = SoftGeminiParam->signalingType;
- pCfg->timeoutNextBtLpPacket = SoftGeminiParam->timeoutNextBtLpPacket;
- pCfg->wlanHpMaxTime = SoftGeminiParam->wlanHpMaxTime;
- pCfg->numberOfMissedRxForAvalancheTrigger = SoftGeminiParam->numberOfMissedRxForAvalancheTrigger;
- pCfg->wlanElpHpSupport = SoftGeminiParam->wlanElpHpSupport;
- pCfg->btAntiStarvationNumberOfCyclesWithinThePeriod = SoftGeminiParam->btAntiStarvationNumberOfCyclesWithinThePeriod;
- pCfg->btAntiStarvationPeriod = SoftGeminiParam->btAntiStarvationPeriod;
- pCfg->ackModeDuringBtLpInDualAnt = SoftGeminiParam->ackModeDuringBtLpInDualAnt;
- pCfg->allowPaSdToggleDuringBtActivityEnable = SoftGeminiParam->allowPaSdToggleDuringBtActivityEnable;
- pCfg->wakeUpTimeBeforeBeacon = SoftGeminiParam->wakeUpTimeBeforeBeacon;
- pCfg->hpdmMaxGuardTime = SoftGeminiParam->hpdmMaxGuardTime;
- pCfg->timeoutNextWlanPacket = SoftGeminiParam->timeoutNextWlanPacket;
- pCfg->sgAutoModeNoCts = SoftGeminiParam->sgAutoModeNoCts;
- pCfg->numOfBtHpRespectedReq = SoftGeminiParam->numOfBtHpRespectedReq;
- /* Convert from pure number to Index. '0' is any rate */
- if ( SoftGeminiParam->wlanRxMinRateToRespectBtHp )
- {
- pCfg->wlanRxMinConvertedRateToRespectBtHp = rateNumberToIndex((UINT8)SoftGeminiParam->wlanRxMinRateToRespectBtHp);
- if (pCfg->wlanRxMinConvertedRateToRespectBtHp == INVALID_RATE_INDEX)
- {
- WLAN_REPORT_ERROR(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s wlanRxMinRateToRespectBtHp from %d to 0 (any rate). \n",
- __FUNCTION__, SoftGeminiParam->wlanRxMinRateToRespectBtHp));
- pCfg->wlanRxMinConvertedRateToRespectBtHp = RATE_INDEX_1MBPS;
- }
- }
- else
- {
- pCfg->wlanRxMinConvertedRateToRespectBtHp = RATE_INDEX_1MBPS;
- }
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s wlanRxMinRateToRespectBtHp from %d to %d. \n",
- __FUNCTION__, SoftGeminiParam->wlanRxMinRateToRespectBtHp, pCfg->wlanRxMinConvertedRateToRespectBtHp));
- /* Send the configuration command */
- return CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg));
- }
- /****************************************************************************
- * whal_hwInfoElemSoftGeminiParamsGet()
- ****************************************************************************
- * DESCRIPTION: Get the BTH-WLAN co-exsistance parameters from the Fw
- *
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemSoftGeminiParamsGet (HwMboxConfig_T* pHwMboxConfig, void *CB_Func, TI_HANDLE CB_handle, void* CB_Buf)
- {
- ACXBluetoothWlanCoParamsStruct AcxElm_BluetoothWlanEnable;
- ACXBluetoothWlanCoParamsStruct* pCfg = &AcxElm_BluetoothWlanEnable;
- WLAN_REPORT_INFORMATION(pHwMboxConfig->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwInfoElemSoftGeminiParamsGet. \n"));
- /* Set information element header */
- pCfg->EleHdr.id = ACX_SG_CFG;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Send the configuration command */
- return CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(ACXBluetoothWlanCoParamsStruct), CB_Func, CB_handle, CB_Buf);
- }
- /****************************************************************************
- * whal_hwInfoElemMemoryMapSet ()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate MemoryMap information element
- *
- * INPUTS:
- * AcxElm_MemoryMap_T *apMap pointer to the memory map structure
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemMemoryMapSet
- (
- HwMboxConfig_T *pHwMboxConfig,
- MemoryMap_t *apMap
- )
- {
- int rc;
- MemoryMap_t SwapMap;
- UINT32 *pSwap, *pOrig, i;
- /* Set information element header */
- SwapMap.EleHdr.id = ACX_MEM_MAP;
- SwapMap.EleHdr.len = sizeof(SwapMap) - sizeof(EleHdrStruct);
- /* Solve endian problem (all fields are 32 bit) */
- pOrig = (UINT32* )&apMap->codeStart;
- pSwap = (UINT32* )&SwapMap.codeStart;
- for (i = 0; i < MEM_MAP_NUM_FIELDS; i++)
- pSwap[i] = ENDIAN_HANDLE_LONG(pOrig[i]);
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigure (pHwMboxConfig->hCmdMboxQueue, &SwapMap, sizeof(SwapMap));
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemMemoryMapGet ()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate MemoryMap information element
- *
- * INPUTS:
- * AcxElm_MemoryMap_T *apMap pointer to the memory map structure
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemMemoryMapGet
- (
- HwMboxConfig_T *pHwMboxConfig,
- MemoryMap_t *apMap,
- void *fCb,
- TI_HANDLE hCb
- )
- {
- int rc;
-
- /* Set information element header */
- apMap->EleHdr.id = ACX_MEM_MAP;
- apMap->EleHdr.len = sizeof(*apMap) - sizeof(EleHdrStruct);
- /* Send the interrogation command */
- if ((rc = CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue, apMap, sizeof(*apMap), fCb, hCb, apMap)) == OK)
- {
- }
- return rc;
- }
- static int whal_hwInfoElemMemoryMapPrintCb (TI_HANDLE hHwMboxConfig, TI_STATUS status, void *pData)
- {
- #ifdef TI_DBG
- HwMboxConfig_T *pHwMboxConfig = (HwMboxConfig_T *)hHwMboxConfig;
- MemoryMap_t *pMemMap = &pHwMboxConfig->MemMap;
- /* Print the memory map */
- WLAN_OS_REPORT (("whal_hwInfoElemMemoryMapPrint:\n"));
- WLAN_OS_REPORT (("\tCode (0x%08x, 0x%08x)\n\tWep (0x%08x, 0x%08x)\n\tTmpl (0x%08x, 0x%08x)\n "
- "\tQueue (0x%08x, 0x%08x)\n\tPool (0x%08x, 0x%08x)\n\tTraceBuffer (A = 0x%08x, B = 0x%08x)\n",
- pMemMap->codeStart, pMemMap->codeEnd,
- pMemMap->wepDefaultKeyStart, pMemMap->wepDefaultKeyEnd,
- pMemMap->packetTemplateStart, pMemMap->packetTemplateEnd,
- pMemMap->queueMemoryStart, pMemMap->queueMemoryEnd,
- pMemMap->packetMemoryPoolStart, pMemMap->packetMemoryPoolEnd,
- pMemMap->debugBuffer1Start, pMemMap->debugBuffer2Start));
- #endif /* TI_DBG */
- return OK;
- }
- /****************************************************************************
- * whal_hwInfoElemMemoryMapPrint ()
- ****************************************************************************
- * DESCRIPTION: Print some of the MemoryMap information element fields
- *
- * INPUTS:
- * HwMboxConfig_T* pHwMboxConfig pointer to the acx mailbox
- *
- * OUTPUT: None
- *
- * RETURNS: None
- ****************************************************************************/
- void whal_hwInfoElemMemoryMapPrint (HwMboxConfig_T* pHwMboxConfig)
- {
- whal_hwInfoElemMemoryMapGet (pHwMboxConfig,
- &pHwMboxConfig->MemMap,
- (void *)whal_hwInfoElemMemoryMapPrintCb,
- (TI_HANDLE)pHwMboxConfig);
- }
- /****************************************************************************
- * whal_hwInfoElemConfigOptionsRead ()
- ****************************************************************************
- * DESCRIPTION: Read ConfigOption information element from the wlan hardware.
- * This is a special case where the data is already in the mailbox
- * after wlan hardware reset and no interrogate command should be sent.
- * This read-only IE provides information stored in the adaptor’s
- * non-volatile memory to host.
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- *
- * NOTE : This function is not in use and must be reexamined (especially the Fw-Driver API)
- *
- ****************************************************************************/
- int whal_hwInfoElemConfigOptionsRead (HwMboxConfig_T* pHwMboxConfig, void* pElm)
- {
- WLAN_OS_REPORT(("%s not implemented\n",__FUNCTION__));
- /* The ConfigOptions information element is ready after reset on the mailbox */
- return 0;
- }
- /****************************************************************************
- * whal_hwInfoElemAcxRevisionGet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate the ACX revision (FW and HW version)
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemAcxRevisionGet
- (
- HwMboxConfig_T *pHwMboxConfig,
- void *fCb,
- TI_HANDLE hCb,
- void *pCb
- )
- {
- ACXRevision_t aElm;
- ACXRevision_t *apElm = &aElm;
- int rc;
- /* Set information element header */
- apElm->EleHdr.id = ACX_FW_REV;
- apElm->EleHdr.len = sizeof(*apElm) - sizeof(EleHdrStruct);
- /* Send the command*/
- rc = CmdQueue_CmdInterrogateWithCb (pHwMboxConfig->hCmdMboxQueue, apElm, sizeof(*apElm), fCb, hCb, pCb);
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemWepDefaultKeyIdSet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate The default Key Id
- *
- * INPUTS:
- * UINT8* Key The default key id to use
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemWepDefaultKeyIdSet (HwMboxConfig_T* pHwMboxConfig, UINT8* apKeyVal,
- void *CB_Func, TI_HANDLE CB_handle)
- {
- int rc;
- dot11WEPDefaultKeyId_t WlanElm_WepDefaultKeyId;
- dot11WEPDefaultKeyId_t *pCfg = &WlanElm_WepDefaultKeyId;
- /* Set information element header*/
- pCfg->EleHdr.id = DOT11_DEFAULT_KEY;
- pCfg->EleHdr.len = sizeof(*pCfg) - sizeof(EleHdrStruct);
- /* Send the command */
- pCfg->DefaultKeyId = *apKeyVal;
- /* Send the configuration command */
- rc = CmdQueue_CmdConfigureWithCb (pHwMboxConfig->hCmdMboxQueue, pCfg, sizeof(*pCfg), CB_Func, CB_handle);
- return rc;
- }
- /****************************************************************************
- * whal_hwInfoElemWepDefaultKeyIdGet()
- ****************************************************************************
- * DESCRIPTION: Configure/Interrogate The default Key Id
- *
- * INPUTS:
- * UINT8* Key The default key id to use
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwInfoElemWepDefaultKeyIdGet (HwMboxConfig_T* pHwMboxConfig, UINT8* apKeyVal,
- void *CB_Func, TI_HANDLE CB_handle)
- {
- int rc = OK;
- dot11WEPDefaultKeyId_t WlanElm_WepDefaultKeyId;
- dot11WEPDefaultKeyId_t *pCfg = &WlanElm_WepDefaultKeyId;
- /* Set information element header */
- pCfg->EleHdr.id = DOT11_DEFAULT_KEY;
- pCfg->Ele…
Large files files are truncated, but you can click here to view the full file