diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index dd24b2663b5e..4ff26c2159bf 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -506,9 +506,19 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
506 | 506 | ||
507 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | 507 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
508 | return 0; | 508 | return 0; |
509 | else if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags)) | 509 | |
510 | if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags)) | ||
511 | return -EOPNOTSUPP; | ||
512 | |||
513 | /* | ||
514 | * To support IBSS RSN, don't program group keys in IBSS, the | ||
515 | * hardware will then not attempt to decrypt the frames. | ||
516 | */ | ||
517 | if (vif->type == NL80211_IFTYPE_ADHOC && | ||
518 | !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) | ||
510 | return -EOPNOTSUPP; | 519 | return -EOPNOTSUPP; |
511 | else if (key->keylen > 32) | 520 | |
521 | if (key->keylen > 32) | ||
512 | return -ENOSPC; | 522 | return -ENOSPC; |
513 | 523 | ||
514 | memset(&crypto, 0, sizeof(crypto)); | 524 | memset(&crypto, 0, sizeof(crypto)); |