2 *****************************************************************************
6 * PURPOSE : Private header file for unifi driver support to wireless extensions.
8 * Copyright (C) 2005-2008 by Cambridge Silicon Radio Ltd.
10 * Refer to LICENSE.txt included with this source code for details on
13 *****************************************************************************
15 #ifndef __LINUX_UNIFI_WEXT_H__
16 #define __LINUX_UNIFI_WEXT_H__ 1
18 #include <linux/kernel.h>
19 #include <net/iw_handler.h>
20 #include "csr_wifi_sme_prim.h"
25 /* A few details needed for WEP (Wireless Equivalent Privacy) */
26 #define UNIFI_MAX_KEY_SIZE 16
28 #define SMALL_KEY_SIZE 5
29 #define LARGE_KEY_SIZE 13
30 typedef struct wep_key_t {
32 unsigned char key[UNIFI_MAX_KEY_SIZE]; /* 40-bit and 104-bit keys */
35 #define UNIFI_SCAN_ACTIVE 0
36 #define UNIFI_SCAN_PASSIVE 1
37 #define UNIFI_MAX_SSID_LEN 32
39 #define MAX_WPA_IE_LEN 64
40 #define MAX_RSN_IE_LEN 255
43 * Function to register in the netdev to report wireless stats.
45 struct iw_statistics *unifi_get_wireless_stats(struct net_device *dev);
47 void uf_sme_wext_set_defaults(unifi_priv_t *priv);
53 /* Functions to generate Wireless Extension events */
54 void wext_send_scan_results_event(unifi_priv_t *priv);
55 void 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);
59 void wext_send_disassoc_event(unifi_priv_t *priv);
60 void wext_send_michaelmicfailure_event(unifi_priv_t *priv,
61 u16 count, CsrWifiMacAddress address,
62 CsrWifiSmeKeyType keyType, u16 interfaceTag);
63 void wext_send_pmkid_candidate_event(unifi_priv_t *priv, CsrWifiMacAddress bssid, u8 preauth_allowed, u16 interfaceTag);
64 void wext_send_started_event(unifi_priv_t *priv);
68 uf_iwe_stream_add_point(struct iw_request_info *info, char *start, char *stop,
69 struct iw_event *piwe, char *extra)
73 new_start = iwe_stream_add_point(
74 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) || defined (IW_REQUEST_FLAG_COMPAT)
77 start, stop, piwe, extra);
78 if (unlikely(new_start == start))
83 return (new_start - start);
88 uf_iwe_stream_add_event(struct iw_request_info *info, char *start, char *stop,
89 struct iw_event *piwe, int len)
93 new_start = iwe_stream_add_event(
94 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) || defined(IW_REQUEST_FLAG_COMPAT)
97 start, stop, piwe, len);
98 if (unlikely(new_start == start)) {
102 return (new_start - start);
106 uf_iwe_stream_add_value(struct iw_request_info *info, char *stream, char *start,
107 char *stop, struct iw_event *piwe, int len)
111 new_start = iwe_stream_add_value(
112 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) || defined(IW_REQUEST_FLAG_COMPAT)
115 stream, start, stop, piwe, len);
116 if (unlikely(new_start == start)) {
120 return (new_start - start);
124 #endif /* __LINUX_UNIFI_WEXT_H__ */