]> Pileus Git - ~andy/linux/blob - drivers/staging/csr/unifi_wext.h
Merge branch 'fixes' into for-linus
[~andy/linux] / drivers / staging / csr / unifi_wext.h
1 /*
2  *****************************************************************************
3  *
4  * FILE : unifi_wext.h
5  *
6  * PURPOSE : Private header file for unifi driver support to wireless extensions.
7  *
8  * Copyright (C) 2005-2008 by Cambridge Silicon Radio Ltd.
9  *
10  * Refer to LICENSE.txt included with this source code for details on
11  * the license terms.
12  *
13 *****************************************************************************
14  */
15 #ifndef __LINUX_UNIFI_WEXT_H__
16 #define __LINUX_UNIFI_WEXT_H__ 1
17
18 #include <linux/kernel.h>
19 #include <linux/version.h>
20 #include <net/iw_handler.h>
21 #include "csr_wifi_sme_prim.h"
22
23 /*
24  *      wext.c
25  */
26 /* A few details needed for WEP (Wireless Equivalent Privacy) */
27 #define UNIFI_MAX_KEY_SIZE      16
28 #define NUM_WEPKEYS              4
29 #define SMALL_KEY_SIZE           5
30 #define LARGE_KEY_SIZE          13
31 typedef struct wep_key_t {
32     int len;
33     unsigned char key[UNIFI_MAX_KEY_SIZE];  /* 40-bit and 104-bit keys */
34 } wep_key_t;
35
36 #define UNIFI_SCAN_ACTIVE       0
37 #define UNIFI_SCAN_PASSIVE      1
38 #define UNIFI_MAX_SSID_LEN      32
39
40 #define MAX_WPA_IE_LEN 64
41 #define MAX_RSN_IE_LEN 255
42
43 /*
44  * Function to register in the netdev to report wireless stats.
45  */
46 struct iw_statistics *unifi_get_wireless_stats(struct net_device *dev);
47
48 void uf_sme_wext_set_defaults(unifi_priv_t *priv);
49
50
51 /*
52  *      wext_events.c
53  */
54 /* Functions to generate Wireless Extension events */
55 void wext_send_scan_results_event(unifi_priv_t *priv);
56 void wext_send_assoc_event(unifi_priv_t *priv, unsigned char *bssid,
57                            unsigned char *req_ie, int req_ie_len,
58                            unsigned char *resp_ie, int resp_ie_len,
59                            unsigned char *scan_ie, unsigned int scan_ie_len);
60 void wext_send_disassoc_event(unifi_priv_t *priv);
61 void wext_send_michaelmicfailure_event(unifi_priv_t *priv,
62                                        u16 count, CsrWifiMacAddress address,
63                                        CsrWifiSmeKeyType keyType, u16 interfaceTag);
64 void wext_send_pmkid_candidate_event(unifi_priv_t *priv, CsrWifiMacAddress bssid, u8 preauth_allowed, u16 interfaceTag);
65 void wext_send_started_event(unifi_priv_t *priv);
66
67
68 static inline int
69 uf_iwe_stream_add_point(struct iw_request_info *info, char *start, char *stop,
70                         struct iw_event *piwe, char *extra)
71 {
72     char *new_start;
73
74     new_start = iwe_stream_add_point(info, start, stop, piwe, extra);
75     if (unlikely(new_start == start))
76         return -E2BIG;
77
78     return (new_start - start);
79 }
80
81
82 static inline int
83 uf_iwe_stream_add_event(struct iw_request_info *info, char *start, char *stop,
84                         struct iw_event *piwe, int len)
85 {
86     char *new_start;
87
88     new_start = iwe_stream_add_event(info, start, stop, piwe, len);
89     if (unlikely(new_start == start))
90         return -E2BIG;
91
92     return (new_start - start);
93 }
94
95 static inline int
96 uf_iwe_stream_add_value(struct iw_request_info *info, char *stream, char *start,
97                         char *stop, struct iw_event *piwe, int len)
98 {
99     char *new_start;
100
101     new_start = iwe_stream_add_value(info, stream, start, stop, piwe, len);
102     if (unlikely(new_start == start))
103         return -E2BIG;
104
105     return (new_start - start);
106 }
107
108
109 #endif /* __LINUX_UNIFI_WEXT_H__ */