testcmd.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //------------------------------------------------------------------------------
  2. // <copyright file="testcmd.h" company="Atheros">
  3. // Copyright (c) 2004-2005 Atheros Corporation. All rights reserved.
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License version 2 as
  7. // published by the Free Software Foundation;
  8. //
  9. // Software distributed under the License is distributed on an "AS
  10. // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11. // implied. See the License for the specific language governing
  12. // rights and limitations under the License.
  13. //
  14. //
  15. //------------------------------------------------------------------------------
  16. //==============================================================================
  17. // Author(s): ="Atheros"
  18. //==============================================================================
  19. #ifndef TESTCMD_H_
  20. #define TESTCMD_H_
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. typedef enum {
  25. ZEROES_PATTERN = 0,
  26. ONES_PATTERN,
  27. REPEATING_10,
  28. PN7_PATTERN,
  29. PN9_PATTERN,
  30. PN15_PATTERN
  31. }TX_DATA_PATTERN;
  32. /* Continous tx
  33. mode : TCMD_CONT_TX_OFF - Disabling continous tx
  34. TCMD_CONT_TX_SINE - Enable continuous unmodulated tx
  35. TCMD_CONT_TX_FRAME- Enable continuous modulated tx
  36. freq : Channel freq in Mhz. (e.g 2412 for channel 1 in 11 g)
  37. dataRate: 0 - 1 Mbps
  38. 1 - 2 Mbps
  39. 2 - 5.5 Mbps
  40. 3 - 11 Mbps
  41. 4 - 6 Mbps
  42. 5 - 9 Mbps
  43. 6 - 12 Mbps
  44. 7 - 18 Mbps
  45. 8 - 24 Mbps
  46. 9 - 36 Mbps
  47. 10 - 28 Mbps
  48. 11 - 54 Mbps
  49. txPwr: Tx power in dBm[5 -11] for unmod Tx, [5-14] for mod Tx
  50. antenna: 1 - one antenna
  51. 2 - two antenna
  52. Note : Enable/disable continuous tx test cmd works only when target is awake.
  53. */
  54. typedef enum {
  55. TCMD_CONT_TX_OFF = 0,
  56. TCMD_CONT_TX_SINE,
  57. TCMD_CONT_TX_FRAME,
  58. TCMD_CONT_TX_TX99,
  59. TCMD_CONT_TX_TX100
  60. } TCMD_CONT_TX_MODE;
  61. typedef PREPACK struct {
  62. A_UINT32 testCmdId;
  63. A_UINT32 mode;
  64. A_UINT32 freq;
  65. A_UINT32 dataRate;
  66. A_INT32 txPwr;
  67. A_UINT32 antenna;
  68. A_UINT32 enANI;
  69. A_UINT32 scramblerOff;
  70. A_UINT32 aifsn;
  71. A_UINT16 pktSz;
  72. A_UINT16 txPattern;
  73. } POSTPACK TCMD_CONT_TX;
  74. #define TCMD_TXPATTERN_ZERONE 0x1
  75. #define TCMD_TXPATTERN_ZERONE_DIS_SCRAMBLE 0x2
  76. /* Continuous Rx
  77. act: TCMD_CONT_RX_PROMIS - promiscuous mode (accept all incoming frames)
  78. TCMD_CONT_RX_FILTER - filter mode (accept only frames with dest
  79. address equal specified
  80. mac address (set via act =3)
  81. TCMD_CONT_RX_REPORT off mode (disable cont rx mode and get the
  82. report from the last cont
  83. Rx test)
  84. TCMD_CONT_RX_SETMAC - set MacAddr mode (sets the MAC address for the
  85. target. This Overrides
  86. the default MAC address.)
  87. */
  88. typedef enum {
  89. TCMD_CONT_RX_PROMIS =0,
  90. TCMD_CONT_RX_FILTER,
  91. TCMD_CONT_RX_REPORT,
  92. TCMD_CONT_RX_SETMAC,
  93. TCMD_CONT_RX_SET_ANT_SWITCH_TABLE
  94. } TCMD_CONT_RX_ACT;
  95. typedef PREPACK struct {
  96. A_UINT32 testCmdId;
  97. A_UINT32 act;
  98. A_UINT32 enANI;
  99. PREPACK union {
  100. struct PREPACK TCMD_CONT_RX_PARA {
  101. A_UINT32 freq;
  102. A_UINT32 antenna;
  103. } POSTPACK para;
  104. struct PREPACK TCMD_CONT_RX_REPORT {
  105. A_UINT32 totalPkt;
  106. A_INT32 rssiInDBm;
  107. A_UINT32 crcErrPkt;
  108. A_UINT32 secErrPkt;
  109. A_UINT32 noiseFloor;
  110. } POSTPACK report;
  111. struct PREPACK TCMD_CONT_RX_MAC {
  112. A_UCHAR addr[ATH_MAC_LEN];
  113. } POSTPACK mac;
  114. struct PREPACK TCMD_CONT_RX_ANT_SWITCH_TABLE {
  115. A_UINT32 antswitch1;
  116. A_UINT32 antswitch2;
  117. }POSTPACK antswitchtable;
  118. } POSTPACK u;
  119. } POSTPACK TCMD_CONT_RX;
  120. /* Force sleep/wake test cmd
  121. mode: TCMD_PM_WAKEUP - Wakeup the target
  122. TCMD_PM_SLEEP - Force the target to sleep.
  123. */
  124. typedef enum {
  125. TCMD_PM_WAKEUP = 1, /* be consistent with target */
  126. TCMD_PM_SLEEP
  127. } TCMD_PM_MODE;
  128. typedef PREPACK struct {
  129. A_UINT32 testCmdId;
  130. A_UINT32 mode;
  131. } POSTPACK TCMD_PM;
  132. typedef enum {
  133. TCMD_CONT_TX_ID,
  134. TCMD_CONT_RX_ID,
  135. TCMD_PM_ID,
  136. TCMD_GET_MAC_ID
  137. } TCMD_ID;
  138. typedef PREPACK struct {
  139. A_UINT32 testCmdId;
  140. A_UCHAR addr[ATH_MAC_LEN];
  141. } POSTPACK TCMD_GET_MAC;
  142. typedef PREPACK union {
  143. TCMD_CONT_TX contTx;
  144. TCMD_CONT_RX contRx;
  145. TCMD_PM pm;
  146. TCMD_GET_MAC getMac;
  147. } POSTPACK TEST_CMD;
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151. #endif /* TESTCMD_H_ */