madwifi.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * Header bits derived from MadWifi source:
  3. * Copyright (c) 2001 Atsushi Onoe
  4. * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  5. * All rights reserved.
  6. *
  7. * Distributed under the terms of the GPLv2 license.
  8. *
  9. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  10. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  11. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  12. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  13. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  14. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  18. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  19. */
  20. #ifndef _MADWIFI_H
  21. #define _MADWIFI_H
  22. /* ieee80211.h */
  23. #define IEEE80211_ADDR_LEN 6
  24. #define IEEE80211_RATE_VAL 0x7f
  25. #define IEEE80211_SEQ_SEQ_MASK 0xfff0
  26. #define IEEE80211_SEQ_SEQ_SHIFT 4
  27. /* ieee80211_crypto.h */
  28. #define IEEE80211_KEYBUF_SIZE 16
  29. #define IEEE80211_MICBUF_SIZE 16
  30. #define IEEE80211_TID_SIZE 17
  31. #define IEEE80211_CIPHER_WEP 0
  32. #define IEEE80211_CIPHER_TKIP 1
  33. #define IEEE80211_CIPHER_AES_OCB 2
  34. #define IEEE80211_CIPHER_AES_CCM 3
  35. #define IEEE80211_CIPHER_CKIP 5
  36. #define IEEE80211_CIPHER_NONE 6
  37. #define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE + 1)
  38. /* ieee80211_ioctl.h */
  39. #define IEEE80211_KEY_DEFAULT 0x80
  40. #define IEEE80211_CHAN_MAX 255
  41. #define IEEE80211_CHAN_BYTES 32
  42. #define IEEE80211_RATE_MAXSIZE 15
  43. #define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE+3)
  44. #define IEEE80211_IOCTL_STA_STATS (SIOCDEVPRIVATE+5)
  45. #define IEEE80211_IOCTL_STA_INFO (SIOCDEVPRIVATE+6)
  46. #define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
  47. #define IEEE80211_IOCTL_GETMODE (SIOCIWFIRSTPRIV+3)
  48. #define IEEE80211_IOCTL_GETCHANLIST (SIOCIWFIRSTPRIV+7)
  49. #define IEEE80211_IOCTL_GETCHANINFO (SIOCIWFIRSTPRIV+13)
  50. #define SIOC80211IFCREATE (SIOCDEVPRIVATE+7)
  51. #define SIOC80211IFDESTROY (SIOCDEVPRIVATE+8)
  52. #define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */
  53. #define IEEE80211_NO_STABEACONS 0x0002 /* Do not setup the station beacon timers */
  54. struct ieee80211_clone_params {
  55. char icp_name[IFNAMSIZ]; /* device name */
  56. u_int16_t icp_opmode; /* operating mode */
  57. u_int16_t icp_flags; /* see below */
  58. };
  59. enum ieee80211_opmode {
  60. IEEE80211_M_STA = 1, /* infrastructure station */
  61. IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */
  62. IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */
  63. IEEE80211_M_HOSTAP = 6, /* Software Access Point */
  64. IEEE80211_M_MONITOR = 8, /* Monitor mode */
  65. IEEE80211_M_WDS = 2, /* WDS link */
  66. };
  67. enum {
  68. IEEE80211_PARAM_AUTHMODE = 3, /* authentication mode */
  69. IEEE80211_PARAM_MCASTCIPHER = 5, /* multicast/default cipher */
  70. IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */
  71. IEEE80211_PARAM_UCASTCIPHERS = 7, /* unicast cipher suites */
  72. IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */
  73. };
  74. /*
  75. * Authentication mode.
  76. */
  77. enum ieee80211_authmode {
  78. IEEE80211_AUTH_NONE = 0,
  79. IEEE80211_AUTH_OPEN = 1, /* open */
  80. IEEE80211_AUTH_SHARED = 2, /* shared-key */
  81. IEEE80211_AUTH_8021X = 3, /* 802.1x */
  82. IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */
  83. /* NB: these are used only for ioctls */
  84. IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x/PSK */
  85. };
  86. struct ieee80211_channel {
  87. u_int16_t ic_freq; /* setting in MHz */
  88. u_int16_t ic_flags; /* see below */
  89. u_int8_t ic_ieee; /* IEEE channel number */
  90. int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */
  91. int8_t ic_maxpower; /* maximum tx power in dBm */
  92. int8_t ic_minpower; /* minimum tx power in dBm */
  93. u_int8_t ic_scanflags;
  94. u_int8_t ic_idletime; /* phy idle time in % */
  95. };
  96. struct ieee80211req_key {
  97. u_int8_t ik_type; /* key/cipher type */
  98. u_int8_t ik_pad;
  99. u_int16_t ik_keyix; /* key index */
  100. u_int8_t ik_keylen; /* key length in bytes */
  101. u_int8_t ik_flags;
  102. u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
  103. u_int64_t ik_keyrsc; /* key receive sequence counter */
  104. u_int64_t ik_keytsc; /* key transmit sequence counter */
  105. u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
  106. };
  107. struct ieee80211req_chanlist {
  108. u_int8_t ic_channels[IEEE80211_CHAN_BYTES];
  109. };
  110. struct ieee80211req_chaninfo {
  111. u_int ic_nchans;
  112. struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
  113. };
  114. struct ieee80211req_sta_info {
  115. u_int16_t isi_len; /* length (mult of 4) */
  116. u_int16_t isi_freq; /* MHz */
  117. u_int16_t isi_flags; /* channel flags */
  118. u_int16_t isi_state; /* state flags */
  119. u_int8_t isi_authmode; /* authentication algorithm */
  120. u_int8_t isi_rssi;
  121. int8_t isi_noise;
  122. u_int16_t isi_capinfo; /* capabilities */
  123. u_int8_t isi_athflags; /* Atheros capabilities */
  124. u_int8_t isi_erp; /* ERP element */
  125. u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
  126. u_int8_t isi_nrates; /* negotiated rates */
  127. u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
  128. u_int8_t isi_txrate; /* index to isi_rates[] */
  129. u_int16_t isi_ie_len; /* IE length */
  130. u_int16_t isi_associd; /* assoc response */
  131. u_int16_t isi_txpower; /* current tx power */
  132. u_int16_t isi_vlan; /* vlan tag */
  133. u_int16_t isi_txseqs[17]; /* seq to be transmitted */
  134. u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/
  135. u_int16_t isi_inact; /* inactivity timer */
  136. u_int8_t isi_uapsd; /* UAPSD queues */
  137. u_int8_t isi_opmode; /* sta operating mode */
  138. };
  139. #endif