Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chaitanya T K and committed by
Johannes Berg
dcae9e02 ef95d8ba

+18
+6
include/net/mac80211.h
··· 3172 3172 * The callback is optional and can sleep. 3173 3173 * 3174 3174 * @add_chanctx: Notifies device driver about new channel context creation. 3175 + * This callback may sleep. 3175 3176 * @remove_chanctx: Notifies device driver about channel context destruction. 3177 + * This callback may sleep. 3176 3178 * @change_chanctx: Notifies device driver about channel context changes that 3177 3179 * may happen when combining different virtual interfaces on the same 3178 3180 * channel context with different settings 3181 + * This callback may sleep. 3179 3182 * @assign_vif_chanctx: Notifies device driver about channel context being bound 3180 3183 * to vif. Possible use is for hw queue remapping. 3184 + * This callback may sleep. 3181 3185 * @unassign_vif_chanctx: Notifies device driver about channel context being 3182 3186 * unbound from vif. 3187 + * This callback may sleep. 3183 3188 * @switch_vif_chanctx: switch a number of vifs from one chanctx to 3184 3189 * another, as specified in the list of 3185 3190 * @ieee80211_vif_chanctx_switch passed to the driver, according 3186 3191 * to the mode defined in &ieee80211_chanctx_switch_mode. 3192 + * This callback may sleep. 3187 3193 * 3188 3194 * @start_ap: Start operation on the AP interface, this is called after all the 3189 3195 * information in bss_conf is set and beacon can be retrieved. A channel
+2
net/mac80211/driver-ops.c
··· 236 236 int ret = 0; 237 237 int i; 238 238 239 + might_sleep(); 240 + 239 241 if (!local->ops->switch_vif_chanctx) 240 242 return -EOPNOTSUPP; 241 243
+10
net/mac80211/driver-ops.h
··· 843 843 { 844 844 int ret = -EOPNOTSUPP; 845 845 846 + might_sleep(); 847 + 846 848 trace_drv_add_chanctx(local, ctx); 847 849 if (local->ops->add_chanctx) 848 850 ret = local->ops->add_chanctx(&local->hw, &ctx->conf); ··· 858 856 static inline void drv_remove_chanctx(struct ieee80211_local *local, 859 857 struct ieee80211_chanctx *ctx) 860 858 { 859 + might_sleep(); 860 + 861 861 if (WARN_ON(!ctx->driver_present)) 862 862 return; 863 863 ··· 874 870 struct ieee80211_chanctx *ctx, 875 871 u32 changed) 876 872 { 873 + might_sleep(); 874 + 877 875 trace_drv_change_chanctx(local, ctx, changed); 878 876 if (local->ops->change_chanctx) { 879 877 WARN_ON_ONCE(!ctx->driver_present); ··· 909 903 struct ieee80211_sub_if_data *sdata, 910 904 struct ieee80211_chanctx *ctx) 911 905 { 906 + might_sleep(); 907 + 912 908 if (!check_sdata_in_driver(sdata)) 913 909 return; 914 910 ··· 932 924 struct ieee80211_sub_if_data *sdata) 933 925 { 934 926 int ret = 0; 927 + 928 + might_sleep(); 935 929 936 930 if (!check_sdata_in_driver(sdata)) 937 931 return -EIO;