diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-05-10 16:18:26 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-05 15:21:46 -0400 |
commit | 72d7872852e1734e94686012a2e9deade3457329 (patch) | |
tree | a03e04cbb654ddd44132b420e068a6e0a24d8f86 /net/mac80211/main.c | |
parent | f8f5701bdaf9134b1f90e5044a82c66324d2073f (diff) |
mac80211: allow low-level drivers to set netdev feature bits
Low level drivers can now set certain netdev feature bits in
netdev_features member of the ieee80211_hw struct. These will be
propagated to every netdev created from this HW.
The white-listed features currently include only ones related to HW
checksumming.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index f5548e95325..779ac613ee5 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -682,6 +682,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) enum ieee80211_band band; int channels, max_bitrates; bool supp_ht; + netdev_features_t feature_whitelist; static const u32 cipher_suites[] = { /* keep WEP first, it may be removed below */ WLAN_CIPHER_SUITE_WEP40, @@ -708,6 +709,12 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) if ((hw->flags & IEEE80211_HW_SCAN_WHILE_IDLE) && !local->ops->hw_scan) return -EINVAL; + /* Only HW csum features are currently compatible with mac80211 */ + feature_whitelist = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | + NETIF_F_HW_CSUM; + if (WARN_ON(hw->netdev_features & ~feature_whitelist)) + return -EINVAL; + if (hw->max_report_rates == 0) hw->max_report_rates = hw->max_rates; |