Home | History | Annotate | Download | only in Test
      1 /*
      2  * TxDbg.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 "DataCtrl_Api.h"
     43 #include "dataCtrlDbg.h"
     44 #include "osApi.h"
     45 #include "report.h"
     46 #include "siteMgrApi.h"
     47 #include "TWDriver.h"
     48 #include "txCtrl.h"
     49 
     50 void printTxRxDbgFunctions(void);
     51 
     52 
     53 
     54 /*************************************************************************
     55  *							rxTxDebugFunction							 *
     56  *************************************************************************
     57 DESCRIPTION:   Call the requested Tx or Rx debug print function.
     58 ************************************************************************/
     59 
     60 void rxTxDebugFunction(TI_HANDLE hRxTxHandle, TI_UINT32 funcType, void *pParam)
     61 {
     62 	txCtrl_t *pTxCtrl = (txCtrl_t *)hRxTxHandle;  /* Relevant only for some of the cases below! */
     63 
     64 	switch ((ERxTxDbgFunc)funcType)
     65 	{
     66 	case TX_RX_DBG_FUNCTIONS:
     67 		printTxRxDbgFunctions();
     68 		break;
     69 
     70 	/*
     71 	 *  TX DEBUG FUNCTIONS:
     72 	 *  ===================
     73 	 */
     74 	case PRINT_TX_CTRL_INFO:
     75 		txCtrlParams_printInfo (hRxTxHandle);
     76 		break;
     77 
     78     case PRINT_TX_CTRL_COUNTERS:
     79         txCtrlParams_printDebugCounters (hRxTxHandle);
     80         break;
     81 
     82 	case PRINT_TX_DATA_QUEUE_INFO:
     83 		txDataQ_PrintModuleParams (pTxCtrl->hTxDataQ);
     84 		break;
     85 
     86 	case PRINT_TX_DATA_QUEUE_COUNTERS:
     87 		txDataQ_PrintQueueStatistics (pTxCtrl->hTxDataQ);
     88 		break;
     89 
     90 	case PRINT_TX_MGMT_QUEUE_INFO:
     91 		txMgmtQ_PrintModuleParams (pTxCtrl->hTxMgmtQ);
     92 		break;
     93 
     94 	case PRINT_TX_MGMT_QUEUE_COUNTERS:
     95 		txMgmtQ_PrintQueueStatistics (pTxCtrl->hTxMgmtQ);
     96 		break;
     97 
     98     case PRINT_TX_CTRL_BLK_INFO:
     99 		TWD_PrintTxInfo (pTxCtrl->hTWD, TWD_PRINT_TX_CTRL_BLK_TBL);
    100         break;
    101 
    102     case PRINT_TX_HW_QUEUE_INFO:
    103 		TWD_PrintTxInfo (pTxCtrl->hTWD, TWD_PRINT_TX_HW_QUEUE_INFO);
    104         break;
    105 
    106     case PRINT_TX_XFER_INFO:
    107 		TWD_PrintTxInfo (pTxCtrl->hTWD, TWD_PRINT_TX_XFER_INFO);
    108         break;
    109 
    110 	case PRINT_TX_RESULT_INFO:
    111 		TWD_PrintTxInfo (pTxCtrl->hTWD, TWD_PRINT_TX_RESULT_INFO);
    112         break;
    113 
    114 	case PRINT_TX_DATA_CLSFR_TABLE:
    115         txDataClsfr_PrintClsfrTable (pTxCtrl->hTxDataQ);
    116         break;
    117 
    118 
    119 	case RESET_TX_CTRL_COUNTERS:
    120 		txCtrlParams_resetDbgCounters (hRxTxHandle);
    121 		break;
    122 
    123 	case RESET_TX_DATA_QUEUE_COUNTERS:
    124 		txDataQ_ResetQueueStatistics (pTxCtrl->hTxDataQ);
    125 		break;
    126 
    127     case RESET_TX_DATA_CLSFR_TABLE:
    128         {
    129             EClsfrType  myLocalType;
    130 
    131             /* Setting again the current classifier type clears the table */
    132             txDataClsfr_GetClsfrType (pTxCtrl->hTxDataQ, &myLocalType);
    133             txDataClsfr_SetClsfrType (pTxCtrl->hTxDataQ, myLocalType);
    134         }
    135 		break;
    136 
    137 	case RESET_TX_MGMT_QUEUE_COUNTERS:
    138 		txMgmtQ_ResetQueueStatistics (pTxCtrl->hTxMgmtQ);
    139 		break;
    140 
    141 	case RESET_TX_RESULT_COUNTERS:
    142 		TWD_PrintTxInfo (pTxCtrl->hTWD, TWD_CLEAR_TX_RESULT_INFO);
    143 		break;
    144 
    145 	case RESET_TX_XFER_COUNTERS:
    146 		TWD_PrintTxInfo (pTxCtrl->hTWD, TWD_CLEAR_TX_XFER_INFO);
    147 		break;
    148 
    149 
    150 	/*
    151 	 *  RX DEBUG FUNCTIONS:
    152 	 *  ===================
    153 	 */
    154 	case PRINT_RX_BLOCK:
    155 		WLAN_OS_REPORT(("RX DBG - Print Rx Block \n\n"));
    156 		rxData_printRxBlock(hRxTxHandle);
    157 		break;
    158 
    159 	case PRINT_RX_COUNTERS:
    160 		WLAN_OS_REPORT(("RX DBG - Print Rx counters \n\n"));
    161 		rxData_printRxCounters(hRxTxHandle);
    162 		break;
    163 
    164 	case RESET_RX_COUNTERS:
    165 		WLAN_OS_REPORT(("RX DBG - Reset Rx counters \n\n"));
    166 		rxData_resetCounters(hRxTxHandle);
    167 		rxData_resetDbgCounters(hRxTxHandle);
    168 		break;
    169 
    170     case PRINT_RX_THROUGHPUT_START:
    171 		rxData_startRxThroughputTimer (hRxTxHandle);
    172 		break;
    173 
    174     case PRINT_RX_THROUGHPUT_STOP:
    175 		rxData_stopRxThroughputTimer (hRxTxHandle);
    176 		break;
    177 
    178 	default:
    179 		WLAN_OS_REPORT(("Invalid function type in Debug Tx Function Command: %d\n\n", funcType));
    180 		break;
    181 	}
    182 }
    183 
    184 
    185 void printTxRxDbgFunctions(void)
    186 {
    187 	WLAN_OS_REPORT(("\n          Tx Dbg Functions   \n"));
    188 	WLAN_OS_REPORT(("--------------------------------------\n"));
    189 
    190 	WLAN_OS_REPORT(("301 - Print TxCtrl info.\n"));
    191 	WLAN_OS_REPORT(("302 - Print TxCtrl Statistics.\n"));
    192 	WLAN_OS_REPORT(("303 - Print TxDataQueue info.\n"));
    193 	WLAN_OS_REPORT(("304 - Print TxDataQueue Statistics.\n"));
    194 	WLAN_OS_REPORT(("305 - Print TxMgmtQueue info.\n"));
    195 	WLAN_OS_REPORT(("306 - Print TxMgmtQueue Statistics.\n"));
    196 	WLAN_OS_REPORT(("307 - Print TxCtrlBlk table.\n"));
    197 	WLAN_OS_REPORT(("308 - Print TxHwQueue info.\n"));
    198 	WLAN_OS_REPORT(("309 - Print TxXfer info.\n"));
    199 	WLAN_OS_REPORT(("310 - Print TxResult info.\n"));
    200 	WLAN_OS_REPORT(("311 - Print TxDataClsfr Classifier Table.\n"));
    201 
    202 	WLAN_OS_REPORT(("320 - Reset TxCtrl Statistics.\n"));
    203 	WLAN_OS_REPORT(("321 - Reset TxDataQueue Statistics.\n"));
    204 	WLAN_OS_REPORT(("322 - Reset TxDataClsfr Classifier Table.\n"));
    205 	WLAN_OS_REPORT(("323 - Reset TxMgmtQueue Statistics.\n"));
    206 	WLAN_OS_REPORT(("324 - Reset TxResult Statistics.\n"));
    207 	WLAN_OS_REPORT(("325 - Reset TxXfer Statistics.\n"));
    208 
    209 	WLAN_OS_REPORT(("\n          Rx Dbg Functions   \n"));
    210 	WLAN_OS_REPORT(("--------------------------------------\n"));
    211 	WLAN_OS_REPORT(("350 - Print Rx block.\n"));
    212 	WLAN_OS_REPORT(("351 - Print Rx counters.\n"));
    213 	WLAN_OS_REPORT(("352 - Reset Rx counters.\n"));
    214 	WLAN_OS_REPORT(("353 - Start Rx throughput timer.\n"));
    215 	WLAN_OS_REPORT(("354 - Stop  Rx throughput timer.\n"));
    216 }
    217 
    218 
    219