wl12xx_80211.h 4.2 KB

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