On Fri, Jan 21, 2011 at 03:46:08PM +0530, Bruno Randolf wrote:
> I need this to enable HW encryption for WEP.
> Otherwise we fall back to software decryption - i only checked the decryption
> case.

Encryption/Decryption is done in hw by default. In which case are you
seeing it done in sw?.

Vasanth
> 
> Any comments?
> 
> bruno
> ---
>  drivers/net/wireless/ath/key.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
> index 5d465e5..5748dae 100644
> --- a/drivers/net/wireless/ath/key.c
> +++ b/drivers/net/wireless/ath/key.c
> @@ -465,6 +465,16 @@ int ath_key_config(struct ath_common *common,
>       hk.kv_len = key->keylen;
>       memcpy(hk.kv_val, key->key, key->keylen);
>  
> +     /* set WEP keys directly to index */
> +     if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
> +          key->cipher == WLAN_CIPHER_SUITE_WEP104) && key->keyidx < 4) {
> +             ret = ath_hw_set_keycache_entry(common, key->keyidx, &hk, NULL);
> +             if (!ret)
> +                     return -EIO;
> +             set_bit(key->keyidx, common->keymap);
> +             return key->keyidx;
> +     }
> +
>       if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
>               switch (vif->type) {
>               case NL80211_IFTYPE_AP:
> @@ -541,10 +551,8 @@ EXPORT_SYMBOL(ath_key_config);
>  void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf 
> *key)
>  {
>       ath_hw_keyreset(common, key->hw_key_idx);
> -     if (key->hw_key_idx < IEEE80211_WEP_NKID)
> -             return;
> -
>       clear_bit(key->hw_key_idx, common->keymap);
> +
>       if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
>               return;
>  
> 
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to