]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/rt2x00/rt2x00crypto.c
Merge branch 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
[mv-sheeva.git] / drivers / net / wireless / rt2x00 / rt2x00crypto.c
index d291c7862e10641d04d92fdadbca6e44cb133e76..5e9074bf2b8efbb7eac0ad72db70474604557a72 100644 (file)
 
 enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key)
 {
-       switch (key->alg) {
-       case ALG_WEP:
-               if (key->keylen == WLAN_KEY_LEN_WEP40)
-                       return CIPHER_WEP64;
-               else
-                       return CIPHER_WEP128;
-       case ALG_TKIP:
+       switch (key->cipher) {
+       case WLAN_CIPHER_SUITE_WEP40:
+               return CIPHER_WEP64;
+       case WLAN_CIPHER_SUITE_WEP104:
+               return CIPHER_WEP128;
+       case WLAN_CIPHER_SUITE_TKIP:
                return CIPHER_TKIP;
-       case ALG_CCMP:
+       case WLAN_CIPHER_SUITE_CCMP:
                return CIPHER_AES;
        default:
                return CIPHER_NONE;
@@ -95,7 +94,7 @@ unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
                overhead += key->iv_len;
 
        if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) {
-               if (key->alg == ALG_TKIP)
+               if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
                        overhead += 8;
        }
 
@@ -128,6 +127,7 @@ void rt2x00crypto_tx_remove_iv(struct sk_buff *skb, struct txentry_desc *txdesc)
 
        /* Pull buffer to correct size */
        skb_pull(skb, txdesc->iv_len);
+       txdesc->length -= txdesc->iv_len;
 
        /* IV/EIV data has officially been stripped */
        skbdesc->flags |= SKBDESC_IV_STRIPPED;