blob: 3694b1eba521cbca531bb56574abb643da79f9a8 [file] [log] [blame]
Jouni Malinenff1d2762005-05-12 22:54:16 -04001#ifndef HOSTAP_80211_H
2#define HOSTAP_80211_H
3
Adrian Bunk5fad5a22006-01-14 03:09:34 +01004#include <linux/types.h>
5#include <net/ieee80211_crypt.h>
6
Jouni Malinenff1d2762005-05-12 22:54:16 -04007struct hostap_ieee80211_mgmt {
Al Viro8a9faf32007-12-21 03:30:16 -05008 __le16 frame_control;
9 __le16 duration;
Jouni Malinenff1d2762005-05-12 22:54:16 -040010 u8 da[6];
11 u8 sa[6];
12 u8 bssid[6];
Al Viro8a9faf32007-12-21 03:30:16 -050013 __le16 seq_ctrl;
Jouni Malinenff1d2762005-05-12 22:54:16 -040014 union {
15 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050016 __le16 auth_alg;
17 __le16 auth_transaction;
18 __le16 status_code;
Jouni Malinenff1d2762005-05-12 22:54:16 -040019 /* possibly followed by Challenge text */
20 u8 variable[0];
21 } __attribute__ ((packed)) auth;
22 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050023 __le16 reason_code;
Jouni Malinenff1d2762005-05-12 22:54:16 -040024 } __attribute__ ((packed)) deauth;
25 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050026 __le16 capab_info;
27 __le16 listen_interval;
Jouni Malinenff1d2762005-05-12 22:54:16 -040028 /* followed by SSID and Supported rates */
29 u8 variable[0];
30 } __attribute__ ((packed)) assoc_req;
31 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050032 __le16 capab_info;
33 __le16 status_code;
34 __le16 aid;
Jouni Malinenff1d2762005-05-12 22:54:16 -040035 /* followed by Supported rates */
36 u8 variable[0];
37 } __attribute__ ((packed)) assoc_resp, reassoc_resp;
38 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050039 __le16 capab_info;
40 __le16 listen_interval;
Jouni Malinenff1d2762005-05-12 22:54:16 -040041 u8 current_ap[6];
42 /* followed by SSID and Supported rates */
43 u8 variable[0];
44 } __attribute__ ((packed)) reassoc_req;
45 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050046 __le16 reason_code;
Jouni Malinenff1d2762005-05-12 22:54:16 -040047 } __attribute__ ((packed)) disassoc;
48 struct {
49 } __attribute__ ((packed)) probe_req;
50 struct {
51 u8 timestamp[8];
Al Viro8a9faf32007-12-21 03:30:16 -050052 __le16 beacon_int;
53 __le16 capab_info;
Jouni Malinenff1d2762005-05-12 22:54:16 -040054 /* 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
67struct hostap_80211_rx_status {
68 u32 mac_time;
69 u8 signal;
70 u8 noise;
71 u16 rate; /* in 100 kbps */
72};
73
Jouni Malinenff1d2762005-05-12 22:54:16 -040074/* prism2_rx_80211 'type' argument */
75enum {
76 PRISM2_RX_MONITOR, PRISM2_RX_MGMT, PRISM2_RX_NON_ASSOC,
77 PRISM2_RX_NULLFUNC_ACK
78};
79
80int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
81 struct hostap_80211_rx_status *rx_stats, int type);
82void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
83 struct hostap_80211_rx_status *rx_stats);
84void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
85 struct hostap_80211_rx_status *rx_stats);
86
87void hostap_dump_tx_80211(const char *name, struct sk_buff *skb);
88int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev);
89int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev);
Jouni Malinenff1d2762005-05-12 22:54:16 -040090int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev);
91
92#endif /* HOSTAP_80211_H */