wl12xx_80211.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 MAX_COUNTRY_TRIPLETS 32
  52. /* Headers */
  53. struct ieee80211_header {
  54. __le16 frame_ctl;
  55. __le16 duration_id;
  56. u8 da[ETH_ALEN];
  57. u8 sa[ETH_ALEN];
  58. u8 bssid[ETH_ALEN];
  59. __le16 seq_ctl;
  60. u8 payload[0];
  61. } __packed;
  62. struct wl12xx_ie_header {
  63. u8 id;
  64. u8 len;
  65. } __packed;
  66. /* IEs */
  67. struct wl12xx_ie_ssid {
  68. struct wl12xx_ie_header header;
  69. char ssid[IEEE80211_MAX_SSID_LEN];
  70. } __packed;
  71. struct wl12xx_ie_rates {
  72. struct wl12xx_ie_header header;
  73. u8 rates[MAX_SUPPORTED_RATES];
  74. } __packed;
  75. struct wl12xx_ie_ds_params {
  76. struct wl12xx_ie_header header;
  77. u8 channel;
  78. } __packed;
  79. struct country_triplet {
  80. u8 channel;
  81. u8 num_channels;
  82. u8 max_tx_power;
  83. } __packed;
  84. struct wl12xx_ie_country {
  85. struct wl12xx_ie_header header;
  86. u8 country_string[IEEE80211_COUNTRY_STRING_LEN];
  87. struct country_triplet triplets[MAX_COUNTRY_TRIPLETS];
  88. } __packed;
  89. /* Templates */
  90. struct wl12xx_null_data_template {
  91. struct ieee80211_header header;
  92. } __packed;
  93. struct wl12xx_ps_poll_template {
  94. __le16 fc;
  95. __le16 aid;
  96. u8 bssid[ETH_ALEN];
  97. u8 ta[ETH_ALEN];
  98. } __packed;
  99. struct wl12xx_arp_rsp_template {
  100. /* not including ieee80211 header */
  101. u8 llc_hdr[sizeof(rfc1042_header)];
  102. __be16 llc_type;
  103. struct arphdr arp_hdr;
  104. u8 sender_hw[ETH_ALEN];
  105. __be32 sender_ip;
  106. u8 target_hw[ETH_ALEN];
  107. __be32 target_ip;
  108. } __packed;
  109. struct wl12xx_disconn_template {
  110. struct ieee80211_header header;
  111. __le16 disconn_reason;
  112. } __packed;
  113. #endif