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 { |
| 8 | u16 frame_control; |
| 9 | u16 duration; |
| 10 | u8 da[6]; |
| 11 | u8 sa[6]; |
| 12 | u8 bssid[6]; |
| 13 | u16 seq_ctrl; |
| 14 | union { |
| 15 | struct { |
| 16 | u16 auth_alg; |
| 17 | u16 auth_transaction; |
| 18 | u16 status_code; |
| 19 | /* possibly followed by Challenge text */ |
| 20 | u8 variable[0]; |
| 21 | } __attribute__ ((packed)) auth; |
| 22 | struct { |
| 23 | u16 reason_code; |
| 24 | } __attribute__ ((packed)) deauth; |
| 25 | struct { |
| 26 | u16 capab_info; |
| 27 | u16 listen_interval; |
| 28 | /* followed by SSID and Supported rates */ |
| 29 | u8 variable[0]; |
| 30 | } __attribute__ ((packed)) assoc_req; |
| 31 | struct { |
| 32 | u16 capab_info; |
| 33 | u16 status_code; |
| 34 | u16 aid; |
| 35 | /* followed by Supported rates */ |
| 36 | u8 variable[0]; |
| 37 | } __attribute__ ((packed)) assoc_resp, reassoc_resp; |
| 38 | struct { |
| 39 | u16 capab_info; |
| 40 | u16 listen_interval; |
| 41 | u8 current_ap[6]; |
| 42 | /* followed by SSID and Supported rates */ |
| 43 | u8 variable[0]; |
| 44 | } __attribute__ ((packed)) reassoc_req; |
| 45 | struct { |
| 46 | u16 reason_code; |
| 47 | } __attribute__ ((packed)) disassoc; |
| 48 | struct { |
| 49 | } __attribute__ ((packed)) probe_req; |
| 50 | struct { |
| 51 | u8 timestamp[8]; |
| 52 | u16 beacon_int; |
| 53 | u16 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 | } __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); |
| 95 | struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, |
Jouni Malinen | 62fe7e3 | 2005-07-30 20:43:20 -0700 | [diff] [blame] | 96 | struct ieee80211_crypt_data *crypt); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 97 | int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev); |
| 98 | |
| 99 | #endif /* HOSTAP_80211_H */ |