diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-02 14:14:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:40 -0400 |
commit | 25e47c18ac4d8ad09c2ed4b99c1dbbcb7e3d2c51 (patch) | |
tree | e224f603ceb19d7c416cd37fc4479a042ccc6890 /net/mac80211/main.c | |
parent | 6bad8766620a3c8b64afa981502fdb543e3cfd6c (diff) |
cfg80211: add cipher capabilities
This adds the necessary code and fields to let drivers specify
their cipher capabilities and exports them to userspace. Also
update mac80211 to export the ciphers it has.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 679b3a14f11f..c1145be72da4 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -823,6 +823,15 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
823 | struct ieee80211_master_priv *mpriv; | 823 | struct ieee80211_master_priv *mpriv; |
824 | int channels, i, j, max_bitrates; | 824 | int channels, i, j, max_bitrates; |
825 | bool supp_ht; | 825 | bool supp_ht; |
826 | static const u32 cipher_suites[] = { | ||
827 | WLAN_CIPHER_SUITE_WEP40, | ||
828 | WLAN_CIPHER_SUITE_WEP104, | ||
829 | WLAN_CIPHER_SUITE_TKIP, | ||
830 | WLAN_CIPHER_SUITE_CCMP, | ||
831 | |||
832 | /* keep last -- depends on hw flags! */ | ||
833 | WLAN_CIPHER_SUITE_AES_CMAC | ||
834 | }; | ||
826 | 835 | ||
827 | /* | 836 | /* |
828 | * generic code guarantees at least one band, | 837 | * generic code guarantees at least one band, |
@@ -894,6 +903,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
894 | if (local->hw.wiphy->max_scan_ie_len) | 903 | if (local->hw.wiphy->max_scan_ie_len) |
895 | local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; | 904 | local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; |
896 | 905 | ||
906 | local->hw.wiphy->cipher_suites = cipher_suites; | ||
907 | local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); | ||
908 | if (!(local->hw.flags & IEEE80211_HW_MFP_CAPABLE)) | ||
909 | local->hw.wiphy->n_cipher_suites--; | ||
910 | |||
897 | result = wiphy_register(local->hw.wiphy); | 911 | result = wiphy_register(local->hw.wiphy); |
898 | if (result < 0) | 912 | if (result < 0) |
899 | goto fail_wiphy_register; | 913 | goto fail_wiphy_register; |