ath9k: Fix key cache slot selection for splitmic
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 18 Dec 2008 12:31:10 +0000 (14:31 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 19 Dec 2008 20:23:51 +0000 (15:23 -0500)
ath_reserve_key_cache_slot() was obviously supposed to return an index
to a free slot, not reserved one. This could have caused problems with
hardware revisions that use splitmic.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/main.c

index 94c526669a4db68966041f8372de392f80f13f88..b44736782abdf514ef8b039deb42d5375f04d9d3 100644 (file)
@@ -756,12 +756,12 @@ static int ath_reserve_key_cache_slot(struct ath_softc *sc)
                            (test_bit(i , sc->sc_keymap) ||
                             test_bit(i + 32, sc->sc_keymap) ||
                             test_bit(i + 64 + 32, sc->sc_keymap)))
-                               return i;
+                               return i + 64;
                        if (!test_bit(i + 64 + 32, sc->sc_keymap) &&
                            (test_bit(i, sc->sc_keymap) ||
                             test_bit(i + 32, sc->sc_keymap) ||
                             test_bit(i + 64, sc->sc_keymap)))
-                               return i;
+                               return i + 64 + 32;
                }
        } else {
                for (i = IEEE80211_WEP_NKID; i < sc->sc_keymax / 2; i++) {