[PATCH] hostap: Replace crypto code with net/ieee80211 version
[powerpc.git] / drivers / net / wireless / hostap / hostap_80211.h
1 #ifndef HOSTAP_80211_H
2 #define HOSTAP_80211_H
3
4 struct hostap_ieee80211_hdr {
5         u16 frame_control;
6         u16 duration_id;
7         u8 addr1[6];
8         u8 addr2[6];
9         u8 addr3[6];
10         u16 seq_ctrl;
11         u8 addr4[6];
12 } __attribute__ ((packed));
13
14
15 struct hostap_ieee80211_mgmt {
16         u16 frame_control;
17         u16 duration;
18         u8 da[6];
19         u8 sa[6];
20         u8 bssid[6];
21         u16 seq_ctrl;
22         union {
23                 struct {
24                         u16 auth_alg;
25                         u16 auth_transaction;
26                         u16 status_code;
27                         /* possibly followed by Challenge text */
28                         u8 variable[0];
29                 } __attribute__ ((packed)) auth;
30                 struct {
31                         u16 reason_code;
32                 } __attribute__ ((packed)) deauth;
33                 struct {
34                         u16 capab_info;
35                         u16 listen_interval;
36                         /* followed by SSID and Supported rates */
37                         u8 variable[0];
38                 } __attribute__ ((packed)) assoc_req;
39                 struct {
40                         u16 capab_info;
41                         u16 status_code;
42                         u16 aid;
43                         /* followed by Supported rates */
44                         u8 variable[0];
45                 } __attribute__ ((packed)) assoc_resp, reassoc_resp;
46                 struct {
47                         u16 capab_info;
48                         u16 listen_interval;
49                         u8 current_ap[6];
50                         /* followed by SSID and Supported rates */
51                         u8 variable[0];
52                 } __attribute__ ((packed)) reassoc_req;
53                 struct {
54                         u16 reason_code;
55                 } __attribute__ ((packed)) disassoc;
56                 struct {
57                 } __attribute__ ((packed)) probe_req;
58                 struct {
59                         u8 timestamp[8];
60                         u16 beacon_int;
61                         u16 capab_info;
62                         /* followed by some of SSID, Supported rates,
63                          * FH Params, DS Params, CF Params, IBSS Params, TIM */
64                         u8 variable[0];
65                 } __attribute__ ((packed)) beacon, probe_resp;
66         } u;
67 } __attribute__ ((packed));
68
69
70 #define IEEE80211_MGMT_HDR_LEN 24
71 #define IEEE80211_DATA_HDR3_LEN 24
72 #define IEEE80211_DATA_HDR4_LEN 30
73
74
75 struct hostap_80211_rx_status {
76         u32 mac_time;
77         u8 signal;
78         u8 noise;
79         u16 rate; /* in 100 kbps */
80 };
81
82
83 void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
84                      struct hostap_80211_rx_status *rx_stats);
85
86
87 /* prism2_rx_80211 'type' argument */
88 enum {
89         PRISM2_RX_MONITOR, PRISM2_RX_MGMT, PRISM2_RX_NON_ASSOC,
90         PRISM2_RX_NULLFUNC_ACK
91 };
92
93 int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
94                     struct hostap_80211_rx_status *rx_stats, int type);
95 void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
96                      struct hostap_80211_rx_status *rx_stats);
97 void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
98                           struct hostap_80211_rx_status *rx_stats);
99
100 void hostap_dump_tx_80211(const char *name, struct sk_buff *skb);
101 int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev);
102 int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev);
103 struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
104                                    struct ieee80211_crypt_data *crypt);
105 int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev);
106
107 #endif /* HOSTAP_80211_H */