1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef __LINUX_UNIFI_WEXT_H__
16#define __LINUX_UNIFI_WEXT_H__ 1
17
18#include <linux/kernel.h>
19#include <net/iw_handler.h>
20#include "csr_wifi_sme_prim.h"
21
22
23
24
25
26#define UNIFI_MAX_KEY_SIZE 16
27#define NUM_WEPKEYS 4
28#define SMALL_KEY_SIZE 5
29#define LARGE_KEY_SIZE 13
30typedef struct wep_key_t {
31 int len;
32 unsigned char key[UNIFI_MAX_KEY_SIZE];
33} wep_key_t;
34
35#define UNIFI_SCAN_ACTIVE 0
36#define UNIFI_SCAN_PASSIVE 1
37#define UNIFI_MAX_SSID_LEN 32
38
39#define MAX_WPA_IE_LEN 64
40#define MAX_RSN_IE_LEN 255
41
42
43
44
45struct iw_statistics *unifi_get_wireless_stats(struct net_device *dev);
46
47void uf_sme_wext_set_defaults(unifi_priv_t *priv);
48
49
50
51
52
53
54void wext_send_scan_results_event(unifi_priv_t *priv);
55void wext_send_assoc_event(unifi_priv_t *priv, unsigned char *bssid,
56 unsigned char *req_ie, int req_ie_len,
57 unsigned char *resp_ie, int resp_ie_len,
58 unsigned char *scan_ie, unsigned int scan_ie_len);
59void wext_send_disassoc_event(unifi_priv_t *priv);
60void wext_send_michaelmicfailure_event(unifi_priv_t *priv,
61 u16 count, CsrWifiMacAddress address,
62 CsrWifiSmeKeyType keyType, u16 interfaceTag);
63void wext_send_pmkid_candidate_event(unifi_priv_t *priv, CsrWifiMacAddress bssid, u8 preauth_allowed, u16 interfaceTag);
64void wext_send_started_event(unifi_priv_t *priv);
65
66
67static inline int
68uf_iwe_stream_add_point(struct iw_request_info *info, char *start, char *stop,
69 struct iw_event *piwe, char *extra)
70{
71 char *new_start;
72
73 new_start = iwe_stream_add_point(info, start, stop, piwe, extra);
74 if (unlikely(new_start == start))
75 return -E2BIG;
76
77 return (new_start - start);
78}
79
80
81static inline int
82uf_iwe_stream_add_event(struct iw_request_info *info, char *start, char *stop,
83 struct iw_event *piwe, int len)
84{
85 char *new_start;
86
87 new_start = iwe_stream_add_event(info, start, stop, piwe, len);
88 if (unlikely(new_start == start))
89 return -E2BIG;
90
91 return (new_start - start);
92}
93
94static inline int
95uf_iwe_stream_add_value(struct iw_request_info *info, char *stream, char *start,
96 char *stop, struct iw_event *piwe, int len)
97{
98 char *new_start;
99
100 new_start = iwe_stream_add_value(info, stream, start, stop, piwe, len);
101 if (unlikely(new_start == start))
102 return -E2BIG;
103
104 return (new_start - start);
105}
106
107
108#endif
109