]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: rtl8192su: merge updated ieee80211_crypto_ops()
authorFlorian Schilhabel <florian.c.schilhabel@googlemail.com>
Thu, 15 Jul 2010 17:04:24 +0000 (19:04 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Jul 2010 19:00:22 +0000 (12:00 -0700)
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8192su/ieee80211/ieee80211.h
drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.h
drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_tkip.c
drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c

index 2c860db396c9b2d0074cead04ace99e93090c031..1c14adbfb98b9c0746b1b3bbdaa8f0a3e1b8dc7f 100644 (file)
@@ -1141,6 +1141,7 @@ struct ieee80211_device {
        /* hw security related */
        u8 hwsec_active;
        bool is_silent_reset;
+       bool force_mic_error;
        bool is_roaming;
        bool ieee_up;
        bool bSupportRemoteWakeUp;
index b58a3bcc0dc0972c882f5992ad02264510769bf5..42e52aedd2925706aa7a5ef1be71c71791383028 100644 (file)
@@ -49,7 +49,7 @@ struct ieee80211_crypto_ops {
         * These can be NULL if full MSDU operations are not needed. */
        int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv);
        int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len,
-                           void *priv);
+                           void *priv, struct ieee80211_device* ieee);
 
        int (*set_key)(void *key, int len, u8 *seq, void *priv);
        int (*get_key)(void *key, int len, u8 *seq, void *priv);
index c8f5ecf20df862b30fa7184b2f52523d673d9655..5ab94a9665e5427386af34d28910ce93b872d402 100644 (file)
@@ -604,7 +604,7 @@ static void ieee80211_michael_mic_failure(struct net_device *dev,
 }
 
 static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
-                                    int hdr_len, void *priv)
+                                    int hdr_len, void *priv, struct ieee80211_device* ieee)
 {
        struct ieee80211_tkip_data *tkey = priv;
        u8 mic[8];
@@ -630,9 +630,14 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
                       "MSDU from %pM keyidx=%d\n",
                       skb->dev ? skb->dev->name : "N/A", hdr->addr2,
                       keyidx);
-               if (skb->dev)
+                printk("%d, force_mic_error = %d\n", (memcmp(mic, skb->data + skb->len - 8, 8) != 0),\
+                        ieee->force_mic_error);
+               if (skb->dev) {
+                        printk("skb->dev != NULL\n");
                        ieee80211_michael_mic_failure(skb->dev, hdr, keyidx);
+                }
                tkey->dot11RSNAStatsTKIPLocalMICFailures++;
+                ieee->force_mic_error = false;
                return -1;
        }
 
index 1f2bc7ac6f7909adda805b81c906c5d2a311fa11..09a02f7e39ff2c3d7e0248fcc99a899de7e551a2 100644 (file)
@@ -360,7 +360,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device* ieee, struct sk_buff *s
        hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
 
        atomic_inc(&crypt->refcnt);
-       res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
+       res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv,ieee);
        atomic_dec(&crypt->refcnt);
        if (res < 0) {
                printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"