diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-23 12:52:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:37 -0400 |
commit | 2448798133d747ad339e57099e32a1d1e68aca1c (patch) | |
tree | ee09385f5dca9e243c38f5f888baa02605423bd7 /net/mac80211/scan.c | |
parent | 2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (diff) |
mac80211: add driver ops wrappers
In order to later add tracing or verifications to the driver
calls mac80211 makes, this patch adds static inline wrappers
for all operations.
All calls are now written as
drv_<op>(local, ...);
instead of
local->ops-><op>(&local->hw, ...);
Where necessary, the wrappers also do existence checking and
return default values as appropriate.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 04e270abdd22..127bd54e0e38 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <net/iw_handler.h> | 21 | #include <net/iw_handler.h> |
22 | 22 | ||
23 | #include "ieee80211_i.h" | 23 | #include "ieee80211_i.h" |
24 | #include "driver-ops.h" | ||
24 | #include "mesh.h" | 25 | #include "mesh.h" |
25 | 26 | ||
26 | #define IEEE80211_PROBE_DELAY (HZ / 33) | 27 | #define IEEE80211_PROBE_DELAY (HZ / 33) |
@@ -316,17 +317,15 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) | |||
316 | netif_tx_lock_bh(local->mdev); | 317 | netif_tx_lock_bh(local->mdev); |
317 | netif_addr_lock(local->mdev); | 318 | netif_addr_lock(local->mdev); |
318 | local->filter_flags &= ~FIF_BCN_PRBRESP_PROMISC; | 319 | local->filter_flags &= ~FIF_BCN_PRBRESP_PROMISC; |
319 | local->ops->configure_filter(local_to_hw(local), | 320 | drv_configure_filter(local, FIF_BCN_PRBRESP_PROMISC, |
320 | FIF_BCN_PRBRESP_PROMISC, | 321 | &local->filter_flags, |
321 | &local->filter_flags, | 322 | local->mdev->mc_count, |
322 | local->mdev->mc_count, | 323 | local->mdev->mc_list); |
323 | local->mdev->mc_list); | ||
324 | 324 | ||
325 | netif_addr_unlock(local->mdev); | 325 | netif_addr_unlock(local->mdev); |
326 | netif_tx_unlock_bh(local->mdev); | 326 | netif_tx_unlock_bh(local->mdev); |
327 | 327 | ||
328 | if (local->ops->sw_scan_complete) | 328 | drv_sw_scan_complete(local); |
329 | local->ops->sw_scan_complete(local_to_hw(local)); | ||
330 | 329 | ||
331 | mutex_lock(&local->iflist_mtx); | 330 | mutex_lock(&local->iflist_mtx); |
332 | list_for_each_entry(sdata, &local->interfaces, list) { | 331 | list_for_each_entry(sdata, &local->interfaces, list) { |
@@ -375,8 +374,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local) | |||
375 | * nullfunc frames and probe requests will be dropped in | 374 | * nullfunc frames and probe requests will be dropped in |
376 | * ieee80211_tx_h_check_assoc(). | 375 | * ieee80211_tx_h_check_assoc(). |
377 | */ | 376 | */ |
378 | if (local->ops->sw_scan_start) | 377 | drv_sw_scan_start(local); |
379 | local->ops->sw_scan_start(local_to_hw(local)); | ||
380 | 378 | ||
381 | mutex_lock(&local->iflist_mtx); | 379 | mutex_lock(&local->iflist_mtx); |
382 | list_for_each_entry(sdata, &local->interfaces, list) { | 380 | list_for_each_entry(sdata, &local->interfaces, list) { |
@@ -405,11 +403,10 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local) | |||
405 | 403 | ||
406 | netif_addr_lock_bh(local->mdev); | 404 | netif_addr_lock_bh(local->mdev); |
407 | local->filter_flags |= FIF_BCN_PRBRESP_PROMISC; | 405 | local->filter_flags |= FIF_BCN_PRBRESP_PROMISC; |
408 | local->ops->configure_filter(local_to_hw(local), | 406 | drv_configure_filter(local, FIF_BCN_PRBRESP_PROMISC, |
409 | FIF_BCN_PRBRESP_PROMISC, | 407 | &local->filter_flags, |
410 | &local->filter_flags, | 408 | local->mdev->mc_count, |
411 | local->mdev->mc_count, | 409 | local->mdev->mc_list); |
412 | local->mdev->mc_list); | ||
413 | netif_addr_unlock_bh(local->mdev); | 410 | netif_addr_unlock_bh(local->mdev); |
414 | 411 | ||
415 | /* TODO: start scan as soon as all nullfunc frames are ACKed */ | 412 | /* TODO: start scan as soon as all nullfunc frames are ACKed */ |
@@ -477,8 +474,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, | |||
477 | mutex_unlock(&local->scan_mtx); | 474 | mutex_unlock(&local->scan_mtx); |
478 | 475 | ||
479 | if (local->ops->hw_scan) | 476 | if (local->ops->hw_scan) |
480 | rc = local->ops->hw_scan(local_to_hw(local), | 477 | rc = drv_hw_scan(local, local->scan_req); |
481 | local->scan_req); | ||
482 | else | 478 | else |
483 | rc = ieee80211_start_sw_scan(local); | 479 | rc = ieee80211_start_sw_scan(local); |
484 | 480 | ||