diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-11-06 14:23:30 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-11-09 11:34:35 -0500 |
commit | 8b2c98243e8d00f9c6b6059976d6de51491ee0c7 (patch) | |
tree | ff4d3dacbbe67d7886ac00b8738a532bb9bb8c76 /include/net/mac80211.h | |
parent | 9214ad7f9a0bfbfb2c204305e7391ce8b7fe4d29 (diff) |
mac80211: clarify interface iteration and make it configurable
During hardware restart, all interfaces are iterated even
though they haven't been re-added to the driver, document
this behaviour. The same also happens during resume, which
is even more confusing since all of the interfaces were
previously removed from the driver. Make this optional so
drivers relying on the current behaviour can still use it,
but to let drivers that don't want this behaviour disable
it.
Also convert all API users, keeping the old semantics
except in hwsim, where the new normal ones are desired.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index e1d830992319..a789dd1d4c10 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -3413,6 +3413,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw); | |||
3413 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | 3413 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); |
3414 | 3414 | ||
3415 | /** | 3415 | /** |
3416 | * enum ieee80211_interface_iteration_flags - interface iteration flags | ||
3417 | * @IEEE80211_IFACE_ITER_NORMAL: Iterate over all interfaces that have | ||
3418 | * been added to the driver; However, note that during hardware | ||
3419 | * reconfiguration (after restart_hw) it will iterate over a new | ||
3420 | * interface and over all the existing interfaces even if they | ||
3421 | * haven't been re-added to the driver yet. | ||
3422 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all | ||
3423 | * interfaces, even if they haven't been re-added to the driver yet. | ||
3424 | */ | ||
3425 | enum ieee80211_interface_iteration_flags { | ||
3426 | IEEE80211_IFACE_ITER_NORMAL = 0, | ||
3427 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), | ||
3428 | }; | ||
3429 | |||
3430 | /** | ||
3416 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 3431 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
3417 | * | 3432 | * |
3418 | * This function iterates over the interfaces associated with a given | 3433 | * This function iterates over the interfaces associated with a given |
@@ -3420,13 +3435,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
3420 | * This function allows the iterator function to sleep, when the iterator | 3435 | * This function allows the iterator function to sleep, when the iterator |
3421 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 3436 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
3422 | * be used. | 3437 | * be used. |
3423 | * Does not iterate over a new interface during add_interface() | 3438 | * Does not iterate over a new interface during add_interface(). |
3424 | * | 3439 | * |
3425 | * @hw: the hardware struct of which the interfaces should be iterated over | 3440 | * @hw: the hardware struct of which the interfaces should be iterated over |
3441 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3426 | * @iterator: the iterator function to call | 3442 | * @iterator: the iterator function to call |
3427 | * @data: first argument of the iterator function | 3443 | * @data: first argument of the iterator function |
3428 | */ | 3444 | */ |
3429 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 3445 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, |
3446 | u32 iter_flags, | ||
3430 | void (*iterator)(void *data, u8 *mac, | 3447 | void (*iterator)(void *data, u8 *mac, |
3431 | struct ieee80211_vif *vif), | 3448 | struct ieee80211_vif *vif), |
3432 | void *data); | 3449 | void *data); |
@@ -3438,13 +3455,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
3438 | * hardware that are currently active and calls the callback for them. | 3455 | * hardware that are currently active and calls the callback for them. |
3439 | * This function requires the iterator callback function to be atomic, | 3456 | * This function requires the iterator callback function to be atomic, |
3440 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 3457 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
3441 | * Does not iterate over a new interface during add_interface() | 3458 | * Does not iterate over a new interface during add_interface(). |
3442 | * | 3459 | * |
3443 | * @hw: the hardware struct of which the interfaces should be iterated over | 3460 | * @hw: the hardware struct of which the interfaces should be iterated over |
3461 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3444 | * @iterator: the iterator function to call, cannot sleep | 3462 | * @iterator: the iterator function to call, cannot sleep |
3445 | * @data: first argument of the iterator function | 3463 | * @data: first argument of the iterator function |
3446 | */ | 3464 | */ |
3447 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, | 3465 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, |
3466 | u32 iter_flags, | ||
3448 | void (*iterator)(void *data, | 3467 | void (*iterator)(void *data, |
3449 | u8 *mac, | 3468 | u8 *mac, |
3450 | struct ieee80211_vif *vif), | 3469 | struct ieee80211_vif *vif), |