Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 May 2008 21:02:22 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 141107 for review
Message-ID:  <200805032102.m43L2Mk5039274@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=141107

Change 141107 by sam@sam_ebb on 2008/05/03 21:01:46

	o fix handling of TKIP tx-only keys for chips that have room
	  for only one MIC key / keycache entry; must pass the MIC key
	  to the hal in kv_mic, not kv_txmic (the hal api was left
	  unchanged for backwards compatibility)
	o yank compat support for hal's older than 0.9.20.3; leave a
	  CTASSERT in place just in case

Affected files ...

.. //depot/projects/vap/sys/dev/ath/if_ath.c#69 edit

Differences ...

==== //depot/projects/vap/sys/dev/ath/if_ath.c#69 (text+ko) ====

@@ -85,6 +85,11 @@
 #endif
 
 /*
+ * We require a HAL w/ the changes for split tx/rx MIC.
+ */
+CTASSERT(HAL_ABI_VERSION > 0x06052200);
+
+/*
  * ATH_BCBUF determines the number of vap's that can transmit
  * beacons and also (currently) the number of vap's that can
  * have unique mac addresses/bssid.  When staggering beacons
@@ -2067,13 +2072,11 @@
 		printf(" %s ", sc->sc_splitmic ? "mic" : "rxmic");
 		for (i = 0; i < sizeof(hk->kv_mic); i++)
 			printf("%02x", hk->kv_mic[i]);
-#if HAL_ABI_VERSION > 0x06052200
 		if (!sc->sc_splitmic) {
 			printf(" txmic ");
 			for (i = 0; i < sizeof(hk->kv_txmic); i++)
 				printf("%02x", hk->kv_txmic[i]);
 		}
-#endif
 	}
 	printf("\n");
 }
@@ -2116,18 +2119,19 @@
 			 * will handle the rest.
 			 */
 			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
-#if HAL_ABI_VERSION > 0x06052200
 			memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
-#endif
 			KEYPRINTF(sc, k->wk_keyix, hk, mac);
 			return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
 		}
 	} else if (k->wk_flags & IEEE80211_KEY_XMIT) {
-#if HAL_ABI_VERSION > 0x06052200
-		memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
-#else
-		memcpy(hk->kv_mic, k->wk_mic, sizeof(hk->kv_mic));
-#endif
+		if (sc->sc_splitmic) {
+			/*
+			 * NB: must pass MIC key in expected location when
+			 * the keycache only holds one MIC key per entry.
+			 */
+			memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_txmic));
+		} else
+			memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
 		KEYPRINTF(sc, k->wk_keyix, hk, mac);
 		return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
 	} else if (k->wk_flags & IEEE80211_KEY_RECV) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805032102.m43L2Mk5039274>