aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/core.h')
-rw-r--r--net/wireless/core.h100
1 files changed, 99 insertions, 1 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 92da612b3f9e..5ccd642e183b 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -57,12 +57,14 @@ struct cfg80211_registered_device {
57 u32 bss_generation; 57 u32 bss_generation;
58 struct cfg80211_scan_request *scan_req; /* protected by RTNL */ 58 struct cfg80211_scan_request *scan_req; /* protected by RTNL */
59 unsigned long suspend_at; 59 unsigned long suspend_at;
60 struct work_struct scan_done_wk;
60 61
61#ifdef CONFIG_NL80211_TESTMODE 62#ifdef CONFIG_NL80211_TESTMODE
62 struct genl_info *testmode_info; 63 struct genl_info *testmode_info;
63#endif 64#endif
64 65
65 struct work_struct conn_work; 66 struct work_struct conn_work;
67 struct work_struct event_work;
66 68
67#ifdef CONFIG_CFG80211_DEBUGFS 69#ifdef CONFIG_CFG80211_DEBUGFS
68 /* Debugfs entries */ 70 /* Debugfs entries */
@@ -170,12 +172,73 @@ struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx);
170extern struct cfg80211_registered_device * 172extern struct cfg80211_registered_device *
171cfg80211_get_dev_from_ifindex(int ifindex); 173cfg80211_get_dev_from_ifindex(int ifindex);
172 174
175static inline void cfg80211_lock_rdev(struct cfg80211_registered_device *drv)
176{
177 mutex_lock(&drv->mtx);
178}
179
173static inline void cfg80211_unlock_rdev(struct cfg80211_registered_device *drv) 180static inline void cfg80211_unlock_rdev(struct cfg80211_registered_device *drv)
174{ 181{
175 BUG_ON(IS_ERR(drv) || !drv); 182 BUG_ON(IS_ERR(drv) || !drv);
176 mutex_unlock(&drv->mtx); 183 mutex_unlock(&drv->mtx);
177} 184}
178 185
186static inline void wdev_lock(struct wireless_dev *wdev)
187 __acquires(wdev)
188{
189 mutex_lock(&wdev->mtx);
190 __acquire(wdev->mtx);
191}
192
193static inline void wdev_unlock(struct wireless_dev *wdev)
194 __releases(wdev)
195{
196 __release(wdev->mtx);
197 mutex_unlock(&wdev->mtx);
198}
199
200#define ASSERT_RDEV_LOCK(rdev) WARN_ON(!mutex_is_locked(&(rdev)->mtx));
201#define ASSERT_WDEV_LOCK(wdev) WARN_ON(!mutex_is_locked(&(wdev)->mtx));
202
203enum cfg80211_event_type {
204 EVENT_CONNECT_RESULT,
205 EVENT_ROAMED,
206 EVENT_DISCONNECTED,
207 EVENT_IBSS_JOINED,
208};
209
210struct cfg80211_event {
211 struct list_head list;
212 enum cfg80211_event_type type;
213
214 union {
215 struct {
216 u8 bssid[ETH_ALEN];
217 const u8 *req_ie;
218 const u8 *resp_ie;
219 size_t req_ie_len;
220 size_t resp_ie_len;
221 u16 status;
222 } cr;
223 struct {
224 u8 bssid[ETH_ALEN];
225 const u8 *req_ie;
226 const u8 *resp_ie;
227 size_t req_ie_len;
228 size_t resp_ie_len;
229 } rm;
230 struct {
231 const u8 *ie;
232 size_t ie_len;
233 u16 reason;
234 } dc;
235 struct {
236 u8 bssid[ETH_ALEN];
237 } ij;
238 };
239};
240
241
179/* free object */ 242/* free object */
180extern void cfg80211_dev_free(struct cfg80211_registered_device *drv); 243extern void cfg80211_dev_free(struct cfg80211_registered_device *drv);
181 244
@@ -191,25 +254,46 @@ void cfg80211_bss_age(struct cfg80211_registered_device *dev,
191 unsigned long age_secs); 254 unsigned long age_secs);
192 255
193/* IBSS */ 256/* IBSS */
257int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
258 struct net_device *dev,
259 struct cfg80211_ibss_params *params);
194int cfg80211_join_ibss(struct cfg80211_registered_device *rdev, 260int cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
195 struct net_device *dev, 261 struct net_device *dev,
196 struct cfg80211_ibss_params *params); 262 struct cfg80211_ibss_params *params);
197void cfg80211_clear_ibss(struct net_device *dev, bool nowext); 263void cfg80211_clear_ibss(struct net_device *dev, bool nowext);
198int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev, 264int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
199 struct net_device *dev, bool nowext); 265 struct net_device *dev, bool nowext);
266void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid);
200 267
201/* MLME */ 268/* MLME */
269int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
270 struct net_device *dev,
271 struct ieee80211_channel *chan,
272 enum nl80211_auth_type auth_type,
273 const u8 *bssid,
274 const u8 *ssid, int ssid_len,
275 const u8 *ie, int ie_len);
202int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, 276int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
203 struct net_device *dev, struct ieee80211_channel *chan, 277 struct net_device *dev, struct ieee80211_channel *chan,
204 enum nl80211_auth_type auth_type, const u8 *bssid, 278 enum nl80211_auth_type auth_type, const u8 *bssid,
205 const u8 *ssid, int ssid_len, 279 const u8 *ssid, int ssid_len,
206 const u8 *ie, int ie_len); 280 const u8 *ie, int ie_len);
281int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
282 struct net_device *dev,
283 struct ieee80211_channel *chan,
284 const u8 *bssid, const u8 *prev_bssid,
285 const u8 *ssid, int ssid_len,
286 const u8 *ie, int ie_len, bool use_mfp,
287 struct cfg80211_crypto_settings *crypt);
207int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev, 288int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
208 struct net_device *dev, struct ieee80211_channel *chan, 289 struct net_device *dev, struct ieee80211_channel *chan,
209 const u8 *bssid, const u8 *prev_bssid, 290 const u8 *bssid, const u8 *prev_bssid,
210 const u8 *ssid, int ssid_len, 291 const u8 *ssid, int ssid_len,
211 const u8 *ie, int ie_len, bool use_mfp, 292 const u8 *ie, int ie_len, bool use_mfp,
212 struct cfg80211_crypto_settings *crypt); 293 struct cfg80211_crypto_settings *crypt);
294int __cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
295 struct net_device *dev, const u8 *bssid,
296 const u8 *ie, int ie_len, u16 reason);
213int cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev, 297int cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
214 struct net_device *dev, const u8 *bssid, 298 struct net_device *dev, const u8 *bssid,
215 const u8 *ie, int ie_len, u16 reason); 299 const u8 *ie, int ie_len, u16 reason);
@@ -218,24 +302,38 @@ int cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev,
218 const u8 *ie, int ie_len, u16 reason); 302 const u8 *ie, int ie_len, u16 reason);
219void cfg80211_mlme_down(struct cfg80211_registered_device *rdev, 303void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
220 struct net_device *dev); 304 struct net_device *dev);
305void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
306 const u8 *req_ie, size_t req_ie_len,
307 const u8 *resp_ie, size_t resp_ie_len,
308 u16 status, bool wextev);
221 309
222/* SME */ 310/* SME */
311int __cfg80211_connect(struct cfg80211_registered_device *rdev,
312 struct net_device *dev,
313 struct cfg80211_connect_params *connect);
223int cfg80211_connect(struct cfg80211_registered_device *rdev, 314int cfg80211_connect(struct cfg80211_registered_device *rdev,
224 struct net_device *dev, 315 struct net_device *dev,
225 struct cfg80211_connect_params *connect); 316 struct cfg80211_connect_params *connect);
317int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
318 struct net_device *dev, u16 reason,
319 bool wextev);
226int cfg80211_disconnect(struct cfg80211_registered_device *rdev, 320int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
227 struct net_device *dev, u16 reason, 321 struct net_device *dev, u16 reason,
228 bool wextev); 322 bool wextev);
323void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid,
324 const u8 *req_ie, size_t req_ie_len,
325 const u8 *resp_ie, size_t resp_ie_len);
229 326
230void cfg80211_conn_work(struct work_struct *work); 327void cfg80211_conn_work(struct work_struct *work);
231 328
232/* internal helpers */ 329/* internal helpers */
233int cfg80211_validate_key_settings(struct key_params *params, int key_idx, 330int cfg80211_validate_key_settings(struct key_params *params, int key_idx,
234 const u8 *mac_addr); 331 const u8 *mac_addr);
235void __cfg80211_disconnected(struct net_device *dev, gfp_t gfp, u8 *ie, 332void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
236 size_t ie_len, u16 reason, bool from_ap); 333 size_t ie_len, u16 reason, bool from_ap);
237void cfg80211_sme_scan_done(struct net_device *dev); 334void cfg80211_sme_scan_done(struct net_device *dev);
238void cfg80211_sme_rx_auth(struct net_device *dev, const u8 *buf, size_t len); 335void cfg80211_sme_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
239void cfg80211_sme_disassoc(struct net_device *dev, int idx); 336void cfg80211_sme_disassoc(struct net_device *dev, int idx);
337void __cfg80211_scan_done(struct work_struct *wk);
240 338
241#endif /* __NET_WIRELESS_CORE_H */ 339#endif /* __NET_WIRELESS_CORE_H */