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