diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-02-20 09:37:03 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:51 -0500 |
commit | 80e775bf08f1915870fbb0c1c7a45a3fdc291721 (patch) | |
tree | 117d475755d5f4f0aba17f9efce8fa4fd51d0d10 | |
parent | 8821905cfb65504f64e6beb014133bd2a998f5dc (diff) |
mac80211: Add software scan notifiers
This adds optional notifier functions for software scan.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/net/mac80211.h | 8 | ||||
-rw-r--r-- | net/mac80211/scan.c | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index e01c63aad66c..12a52efcd0d1 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1324,6 +1324,12 @@ enum ieee80211_ampdu_mlme_action { | |||
1324 | * because the hardware is turned off! Anything else is a bug! | 1324 | * because the hardware is turned off! Anything else is a bug! |
1325 | * Returns a negative error code which will be seen in userspace. | 1325 | * Returns a negative error code which will be seen in userspace. |
1326 | * | 1326 | * |
1327 | * @sw_scan_start: Notifier function that is called just before a software scan | ||
1328 | * is started. Can be NULL, if the driver doesn't need this notification. | ||
1329 | * | ||
1330 | * @sw_scan_complete: Notifier function that is called just after a software scan | ||
1331 | * finished. Can be NULL, if the driver doesn't need this notification. | ||
1332 | * | ||
1327 | * @get_stats: Return low-level statistics. | 1333 | * @get_stats: Return low-level statistics. |
1328 | * Returns zero if statistics are available. | 1334 | * Returns zero if statistics are available. |
1329 | * | 1335 | * |
@@ -1403,6 +1409,8 @@ struct ieee80211_ops { | |||
1403 | u32 iv32, u16 *phase1key); | 1409 | u32 iv32, u16 *phase1key); |
1404 | int (*hw_scan)(struct ieee80211_hw *hw, | 1410 | int (*hw_scan)(struct ieee80211_hw *hw, |
1405 | struct cfg80211_scan_request *req); | 1411 | struct cfg80211_scan_request *req); |
1412 | void (*sw_scan_start)(struct ieee80211_hw *hw); | ||
1413 | void (*sw_scan_complete)(struct ieee80211_hw *hw); | ||
1406 | int (*get_stats)(struct ieee80211_hw *hw, | 1414 | int (*get_stats)(struct ieee80211_hw *hw, |
1407 | struct ieee80211_low_level_stats *stats); | 1415 | struct ieee80211_low_level_stats *stats); |
1408 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1416 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 23f4de274744..0e81e1633a66 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -245,6 +245,9 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) | |||
245 | netif_addr_unlock(local->mdev); | 245 | netif_addr_unlock(local->mdev); |
246 | netif_tx_unlock_bh(local->mdev); | 246 | netif_tx_unlock_bh(local->mdev); |
247 | 247 | ||
248 | if (local->ops->sw_scan_complete) | ||
249 | local->ops->sw_scan_complete(local_to_hw(local)); | ||
250 | |||
248 | mutex_lock(&local->iflist_mtx); | 251 | mutex_lock(&local->iflist_mtx); |
249 | list_for_each_entry(sdata, &local->interfaces, list) { | 252 | list_for_each_entry(sdata, &local->interfaces, list) { |
250 | if (!netif_running(sdata->dev)) | 253 | if (!netif_running(sdata->dev)) |
@@ -395,6 +398,8 @@ int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
395 | } | 398 | } |
396 | 399 | ||
397 | local->sw_scanning = true; | 400 | local->sw_scanning = true; |
401 | if (local->ops->sw_scan_start) | ||
402 | local->ops->sw_scan_start(local_to_hw(local)); | ||
398 | 403 | ||
399 | mutex_lock(&local->iflist_mtx); | 404 | mutex_lock(&local->iflist_mtx); |
400 | list_for_each_entry(sdata, &local->interfaces, list) { | 405 | list_for_each_entry(sdata, &local->interfaces, list) { |