hostap_80211.h 2.5 KB

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