blob: ed98ce7c8f6508e47a22cc9ed4cbc583fc7b7d7f [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>
Dan Williams1ea893f2009-02-11 17:17:10 -05005#include <linux/skbuff.h>
Stephen Hemmingerd0cf9c02009-08-31 19:50:57 +00006#include <linux/netdevice.h>
Adrian Bunk5fad5a22006-01-14 03:09:34 +01007
Jouni Malinenff1d2762005-05-12 22:54:16 -04008struct hostap_ieee80211_mgmt {
Al Viro8a9faf32007-12-21 03:30:16 -05009 __le16 frame_control;
10 __le16 duration;
Jouni Malinenff1d2762005-05-12 22:54:16 -040011 u8 da[6];
12 u8 sa[6];
13 u8 bssid[6];
Al Viro8a9faf32007-12-21 03:30:16 -050014 __le16 seq_ctrl;
Jouni Malinenff1d2762005-05-12 22:54:16 -040015 union {
16 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050017 __le16 auth_alg;
18 __le16 auth_transaction;
19 __le16 status_code;
Jouni Malinenff1d2762005-05-12 22:54:16 -040020 /* possibly followed by Challenge text */
21 u8 variable[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +000022 } __packed auth;
Jouni Malinenff1d2762005-05-12 22:54:16 -040023 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050024 __le16 reason_code;
Eric Dumazetba2d3582010-06-02 18:10:09 +000025 } __packed deauth;
Jouni Malinenff1d2762005-05-12 22:54:16 -040026 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050027 __le16 capab_info;
28 __le16 listen_interval;
Jouni Malinenff1d2762005-05-12 22:54:16 -040029 /* followed by SSID and Supported rates */
30 u8 variable[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +000031 } __packed assoc_req;
Jouni Malinenff1d2762005-05-12 22:54:16 -040032 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050033 __le16 capab_info;
34 __le16 status_code;
35 __le16 aid;
Jouni Malinenff1d2762005-05-12 22:54:16 -040036 /* followed by Supported rates */
37 u8 variable[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +000038 } __packed assoc_resp, reassoc_resp;
Jouni Malinenff1d2762005-05-12 22:54:16 -040039 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050040 __le16 capab_info;
41 __le16 listen_interval;
Jouni Malinenff1d2762005-05-12 22:54:16 -040042 u8 current_ap[6];
43 /* followed by SSID and Supported rates */
44 u8 variable[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +000045 } __packed reassoc_req;
Jouni Malinenff1d2762005-05-12 22:54:16 -040046 struct {
Al Viro8a9faf32007-12-21 03:30:16 -050047 __le16 reason_code;
Eric Dumazetba2d3582010-06-02 18:10:09 +000048 } __packed disassoc;
Jouni Malinenff1d2762005-05-12 22:54:16 -040049 struct {
Eric Dumazetba2d3582010-06-02 18:10:09 +000050 } __packed probe_req;
Jouni Malinenff1d2762005-05-12 22:54:16 -040051 struct {
52 u8 timestamp[8];
Al Viro8a9faf32007-12-21 03:30:16 -050053 __le16 beacon_int;
54 __le16 capab_info;
Jouni Malinenff1d2762005-05-12 22:54:16 -040055 /* followed by some of SSID, Supported rates,
56 * FH Params, DS Params, CF Params, IBSS Params, TIM */
57 u8 variable[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +000058 } __packed beacon, probe_resp;
Jouni Malinenff1d2762005-05-12 22:54:16 -040059 } u;
Eric Dumazetba2d3582010-06-02 18:10:09 +000060} __packed;
Jouni Malinenff1d2762005-05-12 22:54:16 -040061
62
63#define IEEE80211_MGMT_HDR_LEN 24
64#define IEEE80211_DATA_HDR3_LEN 24
65#define IEEE80211_DATA_HDR4_LEN 30
66
67
68struct hostap_80211_rx_status {
69 u32 mac_time;
70 u8 signal;
71 u8 noise;
72 u16 rate; /* in 100 kbps */
73};
74
Jouni Malinenff1d2762005-05-12 22:54:16 -040075/* prism2_rx_80211 'type' argument */
76enum {
77 PRISM2_RX_MONITOR, PRISM2_RX_MGMT, PRISM2_RX_NON_ASSOC,
78 PRISM2_RX_NULLFUNC_ACK
79};
80
81int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
82 struct hostap_80211_rx_status *rx_stats, int type);
83void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
84 struct hostap_80211_rx_status *rx_stats);
85void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
86 struct hostap_80211_rx_status *rx_stats);
87
88void hostap_dump_tx_80211(const char *name, struct sk_buff *skb);
Stephen Hemmingerd0cf9c02009-08-31 19:50:57 +000089netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb,
90 struct net_device *dev);
91netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb,
92 struct net_device *dev);
93netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
94 struct net_device *dev);
Jouni Malinenff1d2762005-05-12 22:54:16 -040095
96#endif /* HOSTAP_80211_H */