diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2010-04-27 05:59:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-27 16:09:23 -0400 |
commit | a060bbfe4ee95d115e8f9705a66894ac34e2c475 (patch) | |
tree | 6aea616cdd07c06886c0e1ffade68e5d58f9e9c2 | |
parent | 9043f3b89abebfbfe4b8d64c7b71b9ac0b9eaa0b (diff) |
mac80211: give virtual interface to hw_scan
When scanning, it is somewhat important to scan
on the correct virtual interface. All drivers
that currently implement hw_scan only support a
single virtual interface, but that may change
and then we'd want to be ready.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/at76c50x-usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_main.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 1 | ||||
-rw-r--r-- | include/net/mac80211.h | 2 | ||||
-rw-r--r-- | net/mac80211/driver-ops.h | 5 | ||||
-rw-r--r-- | net/mac80211/driver-trace.h | 9 | ||||
-rw-r--r-- | net/mac80211/scan.c | 4 |
10 files changed, 21 insertions, 10 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c index 0fb419936dff..7a626d4e100f 100644 --- a/drivers/net/wireless/at76c50x-usb.c +++ b/drivers/net/wireless/at76c50x-usb.c | |||
@@ -1889,6 +1889,7 @@ static void at76_dwork_hw_scan(struct work_struct *work) | |||
1889 | } | 1889 | } |
1890 | 1890 | ||
1891 | static int at76_hw_scan(struct ieee80211_hw *hw, | 1891 | static int at76_hw_scan(struct ieee80211_hw *hw, |
1892 | struct ieee80211_vif *vif, | ||
1892 | struct cfg80211_scan_request *req) | 1893 | struct cfg80211_scan_request *req) |
1893 | { | 1894 | { |
1894 | struct at76_priv *priv = hw->priv; | 1895 | struct at76_priv *priv = hw->priv; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index a0cc11ecbe93..727360944859 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -512,7 +512,9 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags) | |||
512 | void iwl_init_scan_params(struct iwl_priv *priv); | 512 | void iwl_init_scan_params(struct iwl_priv *priv); |
513 | int iwl_scan_cancel(struct iwl_priv *priv); | 513 | int iwl_scan_cancel(struct iwl_priv *priv); |
514 | int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms); | 514 | int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms); |
515 | int iwl_mac_hw_scan(struct ieee80211_hw *hw, struct cfg80211_scan_request *req); | 515 | int iwl_mac_hw_scan(struct ieee80211_hw *hw, |
516 | struct ieee80211_vif *vif, | ||
517 | struct cfg80211_scan_request *req); | ||
516 | void iwl_internal_short_hw_scan(struct iwl_priv *priv); | 518 | void iwl_internal_short_hw_scan(struct iwl_priv *priv); |
517 | int iwl_force_reset(struct iwl_priv *priv, int mode); | 519 | int iwl_force_reset(struct iwl_priv *priv, int mode); |
518 | u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame, | 520 | u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 1bc1d29f2a07..447c3018296d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -312,7 +312,8 @@ static int iwl_scan_initiate(struct iwl_priv *priv) | |||
312 | } | 312 | } |
313 | 313 | ||
314 | int iwl_mac_hw_scan(struct ieee80211_hw *hw, | 314 | int iwl_mac_hw_scan(struct ieee80211_hw *hw, |
315 | struct cfg80211_scan_request *req) | 315 | struct ieee80211_vif *vif, |
316 | struct cfg80211_scan_request *req) | ||
316 | { | 317 | { |
317 | struct iwl_priv *priv = hw->priv; | 318 | struct iwl_priv *priv = hw->priv; |
318 | int ret; | 319 | int ret; |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 79bb8833ddb9..d016933d7573 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -973,6 +973,7 @@ static void hw_scan_done(struct work_struct *work) | |||
973 | } | 973 | } |
974 | 974 | ||
975 | static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw, | 975 | static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw, |
976 | struct ieee80211_vif *vif, | ||
976 | struct cfg80211_scan_request *req) | 977 | struct cfg80211_scan_request *req) |
977 | { | 978 | { |
978 | struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL); | 979 | struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL); |
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c index 390cee7e61a1..4d3be80c220e 100644 --- a/drivers/net/wireless/wl12xx/wl1251_main.c +++ b/drivers/net/wireless/wl12xx/wl1251_main.c | |||
@@ -856,6 +856,7 @@ out: | |||
856 | } | 856 | } |
857 | 857 | ||
858 | static int wl1251_op_hw_scan(struct ieee80211_hw *hw, | 858 | static int wl1251_op_hw_scan(struct ieee80211_hw *hw, |
859 | struct ieee80211_vif *vif, | ||
859 | struct cfg80211_scan_request *req) | 860 | struct cfg80211_scan_request *req) |
860 | { | 861 | { |
861 | struct wl1251 *wl = hw->priv; | 862 | struct wl1251 *wl = hw->priv; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 283d5dade1ae..08ff6447dcd9 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -1523,6 +1523,7 @@ out: | |||
1523 | } | 1523 | } |
1524 | 1524 | ||
1525 | static int wl1271_op_hw_scan(struct ieee80211_hw *hw, | 1525 | static int wl1271_op_hw_scan(struct ieee80211_hw *hw, |
1526 | struct ieee80211_vif *vif, | ||
1526 | struct cfg80211_scan_request *req) | 1527 | struct cfg80211_scan_request *req) |
1527 | { | 1528 | { |
1528 | struct wl1271 *wl = hw->priv; | 1529 | struct wl1271 *wl = hw->priv; |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index c26de6cb12f8..a36e0df5a17c 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1657,7 +1657,7 @@ struct ieee80211_ops { | |||
1657 | struct ieee80211_key_conf *conf, | 1657 | struct ieee80211_key_conf *conf, |
1658 | struct ieee80211_sta *sta, | 1658 | struct ieee80211_sta *sta, |
1659 | u32 iv32, u16 *phase1key); | 1659 | u32 iv32, u16 *phase1key); |
1660 | int (*hw_scan)(struct ieee80211_hw *hw, | 1660 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1661 | struct cfg80211_scan_request *req); | 1661 | struct cfg80211_scan_request *req); |
1662 | void (*sw_scan_start)(struct ieee80211_hw *hw); | 1662 | void (*sw_scan_start)(struct ieee80211_hw *hw); |
1663 | void (*sw_scan_complete)(struct ieee80211_hw *hw); | 1663 | void (*sw_scan_complete)(struct ieee80211_hw *hw); |
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index d1f8a7c2225a..997008e236ff 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -154,14 +154,15 @@ static inline void drv_update_tkip_key(struct ieee80211_local *local, | |||
154 | } | 154 | } |
155 | 155 | ||
156 | static inline int drv_hw_scan(struct ieee80211_local *local, | 156 | static inline int drv_hw_scan(struct ieee80211_local *local, |
157 | struct ieee80211_sub_if_data *sdata, | ||
157 | struct cfg80211_scan_request *req) | 158 | struct cfg80211_scan_request *req) |
158 | { | 159 | { |
159 | int ret; | 160 | int ret; |
160 | 161 | ||
161 | might_sleep(); | 162 | might_sleep(); |
162 | 163 | ||
163 | ret = local->ops->hw_scan(&local->hw, req); | 164 | ret = local->ops->hw_scan(&local->hw, &sdata->vif, req); |
164 | trace_drv_hw_scan(local, req, ret); | 165 | trace_drv_hw_scan(local, sdata, req, ret); |
165 | return ret; | 166 | return ret; |
166 | } | 167 | } |
167 | 168 | ||
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h index e209cb82ff29..ce734b58d07a 100644 --- a/net/mac80211/driver-trace.h +++ b/net/mac80211/driver-trace.h | |||
@@ -363,23 +363,26 @@ TRACE_EVENT(drv_update_tkip_key, | |||
363 | 363 | ||
364 | TRACE_EVENT(drv_hw_scan, | 364 | TRACE_EVENT(drv_hw_scan, |
365 | TP_PROTO(struct ieee80211_local *local, | 365 | TP_PROTO(struct ieee80211_local *local, |
366 | struct ieee80211_sub_if_data *sdata, | ||
366 | struct cfg80211_scan_request *req, int ret), | 367 | struct cfg80211_scan_request *req, int ret), |
367 | 368 | ||
368 | TP_ARGS(local, req, ret), | 369 | TP_ARGS(local, sdata, req, ret), |
369 | 370 | ||
370 | TP_STRUCT__entry( | 371 | TP_STRUCT__entry( |
371 | LOCAL_ENTRY | 372 | LOCAL_ENTRY |
373 | VIF_ENTRY | ||
372 | __field(int, ret) | 374 | __field(int, ret) |
373 | ), | 375 | ), |
374 | 376 | ||
375 | TP_fast_assign( | 377 | TP_fast_assign( |
376 | LOCAL_ASSIGN; | 378 | LOCAL_ASSIGN; |
379 | VIF_ASSIGN; | ||
377 | __entry->ret = ret; | 380 | __entry->ret = ret; |
378 | ), | 381 | ), |
379 | 382 | ||
380 | TP_printk( | 383 | TP_printk( |
381 | LOCAL_PR_FMT " ret:%d", | 384 | LOCAL_PR_FMT VIF_PR_FMT " ret:%d", |
382 | LOCAL_PR_ARG, __entry->ret | 385 | LOCAL_PR_ARG,VIF_PR_ARG, __entry->ret |
383 | ) | 386 | ) |
384 | ); | 387 | ); |
385 | 388 | ||
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index eb86a5f6e645..2b1f1f3d6a58 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -410,7 +410,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, | |||
410 | 410 | ||
411 | if (local->ops->hw_scan) { | 411 | if (local->ops->hw_scan) { |
412 | WARN_ON(!ieee80211_prep_hw_scan(local)); | 412 | WARN_ON(!ieee80211_prep_hw_scan(local)); |
413 | rc = drv_hw_scan(local, local->hw_scan_req); | 413 | rc = drv_hw_scan(local, sdata, local->hw_scan_req); |
414 | } else | 414 | } else |
415 | rc = ieee80211_start_sw_scan(local); | 415 | rc = ieee80211_start_sw_scan(local); |
416 | 416 | ||
@@ -654,7 +654,7 @@ void ieee80211_scan_work(struct work_struct *work) | |||
654 | } | 654 | } |
655 | 655 | ||
656 | if (local->hw_scan_req) { | 656 | if (local->hw_scan_req) { |
657 | int rc = drv_hw_scan(local, local->hw_scan_req); | 657 | int rc = drv_hw_scan(local, sdata, local->hw_scan_req); |
658 | mutex_unlock(&local->scan_mtx); | 658 | mutex_unlock(&local->scan_mtx); |
659 | if (rc) | 659 | if (rc) |
660 | ieee80211_scan_completed(&local->hw, true); | 660 | ieee80211_scan_completed(&local->hw, true); |