/drivers/net/wireless/tiwlan1251/common/src/BusAccess/Shm_Common/whalTrace.h

http://github.com/CyanogenMod/cm-kernel · C Header · 136 lines · 75 code · 21 blank · 40 comment · 0 complexity · ef41d7de19c6d832d31df3a793f04b1a MD5 · raw file

  1. /****************************************************************************
  2. **+-----------------------------------------------------------------------+**
  3. **| |**
  4. **| Copyright(c) 1998 - 2008 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: whalTrace.h
  38. * PURPOSE: Trace on Rx/Tx packets
  39. *
  40. ****************************************************************************/
  41. #ifndef _WHAL_TRACE_H
  42. #define _WHAL_TRACE_H
  43. #include "whalCommon.h"
  44. #include "whalHwDefs.h"
  45. #ifndef TIWLN_WINCE30
  46. #define TRACER_MAX_EVENTS 2000
  47. #else
  48. #define TRACER_MAX_EVENTS 10
  49. #endif
  50. #define TRACER_MAX_ACT_LEN 5
  51. #define TRACER_MAX_OBJ_LEN 3
  52. #define TRACER_HDR_LEN 2
  53. #define TRACER_MAX_STR_LEN 70
  54. typedef enum
  55. {
  56. NUM_FREE_DESCRIPTOR,
  57. DESCRIPTOR_OCCUPIED,
  58. CLEAR_DESCRIPTORS,
  59. FREE_BLOCKS,
  60. } varSetType_e;
  61. typedef struct
  62. {
  63. UINT32 time;
  64. UINT16 MpduLen;
  65. UINT8 Ctl;
  66. UINT16 Rate;
  67. UINT8 Status[4];
  68. dot11_header_t FrameHeader;
  69. int FrameData;
  70. } TRACER_DATA;
  71. typedef struct
  72. {
  73. char String[TRACER_MAX_STR_LEN];
  74. int IntValue;
  75. } TRACER_CTRL;
  76. typedef struct
  77. {
  78. UINT32 TimStamp;
  79. char Action[TRACER_MAX_ACT_LEN];
  80. char Object[TRACER_MAX_OBJ_LEN];
  81. union
  82. {
  83. TRACER_DATA TrcData;
  84. TRACER_CTRL TrcCtrl;
  85. }Info;
  86. } TRACER_EVENT;
  87. typedef struct _WhalTrace_T
  88. {
  89. int Enable;
  90. int Idx;
  91. int Num;
  92. #ifdef TNETW_MASTER_MODE
  93. TRACER_EVENT Evt[TRACER_MAX_EVENTS];
  94. #endif
  95. void *hProtect;
  96. short traceMask;
  97. UINT8 MinNumDescriptorFree;
  98. UINT8 MacOccupiedDescriptor;
  99. UINT8 MaxClearDescriptor;
  100. UINT8 MaxFreeBlks;
  101. UINT8 BugCounter;
  102. UINT8 reBug;
  103. TI_HANDLE hTNETWIF;
  104. TI_HANDLE hOs;
  105. TI_HANDLE hReport;
  106. } WhalTrace_T;
  107. extern WhalTrace_T *whal_traceCreate(TI_HANDLE hOs);
  108. extern int whal_traceDestroy(WhalTrace_T *pTrc);
  109. extern int whal_traceConfig(WhalTrace_T *pTrc, TI_HANDLE hTNETWIF, TI_HANDLE hReport);
  110. #ifdef TNETW_MASTER_MODE
  111. extern int whal_traceAddTx(WhalTrace_T *pTrc, HwTxDesc_T *pHwTxDesc, char *Action);
  112. #endif
  113. extern int whal_traceIsEnable(WhalTrace_T *pTrc);
  114. extern void whal_traceEnable(WhalTrace_T *pTrc, int val);
  115. #endif