channel.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * channel.c - global channel structure;
  11. *
  12. * channel.h
  13. *
  14. * define and initialize a global channel structure; this structure
  15. * is initialized for communication with Atheros devices and it is
  16. * referenced by Atheros Linux Toolkit programs that do not need a
  17. * full int6k data structure;
  18. *
  19. * Contributor(s):
  20. * Charles Maier <cmaier@qca.qualcomm.com>
  21. * Nathaniel Houghton <nhoughto@qca.qualcomm.com>
  22. *
  23. *--------------------------------------------------------------------*/
  24. #ifndef CHANNEL_SOURCE
  25. #define CHANNEL_SOURCE
  26. #include "../ether/channel.h"
  27. struct channel channel =
  28. {
  29. (file_t) (- 1),
  30. 0,
  31. CHANNEL_ETHNUMBER,
  32. CHANNEL_ETHDEVICE,
  33. {
  34. 0x00,
  35. 0xB0,
  36. 0x52,
  37. 0x00,
  38. 0x00,
  39. 0x01
  40. },
  41. {
  42. 0x00,
  43. 0x00,
  44. 0x00,
  45. 0x00,
  46. 0x00,
  47. 0x00
  48. },
  49. ETH_P_HPAV,
  50. #if defined (__linux__)
  51. #elif defined (__APPLE__) || defined (__OpenBSD__)
  52. (struct bpf *) (0),
  53. #elif defined (WINPCAP) || defined (LIBPCAP)
  54. (pcap_t *) (0),
  55. {
  56. 0
  57. },
  58. #else
  59. #error "Unknown Environment"
  60. #endif
  61. CHANNEL_CAPTURE,
  62. CHANNEL_TIMEOUT,
  63. CHANNEL_FLAGS
  64. };
  65. struct channel channel1 =
  66. {
  67. (file_t) (- 1),
  68. 0,
  69. CHANNEL1_ETHNUMBER,
  70. CHANNEL1_ETHDEVICE,
  71. {
  72. 0x00,
  73. 0xB0,
  74. 0x52,
  75. 0x00,
  76. 0x00,
  77. 0x01
  78. },
  79. {
  80. 0x00,
  81. 0x00,
  82. 0x00,
  83. 0x00,
  84. 0x00,
  85. 0x00
  86. },
  87. ETH_P_HPAV,
  88. #if defined (__linux__)
  89. #elif defined (__APPLE__) || defined (__OpenBSD__)
  90. (struct bpf *) (0),
  91. #elif defined (WINPCAP) || defined (LIBPCAP)
  92. (pcap_t *) (0),
  93. {
  94. 0
  95. },
  96. #else
  97. #error "Unknown Environment"
  98. #endif
  99. CHANNEL_CAPTURE,
  100. CHANNEL_TIMEOUT,
  101. CHANNEL_FLAGS
  102. };
  103. #endif