diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-13 11:42:30 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:35 -0500 |
commit | 8a61af65c6d03781015315dbc43d0942a5b31db9 (patch) | |
tree | 624695ba646281508490cb1737fb69d8174fa87a /net/mac80211/driver-ops.h | |
parent | 529ba6e9313dbe60dab7e72c6fdf647a012e9f5b (diff) |
mac80211: fix channel context iteration
During suspend/resume channel contexts might be
iterated even if they haven't been re-added to
the driver, keep track of this and skip them in
iteration. Also use the new status for sanity
checks.
Also clarify the fact that during HW restart all
contexts are iterated over (thanks Eliad.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r-- | net/mac80211/driver-ops.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 698dc7e6f309..608ced41548d 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -913,6 +913,8 @@ static inline int drv_add_chanctx(struct ieee80211_local *local, | |||
913 | if (local->ops->add_chanctx) | 913 | if (local->ops->add_chanctx) |
914 | ret = local->ops->add_chanctx(&local->hw, &ctx->conf); | 914 | ret = local->ops->add_chanctx(&local->hw, &ctx->conf); |
915 | trace_drv_return_int(local, ret); | 915 | trace_drv_return_int(local, ret); |
916 | if (!ret) | ||
917 | ctx->driver_present = true; | ||
916 | 918 | ||
917 | return ret; | 919 | return ret; |
918 | } | 920 | } |
@@ -924,6 +926,7 @@ static inline void drv_remove_chanctx(struct ieee80211_local *local, | |||
924 | if (local->ops->remove_chanctx) | 926 | if (local->ops->remove_chanctx) |
925 | local->ops->remove_chanctx(&local->hw, &ctx->conf); | 927 | local->ops->remove_chanctx(&local->hw, &ctx->conf); |
926 | trace_drv_return_void(local); | 928 | trace_drv_return_void(local); |
929 | ctx->driver_present = false; | ||
927 | } | 930 | } |
928 | 931 | ||
929 | static inline void drv_change_chanctx(struct ieee80211_local *local, | 932 | static inline void drv_change_chanctx(struct ieee80211_local *local, |
@@ -931,8 +934,10 @@ static inline void drv_change_chanctx(struct ieee80211_local *local, | |||
931 | u32 changed) | 934 | u32 changed) |
932 | { | 935 | { |
933 | trace_drv_change_chanctx(local, ctx, changed); | 936 | trace_drv_change_chanctx(local, ctx, changed); |
934 | if (local->ops->change_chanctx) | 937 | if (local->ops->change_chanctx) { |
938 | WARN_ON_ONCE(!ctx->driver_present); | ||
935 | local->ops->change_chanctx(&local->hw, &ctx->conf, changed); | 939 | local->ops->change_chanctx(&local->hw, &ctx->conf, changed); |
940 | } | ||
936 | trace_drv_return_void(local); | 941 | trace_drv_return_void(local); |
937 | } | 942 | } |
938 | 943 | ||
@@ -945,10 +950,12 @@ static inline int drv_assign_vif_chanctx(struct ieee80211_local *local, | |||
945 | check_sdata_in_driver(sdata); | 950 | check_sdata_in_driver(sdata); |
946 | 951 | ||
947 | trace_drv_assign_vif_chanctx(local, sdata, ctx); | 952 | trace_drv_assign_vif_chanctx(local, sdata, ctx); |
948 | if (local->ops->assign_vif_chanctx) | 953 | if (local->ops->assign_vif_chanctx) { |
954 | WARN_ON_ONCE(!ctx->driver_present); | ||
949 | ret = local->ops->assign_vif_chanctx(&local->hw, | 955 | ret = local->ops->assign_vif_chanctx(&local->hw, |
950 | &sdata->vif, | 956 | &sdata->vif, |
951 | &ctx->conf); | 957 | &ctx->conf); |
958 | } | ||
952 | trace_drv_return_int(local, ret); | 959 | trace_drv_return_int(local, ret); |
953 | 960 | ||
954 | return ret; | 961 | return ret; |
@@ -961,10 +968,12 @@ static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local, | |||
961 | check_sdata_in_driver(sdata); | 968 | check_sdata_in_driver(sdata); |
962 | 969 | ||
963 | trace_drv_unassign_vif_chanctx(local, sdata, ctx); | 970 | trace_drv_unassign_vif_chanctx(local, sdata, ctx); |
964 | if (local->ops->unassign_vif_chanctx) | 971 | if (local->ops->unassign_vif_chanctx) { |
972 | WARN_ON_ONCE(!ctx->driver_present); | ||
965 | local->ops->unassign_vif_chanctx(&local->hw, | 973 | local->ops->unassign_vif_chanctx(&local->hw, |
966 | &sdata->vif, | 974 | &sdata->vif, |
967 | &ctx->conf); | 975 | &ctx->conf); |
976 | } | ||
968 | trace_drv_return_void(local); | 977 | trace_drv_return_void(local); |
969 | } | 978 | } |
970 | 979 | ||