1981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* 2981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * ctrlDbg.c 3981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 4981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved. 5981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * All rights reserved. 6981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 7981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * Redistribution and use in source and binary forms, with or without 8981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * modification, are permitted provided that the following conditions 9981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * are met: 10981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 11981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * * Redistributions of source code must retain the above copyright 12981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * notice, this list of conditions and the following disclaimer. 13981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * * Redistributions in binary form must reproduce the above copyright 14981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * notice, this list of conditions and the following disclaimer in 15981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * the documentation and/or other materials provided with the 16981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * distribution. 17981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * * Neither the name Texas Instruments nor the names of its 18981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * contributors may be used to endorse or promote products derived 19981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * from this software without specific prior written permission. 20981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 21981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt */ 33981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 34981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 35981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/***************************************************************************/ 36981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* */ 37981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* MODULE: */ 38981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* PURPOSE: */ 39981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* */ 40981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/***************************************************************************/ 41981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "tidef.h" 42981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "Ctrl.h" 43981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "DataCtrl_Api.h" 44981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "dataCtrlDbg.h" 45981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "osApi.h" 46981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "report.h" 47981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "TWDriver.h" 48981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "paramOut.h" 49981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 50981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidtvoid printCtrlDbgFunctions(void); 51981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 52981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 53981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/************************************************************************* 54981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * * 55981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt ************************************************************************* 56981801b95b81e6d1c7a2085967406e86af0f08fcDmitry ShmidtDESCRIPTION: 57981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 58981801b95b81e6d1c7a2085967406e86af0f08fcDmitry ShmidtINPUT: 59981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 60981801b95b81e6d1c7a2085967406e86af0f08fcDmitry ShmidtOUTPUT: 61981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 62981801b95b81e6d1c7a2085967406e86af0f08fcDmitry ShmidtRETURN: 63981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 64981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt************************************************************************/ 65981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidtvoid ctrlDebugFunction(TI_HANDLE hCtrlData, TI_UINT32 funcType, void *pParam) 66981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt{ 67981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt ctrlData_t *pCtrlData = (ctrlData_t *)hCtrlData; 68981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt paramInfo_t paramInfo; 69981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 70981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt switch ((ECtrlDbgFunc)funcType) 71981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt { 72981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt case CTRL_PRINT_DBG_FUNCTIONS: 73981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt printCtrlDbgFunctions(); 74981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt break; 75981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 76981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt case CTRL_PRINT_CTRL_BLOCK: 77981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("CTRL DBG - Print Ctrl Block \n\n")); 78981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt ctrlData_printCtrlBlock(pCtrlData); 79981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt break; 80981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 81981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt case CTRL_PRINT_TX_PARAMETERS: 82981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("CTRL DBG - Print tx paramters \n\n")); 83981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt ctrlData_printTxParameters(pCtrlData); 84981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt break; 85981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 86981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt case CTRL_SET_CTS_TO_SELF: 87981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("CTRL DBG - Set CtsToSelf = %s\n",((*(TI_UINT8*)pParam > 0) ? "TI_TRUE" : "TI_FALSE"))); 88981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt paramInfo.paramType = CTRL_DATA_CURRENT_PROTECTION_STATUS_PARAM; 89981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt paramInfo.content.ctrlDataProtectionEnabled = ((*(TI_UINT8*)pParam > 0) ? 1 : 0); 90981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt ctrlData_setParam(pCtrlData,¶mInfo); 91981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt break; 92981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 93981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt default: 94981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("Invalid function type in Debug Ctrl Function Command: %d\n\n", funcType)); 95981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt break; 96981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt } 97981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt} 98981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 99981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 100981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidtvoid printCtrlDbgFunctions(void) 101981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt{ 102981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT((" Ctrl Dbg Functions \n")); 103981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("------------------------\n")); 104981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("400 - Print this menu.\n")); 105981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("401 - Print Ctrl Block.\n")); 106981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("402 - Print Tx parameters.\n")); 107981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt WLAN_OS_REPORT(("403 - Set CtsToSelf.\n")); 108981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt} 109981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 110981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 111981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 112