aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaitanya T K <chaitanya.mgit@gmail.com>2015-10-30 13:46:15 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-11-03 05:15:48 -0500
commitdcae9e0203dfd887a7413cd38d1f87aaac1127f4 (patch)
treec3a0d643ad47795a17d0890ac410025dffc623ff
parentef95d8ba384781ce574c10f87b97d6bab2659735 (diff)
mac80211: document sleep requirements for channel context ops
Channel context driver operations can sleep, so add might_sleep() and document this. Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/mac80211.h6
-rw-r--r--net/mac80211/driver-ops.c2
-rw-r--r--net/mac80211/driver-ops.h10
3 files changed, 18 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index dac575c55c62..82045fca388b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3172,18 +3172,24 @@ enum ieee80211_reconfig_type {
3172 * The callback is optional and can sleep. 3172 * The callback is optional and can sleep.
3173 * 3173 *
3174 * @add_chanctx: Notifies device driver about new channel context creation. 3174 * @add_chanctx: Notifies device driver about new channel context creation.
3175 * This callback may sleep.
3175 * @remove_chanctx: Notifies device driver about channel context destruction. 3176 * @remove_chanctx: Notifies device driver about channel context destruction.
3177 * This callback may sleep.
3176 * @change_chanctx: Notifies device driver about channel context changes that 3178 * @change_chanctx: Notifies device driver about channel context changes that
3177 * may happen when combining different virtual interfaces on the same 3179 * may happen when combining different virtual interfaces on the same
3178 * channel context with different settings 3180 * channel context with different settings
3181 * This callback may sleep.
3179 * @assign_vif_chanctx: Notifies device driver about channel context being bound 3182 * @assign_vif_chanctx: Notifies device driver about channel context being bound
3180 * to vif. Possible use is for hw queue remapping. 3183 * to vif. Possible use is for hw queue remapping.
3184 * This callback may sleep.
3181 * @unassign_vif_chanctx: Notifies device driver about channel context being 3185 * @unassign_vif_chanctx: Notifies device driver about channel context being
3182 * unbound from vif. 3186 * unbound from vif.
3187 * This callback may sleep.
3183 * @switch_vif_chanctx: switch a number of vifs from one chanctx to 3188 * @switch_vif_chanctx: switch a number of vifs from one chanctx to
3184 * another, as specified in the list of 3189 * another, as specified in the list of
3185 * @ieee80211_vif_chanctx_switch passed to the driver, according 3190 * @ieee80211_vif_chanctx_switch passed to the driver, according
3186 * to the mode defined in &ieee80211_chanctx_switch_mode. 3191 * to the mode defined in &ieee80211_chanctx_switch_mode.
3192 * This callback may sleep.
3187 * 3193 *
3188 * @start_ap: Start operation on the AP interface, this is called after all the 3194 * @start_ap: Start operation on the AP interface, this is called after all the
3189 * information in bss_conf is set and beacon can be retrieved. A channel 3195 * information in bss_conf is set and beacon can be retrieved. A channel
diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c
index 9f97343f13fd..ca1fe5576103 100644
--- a/net/mac80211/driver-ops.c
+++ b/net/mac80211/driver-ops.c
@@ -236,6 +236,8 @@ int drv_switch_vif_chanctx(struct ieee80211_local *local,
236 int ret = 0; 236 int ret = 0;
237 int i; 237 int i;
238 238
239 might_sleep();
240
239 if (!local->ops->switch_vif_chanctx) 241 if (!local->ops->switch_vif_chanctx)
240 return -EOPNOTSUPP; 242 return -EOPNOTSUPP;
241 243
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index f82cfab615f2..154ce4b13406 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -843,6 +843,8 @@ static inline int drv_add_chanctx(struct ieee80211_local *local,
843{ 843{
844 int ret = -EOPNOTSUPP; 844 int ret = -EOPNOTSUPP;
845 845
846 might_sleep();
847
846 trace_drv_add_chanctx(local, ctx); 848 trace_drv_add_chanctx(local, ctx);
847 if (local->ops->add_chanctx) 849 if (local->ops->add_chanctx)
848 ret = local->ops->add_chanctx(&local->hw, &ctx->conf); 850 ret = local->ops->add_chanctx(&local->hw, &ctx->conf);
@@ -856,6 +858,8 @@ static inline int drv_add_chanctx(struct ieee80211_local *local,
856static inline void drv_remove_chanctx(struct ieee80211_local *local, 858static inline void drv_remove_chanctx(struct ieee80211_local *local,
857 struct ieee80211_chanctx *ctx) 859 struct ieee80211_chanctx *ctx)
858{ 860{
861 might_sleep();
862
859 if (WARN_ON(!ctx->driver_present)) 863 if (WARN_ON(!ctx->driver_present))
860 return; 864 return;
861 865
@@ -870,6 +874,8 @@ static inline void drv_change_chanctx(struct ieee80211_local *local,
870 struct ieee80211_chanctx *ctx, 874 struct ieee80211_chanctx *ctx,
871 u32 changed) 875 u32 changed)
872{ 876{
877 might_sleep();
878
873 trace_drv_change_chanctx(local, ctx, changed); 879 trace_drv_change_chanctx(local, ctx, changed);
874 if (local->ops->change_chanctx) { 880 if (local->ops->change_chanctx) {
875 WARN_ON_ONCE(!ctx->driver_present); 881 WARN_ON_ONCE(!ctx->driver_present);
@@ -903,6 +909,8 @@ static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local,
903 struct ieee80211_sub_if_data *sdata, 909 struct ieee80211_sub_if_data *sdata,
904 struct ieee80211_chanctx *ctx) 910 struct ieee80211_chanctx *ctx)
905{ 911{
912 might_sleep();
913
906 if (!check_sdata_in_driver(sdata)) 914 if (!check_sdata_in_driver(sdata))
907 return; 915 return;
908 916
@@ -925,6 +933,8 @@ static inline int drv_start_ap(struct ieee80211_local *local,
925{ 933{
926 int ret = 0; 934 int ret = 0;
927 935
936 might_sleep();
937
928 if (!check_sdata_in_driver(sdata)) 938 if (!check_sdata_in_driver(sdata))
929 return -EIO; 939 return -EIO;
930 940