From: Florian Schilhabel Date: Thu, 15 Jul 2010 17:04:24 +0000 (+0200) Subject: staging: rtl8192su: merge updated ieee80211_crypto_ops() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bb21199a013b13276336bb92012c9e68a0c179b9;p=linux-beck.git staging: rtl8192su: merge updated ieee80211_crypto_ops() Signed-off-by: Florian Schilhabel Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211.h b/drivers/staging/rtl8192su/ieee80211/ieee80211.h index 2c860db396c9..1c14adbfb98b 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211.h @@ -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; diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.h b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.h index b58a3bcc0dc0..42e52aedd292 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.h +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.h @@ -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); diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_tkip.c index c8f5ecf20df8..5ab94a9665e5 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt_tkip.c @@ -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; } diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c index 1f2bc7ac6f79..09a02f7e39ff 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c @@ -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"