pts.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * pts.h - hold parameters for pts command
  11. *
  12. *--------------------------------------------------------------------*/
  13. #ifndef PTS_HEADER
  14. #define PTS_HEADER
  15. /*====================================================================*
  16. * system header files;
  17. *--------------------------------------------------------------------*/
  18. #include <unistd.h>
  19. /*====================================================================*
  20. * custom header files;
  21. *--------------------------------------------------------------------*/
  22. #include "../ether/ether.h"
  23. #include "../tools/types.h"
  24. /*====================================================================*
  25. * #defines
  26. *--------------------------------------------------------------------*/
  27. #define PTSCTL_LINE_ATTN 127
  28. #define PTSCTL_GRND_ATTN 127
  29. #ifdef WIN32
  30. # define PTSCTL_PORT "com1:"
  31. #else
  32. # define PTSCTL_PORT "/dev/ttyS0"
  33. #endif
  34. /*====================================================================*
  35. * pts error messages;
  36. *--------------------------------------------------------------------*/
  37. /*====================================================================*
  38. * pts structure;
  39. *--------------------------------------------------------------------*/
  40. typedef struct pts
  41. {
  42. uint8_t dut [ETHER_ADDR_LEN];
  43. uint8_t gn [ETHER_ADDR_LEN];
  44. signed traffic; //traffic type 0=GN->DUT, 1=DUT->GN, 2=GN,<->DUT
  45. char const * name; //aten serial port
  46. signed atn_grnd; //gn setting
  47. signed atn_line; //ln setting
  48. signed phy_rate_limit; // minimum PHY rate to achive before exit
  49. uint16_t AVGRX_GN; // RX PHY rate GN
  50. uint16_t AVGRX_DUT; // RX PHY rate DUT
  51. uint16_t AVGTX_GN; // TX PHY rate GN
  52. uint16_t AVGTX_DUT; // TX PHY rate DUT
  53. uint8_t COUPLING; //MIMO, SISO, Alternate
  54. uint8_t timeout; // Max time to run before exiting (max 60 seconds-limited by loopback MME)
  55. signed tonemaps; //1=clear tonemap after test, 0=donot clear tonemap after test
  56. signed exit_option; // 0=always indicate test pass, exit with 0 return code
  57. // 1=normal mode, return with 1 on failure, 0 for test passed
  58. }
  59. PTS;
  60. /*====================================================================*
  61. * pts functions;
  62. *--------------------------------------------------------------------*/
  63. signed GetDUTPhyRates (struct plc * , struct pts * );
  64. signed GetGNPhyRates (struct plc * , struct pts * );
  65. signed Get_GN_MAC (struct plc * plc);
  66. // transmit from GN to DUT
  67. signed Transmit4 (struct plc * plc, byte source [], byte target []);
  68. // transmit from DUT to GN
  69. signed Transmit5 (struct plc * plc, byte source [], byte target []);
  70. // transmit from DUT to GN and DUT to GN (bi-dir)
  71. signed Transmit6 (struct plc * plc, byte source [], byte target []);
  72. // transmit from DUT to GN
  73. //signed Transmit5 (struct plc * plc, byte source [], byte target [], uint8_t tx_time );
  74. /*====================================================================*
  75. *
  76. *--------------------------------------------------------------------*/
  77. #endif