aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcmdhd/wl_cfgp2p.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/net/wireless/bcmdhd/wl_cfgp2p.h
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'drivers/net/wireless/bcmdhd/wl_cfgp2p.h')
-rw-r--r--drivers/net/wireless/bcmdhd/wl_cfgp2p.h247
1 files changed, 247 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/wl_cfgp2p.h b/drivers/net/wireless/bcmdhd/wl_cfgp2p.h
new file mode 100644
index 00000000000..5a69168c6a3
--- /dev/null
+++ b/drivers/net/wireless/bcmdhd/wl_cfgp2p.h
@@ -0,0 +1,247 @@
1/*
2 * Linux cfgp2p driver
3 *
4 * Copyright (C) 1999-2011, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: wl_cfgp2p.h,v 1.1.4.1.2.8 2011/02/09 01:37:52 Exp $
25 */
26#ifndef _wl_cfgp2p_h_
27#define _wl_cfgp2p_h_
28#include <proto/802.11.h>
29#include <proto/p2p.h>
30
31struct wl_priv;
32extern u32 wl_dbg_level;
33
34/* Enumeration of the usages of the BSSCFGs used by the P2P Library. Do not
35 * confuse this with a bsscfg index. This value is an index into the
36 * saved_ie[] array of structures which in turn contains a bsscfg index field.
37 */
38typedef enum {
39 P2PAPI_BSSCFG_PRIMARY, /* maps to driver's primary bsscfg */
40 P2PAPI_BSSCFG_DEVICE, /* maps to driver's P2P device discovery bsscfg */
41 P2PAPI_BSSCFG_CONNECTION, /* maps to driver's P2P connection bsscfg */
42 P2PAPI_BSSCFG_MAX
43} p2p_bsscfg_type_t;
44
45#define IE_MAX_LEN 300
46/* Structure to hold all saved P2P and WPS IEs for a BSSCFG */
47struct p2p_saved_ie {
48 u8 p2p_probe_req_ie[IE_MAX_LEN];
49 u8 p2p_probe_res_ie[IE_MAX_LEN];
50 u8 p2p_assoc_req_ie[IE_MAX_LEN];
51 u8 p2p_assoc_res_ie[IE_MAX_LEN];
52 u8 p2p_beacon_ie[IE_MAX_LEN];
53 u32 p2p_probe_req_ie_len;
54 u32 p2p_probe_res_ie_len;
55 u32 p2p_assoc_req_ie_len;
56 u32 p2p_assoc_res_ie_len;
57 u32 p2p_beacon_ie_len;
58};
59
60struct p2p_bss {
61 u32 bssidx;
62 struct net_device *dev;
63 struct p2p_saved_ie saved_ie;
64 void *private_data;
65};
66
67struct p2p_info {
68 bool on; /* p2p on/off switch */
69 bool scan;
70 bool vif_created;
71 s8 vir_ifname[IFNAMSIZ];
72 unsigned long status;
73 struct ether_addr dev_addr;
74 struct ether_addr int_addr;
75 struct p2p_bss bss_idx[P2PAPI_BSSCFG_MAX];
76 struct timer_list listen_timer;
77 wl_p2p_sched_t noa;
78 wl_p2p_ops_t ops;
79 wlc_ssid_t ssid;
80 spinlock_t timer_lock;
81};
82
83/* dongle status */
84enum wl_cfgp2p_status {
85 WLP2P_STATUS_DISCOVERY_ON = 0,
86 WLP2P_STATUS_SEARCH_ENABLED,
87 WLP2P_STATUS_IF_ADD,
88 WLP2P_STATUS_IF_DEL,
89 WLP2P_STATUS_IF_DELETING,
90 WLP2P_STATUS_IF_CHANGING,
91 WLP2P_STATUS_IF_CHANGED,
92 WLP2P_STATUS_LISTEN_EXPIRED,
93 WLP2P_STATUS_ACTION_TX_COMPLETED,
94 WLP2P_STATUS_ACTION_TX_NOACK,
95 WLP2P_STATUS_SCANNING
96};
97
98
99#define wl_to_p2p_bss_ndev(w, type) ((wl)->p2p->bss_idx[type].dev)
100#define wl_to_p2p_bss_bssidx(w, type) ((wl)->p2p->bss_idx[type].bssidx)
101#define wl_to_p2p_bss_saved_ie(w, type) ((wl)->p2p->bss_idx[type].saved_ie)
102#define wl_to_p2p_bss_private(w, type) ((wl)->p2p->bss_idx[type].private_data)
103#define wl_to_p2p_bss(wl, type) ((wl)->p2p->bss_idx[type])
104#define wl_get_p2p_status(wl, stat) ((!(wl)->p2p_supported) ? 0 : test_bit(WLP2P_STATUS_ ## stat, \
105 &(wl)->p2p->status))
106#define wl_set_p2p_status(wl, stat) ((!(wl)->p2p_supported) ? : set_bit(WLP2P_STATUS_ ## stat, \
107 &(wl)->p2p->status))
108#define wl_clr_p2p_status(wl, stat) ((!(wl)->p2p_supported) ? : clear_bit(WLP2P_STATUS_ ## stat, \
109 &(wl)->p2p->status))
110#define wl_chg_p2p_status(wl, stat) ((!(wl)->p2p_supported) ? : change_bit(WLP2P_STATUS_ ## stat, \
111 &(wl)->p2p->status))
112#define p2p_on(wl) ((wl)->p2p->on)
113#define p2p_scan(wl) ((wl)->p2p->scan)
114#define p2p_is_on(wl) ((wl)->p2p && (wl)->p2p->on)
115
116/* dword align allocation */
117#define WLC_IOCTL_MAXLEN 8192
118#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
119#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
120
121#define CFGP2P_ERR(args) \
122 do { \
123 if (wl_dbg_level & WL_DBG_ERR) { \
124 printk(KERN_ERR "CFGP2P-ERROR) %s : ", __func__); \
125 printk args; \
126 } \
127 } while (0)
128#define CFGP2P_INFO(args) \
129 do { \
130 if (wl_dbg_level & WL_DBG_INFO) { \
131 printk(KERN_ERR "CFGP2P-INFO) %s : ", __func__); \
132 printk args; \
133 } \
134 } while (0)
135#define CFGP2P_DBG(args) \
136 do { \
137 if (wl_dbg_level & WL_DBG_DBG) { \
138 printk(KERN_ERR "CFGP2P-DEBUG) %s :", __func__); \
139 printk args; \
140 } \
141 } while (0)
142
143
144extern s32
145wl_cfgp2p_init_priv(struct wl_priv *wl);
146extern void
147wl_cfgp2p_deinit_priv(struct wl_priv *wl);
148extern s32
149wl_cfgp2p_set_firm_p2p(struct wl_priv *wl);
150extern s32
151wl_cfgp2p_set_p2p_mode(struct wl_priv *wl, u8 mode,
152 u32 channel, u16 listen_ms, int bssidx);
153extern s32
154wl_cfgp2p_ifadd(struct wl_priv *wl, struct ether_addr *mac, u8 if_type,
155 chanspec_t chspec);
156extern s32
157wl_cfgp2p_ifdel(struct wl_priv *wl, struct ether_addr *mac);
158extern s32
159wl_cfgp2p_ifchange(struct wl_priv *wl, struct ether_addr *mac, u8 if_type, chanspec_t chspec);
160
161extern s32
162wl_cfgp2p_ifidx(struct wl_priv *wl, struct ether_addr *mac, s32 *index);
163
164extern s32
165wl_cfgp2p_init_discovery(struct wl_priv *wl);
166extern s32
167wl_cfgp2p_enable_discovery(struct wl_priv *wl, struct net_device *dev, const u8 *ie, u32 ie_len);
168extern s32
169wl_cfgp2p_disable_discovery(struct wl_priv *wl);
170extern s32
171wl_cfgp2p_escan(struct wl_priv *wl, struct net_device *dev, u16 active, u32 num_chans,
172 u16 *channels,
173 s32 search_state, u16 action, u32 bssidx);
174
175extern wpa_ie_fixed_t *
176wl_cfgp2p_find_wpaie(u8 *parse, u32 len);
177
178extern wpa_ie_fixed_t *
179wl_cfgp2p_find_wpsie(u8 *parse, u32 len);
180
181extern wifi_p2p_ie_t *
182wl_cfgp2p_find_p2pie(u8 *parse, u32 len);
183
184extern s32
185wl_cfgp2p_set_management_ie(struct wl_priv *wl, struct net_device *ndev, s32 bssidx,
186 s32 pktflag, const u8 *vndr_ie, u32 vndr_ie_len);
187extern s32
188wl_cfgp2p_clear_management_ie(struct wl_priv *wl, s32 bssidx);
189
190extern s32
191wl_cfgp2p_find_idx(struct wl_priv *wl, struct net_device *ndev);
192
193
194extern s32
195wl_cfgp2p_listen_complete(struct wl_priv *wl, struct net_device *ndev,
196 const wl_event_msg_t *e, void *data);
197extern s32
198wl_cfgp2p_discover_listen(struct wl_priv *wl, s32 channel, u32 duration_ms);
199
200extern s32
201wl_cfgp2p_discover_enable_search(struct wl_priv *wl, u8 enable);
202
203extern s32
204wl_cfgp2p_action_tx_complete(struct wl_priv *wl, struct net_device *ndev,
205 const wl_event_msg_t *e, void *data);
206extern s32
207wl_cfgp2p_tx_action_frame(struct wl_priv *wl, struct net_device *dev,
208 wl_af_params_t *af_params, s32 bssidx);
209
210extern void
211wl_cfgp2p_generate_bss_mac(struct ether_addr *primary_addr, struct ether_addr *out_dev_addr,
212 struct ether_addr *out_int_addr);
213
214extern void
215wl_cfg80211_change_ifaddr(u8* buf, struct ether_addr *p2p_int_addr, u8 element_id);
216extern bool
217wl_cfgp2p_bss_isup(struct net_device *ndev, int bsscfg_idx);
218
219extern s32
220wl_cfgp2p_bss(struct net_device *ndev, s32 bsscfg_idx, s32 up);
221
222
223extern s32
224wl_cfgp2p_supported(struct wl_priv *wl, struct net_device *ndev);
225
226extern s32
227wl_cfgp2p_down(struct wl_priv *wl);
228
229extern s32
230wl_cfgp2p_set_p2p_noa(struct wl_priv *wl, struct net_device *ndev, char* buf, int len);
231
232extern s32
233wl_cfgp2p_get_p2p_noa(struct wl_priv *wl, struct net_device *ndev, char* buf, int len);
234
235extern s32
236wl_cfgp2p_set_p2p_ps(struct wl_priv *wl, struct net_device *ndev, char* buf, int len);
237
238/* WiFi Direct */
239#define SOCIAL_CHAN_1 1
240#define SOCIAL_CHAN_2 6
241#define SOCIAL_CHAN_3 11
242#define WL_P2P_WILDCARD_SSID "DIRECT-"
243#define WL_P2P_WILDCARD_SSID_LEN 7
244#define WL_P2P_INTERFACE_PREFIX "p2p"
245#define WL_P2P_TEMP_CHAN "11"
246#define IS_P2P_SSID(ssid) (memcmp(ssid, WL_P2P_WILDCARD_SSID, WL_P2P_WILDCARD_SSID_LEN) == 0)
247#endif /* _wl_cfgp2p_h_ */