/drivers/net/wireless/tiwlan1251/pform/common/src/osUtil.c
C | 2526 lines | 1442 code | 477 blank | 607 comment | 46 complexity | 6f483839279275d1d2ab27aea9552aec 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. |**
- **| |**
- **+-----------------------------------------------------------------------+**
- ****************************************************************************/
- #ifdef _WINDOWS /*nick*/
- #elif defined(__ARMCC__)
- #include "string.h"
- #endif
- #include "osAdapter.h"
- #include "srcApi.h"
- #include "tiwlnif.h"
- #include "osDot11.h"
- #include "osUtil.h"
- #include "paramOut.h"
- #include "wspVer.h"
- #include "osClsfr.h"
- #include "whalHwMboxCmdBit.h"
- static TI_STATUS
- UtilRegulatoryDomain_setCountryIE(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- );
- #ifdef TIWLN_WINCE30
- gprintf(const char *format ,... )
- {
- #if 1
- #ifdef DEBUG_PB
- wchar_t Buf[500];
- #endif
- FILE *Fpn;
- Fpn = fopen("TILog.txt","a");
- if (Fpn)
- {
- char Msg[500];
- va_list ap;
- va_start(ap,format);
- _vsnprintf(Msg,500,format,ap);
- fprintf(Fpn,"%s", Msg);
- #ifdef DEBUG_PB
- mbstowcs(Buf,Msg,strlen(Msg)+1);
- DEBUGMSG(1,(Buf));
- #endif
- fclose(Fpn);
- }
- #endif
- }
- #endif
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSetParam
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- TI_STATUS
- UtilSetParam(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- if (Length > sizeof(Param.content))
- {
- PRINTF(DBG_NDIS_OIDS_VERY_LOUD, (" UtilSetParam: Buffer for parameter 0x%X is bigger(%d) then Param size(%d)\n", ParamType, (int)Length, sizeof(Param.content)));
- Param.paramLength = sizeof(Param.content);
- NdisMoveMemory(&Param.content, pData, sizeof(Param.content));
- } else
- {
- Param.paramLength = Length;
- NdisMoveMemory(&Param.content, pData, Length);
- }
- Status = configMgr_setParam(pAdapter->CoreHalCtx, &Param);
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetParam
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- TI_STATUS
- UtilGetParam(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Param.paramLength = Length;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- if (Status == NOK)
- {
- PRINTF(DBG_NDIS_OIDS_VERY_LOUD, (" UtilGetParam: ERROR on return from get param, status=%d, param=%d\n",
- Status, ParamType));
- } else if ( Status != NOK )
- {
- PRINTF(DBG_NDIS_OIDS_LOUD, (" UtilGetParam: WARNING on return from get param, status=%d, param=%d\n",
- Status, ParamType));
- }
- if (Length > sizeof(Param.content))
- {
- PRINTF(DBG_NDIS_OIDS_VERY_LOUD, (" UtilGetParam: Buffer for parameter 0x%X is bigger then Param size\n", ParamType));
- NdisMoveMemory(pData, &Param.content, sizeof(Param.content));
- } else
- {
- NdisMoveMemory(pData, &Param.content, Length);
- }
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSetGetParam
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- TI_STATUS
- UtilSetGetParam(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- if (Length > sizeof(Param.content))
- {
- PRINTF(DBG_NDIS_OIDS_VERY_LOUD, (" UtilSetParam: Buffer for parameter 0x%X is bigger(%d) then Param size(%d)\n", ParamType, (int)Length, sizeof(Param.content)));
- Param.paramLength = sizeof(Param.content);
- NdisMoveMemory(&Param.content, pData, sizeof(Param.content));
- } else
- {
- Param.paramLength = Length;
- NdisMoveMemory(&Param.content, pData, Length);
- }
- Status = configMgr_setParam(pAdapter->CoreHalCtx, &Param);
- if (Length > sizeof(Param.content))
- {
- PRINTF(DBG_NDIS_OIDS_VERY_LOUD, (" UtilGetParam: Buffer for parameter 0x%X is bigger then Param size\n", ParamType));
- NdisMoveMemory(pData, &Param.content, sizeof(Param.content));
- } else
- {
- NdisMoveMemory(pData, &Param.content, Length);
- }
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetTxPowerValue
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetTxPowerValue(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Param.paramLength = Length;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- *(PULONG)pData = (ULONG)Param.content.regulatoryDomainParam.txPower;
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSetTxPowerDbm
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilSetTxPowerDbm(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length)
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, REGULATORY_DOMAIN_CURRENT_TX_POWER_IN_DBM_PARAM, pData, sizeof(UINT8));
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetTxPowerLevel
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilGetTxPowerLevel(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length)
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, REGULATORY_DOMAIN_TX_POWER_LEVEL_TABLE_PARAM, pData, sizeof(TIWLAN_POWER_LEVEL_TABLE));
- *Length=sizeof(TIWLAN_POWER_LEVEL_TABLE);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilEnableDisableRxDataFilters
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilEnableDisableRxDataFilters(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length)
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, RX_DATA_ENABLE_DISABLE_RX_DATA_FILTERS, pData, Length);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetRxDataFiltersStatisticsCB
- Routine Description: This is the CB triggered when Rx Data Filter statistics
- are returned by the FW.
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- static VOID UtilGetRxDataFiltersStatisticsCB(TI_HANDLE hAdapter, TI_STATUS status, PUINT8 pReadBuff)
- {
- PTIWLN_ADAPTER_T pAdapter = (PTIWLN_ADAPTER_T) hAdapter;
- ACXDataFilteringStatistics_t * pStatistics = (ACXDataFilteringStatistics_t *) pReadBuff;
- TIWLAN_DATA_FILTER_STATISTICS * pResult = (TIWLAN_DATA_FILTER_STATISTICS *) &(pAdapter->pIoBuffer[0]);
- int i;
- pResult->UnmatchedPacketsCount = pStatistics->unmatchedPacketsCount;
- for (i = 0; i < MAX_DATA_FILTERS; ++i)
- {
- pResult->MatchedPacketsCount[i] = pStatistics->matchedPacketsCount[i];
- }
- *(pAdapter->pIoCompleteBuffSize) = sizeof(TIWLAN_DATA_FILTER_STATISTICS);
- /* indicate that the buffer is ready */
- os_IoctlComplete(pAdapter, status);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilEnableDisableRxDataFilters
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilGetRxDataFiltersStatistics(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length)
- {
- paramInfo_t Param;
- memset(&(pAdapter->IoCompleteBuff[0]) , 0xFF , MAX_IO_BUFFER_COMPLETE_SIZE);
- pAdapter->pIoBuffer = pData;
- pAdapter->pIoCompleteBuffSize = Length;
- Param.paramType = RX_DATA_GET_RX_DATA_FILTERS_STATISTICS;
- Param.paramLength = sizeof(TIWLAN_DATA_FILTER_STATISTICS);
- Param.content.interogateCmdCBParams.CB_handle = (TI_HANDLE) pAdapter;
- Param.content.interogateCmdCBParams.CB_Func = (PVOID) UtilGetRxDataFiltersStatisticsCB;
- Param.content.interogateCmdCBParams.CB_buf = &(pAdapter->IoCompleteBuff[0]) ;
- return configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetPowerConsumptionStatisticsCB
- Routine Description: This is the CB triggered when Power consumption statistics
- are returned by the FW.
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- static VOID UtilGetPowerConsumptionStatisticsCB(TI_HANDLE hAdapter, TI_STATUS status, PUINT8 pReadBuff)
- {
- PTIWLN_ADAPTER_T pAdapter = (PTIWLN_ADAPTER_T) hAdapter;
- ACXPowerConsumptionTimeStat_t * pStatistics = (ACXPowerConsumptionTimeStat_t *) pReadBuff;
- PowerConsumptionTimeStat_t * pResult = (PowerConsumptionTimeStat_t *) &(pAdapter->pIoBuffer[0]);
- pResult->activeTimeCnt_Hi = pStatistics->activeTimeCnt_Hi;
- pResult->activeTimeCnt_Low = pStatistics->activeTimeCnt_Low;
- pResult->elpTimeCnt_Hi = pStatistics->elpTimeCnt_Hi;
- pResult->elpTimeCnt_Low = pStatistics->elpTimeCnt_Low;
- pResult->powerDownTimeCnt_Hi = pStatistics->powerDownTimeCnt_Hi;
- pResult->powerDownTimeCnt_Low = pStatistics->powerDownTimeCnt_Low;
-
- *(pAdapter->pIoCompleteBuffSize) = sizeof(PowerConsumptionTimeStat_t);
- /* indicate that the buffer is ready */
- os_IoctlComplete(pAdapter, status);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetPowerConsumptionStatistics
- Routine Description: Request the power consumption statistics from the FW
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilGetPowerConsumptionStatistics(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, PULONG Length)
- {
- paramInfo_t Param;
- memset(&(pAdapter->IoCompleteBuff[0]) , 0xFF , MAX_IO_BUFFER_COMPLETE_SIZE);
- pAdapter->pIoBuffer = pData;
- pAdapter->pIoCompleteBuffSize = Length;
- Param.paramType = HAL_CTRL_POWER_CONSUMPTION;
- Param.paramLength = sizeof(PowerConsumptionTimeStat_t);
- Param.content.interogateCmdCBParams.CB_handle = (TI_HANDLE) pAdapter;
- Param.content.interogateCmdCBParams.CB_Func = (PVOID) UtilGetPowerConsumptionStatisticsCB;
- Param.content.interogateCmdCBParams.CB_buf = &(pAdapter->IoCompleteBuff[0]);
- return configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilAddRxDataFilter
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilAddRxDataFilter(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length)
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, RX_DATA_ADD_RX_DATA_FILTER, pData, Length);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilRemoveRxDataFilter
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilRemoveRxDataFilter(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length)
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, RX_DATA_REMOVE_RX_DATA_FILTER, pData, Length);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetCurrentRssiLevel
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilGetCurrentRssiLevel(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length)
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, SITE_MGR_CURRENT_SIGNAL_PARAM, pData, sizeof(INT32));
- *Length = sizeof(INT32);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: RssiUtilIoctlCompleteCB
- Routine Description: This is the CB triggered when Rssi/Snr have been
- returned by FW - return RSSI only to user
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- VOID RssiUtilIoctlCompleteCB(TI_HANDLE hAdapter, TI_STATUS status, PUINT8 pReadBuff)
- {
- PTIWLN_ADAPTER_T pAdapter = (PTIWLN_ADAPTER_T)hAdapter;
- TIWLN_RADIO_RX_QUALITY tmpRadioRxQuality;
- paramInfo_t Param;
- ACXRoamingStatisticsTable_t * radioResults = (ACXRoamingStatisticsTable_t *) pReadBuff;
- tmpRadioRxQuality.Rssi = radioResults->rssi;
- tmpRadioRxQuality.Snr = (INT32) radioResults->snr;
- /* here we update the site manager about these new values */
- Param.paramType = SITE_MGR_CURRENT_SIGNAL_PARAM;
- Param.paramLength = sizeof(INT32);
- Param.content.siteMgrCurrentRssi = tmpRadioRxQuality.Rssi;
- configMgr_setParam(pAdapter->CoreHalCtx, &Param);
- *(pAdapter->pIoCompleteBuffSize) = sizeof(INT32);
- os_memoryCopy(hAdapter, (PVOID) &(pAdapter->pIoBuffer[0]), (PVOID) &(tmpRadioRxQuality.Rssi), sizeof(INT32));
- /* Call back the Completion that will indicate to the user that the buffer is ready to be read */
- os_IoctlComplete(pAdapter, status);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: SnrUtilIoctlCompleteCB
- Routine Description: This is the CB triggered when Rssi/Snr have been
- returned by FW - return SNR only to user
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- VOID SnrUtilIoctlCompleteCB(TI_HANDLE hAdapter, TI_STATUS status, PUINT8 pReadBuff)
- {
- PTIWLN_ADAPTER_T pAdapter = (PTIWLN_ADAPTER_T) hAdapter;
- TIWLN_RADIO_RX_QUALITY tmpRadioRxQuality;
- ACXRoamingStatisticsTable_t * radioResults = (ACXRoamingStatisticsTable_t *) pReadBuff;
- tmpRadioRxQuality.Rssi = radioResults->rssi;
- /* The SNR returned by FW is not true. We have to divide it by 2 and turns it to a signed */
- tmpRadioRxQuality.Snr = (INT32) radioResults->snr;
- *(pAdapter->pIoCompleteBuffSize) = sizeof(INT32);
- os_memoryCopy(hAdapter, (PVOID) &(pAdapter->pIoBuffer[0]), (PVOID) &(tmpRadioRxQuality.Snr), sizeof(INT32));
- os_IoctlComplete(pAdapter, status);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetAsyncCurrentRssiLevel
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilGetAsyncCurrentRssiLevel(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length)
- {
- paramInfo_t Param;
- TI_STATUS Status;
- memset(&(pAdapter->IoCompleteBuff[0]) , 0xFF , MAX_IO_BUFFER_COMPLETE_SIZE );
- /* To implement the Async IOCTL store the user buffer pointer to be filled at
- the Command Completion calback */
- pAdapter->pIoBuffer = pData;
- pAdapter->pIoCompleteBuffSize = Length ;
- /* Fill the IOCTL struct to the Command Mailbox by giving a stack parameter */
- Param.paramType = HAL_CTRL_RSSI_LEVEL_PARAM;
- Param.paramLength = sizeof(INT32);
- Param.content.interogateCmdCBParams.CB_handle = (TI_HANDLE)pAdapter;
- Param.content.interogateCmdCBParams.CB_Func = (PVOID)RssiUtilIoctlCompleteCB;
- Param.content.interogateCmdCBParams.CB_buf = &(pAdapter->IoCompleteBuff[0]) ;
- /* This Get Param will in fact get till the HAL and will interrogate the FW */
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetAsyncCurrentRssiLevel
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilGetAsyncCurrentSnrRatio(PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length)
- {
- paramInfo_t Param;
- TI_STATUS Status;
- memset(&(pAdapter->IoCompleteBuff[0]) , 0xFF , MAX_IO_BUFFER_COMPLETE_SIZE );
- pAdapter->pIoBuffer = pData;
- pAdapter->pIoCompleteBuffSize = Length ;
- Param.paramType = HAL_CTRL_SNR_RATIO_PARAM;
- Param.paramLength = sizeof(INT32);
- Param.content.interogateCmdCBParams.CB_handle = (TI_HANDLE)pAdapter;
- Param.content.interogateCmdCBParams.CB_Func = (PVOID)SnrUtilIoctlCompleteCB;
- Param.content.interogateCmdCBParams.CB_buf = &(pAdapter->IoCompleteBuff[0]) ;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetAPTxPowerLevel
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetAPTxPowerLevel(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Param.paramLength = Length;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- *(PULONG)pData = (ULONG)Param.content.APTxPower;
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetCountryCode
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetCountryCode(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Param.paramLength = Length;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- NdisMoveMemory(pData, Param.content.pCountryString, Length);
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetRegDomainBand
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetRegDomainBand(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Param.paramLength = Length;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- *(PULONG)pData = (ULONG) *(PUCHAR)&Param.content;
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetPacketBursting
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetPacketBursting(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Param.paramLength = Length;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- *(PULONG)pData = (ULONG)Param.content.qosPacketBurstEnb;
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetMixedMode
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetMixedMode(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- PULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- *(PULONG)pData = (ULONG)Param.content.rsnMixedMode;
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetDefaultKeyId
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetDefaultKeyId(
- PTIWLN_ADAPTER_T pAdapter,
- externalParam_e ParamType,
- PUCHAR pData,
- PULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = ParamType;
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- *(PULONG)pData = (ULONG)Param.content.rsnDefaultKeyID;
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSetTrafficIntensityThresholds
- Routine Description: Sets the traffic intensity thresholds
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilSetTrafficIntensityThresholds(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, ULONG Length)
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter,CTRL_DATA_TRAFFIC_INTENSITY_THRESHOLD , pData, Length);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetTrafficIntensityThresholds
- Routine Description: retrieves the traffic intensity thresholds
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilGetTrafficIntensityThresholds(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, PULONG Length)
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, CTRL_DATA_TRAFFIC_INTENSITY_THRESHOLD, pData, (*Length));
- *Length = sizeof(OS_802_11_TRAFFIC_INTENSITY_THRESHOLD_PARAMS);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilToggleTrafficIntensityEvents
- Routine Description: Toggles ON/OFF traffic intensity events
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG UtilToggleTrafficIntensityEvents(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, ULONG Length)
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter,CTRL_DATA_TOGGLE_TRAFFIC_INTENSITY_EVENTS , pData, Length);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name:
- UtilSetBSSID
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilSetBSSID(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- return UtilSetParam(pAdapter, SITE_MGR_DESIRED_BSSID_PARAM, pData, ETH_ADDR_SIZE);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetBSSID
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetBSSID(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- TI_STATUS res;
- if (!Length)
- return NOK;
- res = UtilGetParam(pAdapter, CTRL_DATA_CURRENT_BSSID_PARAM, pData, ETH_ADDR_SIZE);
- *Length = ETH_ADDR_SIZE;
- return res;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetSSID
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetSSID(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG size;
- ssid_t ssid;
- OS_802_11_SSID* RetSsid;
- if (*Length<sizeof(OS_802_11_SSID))
- return NOK;
- size = sizeof(ssid_t);
- UtilGetParam(pAdapter, SITE_MGR_CURRENT_SSID_PARAM, (PUCHAR)&ssid, size);
- RetSsid = (OS_802_11_SSID*) pData;
- RetSsid->SsidLength = ssid.len;
- NdisMoveMemory((void *)RetSsid->Ssid, (void *)ssid.ssidString, ssid.len);
- *Length = sizeof(OS_802_11_SSID);
- return OK;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilGetDesiredSSID
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilGetDesiredSSID(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG size,retValue;
- ssid_t ssid;
- OS_802_11_SSID* RetSsid;
- if (!(*Length))
- {
- *Length = sizeof(OS_802_11_SSID);
- return NOK;
- }
- size = sizeof(ssid_t);
- retValue = UtilGetParam(pAdapter, SITE_MGR_DESIRED_SSID_PARAM, (PUCHAR)&ssid, size);
- RetSsid = (OS_802_11_SSID*) pData;
- RetSsid->SsidLength = ssid.len;
- NdisMoveMemory((void *)RetSsid->Ssid, (void *)ssid.ssidString, ssid.len);
- *Length = sizeof(OS_802_11_SSID);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSetSSID
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilSetSSID(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- OS_802_11_SSID* UtilSsid;
- ssid_t ssid;
- UtilSsid = (OS_802_11_SSID*) pData;
- if (UtilSsid->SsidLength<=MAX_SSID_LEN)
- {
- ssid.len = (UINT8)UtilSsid->SsidLength;
- NdisMoveMemory((void *)ssid.ssidString, (void *)UtilSsid->Ssid, ssid.len);
- /* The driver should support setting the SSID to NULL string */
- if (ssid.len == 0)
- ssid.ssidString[0] = '\0';
- #ifdef TI_DBG
- {
- UCHAR tempName[33];
- NdisMoveMemory(tempName, (void *)UtilSsid->Ssid, ssid.len);
- tempName[ssid.len] ='\0';
- PRINTF(DBG_NDIS_OIDS_LOUD, (" SET SSID: Len=%d %s\n", ssid.len, tempName));
- }
- #endif
- UtilSetParam(pAdapter, SITE_MGR_DESIRED_SSID_PARAM, (PUCHAR)&ssid, sizeof(ssid_t));
- }
- return OK;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilNetworkTypesSupported
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilNetworkTypesSupported(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- OS_802_11_NETWORK_TYPE_LIST * pList;
- ULONG mode, size;
- UtilGetParam(pAdapter, SITE_MGR_DESIRED_DOT11_MODE_PARAM,
- (PUCHAR)&mode, sizeof(ULONG));
- if (!(*Length))
- {
- /**/
- /* Return the maximum size*/
- /**/
- size = sizeof(OS_802_11_NETWORK_TYPE_LIST) +
- 3 * sizeof(OS_802_11_NETWORK_TYPE) -
- sizeof(OS_802_11_NETWORK_TYPE);
- *Length = size;
- return NOK;
- }
- pList = (OS_802_11_NETWORK_TYPE_LIST *) pData;
- switch (mode)
- {
-
- case 1:
- pList->NumberOfItems = 1;
- pList->NetworkType[0] = os802_11DS;
- break;
- case 2:
- pList->NumberOfItems = 1;
- pList->NetworkType[0] = os802_11OFDM5;
- break;
- case 3:
- pList->NumberOfItems = 2;
- pList->NetworkType[0] = os802_11DS;
- pList->NetworkType[1] = os802_11OFDM24;
- break;
- case 4:
- pList->NumberOfItems = 3;
- pList->NetworkType[0] = os802_11DS;
- pList->NetworkType[1] = os802_11OFDM24;
- pList->NetworkType[2] = os802_11OFDM5;
- break;
- default:
- pList->NumberOfItems = 1;
- pList->NetworkType[0] = os802_11DS;
- break;
- }
- size = sizeof(OS_802_11_NETWORK_TYPE_LIST) +
- pList->NumberOfItems * sizeof(OS_802_11_NETWORK_TYPE) -
- sizeof(OS_802_11_NETWORK_TYPE);
- *Length = size;
- return OK;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilNetworkTypeInUseGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilNetworkTypeInUseGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG mode;
- if (!(*Length))
- {
- *Length = sizeof(OS_802_11_NETWORK_TYPE);
- return NOK;
- }
- UtilGetParam(pAdapter, SITE_MGR_DESIRED_DOT11_MODE_PARAM,
- (PUCHAR)&mode, sizeof(ULONG));
- switch (mode)
- {
-
- case 1:
- *((OS_802_11_NETWORK_TYPE *) pData) = os802_11DS;
- break;
- case 2:
- *((OS_802_11_NETWORK_TYPE *) pData) = os802_11OFDM5;
- break;
- case 3:
- *((OS_802_11_NETWORK_TYPE *) pData) = os802_11OFDM24;
- break;
- case 4:
- *((OS_802_11_NETWORK_TYPE *) pData) = os802_11Automode;
- break;
- default:
- *((OS_802_11_NETWORK_TYPE *) pData) = os802_11DS;
- break;
- }
- *Length = sizeof(OS_802_11_NETWORK_TYPE);
- return OK;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilNetworkTypeInUseSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilNetworkTypeInUseSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, SITE_MGR_DESIRED_DOT11_MODE_PARAM, pData, sizeof(ULONG));
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSetPacketBursting
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilSetPacketBursting(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = QOS_PACKET_BURST_ENABLE;
- Param.content.qosPacketBurstEnb = *((UINT8*)pData);
- Status = configMgr_setParam(pAdapter->CoreHalCtx, &Param);
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSetMixedMode
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilSetMixedMode(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- paramInfo_t Param;
- TI_STATUS Status;
- Param.paramType = RSN_MIXED_MODE;
- Param.content.rsnMixedMode = *((UINT32*)pData);
- Status = configMgr_setParam(pAdapter->CoreHalCtx, &Param);
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerModeSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerModeSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- ULONG retValue;
- PowerMgr_PowerMode_t PowerMgr_PowerMode;
- PowerMgr_PowerMode.PowerMode = (PowerMgr_PowerMode_e)*pData;
- PowerMgr_PowerMode.powerMngPriority = POWER_MANAGER_USER_PRIORITY;
- retValue = UtilSetParam(pAdapter, POWER_MGR_POWER_MODE,(PUCHAR)&PowerMgr_PowerMode, sizeof(PowerMgr_PowerMode));
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerModeGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerModeGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, POWER_MGR_POWER_MODE, pData, sizeof(PowerMgr_PowerMode_e));
- *Length = sizeof(PowerMgr_PowerMode_e);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerLevelPSGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerLevelPSGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, POWER_MGR_POWER_LEVEL_PS, pData, sizeof(powerAutho_PowerPolicy_e));
- *Length = sizeof(powerAutho_PowerPolicy_e);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerLevelPSSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerLevelPSSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, POWER_MGR_POWER_LEVEL_PS, pData, sizeof(powerAutho_PowerPolicy_e));
- *Length = sizeof(powerAutho_PowerPolicy_e);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerLevelDefaultGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerLevelDefaultGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, POWER_MGR_POWER_LEVEL_DEFAULT, pData, sizeof(powerAutho_PowerPolicy_e));
- *Length = sizeof(powerAutho_PowerPolicy_e);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerLevelDefaultSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerLevelDefaultSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, POWER_MGR_POWER_LEVEL_DEFAULT, pData, sizeof(powerAutho_PowerPolicy_e));
- *Length = sizeof(powerAutho_PowerPolicy_e);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerLevelDozeModeGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerLevelDozeModeGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, POWER_MGR_POWER_LEVEL_DOZE_MODE, pData, sizeof(PowerMgr_PowerMode_e));
- *Length = sizeof(PowerMgr_PowerMode_e);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilPowerLevelDozeModeSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilPowerLevelDozeModeSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, POWER_MGR_POWER_LEVEL_DOZE_MODE, pData, sizeof(PowerMgr_PowerMode_e));
- *Length = sizeof(PowerMgr_PowerMode_e);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilBeaconFilterDesiredStateSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilBeaconFilterDesiredStateSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, SITE_MGR_BEACON_FILTER_DESIRED_STATE_PARAM, pData, sizeof(UINT8));
- *Length = sizeof(UINT8);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilBeaconFilterDesiredStateGet
- Routine Description: gets the current beacon filter state
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilBeaconFilterDesiredStateGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, SITE_MGR_BEACON_FILTER_DESIRED_STATE_PARAM, pData, sizeof(UINT8));
- *Length = sizeof(UINT8);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilBssidListGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilBssidListGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length,
- BOOLEAN ExtBssid,
- BOOLEAN allVarIes
- )
- {
- OS_802_11_BSSID_LIST_EX* pListEx;
- OS_802_11_BSSID_EX* pBssidEx;
- OS_802_11_BSSID* pBssid;
- OS_802_11_BSSID_LIST* pList;
- paramInfo_t Param;
- ULONG RetSize, i;
- TI_STATUS Status;
- PUCHAR pTempData=NULL;
- ULONG LocalLength = sizeof(OS_802_11_BSSID_LIST_EX)+NUM_OF_SITE_TABLE*MAX_SITES_BG_BAND*sizeof(OS_802_11_BSSID);
- /****** At the callback of RSSI update the RSSI in the Site TAble in the Site Manager *
- Update Site Table in order to represent the RSSI of current AP correctly in the utility
- param.paramType = SITE_MGR_CURRENT_SIGNAL_PARAM;
- param.content.siteMgrCurrentSignal.rssi = pCurrBSS->averageRssi;
- siteMgr_setParam(pCurrBSS->hSiteMgr, ¶m);
- ***************************************/
- if (allVarIes)
- {
- Param.paramType = SITE_MGR_BSSID_FULL_LIST_PARAM;
- } else
- {
- Param.paramType = SITE_MGR_BSSID_LIST_PARAM;
- }
- if (ExtBssid)
- {
- *(PULONG)&Param.content = (ULONG)pData;
- Param.paramLength = *Length;
- } else
- {
- if (*Length)
- {
- pTempData = os_memoryAlloc(pAdapter, LocalLength);
- if (!pTempData)
- {
- *(PULONG)pData = LocalLength;
- *Length = 0;
- return NOK;
- }
- *(PULONG)&Param.content = (ULONG)pTempData;
- Param.paramLength = *Length;
- } else
- {
- *Length = LocalLength;
- return NOK;
- }
- }
- Status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
- if (!(*Length))
- {
- *Length = Param.paramLength * 4;
- return NOK;
- }
- if (Status != OK)
- {
- *(PULONG)pData = Param.paramLength;
- PRINT(DBG_IOCTL_LOUD, "...More buffer space needed\n");
- if (!ExtBssid)
- os_memoryFree(pAdapter, pTempData, LocalLength);
- *Length = 0;
- return NOK;
- }
- if (!ExtBssid)
- {
- pListEx = (OS_802_11_BSSID_LIST_EX*) pTempData;
- if (pListEx->NumberOfItems)
- {
- if ((sizeof(OS_802_11_BSSID_LIST) +
- sizeof(OS_802_11_BSSID)*pListEx->NumberOfItems -
- sizeof(OS_802_11_BSSID)) > *Length)
- {
- PRINT(DBG_IOCTL_LOUD, "Utility buffer is too small\n");
- os_memoryFree(pAdapter, pTempData, LocalLength);
- *Length = 0;
- return NOK;
- }
- if (pListEx->NumberOfItems >
- ((0xFFFFFFFFUL - ((ULONG)sizeof(OS_802_11_BSSID_LIST) - 1)) /
- (ULONG)sizeof(OS_802_11_BSSID) + 1)) /* Dm: Security fix */
- {
- printk("TI: %s - Security Error\n", __FUNCTION__);
- PRINT(DBG_IOCTL_LOUD, "Number of AP is too big\n");
- os_memoryFree(pAdapter, pTempData, LocalLength);
- *Length = 0;
- return NOK;
- }
- pList = (OS_802_11_BSSID_LIST *)pData;
- pList->NumberOfItems = pListEx->NumberOfItems;
- *Length = RetSize = sizeof(OS_802_11_BSSID_LIST) +
- sizeof(OS_802_11_BSSID)*pList->NumberOfItems -
- sizeof(OS_802_11_BSSID);
- pBssidEx = pListEx->Bssid;
- for (i=0; i<pListEx->NumberOfItems; i++)
- {
- pBssid = (OS_802_11_BSSID*) pBssidEx;
- NdisMoveMemory(&pList->Bssid[i], pBssid,
- sizeof(OS_802_11_BSSID));
- pList->Bssid[i].Length = sizeof(OS_802_11_BSSID);
- pBssidEx = (OS_802_11_BSSID_EX*) ((PUCHAR)pBssidEx +
- pBssidEx->Length);
- }
- }
- else
- {
- pList = (OS_802_11_BSSID_LIST*) pData;
- pList->NumberOfItems = 0;
- RetSize = sizeof(OS_802_11_BSSID_LIST);
- *Length = RetSize;
- }
- PRINT(DBG_IOCTL_LOUD, "...Copy done.\n");
- os_memoryFree(pAdapter, pTempData, LocalLength);
- }
- else
- {
- RetSize = Param.paramLength;
- *Length = RetSize;
- }
- return OK;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilStartAppScanSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilStartAppScanSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- ULONG retValue;
- /* scan concentrator will start an application scan */
- retValue = UtilSetParam(pAdapter, SCAN_CNCN_START_APP_SCAN, (PUCHAR)&pData, sizeof(PUCHAR));
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilStopAppScanSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilStopAppScanSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- ULONG retValue;
- /* scan concentrator will stop the running application scan (if any) */
- retValue = UtilSetParam(pAdapter, SCAN_CNCN_STOP_APP_SCAN, NULL, 0);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilScanPolicyParamSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilScanPolicyParamSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- ULONG retValue;
- applicationConfigBuffer_t applicationConfigBuffer;
- applicationConfigBuffer.buffer = pData;
- applicationConfigBuffer.bufferSize = (UINT16)Length;
- /* set the scan manager policy */
- retValue = UtilSetParam( pAdapter, SCAN_MNGR_SET_CONFIGURATION, (PUCHAR)&applicationConfigBuffer, sizeof(applicationConfigBuffer_t) );
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilScanBssListGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilScanBssListGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- paramInfo_t param;
- TI_STATUS status;
- param.paramType = SCAN_MNGR_BSS_LIST_GET;
- param.paramLength = sizeof(PUCHAR);
- status = configMgr_getParam(pAdapter->CoreHalCtx, ¶m);
- NdisMoveMemory( pData, param.content.pScanBssList, *Length );
- *Length = sizeof(bssList_t);
- return status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilBssidListScanOid
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilBssidListScanOid(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- TI_STATUS Status;
- //TRS: Scan changes from TI
- Status = UtilSetParam(pAdapter, SCAN_CNCN_BSSID_LIST_SCAN_PARAM, pData, 0);
- //TRS: end of Scan changes from TI
- return Status;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilInfrastructureModeGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilInfrastructureModeGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- if (!Length)
- return NOK;
- retValue = UtilGetParam(pAdapter, CTRL_DATA_CURRENT_BSS_TYPE_PARAM, pData, sizeof(bssType_e));
- *Length = sizeof(ULONG);
- return(retValue);
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilDesiredInfrastructureModeGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilDesiredInfrastructureModeGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- ULONG retValue;
- if (!Length)
- return NOK;
- retValue = UtilGetParam(pAdapter, SITE_MGR_DESIRED_BSS_TYPE_PARAM, pData, sizeof(bssType_e));
- *Length = sizeof(ULONG);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilInfrastructureModeSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilInfrastructureModeSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- ULONG retValue;
- retValue = UtilSetParam(pAdapter, SITE_MGR_DESIRED_BSS_TYPE_PARAM, pData, sizeof(bssType_e));
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilFragmentationThresholdGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilFragmentationThresholdGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- UINT16 FragThreshold;
- ULONG retValue;
- if (!Length)
- {
- *Length = sizeof(ULONG);
- return NOK;
- }
- retValue = UtilGetParam(pAdapter, HAL_CTRL_FRAG_THRESHOLD_PARAM, pData, sizeof(ULONG));
- FragThreshold = *(PUINT16)pData;
- *(PULONG)pData = FragThreshold;
- *Length = sizeof(ULONG);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilFragmentationThresholdSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilFragmentationThresholdSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- UINT16 FragThreshold = (UINT16) *(PULONG)pData;
- ULONG retValue;
- FragThreshold = ((FragThreshold+1)>>1) << 1; /*make it always even(GreenA)*/
- retValue = UtilSetParam(pAdapter, HAL_CTRL_FRAG_THRESHOLD_PARAM, (PUCHAR)&FragThreshold, sizeof(UINT16));
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilRtsThresholdGet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilRtsThresholdGet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- UINT16 RtsThreshold;
- ULONG retValue;
- if (!Length)
- {
- *Length = sizeof(ULONG);
- return NOK;
- }
- retValue = UtilGetParam(pAdapter, HAL_CTRL_RTS_THRESHOLD_PARAM, pData, sizeof(ULONG));
- RtsThreshold = *(PUINT16)pData;
- *(PULONG)pData = RtsThreshold;
- *Length = sizeof (ULONG);
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSupportedRates
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilSupportedRates(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- PULONG Length
- )
- {
- rates_t rateSet;
- ULONG retValue;
- retValue = UtilGetParam(pAdapter, SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM, (PUCHAR)&rateSet, sizeof(rates_t));
- NdisMoveMemory(pData, (PUCHAR)&rateSet, *Length);
- *Length = rateSet.len +1; /* 1 is added for the length field itself */
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilSupportedRatesSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilSupportedRatesSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pData,
- ULONG Length
- )
- {
- rates_t rateSet;
- ULONG retValue;
- NdisMoveMemory(&rateSet, pData, Length);
- retValue = UtilSetParam(pAdapter, SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM, (PUCHAR)&rateSet, sizeof(rates_t));
- return retValue;
- }
- /*-----------------------------------------------------------------------------
- Routine Name: UtilRtsThresholdSet
- Routine Description:
- Arguments:
- Return Value:
- -----------------------------------------------------------------------------*/
- ULONG
- UtilRtsThresholdSet(
- PTIWLN_ADAPTER_T pAdapter,
- PUCHAR pDa…
Large files files are truncated, but you can click here to view the full file