diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2012-06-26 08:37:17 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-10-16 14:22:42 -0400 |
commit | c3645eac479d9aaac9f8099c94bf681dc695dd34 (patch) | |
tree | f701eb4d7b3449d9f4672590f752081ea92f2009 /net/mac80211/driver-ops.h | |
parent | d01a1e658606a0a69100f49c2ef09aacaf74d3e7 (diff) |
mac80211: introduce new ieee80211_ops
Introduce channel context driver methods. The channel
on a context channel is immutable, but the channel type
and other properties can change.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
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 | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index da9003b20004..77407b31e1ff 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -871,4 +871,69 @@ static inline void drv_mgd_prepare_tx(struct ieee80211_local *local, | |||
871 | local->ops->mgd_prepare_tx(&local->hw, &sdata->vif); | 871 | local->ops->mgd_prepare_tx(&local->hw, &sdata->vif); |
872 | trace_drv_return_void(local); | 872 | trace_drv_return_void(local); |
873 | } | 873 | } |
874 | |||
875 | static inline int drv_add_chanctx(struct ieee80211_local *local, | ||
876 | struct ieee80211_chanctx *ctx) | ||
877 | { | ||
878 | int ret = -EOPNOTSUPP; | ||
879 | |||
880 | trace_drv_add_chanctx(local, ctx); | ||
881 | if (local->ops->add_chanctx) | ||
882 | ret = local->ops->add_chanctx(&local->hw, &ctx->conf); | ||
883 | trace_drv_return_int(local, ret); | ||
884 | |||
885 | return ret; | ||
886 | } | ||
887 | |||
888 | static inline void drv_remove_chanctx(struct ieee80211_local *local, | ||
889 | struct ieee80211_chanctx *ctx) | ||
890 | { | ||
891 | trace_drv_remove_chanctx(local, ctx); | ||
892 | if (local->ops->remove_chanctx) | ||
893 | local->ops->remove_chanctx(&local->hw, &ctx->conf); | ||
894 | trace_drv_return_void(local); | ||
895 | } | ||
896 | |||
897 | static inline void drv_change_chanctx(struct ieee80211_local *local, | ||
898 | struct ieee80211_chanctx *ctx, | ||
899 | u32 changed) | ||
900 | { | ||
901 | trace_drv_change_chanctx(local, ctx, changed); | ||
902 | if (local->ops->change_chanctx) | ||
903 | local->ops->change_chanctx(&local->hw, &ctx->conf, changed); | ||
904 | trace_drv_return_void(local); | ||
905 | } | ||
906 | |||
907 | static inline int drv_assign_vif_chanctx(struct ieee80211_local *local, | ||
908 | struct ieee80211_sub_if_data *sdata, | ||
909 | struct ieee80211_chanctx *ctx) | ||
910 | { | ||
911 | int ret = 0; | ||
912 | |||
913 | check_sdata_in_driver(sdata); | ||
914 | |||
915 | trace_drv_assign_vif_chanctx(local, sdata, ctx); | ||
916 | if (local->ops->assign_vif_chanctx) | ||
917 | ret = local->ops->assign_vif_chanctx(&local->hw, | ||
918 | &sdata->vif, | ||
919 | &ctx->conf); | ||
920 | trace_drv_return_int(local, ret); | ||
921 | |||
922 | return ret; | ||
923 | } | ||
924 | |||
925 | static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local, | ||
926 | struct ieee80211_sub_if_data *sdata, | ||
927 | struct ieee80211_chanctx *ctx) | ||
928 | { | ||
929 | check_sdata_in_driver(sdata); | ||
930 | |||
931 | trace_drv_unassign_vif_chanctx(local, sdata, ctx); | ||
932 | if (local->ops->unassign_vif_chanctx) | ||
933 | local->ops->unassign_vif_chanctx(&local->hw, | ||
934 | &sdata->vif, | ||
935 | &ctx->conf); | ||
936 | trace_drv_return_void(local); | ||
937 | } | ||
938 | |||
874 | #endif /* __MAC80211_DRIVER_OPS */ | 939 | #endif /* __MAC80211_DRIVER_OPS */ |