hostap_80211.h 2.4 KB

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