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