hostap_80211.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef HOSTAP_80211_H
  2. #define HOSTAP_80211_H
  3. struct hostap_ieee80211_hdr {
  4. u16 frame_control;
  5. u16 duration_id;
  6. u8 addr1[6];
  7. u8 addr2[6];
  8. u8 addr3[6];
  9. u16 seq_ctrl;
  10. u8 addr4[6];
  11. } __attribute__ ((packed));
  12. struct hostap_ieee80211_mgmt {
  13. u16 frame_control;
  14. u16 duration;
  15. u8 da[6];
  16. u8 sa[6];
  17. u8 bssid[6];
  18. u16 seq_ctrl;
  19. union {
  20. struct {
  21. u16 auth_alg;
  22. u16 auth_transaction;
  23. u16 status_code;
  24. /* possibly followed by Challenge text */
  25. u8 variable[0];
  26. } __attribute__ ((packed)) auth;
  27. struct {
  28. u16 reason_code;
  29. } __attribute__ ((packed)) deauth;
  30. struct {
  31. u16 capab_info;
  32. u16 listen_interval;
  33. /* followed by SSID and Supported rates */
  34. u8 variable[0];
  35. } __attribute__ ((packed)) assoc_req;
  36. struct {
  37. u16 capab_info;
  38. u16 status_code;
  39. u16 aid;
  40. /* followed by Supported rates */
  41. u8 variable[0];
  42. } __attribute__ ((packed)) assoc_resp, reassoc_resp;
  43. struct {
  44. u16 capab_info;
  45. u16 listen_interval;
  46. u8 current_ap[6];
  47. /* followed by SSID and Supported rates */
  48. u8 variable[0];
  49. } __attribute__ ((packed)) reassoc_req;
  50. struct {
  51. u16 reason_code;
  52. } __attribute__ ((packed)) disassoc;
  53. struct {
  54. } __attribute__ ((packed)) probe_req;
  55. struct {
  56. u8 timestamp[8];
  57. u16 beacon_int;
  58. u16 capab_info;
  59. /* followed by some of SSID, Supported rates,
  60. * FH Params, DS Params, CF Params, IBSS Params, TIM */
  61. u8 variable[0];
  62. } __attribute__ ((packed)) beacon, probe_resp;
  63. } u;
  64. } __attribute__ ((packed));
  65. #define IEEE80211_MGMT_HDR_LEN 24
  66. #define IEEE80211_DATA_HDR3_LEN 24
  67. #define IEEE80211_DATA_HDR4_LEN 30
  68. struct hostap_80211_rx_status {
  69. u32 mac_time;
  70. u8 signal;
  71. u8 noise;
  72. u16 rate; /* in 100 kbps */
  73. };
  74. void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
  75. struct hostap_80211_rx_status *rx_stats);
  76. /* prism2_rx_80211 'type' argument */
  77. enum {
  78. PRISM2_RX_MONITOR, PRISM2_RX_MGMT, PRISM2_RX_NON_ASSOC,
  79. PRISM2_RX_NULLFUNC_ACK
  80. };
  81. int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
  82. struct hostap_80211_rx_status *rx_stats, int type);
  83. void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
  84. struct hostap_80211_rx_status *rx_stats);
  85. void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
  86. struct hostap_80211_rx_status *rx_stats);
  87. void hostap_dump_tx_80211(const char *name, struct sk_buff *skb);
  88. int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev);
  89. int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev);
  90. struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
  91. struct prism2_crypt_data *crypt);
  92. int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev);
  93. #endif /* HOSTAP_80211_H */