aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-26 08:46:32 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-16 14:22:45 -0400
commite269d8600a8f6a9f2387b3f283bfb579a5479dc3 (patch)
treed07057cda19093807cad649db63a1b6f2f5bbc69 /net/mac80211/main.c
parente89a96f5cc4c39c268c771f52d675e15e3ba8123 (diff)
mac80211: check channel context methods
Verify that the channel context methods are all assigned by the driver or not used. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 9be3ef1d2e86..d709a5d42f69 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -549,6 +549,13 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
549 if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove))) 549 if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove)))
550 return NULL; 550 return NULL;
551 551
552 /* check all or no channel context operations exist */
553 i = !!ops->add_chanctx + !!ops->remove_chanctx +
554 !!ops->change_chanctx + !!ops->assign_vif_chanctx +
555 !!ops->unassign_vif_chanctx;
556 if (WARN_ON(i != 0 && i != 5))
557 return NULL;
558
552 /* Ensure 32-byte alignment of our private data and hw private data. 559 /* Ensure 32-byte alignment of our private data and hw private data.
553 * We use the wiphy priv data for both our ieee80211_local and for 560 * We use the wiphy priv data for both our ieee80211_local and for
554 * the driver's private data 561 * the driver's private data