]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ath9k_hw: handle rx key miss
authorFelix Fietkau <nbd@openwrt.org>
Tue, 14 Sep 2010 16:38:26 +0000 (18:38 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 14 Sep 2010 20:14:27 +0000 (16:14 -0400)
If AR_KeyMiss is set in the rx descriptor and AR_RxFrameOK is unset,
the hardware could not locate a valid key during a decryption attempt.

In this case, the frame must not be reported as decrypted, otherwise
mac80211 sees only random garbage.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9003_mac.c
drivers/net/wireless/ath/ath9k/mac.c

index a462da23e87e7735e632cdd582e9344d39ee1c35..3b424ca1ba844855b798e757e0d0727dd29e9e27 100644 (file)
@@ -616,7 +616,8 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
                        rxs->rs_status |= ATH9K_RXERR_DECRYPT;
                } else if (rxsp->status11 & AR_MichaelErr) {
                        rxs->rs_status |= ATH9K_RXERR_MIC;
-               }
+               } else if (rxsp->status11 & AR_KeyMiss)
+                       rxs->rs_status |= ATH9K_RXERR_DECRYPT;
        }
 
        return 0;
index 0b7d1253f0c0de6fbddb6eeba3b0c23af7831b08..3efda8a8a3c1e66e1b0ed71a7a5bbad2a936bb28 100644 (file)
@@ -714,6 +714,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
                else if ((ads.ds_rxstatus8 & AR_MichaelErr) &&
                         rs->rs_keyix != ATH9K_RXKEYIX_INVALID)
                        rs->rs_status |= ATH9K_RXERR_MIC;
+               else if (ads.ds_rxstatus8 & AR_KeyMiss)
+                       rs->rs_status |= ATH9K_RXERR_DECRYPT;
        }
 
        return 0;