/drivers/net/wireless/tiwlan1251/common/src/hal/hw_ctrl/whalHwCtrl.c
C | 1687 lines | 750 code | 254 blank | 683 comment | 63 complexity | 274a2fad48e6a4550cc63e6fbdd69e77 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: whalHwCtrl.c
- * PURPOSE: Implements action on the wlan hardware card (Reset, Run, SendCmd, Sw Download)
- *
- ****************************************************************************/
- #include "802_11Defs.h"
- #include "Ethernet.h"
- #include "whalCommon.h"
-
- #include "whalCtrl_api.h"
- #include "whalHwDefs.h"
- #include "whalHwCtrl.h"
- #include "whalHwMboxCmd.h"
- #include "whalHwMboxConfig.h"
- #include "eventMbox_api.h"
- #include "whalParams.h"
- #include "commonTypes.h"
- #include "txResult_api.h"
- #include "TNETW_Driver_api.h"
- #include "TNETW_Driver.h"
- #include "whalSecurity.h"
- #define ACX_POWER_MGMT_OPTIONS_STRUCT_DEBUG 0
- int whal_hwCtrl_ConfigTemplates(HwCtrl_T *pHwCtrl);
- int whal_hwCtrl_ConfigQueues(HwCtrl_T *pHwCtrl, UINT32 MemoryStart);
- void whal_hwCtrl_OverridePhyRegsDefaults(HwCtrl_T *pHwCtrl);
- #define CF_FORM_FACTOR 3 /* Compact Flash*/
- #define CB_FORM_FACTOR 1 /* Card Bus */
- /****************************************************************************
- * whal_hwCtrl_Create()
- ****************************************************************************
- * DESCRIPTION: Create the wlan hardware control object
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: The Created object
- ****************************************************************************/
- HwCtrl_T *whal_hwCtrl_Create(TI_HANDLE hOs, WhalParams_T *pWhalParams)
- {
- HwCtrl_T *pHwCtrl;
- pHwCtrl = os_memoryAlloc(hOs, sizeof(HwCtrl_T));
- if (pHwCtrl == NULL)
- return NULL;
- os_memoryZero(hOs, (void*)pHwCtrl, sizeof(HwCtrl_T));
- pHwCtrl->hOs = hOs;
- pHwCtrl->pWhalParams = pWhalParams;
- pHwCtrl->pHwMboxCmd = whal_hwMboxCmd_Create(hOs, pHwCtrl->pWhalParams);
- pHwCtrl->pHwMboxCmdBit = whal_hwMboxCmdBit_Create(hOs);
- pHwCtrl->pHwMboxConfig = whal_hwMboxConfig_Create(hOs);
- pHwCtrl->hWhalBus = whalBus_Create(hOs);
- if ( (!pHwCtrl->pHwMboxCmd) || (!pHwCtrl->pHwMboxConfig) || (!pHwCtrl->hWhalBus) )
- {
- whal_hwCtrl_Destroy(pHwCtrl);
- return NULL;
- }
- return(pHwCtrl);
- }
- /****************************************************************************
- * whal_hwCtrl_Destroy()
- ****************************************************************************
- * DESCRIPTION: Destroy the object
- *
- * INPUTS:
- * pHwCtrl The object to free
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_Destroy(HwCtrl_T *pHwCtrl)
- {
- if (pHwCtrl == NULL)
- return OK;
- whal_hwMboxCmd_Destroy(pHwCtrl->pHwMboxCmd);
- whal_hwMboxCmdBit_Destroy(pHwCtrl->pHwMboxCmdBit);
- whal_hwMboxConfig_Destroy(pHwCtrl->pHwMboxConfig);
- whalBus_Destroy(pHwCtrl->hWhalBus);
- os_memoryFree(pHwCtrl->hOs, pHwCtrl, sizeof(HwCtrl_T));
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_GetTnentwifHandle()
- ****************************************************************************
- * DESCRIPTION: Return TNETWIF handle
- *
- * INPUTS:
- * pHwCtrl The object to free
- *
- * OUTPUT: None
- *
- * RETURNS: TNETWIF handle
- ****************************************************************************/
- TI_HANDLE whal_hwCtrl_GetTnentwifHandle (HwCtrl_T *pHwCtrl)
- {
- return whalBus_GetTnentwifHandle (pHwCtrl->hWhalBus);
- }
- /****************************************************************************
- * whal_hwCtrl_StartJoin()
- ****************************************************************************
- * DESCRIPTION: Enable Rx/Tx and send Start/Join command
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_StartJoin(HwCtrl_T *pHwCtrl, bssType_e BssType, void *JoinCompleteCB, TI_HANDLE CB_handle)
- {
- HwMboxCmd_T *pHwMboxCmd = pHwCtrl->pHwMboxCmd;
- UINT8 HwBssType;
- #ifdef TI_DBG
- UINT8 *pBssId = whal_ParamsGetBssId(pHwCtrl->pWhalParams);
- WLAN_REPORT_INIT(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_StartJoin: Enable Tx, Rx and Start the Bss, type=%d\n", BssType));
- WLAN_REPORT_INIT(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("------------------------------------------------------------\n"));
- WLAN_REPORT_INIT(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("START/JOIN, SSID=%s, BSSID=%02X-%02X-%02X-%02X-%02X-%02X, Chan=%d\n", whal_ParamsGetElm_Ssid(pHwCtrl->pWhalParams)->serviceSetId, pBssId[0], pBssId[1], pBssId[2], pBssId[3], pBssId[4], pBssId[5], whal_ParamsGetRadioChannel(pHwCtrl->pWhalParams)));
- WLAN_REPORT_INIT(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("------------------------------------------------------------\n"));
- #endif /* TI_DBG */
- /*
- * Set frame rates according to the values previously configured:
- * Driver join -> as configured to whalCtrl_JoinBss()
- * GWSI join -> as configured to the template framed before, or default values
- * Recovery -> Saved parameters from last Join command
- */
- whal_hwCtrl_SetFrameRate(pHwCtrl,
- pHwCtrl->pWhalParams->BssInfoParams.txCtrlFrmRate,
- pHwCtrl->pWhalParams->BssInfoParams.txCtrlFrmModulation,
- pHwCtrl->pWhalParams->BssInfoParams.txMgmtFrmRate,
- pHwCtrl->pWhalParams->BssInfoParams.txMgmtFrmModulation);
- /*
- * set RxFilter (but don't write it to the FW, this is done in the join command),
- * Configure templates content, ...
- */
- whal_hwCtrl_SetBssType(pHwCtrl, BssType, &HwBssType);
- return whal_hwMboxCmd_StartBss(pHwMboxCmd, HwBssType, JoinCompleteCB, CB_handle);
- }
- /****************************************************************************
- * whal_hwCtrl_switchChannel()
- ****************************************************************************
- * DESCRIPTION: Switching the serving channel
- *
- * INPUTS: channel - new channel number
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_switchChannel(HwCtrl_T *pHwCtrl,UINT8 channel)
- {
- HwMboxCmd_T *pHwMboxCmd = pHwCtrl->pHwMboxCmd;
- return whal_hwMboxCmd_EnableTx(pHwMboxCmd,channel);
- }
- /****************************************************************************
- * whal_hwCtrl_DisableTx()
- ****************************************************************************
- * DESCRIPTION: Disable Tx path.
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_DisableTx(HwCtrl_T *pHwCtrl)
- {
- HwMboxCmd_T *pHwMboxCmd = pHwCtrl->pHwMboxCmd;
- return whal_hwMboxCmd_DisableTx(pHwMboxCmd);
- }
- /****************************************************************************
- * whal_hwCtrl_EnableTx()
- ****************************************************************************
- * DESCRIPTION: Disable Tx path.
- *
- * INPUTS: channel - new channel number
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_EnableTx(HwCtrl_T *pHwCtrl, int channel)
- {
- HwMboxCmd_T *pHwMboxCmd = pHwCtrl->pHwMboxCmd;
- return whal_hwMboxCmd_EnableTx(pHwMboxCmd, (UINT8)channel);
- }
- /****************************************************************************
- * whal_hwCtrl_EnableDataPath()
- ****************************************************************************
- * DESCRIPTION: Enable Rx/Tx and send Start/Join command
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_EnableDataPath(HwCtrl_T *pHwCtrl)
- {
- HwMboxCmd_T *pHwMboxCmd = pHwCtrl->pHwMboxCmd;
- whal_hwMboxCmd_EnableRx(pHwMboxCmd);
- whal_hwMboxCmd_EnableTx(pHwMboxCmd, whal_ParamsGetDefaultChannel(pHwCtrl->pWhalParams));
-
- #ifdef WDBG_POLLING /* (!!!) ONLY FOR DEBUG WHEN THERE ARE NO INTERRUPTS */
- /* allocate OS timer memory */
- hal_timer = os_timerCreate(pHwCtrl->hOs, whal_hwCtrl_RxPollingTimeout, (TI_HANDLE) pHwCtrl);
- if (!hal_timer)
- return NOK;
- os_timerStart(pHwCtrl->hOs, hal_timer, 20, FALSE);
- #endif
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_EnableDataPath()
- ****************************************************************************
- * DESCRIPTION: Enable Rx/Tx and send Start/Join command
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_DisableDataPath(HwCtrl_T *pHwCtrl)
- {
- #if 0
- HwMboxCmd_T *pHwMboxCmd = pHwCtrl->pHwMboxCmd;
- /*
- * L.M. removed because of two reasons:
- * 1. When the FW is dead, it only adds delay to recovery.
- * 2. WSP does not have it.
- */
- whal_hwMboxCmd_DisableTx(pHwMboxCmd);
- whal_hwMboxCmd_DisableRx(pHwMboxCmd);
-
- /* use FwEvent ... whalBus_hwIntr_Disable(pHwCtrl->hWhalBus, HAL_ALL_INTERRUPTS); */
- #endif
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_SetBssType()
- ****************************************************************************
- * DESCRIPTION: Set Bss type, set RxFilter
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_SetBssType(HwCtrl_T *pHwCtrl, bssType_e BssType, UINT8 *HwBssType)
- {
- switch (BssType)
- {
- case BSS_AP:
- whal_ParamsSetBssType(pHwCtrl->pWhalParams, BSS_TYPE_AP_BSS);
- whal_ParamsSetRxFilter(pHwCtrl->pWhalParams, RX_CONFIG_OPTION_ANY_DST_MY_BSS, RX_FILTER_OPTION_DEF);
- break;
- case BSS_INFRASTRUCTURE:
- whal_ParamsSetBssType(pHwCtrl->pWhalParams, BSS_TYPE_STA_BSS);
- whal_ParamsSetRxFilter(pHwCtrl->pWhalParams, RX_CONFIG_OPTION_FOR_JOIN, RX_FILTER_OPTION_JOIN);
- break;
- case BSS_INDEPENDENT:
- whal_ParamsSetBssType(pHwCtrl->pWhalParams, BSS_TYPE_IBSS);
- #ifdef GWSI_LIB
- /* In GWSI we filter with SSID. This is not done in the full driver because of RTP version.
- * In the future leave only GWSI option for both cases.
- */
- whal_ParamsSetRxFilter(pHwCtrl->pWhalParams, RX_CONFIG_OPTION_FOR_IBSS_JOIN, RX_FILTER_OPTION_DEF);
- #else
- whal_ParamsSetRxFilter(pHwCtrl->pWhalParams, RX_CONFIG_OPTION_FOR_JOIN, RX_FILTER_OPTION_DEF);
- #endif
- break;
- default:
- WLAN_REPORT_FATAL_ERROR(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_SetBssType: FATAL_ERROR, unknown BssType %d\n", BssType));
- return NOK;
- }
- *HwBssType = whal_ParamsGetBssType(pHwCtrl->pWhalParams);
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_setRxFilters()
- ****************************************************************************
- * DESCRIPTION: Sets the filters according to the given configuration.
- *
- * INPUTS: RxConfigOption - The given Rx filters configuration
- * RxFilterOption - The given Rx filters options
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_setRxFilters(HwCtrl_T *pHwCtrl, UINT32 RxConfigOption, UINT32 RxFilterOption)
- {
- whal_ParamsSetRxFilter(pHwCtrl->pWhalParams, RxConfigOption, RxFilterOption);
- return whal_hwInfoElemRxConfigSet (pHwCtrl->pHwMboxConfig,
- &pHwCtrl->pWhalParams->WlanParams.RxConfigOption,
- &pHwCtrl->pWhalParams->WlanParams.RxFilterOption);
- }
- /****************************************************************************
- * whal_hwCtrl_GetRxFilters()
- ****************************************************************************
- * DESCRIPTION: Sets the filters according to the given configuration.
- *
- * INPUTS: RxConfigOption - The given Rx filters configuration
- * RxFilterOption - The given Rx filters options
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_GetRxFilters(HwCtrl_T *pHwCtrl, UINT32* pRxConfigOption, UINT32* pRxFilterOption)
- {
- whal_ParamsGetRxFilter(pHwCtrl->pWhalParams, pRxConfigOption, pRxFilterOption);
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_setRxDataFiltersParams()
- ****************************************************************************
- * 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_hwCtrl_setRxDataFiltersParams(HwCtrl_T * pHwCtrl, BOOL enabled, filter_e defaultAction)
- {
- return whal_hwInfoElemSetRxDataFiltersParams(pHwCtrl->pHwMboxConfig, enabled, defaultAction);
- }
- /****************************************************************************
- * whal_hwCtrl_setRxDataFilter()
- ****************************************************************************
- * DESCRIPTION: Sets the filters according to the given configuration.
- *
- * 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_hwCtrl_setRxDataFilter(HwCtrl_T * pHwCtrl, UINT8 index, UINT8 command, filter_e action, UINT8 numFieldPatterns, UINT8 lenFieldPatterns, UINT8 * fieldPatterns)
- {
- return whal_hwInfoElemSetRxDataFilter(pHwCtrl->pHwMboxConfig,
- index, command, action, numFieldPatterns, lenFieldPatterns, fieldPatterns);
- }
- /****************************************************************************
- * whal_hwCtrl_SetarpIpAddressesTable()
- ****************************************************************************
- * DESCRIPTION: Sets the ARP IP table according to the given configuration.
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_SetarpIpAddressesTable (HwCtrl_T *pHwCtrl, IpAddress_t *IP_addr, UINT8 isEnabled , IPver_e IP_ver)
- {
- if ( NULL == IP_addr )
- {
- WLAN_REPORT_ERROR(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_SetarpIpAddressesTable: Ip Addr ptr = NULL !!!\n"));
- return PARAM_VALUE_NOT_VALID ;
- }
- whal_ParamsSetarpIpAddressesTable(pHwCtrl->pWhalParams, IP_addr, IP_ver);
- whal_ParamsSetarpIpFilterEnabled(pHwCtrl->pWhalParams, isEnabled);
- WLAN_REPORT_DEBUG_CONTROL (pHwCtrl->hReport,
- ("\n whal_hwCtrl_SetarpIpAddressesTable - ip filtering : %d.%d.%d.%d \n" , IP_addr->addr[0] , IP_addr->addr[1] , IP_addr->addr[2] , IP_addr->addr[3] )) ;
- /* Set the new ip with the current state (e/d) */
- return whal_hwInfoElemarpIpAddressesTableSet (pHwCtrl->pHwMboxConfig,
- IP_addr,
- (UINT32)isEnabled);
- }
- /****************************************************************************
- * whalCtrl_GetArpIpAddressesTable()
- ****************************************************************************
- * DESCRIPTION: Sets the Group table according to the given configuration.
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whalCtrl_GetArpIpAddressesTable (HwCtrl_T *pHwCtrl, IpAddress_t *IP_addr, UINT8* pisEnabled , IPver_e* pIP_ver)
- {
- if ( NULL == pHwCtrl )
- {
- WLAN_REPORT_ERROR(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whalCtrl_GetArpIpAddressesTable = pHwCtrl NULL !!!\n"));
- return PARAM_VALUE_NOT_VALID ;
- }
- if ( NULL == pHwCtrl->pWhalParams )
- {
- WLAN_REPORT_ERROR(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whalCtrl_GetArpIpAddressesTable = pHwCtrl->pWhalParams NULL !!!\n"));
- return PARAM_VALUE_NOT_VALID ;
- }
- whal_ParamsGetarpIpAddressesTable(pHwCtrl->pWhalParams, IP_addr, pIP_ver);
- whal_ParamsGetarpIpFilterEnabled(pHwCtrl->pWhalParams, pisEnabled);
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_SetarpIpFilterEnabled()
- ****************************************************************************
- * DESCRIPTION: Enable\Disable the ARP filter
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_SetarpIpFilterEnabled(HwCtrl_T *pHwCtrl, UINT8 isEnabled )
- {
- IpAddress_t *IP_addr = &(pHwCtrl->pWhalParams->WlanParams.arp_IP_addr) ;
- if ( NULL == pHwCtrl )
- {
- WLAN_REPORT_ERROR(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_SetarpIpFilterEnabled = pHwCtrl NULL !!!\n"));
- return PARAM_VALUE_NOT_VALID ;
- }
- /* set the current ip address with the new state (e/d) */
- whal_ParamsSetarpIpFilterEnabled(pHwCtrl->pWhalParams, isEnabled);
- return whal_hwInfoElemarpIpAddressesTableSet (pHwCtrl->pHwMboxConfig,
- IP_addr,
- (UINT32)isEnabled);
- }
- /****************************************************************************
- * whal_hwCtrl_SetGroupAddressesTable()
- ****************************************************************************
- * DESCRIPTION: Sets the Group table according to the given configuration.
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_SetGroupAddressesTable (HwCtrl_T *pHwCtrl,
- UINT8 numGroupAddrs,
- macAddress_t *Group_addr,
- UINT8 isEnabled)
- {
- if ( NULL == pHwCtrl )
- {
- return PARAM_VALUE_NOT_VALID;
- }
- if ( NULL == Group_addr)
- {
- WLAN_REPORT_ERROR(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_SetGroupAddressesTable: numGroupAddrs=%d Group_addr=0x%x !!!\n", numGroupAddrs , Group_addr));
- return PARAM_VALUE_NOT_VALID;
- }
- /* Keeps the parameters in the whal */
- whal_ParamsSetGroupAddressesTable(pHwCtrl->pWhalParams, isEnabled, numGroupAddrs, Group_addr);
- /* Keeps the parameters in the whal for recovery */
- return whal_hwInfoElemGroupAdressesTableSet (pHwCtrl->pHwMboxConfig,
- &numGroupAddrs,
- Group_addr,
- &isEnabled);
- }
- /****************************************************************************
- * whal_hwCtrl_SetRtsThreshold()
- ****************************************************************************
- * DESCRIPTION: Sets the Rts Threshold.
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK pWlanParams->RtsThreshold
- ****************************************************************************/
- int whal_hwCtrl_SetRtsThreshold (HwCtrl_T *pHwCtrl,UINT16 RtsThreshold)
- {
- return whal_hwInfoElemRtsThresholdSet (pHwCtrl->pHwMboxConfig, RtsThreshold);
- }
- /****************************************************************************
- * whal_hwCtrl_ConfigCb()
- ****************************************************************************
- * DESCRIPTION: Config the object
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- static void whal_hwCtrl_ConfigCb (TI_HANDLE hHwCtrl, TI_STATUS status)
- {
- HwCtrl_T *pHwCtrl = (HwCtrl_T*)hHwCtrl;
- WHAL_CTRL *pWhalCtrl = (WHAL_CTRL *)pHwCtrl->hWhalCtrl;
-
- whal_hwMboxCmd_Config(pHwCtrl->pHwMboxCmd, ((TnetwDrv_t*)pWhalCtrl->hTNETW_Driver)->hCmdQueue, pHwCtrl->hReport);
- CmdQueue_Config(((TnetwDrv_t*)pWhalCtrl->hTNETW_Driver)->hCmdQueue,
- ((TnetwDrv_t*)pWhalCtrl->hTNETW_Driver)->hCmdMBox, pHwCtrl->hReport);
- whal_hwMboxCmdBit_Config(pHwCtrl->hWhalCtrl, pHwCtrl->pHwMboxCmdBit, ((TnetwDrv_t*)pWhalCtrl->hTNETW_Driver)->hCmdQueue, pHwCtrl->hReport);
- whal_hwMboxConfig_Config(pHwCtrl->pHwMboxConfig, ((TnetwDrv_t*)pWhalCtrl->hTNETW_Driver)->hCmdQueue, pHwCtrl->hReport);
- /* This will initiate the download to the FW */
- status = whal_hwCtrl_Initiate (pHwCtrl);
- if (status == TNETWIF_ERROR)
- {
- WLAN_REPORT_ERROR (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_Config: failed to initialize\n"));
- }
- }
- /****************************************************************************
- * whal_hwCtrl_GetGroupAddressesTable()
- ****************************************************************************
- * DESCRIPTION: Sets the Group table according to the given configuration.
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_GetGroupAddressesTable (HwCtrl_T *pHwCtrl,
- UINT8* pisEnabled, UINT8* pnumGroupAddrs, macAddress_t *Group_addr)
- {
- if ( NULL == pHwCtrl )
- {
- return PARAM_VALUE_NOT_VALID;
- }
- if ( (NULL == pisEnabled) || (NULL == pnumGroupAddrs) || (NULL == Group_addr))
- {
- WLAN_REPORT_ERROR(pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_GetGroupAddressesTable: pisEnabled=0x%p pnumGroupAddrs=0x%p Group_addr=0x%p !!!\n", pisEnabled , pnumGroupAddrs, Group_addr));
- return PARAM_VALUE_NOT_VALID;
- }
- whal_ParamsGetGroupAddressesTable(pHwCtrl->pWhalParams, pisEnabled, pnumGroupAddrs, Group_addr);
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_Config()
- ****************************************************************************
- * DESCRIPTION: Config the object
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- TI_STATUS whal_hwCtrl_Config
- (
- HwCtrl_T *pHwCtrl,
- TI_HANDLE hWhalCtrl,
- UINT8 AccessMode,
- UINT32 AcxRegAddr,
- UINT32 AcxMemAddr,
- TI_HANDLE hReport,
- TI_HANDLE hMemMgr,
- UINT32 *pFWImage,
- TI_HANDLE hEventMbox
- )
- {
- pHwCtrl->hReport = hReport;
- pHwCtrl->hWhalCtrl = hWhalCtrl;
- pHwCtrl->hEventMbox = hEventMbox;
- /*
- * NOTE: Save firmware image parameters before the 1st TNETWIF call.
- * These parameters are passed from the user application and
- * may be lost in a case TNETWIF call is asynchronous.
- */
- pHwCtrl->uFwBuf = pFWImage[0];
- pHwCtrl->uFwAddr = pFWImage[1];
- pHwCtrl->uEEEPROMBuf = pFWImage[2];
- pHwCtrl->uEEEPROMLen = pFWImage[3];
- return whalBus_Config (pHwCtrl->hWhalBus,
- hWhalCtrl,
- AccessMode,
- AcxRegAddr,
- AcxMemAddr,
- hReport,
- hMemMgr,
- whal_hwCtrl_ConfigCb,
- pHwCtrl);
- }
- /****************************************************************************
- * whal_hwCtrl_FinalizeDownloadCb2()
- ****************************************************************************
- * DESCRIPTION: Finalize all the remaining initialization after the download has finished
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- static void whal_hwCtrl_FinalizeDownloadCb2 (TI_HANDLE hHwCtrl, TI_STATUS status, void *pData)
- {
- HwCtrl_T *pHwCtrl = (HwCtrl_T *)hHwCtrl;
- whalCtrl_antennaDiversityOptions_t antennaDiversityOptions;
- /* Print firmware version */
- whal_ParamsPrintFwVersion (pHwCtrl->pWhalParams);
- /*
- * Configure antenna diversity parameters, same for both radio types.
- * (the only difference between DCR and WBR is the antennas number, which is
- * hard-coded in the mbox config function per radio type
- */
- antennaDiversityOptions.enableRxDiversity = FALSE;
- antennaDiversityOptions.rxSelectedAntenna = DIVS_RX_START_ANT2;
- antennaDiversityOptions.enableTxDiversity = FALSE;
- antennaDiversityOptions.txSelectedAntenna = DIVS_TX_START_ANT2;
- antennaDiversityOptions.rxTxSharedAnts = TRUE;
- whal_hwCtrl_SaveAntennaDiversityOptions (pHwCtrl, &antennaDiversityOptions);
- whalCtrl_FinalizeDownload (pHwCtrl->hWhalCtrl);
- }
- /****************************************************************************
- * whal_hwCtrl_FinalizeDownloadCb1()
- ****************************************************************************
- * DESCRIPTION: Finalize all the remaining initialization after the download has finished
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- static void whal_hwCtrl_FinalizeDownloadCb1 (TI_HANDLE hHwCtrl, TI_STATUS status, void *pData)
- {
- HwCtrl_T *pHwCtrl = (HwCtrl_T *)hHwCtrl;
- ACXRevision_t *pACXRevision = whal_ParamsGetAcxVersion (pHwCtrl->pWhalParams);
- UINT8 *pStationId = ((dot11StationIDStruct*)pData)->dot11StationID;
- UINT32 i;
- /* Swap bytes of the station id */
- for (i = 0; i < 3; i++)
- {
- UINT8 uTmp = pStationId[i];
- pStationId[i] = pStationId[5 - i];
- pStationId[5 - i] = uTmp;
- }
- whal_ParamsSetSrcMac (pHwCtrl->pWhalParams, (char*)pStationId);
- /* Get firmware version */
- whal_hwInfoElemAcxRevisionGet (pHwCtrl->pHwMboxConfig,
- (void *)whal_hwCtrl_FinalizeDownloadCb2,
- hHwCtrl,
- pACXRevision);
- }
-
- /****************************************************************************
- * whal_hwCtrl_FinalizeDownload()
- ****************************************************************************
- * DESCRIPTION: Finalize all the remaining initialization after the download has finished
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- TI_STATUS whal_hwCtrl_FinalizeDownload (TI_HANDLE hHwCtrl, BootAttr_T *pBootAttr)
- {
- HwCtrl_T *pHwCtrl= (HwCtrl_T *)hHwCtrl;
- /*
- * Just comment it since we may need it in future version when we will read from the NVS the
- * Configure options (for example power levels)
- */
- WlanParams_T *pWlanParams = whal_ParamsGetWlanParams (pHwCtrl->pWhalParams);
-
- /* Read NVS version */
- pWlanParams->radioType = pBootAttr->radioType;
- pWlanParams->minorE2Ver = pBootAttr->minorE2Ver;
- pWlanParams->majorE2Ver = pBootAttr->majorE2Ver;
- pWlanParams->bugfixE2Ver = pBootAttr->bugfixE2Ver;
-
- /*
- * Read config options (WLAN hardware EEPROM). Must be before any configuration
- * because the WLAN hardware put the data in the mbox after running the FW
- * Not used by now but keep it in code since the data may be requested later on when the
- * NVS data will be read from the driver and not from the INI:
- * For example the number of power level
- * whal_hwInfoElemConfigOptionsRead(pHwCtrl->pHwMboxConfig, pConfigOptions);
- */
- if (whal_hwInfoElemStationIdGet (pHwCtrl->pHwMboxConfig,
- (void *)whal_hwCtrl_FinalizeDownloadCb1,
- hHwCtrl,
- &pHwCtrl->mbox) != OK)
- {
- WLAN_REPORT_ERROR (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("whal_hwCtrl_Config: Error on whal_hwInfoElemStationIdGet\n"));
- /* For driver debug only, don't return error */
- /* return NOK; */
- }
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_FinalizeOnFailure()
- ****************************************************************************
- * DESCRIPTION: Finalize all the initialization upon failure
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- TI_STATUS whal_hwCtrl_FinalizeOnFailure (TI_HANDLE hHwCtrl)
- {
- HwCtrl_T *pHwCtrl= (HwCtrl_T *)hHwCtrl;
- return whalCtrl_FinalizeOnFailure (pHwCtrl->hWhalCtrl);
- }
- typedef int (*fcallback_t) (TI_HANDLE, TI_STATUS);
- /****************************************************************************
- * whal_hwCtrl_ConfigHwCb2()
- ****************************************************************************
- * DESCRIPTION: Configure the WLAN hardware
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- static int whal_hwCtrl_ConfigHwCb2 (HwCtrl_T *pHwCtrl, TI_STATUS status, void *pData)
- {
- WlanParams_T *pWlanParams = whal_ParamsGetWlanParams (pHwCtrl->pWhalParams);
- UINT8 *pSrcMacAddr = whal_ParamsGetSrcMac (pHwCtrl->pWhalParams);
- UINT32 acID;
- whalCtrl_powerMgmtConfig_t powerMgmtConfig;
- /* Arrived from callback */
- if (pData)
- {
- ACXDataPathParamsResp_t *pCfg = &pHwCtrl->DataPathParams;
- WLAN_REPORT_INIT (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("%s: rxPacketRingChunkSize = 0x%x,txPacketRingChunkSize = 0x%x,rxPacketRingAddr = 0x%x\n",
- __FUNCTION__,pCfg->rxPacketRingChunkSize,pCfg->txPacketRingChunkSize,pCfg->rxPacketRingAddr));
-
- WLAN_REPORT_INIT (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG,
- ("(cont')%s: txPacketRingAddr = 0x%x,rxControlAddr = 0x%x,txControlAddr = 0x%x,txCompleteAddr = 0x%x\n",
- __FUNCTION__,pCfg->txPacketRingAddr,pCfg->rxControlAddr,pCfg->txControlAddr,pCfg->txCompleteAddr));
- pCfg->rxPacketRingChunkSize = ENDIAN_HANDLE_WORD(pCfg->rxPacketRingChunkSize);
- pCfg->txPacketRingChunkSize = ENDIAN_HANDLE_WORD(pCfg->txPacketRingChunkSize);
- pCfg->rxPacketRingAddr = ENDIAN_HANDLE_LONG(pCfg->rxPacketRingAddr);
- pCfg->txPacketRingAddr = ENDIAN_HANDLE_LONG(pCfg->txPacketRingAddr);
- pCfg->rxControlAddr = ENDIAN_HANDLE_LONG(pCfg->rxControlAddr);
- pCfg->txControlAddr = ENDIAN_HANDLE_LONG(pCfg->txControlAddr);
- pCfg->txCompleteAddr = ENDIAN_HANDLE_LONG(pCfg->txCompleteAddr);
- }
- /* Configure WEP maximum space */
- WLAN_REPORT_INIT (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG, ("whal_hwCtrl_Configure: WEP cache - none\n"));
- #ifdef CORE_5_0
- whal_hwInfoElemMemoryMapPrint (pHwCtrl->pHwMboxConfig);
- #endif
- /* Override WLAN hardware defaults */
- whal_hwInfoElemStationIdSet (pHwCtrl->pHwMboxConfig, pSrcMacAddr);
- /* Configure the Rx Msdu Life Time (expiry time of de-fragmentation in FW) */
- whal_hwInfoElemRxMsduLifeTimeSet (pHwCtrl->pHwMboxConfig, pWlanParams->MaxRxMsduLifetime);
- whal_hwInfoElemRxConfigSet (pHwCtrl->pHwMboxConfig, &pWlanParams->RxConfigOption, &pWlanParams->RxFilterOption);
- #if 0
- /* Use firmware default parameters for ant. which is ant 2 for both TX and RX */
- whal_hwCtrl_CurrentAntennaDiversitySendCmd (pHwCtrl);
- #endif
- for (acID = 0; acID < MAX_NUM_OF_AC; acID++)
- {
- whal_hwCtrl_QueueConf (pHwCtrl, &pWlanParams->acQueuesParams[acID]);
- /*
- * NOTE: Set following parameters only if they were configured.
- * Otherwise, they contain garbage.
- */
- if (pHwCtrl->pWhalParams->AcParams.isAcConfigured[acID])
- {
- configureCmdCBParams_t configureCmdAc = {NULL,NULL,NULL};
- configureCmdAc.CB_buf = (UINT8*)&pHwCtrl->pWhalParams->AcParams.ac[acID];
- whal_hwCtrl_AcParamsConf (pHwCtrl, &configureCmdAc);
- }
- if (pHwCtrl->pWhalParams->QueuesParams.isQueueConfigured[acID])
- {
- whal_hwCtrl_TrafficConf (pHwCtrl, &pHwCtrl->pWhalParams->QueuesParams.queues[acID]);
- }
- }
- whal_hwCtrl_PacketDetectionThreshold (pHwCtrl, &pHwCtrl->pWhalParams->WlanParams.PacketDetectionThreshold);
- whal_hwCtrl_SetSlotTime (pHwCtrl, (slotTime_e )pWlanParams->SlotTime);
- whal_hwCtrl_SetarpIpAddressesTable (pHwCtrl,
- &pWlanParams->arp_IP_addr,
- pWlanParams->isArpIpFilteringEnabled,
- IP_VER_4);
- whal_hwCtrl_SetGroupAddressesTable (pHwCtrl,
- pWlanParams->numGroupAddrs,
- pWlanParams->Group_addr,
- pWlanParams->isMacAddrFilteringnabled);
- whal_hwInfoElemRxTimeOutSet (pHwCtrl->pHwMboxConfig, &pWlanParams->rxTimeOut);
- whal_hwCtrl_SetRtsThreshold (pHwCtrl, pWlanParams->RtsThreshold);
-
- /* Set The Beacon Filter in HAL */
- whal_hwCtrl_SetBeaconFiltering (pHwCtrl,
- pWlanParams->beaconFilterParams.desiredState,
- pWlanParams->beaconFilterParams.numOfElements);
- whal_hwCtrl_SetBeaconFilterIETable (pHwCtrl,
- &pWlanParams->beaconFilterIETable.numberOfIEs,
- pWlanParams->beaconFilterIETable.IETable,
- &pWlanParams->beaconFilterIETable.IETableSize);
- /* Set SG Params only in Init Phase. */
- /* In recovery it will be handled in SoftGemini_hanfleRecovery() */
- if (pData)
- {
- WLAN_REPORT_INIT (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG, ("whal_hwCtrl_Configure: Setting the Soft Gemini state\n"));
- /* Set the Soft Gemini state */
- if (pWlanParams->SoftGeminiEnable == SG_SENSE_ACTIVE)
- {
- whal_hwCtrl_SoftGeminiEnable (pHwCtrl, SG_SENSE_NO_ACTIVITY);
- }
- else
- {
- whal_hwCtrl_SoftGeminiEnable (pHwCtrl, pWlanParams->SoftGeminiEnable);
- }
- /* Set the Soft Gemini params */
- whal_hwCtrl_SetSoftGeminiParams (pHwCtrl, &pWlanParams->SoftGeminiParams);
- }
- /* For recovery decision */
- eventMbox_EvUnMask (pHwCtrl->hEventMbox, HAL_EVENT_HEALTH_REPORT);
- whal_hwCtrl_OverridePhyRegsDefaults (pHwCtrl);
- #ifdef TNETW1150
- whal_hwCtrl_SetACIConfiguration (pHwCtrl,
- pWlanParams->ACIMode,
- pWlanParams->inputCCA,
- pWlanParams->qualifiedCCA,
- pWlanParams->stompForRx,
- pWlanParams->stompForTx,
- pWlanParams->txCCA);
- #endif/*TNETW1150*/
- /* Beacon broadcast options */
- powerMgmtConfig.BcnBrcOptions = pWlanParams->BcnBrcOptions;
- powerMgmtConfig.ConsecutivePsPollDeliveryFailureThreshold = pWlanParams->ConsecutivePsPollDeliveryFailureThreshold;
- whal_hwCtrl_BcnBrcOptions (pHwCtrl, &powerMgmtConfig);
- /* Enable rx/tx path on the hardware */
- if (whal_hwCtrl_EnableDataPath (pHwCtrl) != OK)
- return NOK;
- /* ACX for a work around for Wi-Fi test */
- whal_hwInfoElemWiFiWmmPSWASet (pHwCtrl->pHwMboxConfig, pWlanParams->WiFiWmmPS);
- /* Enable the scan complete interrupt source */
- eventMbox_EvUnMask (pHwCtrl->hEventMbox, HAL_EVENT_SCAN_CMPLT);
- eventMbox_EvUnMask (pHwCtrl->hEventMbox, HAL_EVENT_SPS_SCAN_CMPLT);
- /* Call the upper layer callback */
- return (*((fcallback_t)pHwCtrl->fCb)) (pHwCtrl->hCb, OK);
- }
- /****************************************************************************
- * whal_hwCtrl_ConfigHwCb1()
- ****************************************************************************
- * DESCRIPTION: Configure the WLAN hardware
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- static int whal_hwCtrl_ConfigHwCb1 (HwCtrl_T *pHwCtrl, TI_STATUS status, void *pData)
- {
- MemoryMap_t *pMemMap = &pHwCtrl->MemMap;
- DmaParams_T *pDmaParams = whal_ParamsGetDmaParams (pHwCtrl->pWhalParams);
- WlanParams_T *pWlanParams = whal_ParamsGetWlanParams (pHwCtrl->pWhalParams);
- /* Arrived from callback */
- if (pData)
- {
- UINT32 *pSwap, i;
- /* Solve endian problem (all fields are 32 bit) */
- pSwap = (UINT32* )&(pMemMap->codeStart);
- for (i = 0; i < MEM_MAP_NUM_FIELDS; i++)
- pSwap[i] = ENDIAN_HANDLE_LONG(pSwap[i]);
- }
- /* Save number of TX blocks */
- pDmaParams->NumTxBlocks = pMemMap->numTxMemBlks;
- /*
- * Configure DataPath parameters to default
- * values and Read the Addresses of the FW data path buffers
- */
- /* Set Data path parameters to constant value to emulate the original double buffer*/
- whal_hwInfoElemDataPathParamsSet (pHwCtrl->pHwMboxConfig,
- DP_RX_PACKET_RING_CHUNK_SIZE,
- DP_TX_PACKET_RING_CHUNK_SIZE,
- DP_RX_PACKET_RING_CHUNK_NUM,
- DP_TX_PACKET_RING_CHUNK_NUM,
- pWlanParams->TxCompleteThreshold,
- FW_TX_CMPLT_BLOCK_SIZE,
- DP_TX_COMPLETE_TIME_OUT);
- /* Arrived from callback */
- if (pData)
- {
- /* Get the double buffers and registers address values */
- return whal_hwInfoElemDataPathParamsGet (pHwCtrl->pHwMboxConfig,
- &pHwCtrl->DataPathParams,
- (void *)whal_hwCtrl_ConfigHwCb2,
- pHwCtrl);
- }
- /* Called directly */
- else
- {
- return whal_hwCtrl_ConfigHwCb2 (pHwCtrl, OK, NULL);
- }
- }
- /****************************************************************************
- * whal_hwCtrl_ConfigHw()
- ****************************************************************************
- * DESCRIPTION: Configure the WLAN hardware
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_ConfigHw (HwCtrl_T *pHwCtrl, void *fCb, TI_HANDLE hCb, BOOL bRecovery)
- {
- MemoryMap_t *pMemMap = &pHwCtrl->MemMap;
- /*
- * The addresses of the Double buffer, The Tx Path Status,
- * Rx Path Status, Tx Path Control, Rx Path Control
- */
- /* ACXDataPathParamsResp_t *DataPathParam = &pHwCtrl->DataPathParams; */
- /*
- * The DmaParams_T is the same struct as the halTxRxQueueGlobalsParams_t struct
- * but is defined in the whalBus_Defs.h and not in the paramOut.h as done by BCIL
- */
- DmaParams_T *pDmaParams = whal_ParamsGetDmaParams (pHwCtrl->pWhalParams);
- pHwCtrl->fCb = fCb;
- pHwCtrl->hCb = hCb;
- /* Configure the WLAN hardware memory (WEP, Templates, Queue, Buffers) */
- /* Configure packet templates */
- WLAN_REPORT_INIT (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG, ("whal_hwCtrl_Configure: templates \n"));
- whal_hwCtrl_ConfigTemplates (pHwCtrl);
- /* Configure RX/TX queues */
- WLAN_REPORT_INIT (pHwCtrl->hReport, HAL_HW_CTRL_MODULE_LOG, ("whal_hwCtrl_Configure: queues\n"));
-
- /* Configure the weight among the different hardware queues */
- whal_hwInfoElemConfigMemorySet (pHwCtrl->pHwMboxConfig, pDmaParams);
- /* Extract total number of blocks in the pool */
- if (bRecovery)
- return whal_hwCtrl_ConfigHwCb1 (pHwCtrl, OK, NULL);
- else
- return whal_hwInfoElemMemoryMapGet (pHwCtrl->pHwMboxConfig,
- pMemMap,
- (void *)whal_hwCtrl_ConfigHwCb1,
- pHwCtrl);
- }
- #ifdef TNETW1150
- /****************************************************************************
- * whal_hwCtrl_SetACIConfiguration()
- ****************************************************************************
- * DESCRIPTION: Set the hardware ACI configuration
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_SetACIConfiguration (HwCtrl_T *pHwCtrl, UINT8 ACIMode,
- UINT8 inputCCA, UINT8 qualifiedCCA,
- UINT8 stompForRx, UINT8 stompForTx,
- UINT8 txCCA)
- {
- return (whal_hwInfoElemACIConfigurationSet (pHwCtrl->pHwMboxConfig, ACIMode,
- inputCCA, qualifiedCCA, stompForRx,
- stompForTx, txCCA));
- }
- #endif/*TNETW1150*/
- /****************************************************************************
- * whal_hwCtrl_SetMacAddress()
- ****************************************************************************
- * DESCRIPTION:
- *
- * INPUTS: None
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_SetMacAddress(HwCtrl_T *pHwCtrl, macAddress_t *macAddr)
- {
- whal_ParamsSetSrcMac(pHwCtrl->pWhalParams, (char*)macAddr->addr);
- return whal_hwInfoElemStationIdSet (pHwCtrl->pHwMboxConfig, (UINT8*)macAddr->addr);
- }
- /****************************************************************************
- * whal_hwCtrl_ConfigTemplates()
- ****************************************************************************
- * DESCRIPTION: Configure the packet templates
- *
- * AP - beacon, probe response, tim
- * STA (INFRA) - probe request
- * STA (IBSS) - beacon, probe response, probe request
- * know yet the bss type
- *
- * INPUTS:
- *
- * OUTPUT: None
- *
- * RETURNS: OK or NOK
- ****************************************************************************/
- int whal_hwCtrl_ConfigTemplates(HwCtrl_T *pHwCtrl)
- {
- UINT8 PartialVirtualBmap[DOT11_PARTIAL_VIRTUAL_BITMAP_MAX];
- UINT8 BmapControl;
- WlanParams_T *pWlanParams = whal_ParamsGetWlanParams(pHwCtrl->pWhalParams);
- /*
- * Probe request template
- */
- whal_hwMboxCmd_ConfigureTemplateFrame(pHwCtrl->pHwMboxCmd, NULL, pWlanParams->probeRequestTemplateSize,
- CMD_PROBE_REQ,NULL,NULL);
- /*
- * Null Data template
- */
- whal_hwMboxCmd_ConfigureTemplateFrame(pHwCtrl->pHwMboxCmd, NULL, pWlanParams->nullTemplateSize,
- CMD_NULL_DATA,NULL,NULL);
- /*
- * Ps Poll template
- */
- whal_hwMboxCmd_ConfigureTemplateFrame(pHwCtrl->pHwMboxCmd, NULL, pWlanParams->PsPollTemplateSize,
- CMD_PS_POLL,NULL,NULL);
-
- /*
- * Qos Null Data template
- */
- whal_hwMboxCmd_ConfigureTemplateFrame(pHwCtrl->pHwMboxCmd, NULL, pWlanParams->qosNullDataTemplateSize,
- CMD_QOS_NULL_DATA,NULL,NULL);
- /*
- * Probe response template
- */
- whal_hwMboxCmd_ConfigureTemplateFrame(pHwCtrl->pHwMboxCmd, NULL, pWlanParams->probeResponseTemplateSize,
- CMD_PROBE_RESP,NULL,NULL);
- /*
- * Beacon template
- */
- whal_hwMboxCmd_ConfigureTemplateFrame(pHwCtrl->pHwMboxCmd, NULL, pWlanParams->beaconTemplateSize,
- CMD_BEACON,NULL,NULL);
- /*
- * Tim template, first reserve space (len=MAX), second init to empty
- */
- BmapControl = 0;
- os_memoryZero(pHwCtrl->hOs, (void*)PartialVirtualBmap, DOT11_PARTIAL_VIRTUAL_BITMAP_MAX);
- whal_hwMboxCmd_TimTemplate(pHwCtrl->pHwMboxCmd, BmapControl, (char*)PartialVirtualBmap, DOT11_PARTIAL_VIRTUAL_BITMAP_MAX);
- whal_hwMboxCmd_TimTemplate(pHwCtrl->pHwMboxCmd, BmapControl, (char*)PartialVirtualBmap, 1);
- return OK;
- }
- /****************************************************************************
- * whal_hwCtrl_SetSlotTime()
- ****************************************************************************
- * DESCRIPTION: Set the Slot field in ACM_IFS_CFG1 hardware register
- *
- * INPUTS:
- * SlotTimeVal The Short SlotTime bit value in the Capabilities
- *
- * OUTPUT: None
- *
- * RETURNS: None
- ****************************************************************************/
- int whal_hwCtrl_SetSlotTime(HwCtrl_T *pHwCtrl, slotTime_e SlotTimeVal)
- {
- UINT8 slotTime;
- WLAN_REPORT_DEBUG_CONTROL(pHwCtrl->hReport,(" whal_hwCtrl_SetSlotTime: SlotTimeVal = 0x%x\n",SlotTimeVal));
- if (SlotTimeVal == SLOT_TIME_LONG)
- slotTime = (UINT8) SLOT_TIME_LONG;
- else
- slotTime = (UINT8) SLOT_TIME_SHORT;
- return whal_hwInfoElemSlotTimeSet (pHwCtrl->pHwMboxConfig, &slotTime);
- }
- /****************************************************************************
- * whal_hwCtrl_SetPreamble()
- ****************************************************************************
- * DESCRIPTION: Set the preamble in ?????? hardware register
- *
- * INPUTS:
- * preambleVal
- *
- * OUTPUT: None
- *
- * RETURNS…
Large files files are truncated, but you can click here to view the full file