aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/wireless/core.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'net/wireless/core.h')
-rw-r--r--net/wireless/core.h88
1 files changed, 72 insertions, 16 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 63d57ae399c3..a570ff9214ec 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -60,8 +60,12 @@ struct cfg80211_registered_device {
60 struct rb_root bss_tree; 60 struct rb_root bss_tree;
61 u32 bss_generation; 61 u32 bss_generation;
62 struct cfg80211_scan_request *scan_req; /* protected by RTNL */ 62 struct cfg80211_scan_request *scan_req; /* protected by RTNL */
63 struct cfg80211_sched_scan_request *sched_scan_req;
63 unsigned long suspend_at; 64 unsigned long suspend_at;
64 struct work_struct scan_done_wk; 65 struct work_struct scan_done_wk;
66 struct work_struct sched_scan_results_wk;
67
68 struct mutex sched_scan_mtx;
65 69
66#ifdef CONFIG_NL80211_TESTMODE 70#ifdef CONFIG_NL80211_TESTMODE
67 struct genl_info *testmode_info; 71 struct genl_info *testmode_info;
@@ -70,6 +74,8 @@ struct cfg80211_registered_device {
70 struct work_struct conn_work; 74 struct work_struct conn_work;
71 struct work_struct event_work; 75 struct work_struct event_work;
72 76
77 struct cfg80211_wowlan *wowlan;
78
73 /* must be last because of the way we do wiphy_priv(), 79 /* must be last because of the way we do wiphy_priv(),
74 * and it should at least be aligned to NETDEV_ALIGN */ 80 * and it should at least be aligned to NETDEV_ALIGN */
75 struct wiphy wiphy __attribute__((__aligned__(NETDEV_ALIGN))); 81 struct wiphy wiphy __attribute__((__aligned__(NETDEV_ALIGN)));
@@ -86,16 +92,31 @@ struct cfg80211_registered_device *wiphy_to_dev(struct wiphy *wiphy)
86static inline 92static inline
87bool wiphy_idx_valid(int wiphy_idx) 93bool wiphy_idx_valid(int wiphy_idx)
88{ 94{
89 return (wiphy_idx >= 0); 95 return wiphy_idx >= 0;
90} 96}
91 97
98static inline void
99cfg80211_rdev_free_wowlan(struct cfg80211_registered_device *rdev)
100{
101 int i;
102
103 if (!rdev->wowlan)
104 return;
105 for (i = 0; i < rdev->wowlan->n_patterns; i++)
106 kfree(rdev->wowlan->patterns[i].mask);
107 kfree(rdev->wowlan->patterns);
108 kfree(rdev->wowlan);
109}
92 110
93extern struct workqueue_struct *cfg80211_wq; 111extern struct workqueue_struct *cfg80211_wq;
94extern struct mutex cfg80211_mutex; 112extern struct mutex cfg80211_mutex;
95extern struct list_head cfg80211_rdev_list; 113extern struct list_head cfg80211_rdev_list;
96extern int cfg80211_rdev_list_generation; 114extern int cfg80211_rdev_list_generation;
97 115
98#define assert_cfg80211_lock() WARN_ON(!mutex_is_locked(&cfg80211_mutex)) 116static inline void assert_cfg80211_lock(void)
117{
118 lockdep_assert_held(&cfg80211_mutex);
119}
99 120
100/* 121/*
101 * You can use this to mark a wiphy_idx as not having an associated wiphy. 122 * You can use this to mark a wiphy_idx as not having an associated wiphy.
@@ -202,8 +223,8 @@ static inline void wdev_unlock(struct wireless_dev *wdev)
202 mutex_unlock(&wdev->mtx); 223 mutex_unlock(&wdev->mtx);
203} 224}
204 225
205#define ASSERT_RDEV_LOCK(rdev) WARN_ON(!mutex_is_locked(&(rdev)->mtx)); 226#define ASSERT_RDEV_LOCK(rdev) lockdep_assert_held(&(rdev)->mtx)
206#define ASSERT_WDEV_LOCK(wdev) WARN_ON(!mutex_is_locked(&(wdev)->mtx)); 227#define ASSERT_WDEV_LOCK(wdev) lockdep_assert_held(&(wdev)->mtx)
207 228
208enum cfg80211_event_type { 229enum cfg80211_event_type {
209 EVENT_CONNECT_RESULT, 230 EVENT_CONNECT_RESULT,
@@ -226,6 +247,7 @@ struct cfg80211_event {
226 u16 status; 247 u16 status;
227 } cr; 248 } cr;
228 struct { 249 struct {
250 struct ieee80211_channel *channel;
229 u8 bssid[ETH_ALEN]; 251 u8 bssid[ETH_ALEN];
230 const u8 *req_ie; 252 const u8 *req_ie;
231 const u8 *resp_ie; 253 const u8 *resp_ie;
@@ -282,6 +304,20 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid);
282int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev, 304int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
283 struct wireless_dev *wdev); 305 struct wireless_dev *wdev);
284 306
307/* mesh */
308extern const struct mesh_config default_mesh_config;
309extern const struct mesh_setup default_mesh_setup;
310int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
311 struct net_device *dev,
312 const struct mesh_setup *setup,
313 const struct mesh_config *conf);
314int cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
315 struct net_device *dev,
316 const struct mesh_setup *setup,
317 const struct mesh_config *conf);
318int cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
319 struct net_device *dev);
320
285/* MLME */ 321/* MLME */
286int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, 322int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
287 struct net_device *dev, 323 struct net_device *dev,
@@ -331,16 +367,17 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
331 const u8 *resp_ie, size_t resp_ie_len, 367 const u8 *resp_ie, size_t resp_ie_len,
332 u16 status, bool wextev, 368 u16 status, bool wextev,
333 struct cfg80211_bss *bss); 369 struct cfg80211_bss *bss);
334int cfg80211_mlme_register_action(struct wireless_dev *wdev, u32 snd_pid, 370int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
335 const u8 *match_data, int match_len); 371 u16 frame_type, const u8 *match_data,
336void cfg80211_mlme_unregister_actions(struct wireless_dev *wdev, u32 nlpid); 372 int match_len);
337void cfg80211_mlme_purge_actions(struct wireless_dev *wdev); 373void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid);
338int cfg80211_mlme_action(struct cfg80211_registered_device *rdev, 374void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);
339 struct net_device *dev, 375int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
340 struct ieee80211_channel *chan, 376 struct net_device *dev,
341 enum nl80211_channel_type channel_type, 377 struct ieee80211_channel *chan, bool offchan,
342 bool channel_type_valid, 378 enum nl80211_channel_type channel_type,
343 const u8 *buf, size_t len, u64 *cookie); 379 bool channel_type_valid, unsigned int wait,
380 const u8 *buf, size_t len, u64 *cookie);
344 381
345/* SME */ 382/* SME */
346int __cfg80211_connect(struct cfg80211_registered_device *rdev, 383int __cfg80211_connect(struct cfg80211_registered_device *rdev,
@@ -358,7 +395,9 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
358int cfg80211_disconnect(struct cfg80211_registered_device *rdev, 395int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
359 struct net_device *dev, u16 reason, 396 struct net_device *dev, u16 reason,
360 bool wextev); 397 bool wextev);
361void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid, 398void __cfg80211_roamed(struct wireless_dev *wdev,
399 struct ieee80211_channel *channel,
400 const u8 *bssid,
362 const u8 *req_ie, size_t req_ie_len, 401 const u8 *req_ie, size_t req_ie_len,
363 const u8 *resp_ie, size_t resp_ie_len); 402 const u8 *resp_ie, size_t resp_ie_len);
364int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev, 403int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
@@ -371,7 +410,7 @@ bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev);
371/* internal helpers */ 410/* internal helpers */
372int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, 411int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
373 struct key_params *params, int key_idx, 412 struct key_params *params, int key_idx,
374 const u8 *mac_addr); 413 bool pairwise, const u8 *mac_addr);
375void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, 414void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
376 size_t ie_len, u16 reason, bool from_ap); 415 size_t ie_len, u16 reason, bool from_ap);
377void cfg80211_sme_scan_done(struct net_device *dev); 416void cfg80211_sme_scan_done(struct net_device *dev);
@@ -379,12 +418,26 @@ void cfg80211_sme_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
379void cfg80211_sme_disassoc(struct net_device *dev, int idx); 418void cfg80211_sme_disassoc(struct net_device *dev, int idx);
380void __cfg80211_scan_done(struct work_struct *wk); 419void __cfg80211_scan_done(struct work_struct *wk);
381void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, bool leak); 420void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, bool leak);
421void __cfg80211_sched_scan_results(struct work_struct *wk);
422int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
423 bool driver_initiated);
382void cfg80211_upload_connect_keys(struct wireless_dev *wdev); 424void cfg80211_upload_connect_keys(struct wireless_dev *wdev);
383int cfg80211_change_iface(struct cfg80211_registered_device *rdev, 425int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
384 struct net_device *dev, enum nl80211_iftype ntype, 426 struct net_device *dev, enum nl80211_iftype ntype,
385 u32 *flags, struct vif_params *params); 427 u32 *flags, struct vif_params *params);
386void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev); 428void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev);
387 429
430int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
431 struct wireless_dev *wdev,
432 enum nl80211_iftype iftype);
433
434static inline int
435cfg80211_can_add_interface(struct cfg80211_registered_device *rdev,
436 enum nl80211_iftype iftype)
437{
438 return cfg80211_can_change_interface(rdev, NULL, iftype);
439}
440
388struct ieee80211_channel * 441struct ieee80211_channel *
389rdev_freq_to_chan(struct cfg80211_registered_device *rdev, 442rdev_freq_to_chan(struct cfg80211_registered_device *rdev,
390 int freq, enum nl80211_channel_type channel_type); 443 int freq, enum nl80211_channel_type channel_type);
@@ -394,6 +447,9 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
394 447
395u16 cfg80211_calculate_bitrate(struct rate_info *rate); 448u16 cfg80211_calculate_bitrate(struct rate_info *rate);
396 449
450int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
451 u32 beacon_int);
452
397#ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS 453#ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS
398#define CFG80211_DEV_WARN_ON(cond) WARN_ON(cond) 454#define CFG80211_DEV_WARN_ON(cond) WARN_ON(cond)
399#else 455#else