1 /* 2 * ctrlDbg.c 3 * 4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * * Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * * Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in 15 * the documentation and/or other materials provided with the 16 * distribution. 17 * * Neither the name Texas Instruments nor the names of its 18 * contributors may be used to endorse or promote products derived 19 * from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 35 /***************************************************************************/ 36 /* */ 37 /* MODULE: */ 38 /* PURPOSE: */ 39 /* */ 40 /***************************************************************************/ 41 #include "tidef.h" 42 #include "Ctrl.h" 43 #include "DataCtrl_Api.h" 44 #include "dataCtrlDbg.h" 45 #include "osApi.h" 46 #include "report.h" 47 #include "TWDriver.h" 48 #include "paramOut.h" 49 50 void printCtrlDbgFunctions(void); 51 52 53 /************************************************************************* 54 * * 55 ************************************************************************* 56 DESCRIPTION: 57 58 INPUT: 59 60 OUTPUT: 61 62 RETURN: 63 64 ************************************************************************/ 65 void ctrlDebugFunction(TI_HANDLE hCtrlData, TI_UINT32 funcType, void *pParam) 66 { 67 ctrlData_t *pCtrlData = (ctrlData_t *)hCtrlData; 68 paramInfo_t paramInfo; 69 70 switch ((ECtrlDbgFunc)funcType) 71 { 72 case CTRL_PRINT_DBG_FUNCTIONS: 73 printCtrlDbgFunctions(); 74 break; 75 76 case CTRL_PRINT_CTRL_BLOCK: 77 WLAN_OS_REPORT(("CTRL DBG - Print Ctrl Block \n\n")); 78 ctrlData_printCtrlBlock(pCtrlData); 79 break; 80 81 case CTRL_PRINT_TX_PARAMETERS: 82 WLAN_OS_REPORT(("CTRL DBG - Print tx paramters \n\n")); 83 ctrlData_printTxParameters(pCtrlData); 84 break; 85 86 case CTRL_SET_CTS_TO_SELF: 87 WLAN_OS_REPORT(("CTRL DBG - Set CtsToSelf = %s\n",((*(TI_UINT8*)pParam > 0) ? "TI_TRUE" : "TI_FALSE"))); 88 paramInfo.paramType = CTRL_DATA_CURRENT_PROTECTION_STATUS_PARAM; 89 paramInfo.content.ctrlDataProtectionEnabled = ((*(TI_UINT8*)pParam > 0) ? 1 : 0); 90 ctrlData_setParam(pCtrlData,¶mInfo); 91 break; 92 93 default: 94 WLAN_OS_REPORT(("Invalid function type in Debug Ctrl Function Command: %d\n\n", funcType)); 95 break; 96 } 97 } 98 99 100 void printCtrlDbgFunctions(void) 101 { 102 WLAN_OS_REPORT((" Ctrl Dbg Functions \n")); 103 WLAN_OS_REPORT(("------------------------\n")); 104 WLAN_OS_REPORT(("400 - Print this menu.\n")); 105 WLAN_OS_REPORT(("401 - Print Ctrl Block.\n")); 106 WLAN_OS_REPORT(("402 - Print Tx parameters.\n")); 107 WLAN_OS_REPORT(("403 - Set CtsToSelf.\n")); 108 } 109 110 111 112