rndis.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * 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 as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. *
  20. * File: rndis.h
  21. *
  22. * Purpose: Interface between firmware and driver
  23. *
  24. * Author: Warren Hsu
  25. *
  26. * Date: Nov 24, 2004
  27. *
  28. */
  29. #ifndef __RNDIS_H__
  30. #define __RNDIS_H__
  31. /*--------------------- Export Definitions -------------------------*/
  32. #define MESSAGE_TYPE_READ 0x01
  33. #define MESSAGE_TYPE_WRITE 0x00
  34. #define MESSAGE_TYPE_LOCK_OR 0x02
  35. #define MESSAGE_TYPE_LOCK_AND 0x03
  36. #define MESSAGE_TYPE_WRITE_MASK 0x04
  37. #define MESSAGE_TYPE_CARDINIT 0x05
  38. #define MESSAGE_TYPE_INIT_RSP 0x06
  39. #define MESSAGE_TYPE_MACSHUTDOWN 0x07
  40. #define MESSAGE_TYPE_SETKEY 0x08
  41. #define MESSAGE_TYPE_CLRKEYENTRY 0x09
  42. #define MESSAGE_TYPE_WRITE_MISCFF 0x0A
  43. #define MESSAGE_TYPE_SET_ANTMD 0x0B
  44. #define MESSAGE_TYPE_SELECT_CHANNLE 0x0C
  45. #define MESSAGE_TYPE_SET_TSFTBTT 0x0D
  46. #define MESSAGE_TYPE_SET_SSTIFS 0x0E
  47. #define MESSAGE_TYPE_CHANGE_BBTYPE 0x0F
  48. #define MESSAGE_TYPE_DISABLE_PS 0x10
  49. #define MESSAGE_TYPE_WRITE_IFRF 0x11
  50. //used for read/write(index)
  51. #define MESSAGE_REQUEST_MEM 0x01
  52. #define MESSAGE_REQUEST_BBREG 0x02
  53. #define MESSAGE_REQUEST_MACREG 0x03
  54. #define MESSAGE_REQUEST_EEPROM 0x04
  55. #define MESSAGE_REQUEST_TSF 0x05
  56. #define MESSAGE_REQUEST_TBTT 0x06
  57. #define MESSAGE_REQUEST_BBAGC 0x07
  58. #define MESSAGE_REQUEST_VERSION 0x08
  59. #define MESSAGE_REQUEST_RF_INIT 0x09
  60. #define MESSAGE_REQUEST_RF_INIT2 0x0A
  61. #define MESSAGE_REQUEST_RF_CH0 0x0B
  62. #define MESSAGE_REQUEST_RF_CH1 0x0C
  63. #define MESSAGE_REQUEST_RF_CH2 0x0D
  64. #define VIAUSB20_PACKET_HEADER 0x04
  65. /*--------------------- Export Classes ----------------------------*/
  66. typedef struct _CMD_MESSAGE
  67. {
  68. BYTE byData[256];
  69. } CMD_MESSAGE, *PCMD_MESSAGE;
  70. typedef struct _CMD_WRITE_MASK
  71. {
  72. BYTE byData;
  73. BYTE byMask;
  74. } CMD_WRITE_MASK, *PCMD_WRITE_MASK;
  75. typedef struct _CMD_CARD_INIT
  76. {
  77. BYTE byInitClass;
  78. BYTE bExistSWNetAddr;
  79. BYTE bySWNetAddr[6];
  80. BYTE byShortRetryLimit;
  81. BYTE byLongRetryLimit;
  82. } CMD_CARD_INIT, *PCMD_CARD_INIT;
  83. typedef struct _RSP_CARD_INIT
  84. {
  85. BYTE byStatus;
  86. BYTE byNetAddr[6];
  87. BYTE byRFType;
  88. BYTE byMinChannel;
  89. BYTE byMaxChannel;
  90. } RSP_CARD_INIT, *PRSP_CARD_INIT;
  91. typedef struct _CMD_SET_KEY
  92. {
  93. WORD wKCTL;
  94. BYTE abyMacAddr[6];
  95. BYTE abyKey[16];
  96. } CMD_SET_KEY, *PCMD_SET_KEY;
  97. typedef struct _CMD_CLRKEY_ENTRY
  98. {
  99. BYTE abyKeyEntry[11];
  100. } CMD_CLRKEY_ENTRY, *PCMD_CLRKEY_ENTRY;
  101. typedef struct _CMD_WRITE_MISCFF
  102. {
  103. DWORD adwMiscFFData[22][4]; //a key entry has only 22 dwords
  104. } CMD_WRITE_MISCFF, *PCMD_WRITE_MISCFF;
  105. typedef struct _CMD_SET_TSFTBTT
  106. {
  107. BYTE abyTSF_TBTT[8];
  108. } CMD_SET_TSFTBTT, *PCMD_SET_TSFTBTT;
  109. typedef struct _CMD_SET_SSTIFS
  110. {
  111. BYTE bySIFS;
  112. BYTE byDIFS;
  113. BYTE byEIFS;
  114. BYTE bySlotTime;
  115. BYTE byCwMax_Min;
  116. BYTE byBBCR10;
  117. } CMD_SET_SSTIFS, *PCMD_SET_SSTIFS;
  118. typedef struct _CMD_CHANGE_BBTYPE
  119. {
  120. BYTE bySIFS;
  121. BYTE byDIFS;
  122. BYTE byEIFS;
  123. BYTE bySlotTime;
  124. BYTE byCwMax_Min;
  125. BYTE byBBCR10;
  126. BYTE byBB_BBType; //CR88
  127. BYTE byMAC_BBType;
  128. DWORD dwRSPINF_b_1;
  129. DWORD dwRSPINF_b_2;
  130. DWORD dwRSPINF_b_55;
  131. DWORD dwRSPINF_b_11;
  132. WORD wRSPINF_a[9];
  133. } CMD_CHANGE_BBTYPE, *PCMD_CHANGE_BBTYPE;
  134. /*--------------------- Export Macros -------------------------*/
  135. #define EXCH_WORD(w) ((WORD)((WORD)(w)<<8) | (WORD)((WORD)(w)>>8))
  136. /*--------------------- Export Variables --------------------------*/
  137. /*--------------------- Export Functions --------------------------*/
  138. #endif /* _RNDIS_H_ */