diff options
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r-- | net/mac80211/driver-ops.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 698dc7e6f309..0c07f94c5378 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -207,6 +207,14 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local, | |||
207 | { | 207 | { |
208 | might_sleep(); | 208 | might_sleep(); |
209 | 209 | ||
210 | WARN_ON_ONCE(changed & (BSS_CHANGED_BEACON | | ||
211 | BSS_CHANGED_BEACON_ENABLED) && | ||
212 | sdata->vif.type != NL80211_IFTYPE_AP && | ||
213 | sdata->vif.type != NL80211_IFTYPE_ADHOC && | ||
214 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT); | ||
215 | WARN_ON_ONCE(sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE && | ||
216 | changed & ~BSS_CHANGED_IDLE); | ||
217 | |||
210 | check_sdata_in_driver(sdata); | 218 | check_sdata_in_driver(sdata); |
211 | 219 | ||
212 | trace_drv_bss_info_changed(local, sdata, info, changed); | 220 | trace_drv_bss_info_changed(local, sdata, info, changed); |
@@ -913,6 +921,8 @@ static inline int drv_add_chanctx(struct ieee80211_local *local, | |||
913 | if (local->ops->add_chanctx) | 921 | if (local->ops->add_chanctx) |
914 | ret = local->ops->add_chanctx(&local->hw, &ctx->conf); | 922 | ret = local->ops->add_chanctx(&local->hw, &ctx->conf); |
915 | trace_drv_return_int(local, ret); | 923 | trace_drv_return_int(local, ret); |
924 | if (!ret) | ||
925 | ctx->driver_present = true; | ||
916 | 926 | ||
917 | return ret; | 927 | return ret; |
918 | } | 928 | } |
@@ -924,6 +934,7 @@ static inline void drv_remove_chanctx(struct ieee80211_local *local, | |||
924 | if (local->ops->remove_chanctx) | 934 | if (local->ops->remove_chanctx) |
925 | local->ops->remove_chanctx(&local->hw, &ctx->conf); | 935 | local->ops->remove_chanctx(&local->hw, &ctx->conf); |
926 | trace_drv_return_void(local); | 936 | trace_drv_return_void(local); |
937 | ctx->driver_present = false; | ||
927 | } | 938 | } |
928 | 939 | ||
929 | static inline void drv_change_chanctx(struct ieee80211_local *local, | 940 | static inline void drv_change_chanctx(struct ieee80211_local *local, |
@@ -931,8 +942,10 @@ static inline void drv_change_chanctx(struct ieee80211_local *local, | |||
931 | u32 changed) | 942 | u32 changed) |
932 | { | 943 | { |
933 | trace_drv_change_chanctx(local, ctx, changed); | 944 | trace_drv_change_chanctx(local, ctx, changed); |
934 | if (local->ops->change_chanctx) | 945 | if (local->ops->change_chanctx) { |
946 | WARN_ON_ONCE(!ctx->driver_present); | ||
935 | local->ops->change_chanctx(&local->hw, &ctx->conf, changed); | 947 | local->ops->change_chanctx(&local->hw, &ctx->conf, changed); |
948 | } | ||
936 | trace_drv_return_void(local); | 949 | trace_drv_return_void(local); |
937 | } | 950 | } |
938 | 951 | ||
@@ -945,10 +958,12 @@ static inline int drv_assign_vif_chanctx(struct ieee80211_local *local, | |||
945 | check_sdata_in_driver(sdata); | 958 | check_sdata_in_driver(sdata); |
946 | 959 | ||
947 | trace_drv_assign_vif_chanctx(local, sdata, ctx); | 960 | trace_drv_assign_vif_chanctx(local, sdata, ctx); |
948 | if (local->ops->assign_vif_chanctx) | 961 | if (local->ops->assign_vif_chanctx) { |
962 | WARN_ON_ONCE(!ctx->driver_present); | ||
949 | ret = local->ops->assign_vif_chanctx(&local->hw, | 963 | ret = local->ops->assign_vif_chanctx(&local->hw, |
950 | &sdata->vif, | 964 | &sdata->vif, |
951 | &ctx->conf); | 965 | &ctx->conf); |
966 | } | ||
952 | trace_drv_return_int(local, ret); | 967 | trace_drv_return_int(local, ret); |
953 | 968 | ||
954 | return ret; | 969 | return ret; |
@@ -961,10 +976,12 @@ static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local, | |||
961 | check_sdata_in_driver(sdata); | 976 | check_sdata_in_driver(sdata); |
962 | 977 | ||
963 | trace_drv_unassign_vif_chanctx(local, sdata, ctx); | 978 | trace_drv_unassign_vif_chanctx(local, sdata, ctx); |
964 | if (local->ops->unassign_vif_chanctx) | 979 | if (local->ops->unassign_vif_chanctx) { |
980 | WARN_ON_ONCE(!ctx->driver_present); | ||
965 | local->ops->unassign_vif_chanctx(&local->hw, | 981 | local->ops->unassign_vif_chanctx(&local->hw, |
966 | &sdata->vif, | 982 | &sdata->vif, |
967 | &ctx->conf); | 983 | &ctx->conf); |
984 | } | ||
968 | trace_drv_return_void(local); | 985 | trace_drv_return_void(local); |
969 | } | 986 | } |
970 | 987 | ||