diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-09-30 14:52:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-30 14:52:29 -0400 |
commit | 8e00f5fbb4ecbc3431fa686cba60cd76a62604af (patch) | |
tree | 78aa3bdef892dbd1afc8969fc528e529cfc266f7 /net/wireless/util.c | |
parent | 56fd49e399ce1d82200fad5b8924d4e35a587809 (diff) | |
parent | 0874073570d9184a169a4ae2abbe8dbcb71878e9 (diff) |
Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem
Conflicts:
drivers/net/wireless/iwlwifi/iwl-pci.c
drivers/net/wireless/wl12xx/main.c
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index 39dbf4ad7ca1..6304ed63588a 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -151,12 +151,19 @@ void ieee80211_set_bitrate_flags(struct wiphy *wiphy) | |||
151 | set_mandatory_flags_band(wiphy->bands[band], band); | 151 | set_mandatory_flags_band(wiphy->bands[band], band); |
152 | } | 152 | } |
153 | 153 | ||
154 | bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher) | ||
155 | { | ||
156 | int i; | ||
157 | for (i = 0; i < wiphy->n_cipher_suites; i++) | ||
158 | if (cipher == wiphy->cipher_suites[i]) | ||
159 | return true; | ||
160 | return false; | ||
161 | } | ||
162 | |||
154 | int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | 163 | int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, |
155 | struct key_params *params, int key_idx, | 164 | struct key_params *params, int key_idx, |
156 | bool pairwise, const u8 *mac_addr) | 165 | bool pairwise, const u8 *mac_addr) |
157 | { | 166 | { |
158 | int i; | ||
159 | |||
160 | if (key_idx > 5) | 167 | if (key_idx > 5) |
161 | return -EINVAL; | 168 | return -EINVAL; |
162 | 169 | ||
@@ -226,10 +233,7 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | |||
226 | } | 233 | } |
227 | } | 234 | } |
228 | 235 | ||
229 | for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) | 236 | if (!cfg80211_supported_cipher_suite(&rdev->wiphy, params->cipher)) |
230 | if (params->cipher == rdev->wiphy.cipher_suites[i]) | ||
231 | break; | ||
232 | if (i == rdev->wiphy.n_cipher_suites) | ||
233 | return -EINVAL; | 237 | return -EINVAL; |
234 | 238 | ||
235 | return 0; | 239 | return 0; |