wl12xx_80211.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #ifndef __WL12XX_80211_H__
  2. #define __WL12XX_80211_H__
  3. #include <linux/if_ether.h> /* ETH_ALEN */
  4. /* RATES */
  5. #define IEEE80211_CCK_RATE_1MB 0x02
  6. #define IEEE80211_CCK_RATE_2MB 0x04
  7. #define IEEE80211_CCK_RATE_5MB 0x0B
  8. #define IEEE80211_CCK_RATE_11MB 0x16
  9. #define IEEE80211_OFDM_RATE_6MB 0x0C
  10. #define IEEE80211_OFDM_RATE_9MB 0x12
  11. #define IEEE80211_OFDM_RATE_12MB 0x18
  12. #define IEEE80211_OFDM_RATE_18MB 0x24
  13. #define IEEE80211_OFDM_RATE_24MB 0x30
  14. #define IEEE80211_OFDM_RATE_36MB 0x48
  15. #define IEEE80211_OFDM_RATE_48MB 0x60
  16. #define IEEE80211_OFDM_RATE_54MB 0x6C
  17. #define IEEE80211_BASIC_RATE_MASK 0x80
  18. #define IEEE80211_CCK_RATE_1MB_MASK (1<<0)
  19. #define IEEE80211_CCK_RATE_2MB_MASK (1<<1)
  20. #define IEEE80211_CCK_RATE_5MB_MASK (1<<2)
  21. #define IEEE80211_CCK_RATE_11MB_MASK (1<<3)
  22. #define IEEE80211_OFDM_RATE_6MB_MASK (1<<4)
  23. #define IEEE80211_OFDM_RATE_9MB_MASK (1<<5)
  24. #define IEEE80211_OFDM_RATE_12MB_MASK (1<<6)
  25. #define IEEE80211_OFDM_RATE_18MB_MASK (1<<7)
  26. #define IEEE80211_OFDM_RATE_24MB_MASK (1<<8)
  27. #define IEEE80211_OFDM_RATE_36MB_MASK (1<<9)
  28. #define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
  29. #define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
  30. #define IEEE80211_CCK_RATES_MASK 0x0000000F
  31. #define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
  32. IEEE80211_CCK_RATE_2MB_MASK)
  33. #define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
  34. IEEE80211_CCK_RATE_5MB_MASK | \
  35. IEEE80211_CCK_RATE_11MB_MASK)
  36. #define IEEE80211_OFDM_RATES_MASK 0x00000FF0
  37. #define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
  38. IEEE80211_OFDM_RATE_12MB_MASK | \
  39. IEEE80211_OFDM_RATE_24MB_MASK)
  40. #define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
  41. IEEE80211_OFDM_RATE_9MB_MASK | \
  42. IEEE80211_OFDM_RATE_18MB_MASK | \
  43. IEEE80211_OFDM_RATE_36MB_MASK | \
  44. IEEE80211_OFDM_RATE_48MB_MASK | \
  45. IEEE80211_OFDM_RATE_54MB_MASK)
  46. #define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
  47. IEEE80211_CCK_DEFAULT_RATES_MASK)
  48. /* This really should be 8, but not for our firmware */
  49. #define MAX_SUPPORTED_RATES 32
  50. #define MAX_COUNTRY_TRIPLETS 32
  51. /* Headers */
  52. struct ieee80211_header {
  53. __le16 frame_ctl;
  54. __le16 duration_id;
  55. u8 da[ETH_ALEN];
  56. u8 sa[ETH_ALEN];
  57. u8 bssid[ETH_ALEN];
  58. __le16 seq_ctl;
  59. u8 payload[0];
  60. } __packed;
  61. struct wl12xx_ie_header {
  62. u8 id;
  63. u8 len;
  64. } __packed;
  65. /* IEs */
  66. struct wl12xx_ie_ssid {
  67. struct wl12xx_ie_header header;
  68. char ssid[IEEE80211_MAX_SSID_LEN];
  69. } __packed;
  70. struct wl12xx_ie_rates {
  71. struct wl12xx_ie_header header;
  72. u8 rates[MAX_SUPPORTED_RATES];
  73. } __packed;
  74. struct wl12xx_ie_ds_params {
  75. struct wl12xx_ie_header header;
  76. u8 channel;
  77. } __packed;
  78. struct country_triplet {
  79. u8 channel;
  80. u8 num_channels;
  81. u8 max_tx_power;
  82. } __packed;
  83. struct wl12xx_ie_country {
  84. struct wl12xx_ie_header header;
  85. u8 country_string[IEEE80211_COUNTRY_STRING_LEN];
  86. struct country_triplet triplets[MAX_COUNTRY_TRIPLETS];
  87. } __packed;
  88. /* Templates */
  89. struct wl12xx_beacon_template {
  90. struct ieee80211_header header;
  91. __le32 time_stamp[2];
  92. __le16 beacon_interval;
  93. __le16 capability;
  94. struct wl12xx_ie_ssid ssid;
  95. struct wl12xx_ie_rates rates;
  96. struct wl12xx_ie_rates ext_rates;
  97. struct wl12xx_ie_ds_params ds_params;
  98. struct wl12xx_ie_country country;
  99. } __packed;
  100. struct wl12xx_null_data_template {
  101. struct ieee80211_header header;
  102. } __packed;
  103. struct wl12xx_ps_poll_template {
  104. __le16 fc;
  105. __le16 aid;
  106. u8 bssid[ETH_ALEN];
  107. u8 ta[ETH_ALEN];
  108. } __packed;
  109. struct wl12xx_qos_null_data_template {
  110. struct ieee80211_header header;
  111. __le16 qos_ctl;
  112. } __packed;
  113. struct wl12xx_probe_req_template {
  114. struct ieee80211_header header;
  115. struct wl12xx_ie_ssid ssid;
  116. struct wl12xx_ie_rates rates;
  117. struct wl12xx_ie_rates ext_rates;
  118. } __packed;
  119. struct wl12xx_probe_resp_template {
  120. struct ieee80211_header header;
  121. __le32 time_stamp[2];
  122. __le16 beacon_interval;
  123. __le16 capability;
  124. struct wl12xx_ie_ssid ssid;
  125. struct wl12xx_ie_rates rates;
  126. struct wl12xx_ie_rates ext_rates;
  127. struct wl12xx_ie_ds_params ds_params;
  128. struct wl12xx_ie_country country;
  129. } __packed;
  130. #endif