hostap_80211.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef HOSTAP_80211_H
  2. #define HOSTAP_80211_H
  3. #include <linux/types.h>
  4. #include <linux/skbuff.h>
  5. struct hostap_ieee80211_mgmt {
  6. __le16 frame_control;
  7. __le16 duration;
  8. u8 da[6];
  9. u8 sa[6];
  10. u8 bssid[6];
  11. __le16 seq_ctrl;
  12. union {
  13. struct {
  14. __le16 auth_alg;
  15. __le16 auth_transaction;
  16. __le16 status_code;
  17. /* possibly followed by Challenge text */
  18. u8 variable[0];
  19. } __attribute__ ((packed)) auth;
  20. struct {
  21. __le16 reason_code;
  22. } __attribute__ ((packed)) deauth;
  23. struct {
  24. __le16 capab_info;
  25. __le16 listen_interval;
  26. /* followed by SSID and Supported rates */
  27. u8 variable[0];
  28. } __attribute__ ((packed)) assoc_req;
  29. struct {
  30. __le16 capab_info;
  31. __le16 status_code;
  32. __le16 aid;
  33. /* followed by Supported rates */
  34. u8 variable[0];
  35. } __attribute__ ((packed)) assoc_resp, reassoc_resp;
  36. struct {
  37. __le16 capab_info;
  38. __le16 listen_interval;
  39. u8 current_ap[6];
  40. /* followed by SSID and Supported rates */
  41. u8 variable[0];
  42. } __attribute__ ((packed)) reassoc_req;
  43. struct {
  44. __le16 reason_code;
  45. } __attribute__ ((packed)) disassoc;
  46. struct {
  47. } __attribute__ ((packed)) probe_req;
  48. struct {
  49. u8 timestamp[8];
  50. __le16 beacon_int;
  51. __le16 capab_info;
  52. /* followed by some of SSID, Supported rates,
  53. * FH Params, DS Params, CF Params, IBSS Params, TIM */
  54. u8 variable[0];
  55. } __attribute__ ((packed)) beacon, probe_resp;
  56. } u;
  57. } __attribute__ ((packed));
  58. #define IEEE80211_MGMT_HDR_LEN 24
  59. #define IEEE80211_DATA_HDR3_LEN 24
  60. #define IEEE80211_DATA_HDR4_LEN 30
  61. struct hostap_80211_rx_status {
  62. u32 mac_time;
  63. u8 signal;
  64. u8 noise;
  65. u16 rate; /* in 100 kbps */
  66. };
  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. int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev);
  82. #endif /* HOSTAP_80211_H */