hostap_80211.h 2.3 KB

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