Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2012 23:54:05 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243318 - head/sys/dev/ath
Message-ID:  <201211192354.qAJNs51P069992@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon Nov 19 23:54:05 2012
New Revision: 243318
URL: http://svnweb.freebsd.org/changeset/base/243318

Log:
  Don't allocate or program a key for the AR5210.
  
  The AR5210 doesn't support HAL_CIPHER_CLR ('clear encryption' keycache
  slots), so don't bother - just map them to slot 0 and never program them.

Modified:
  head/sys/dev/ath/if_ath_keycache.c

Modified: head/sys/dev/ath/if_ath_keycache.c
==============================================================================
--- head/sys/dev/ath/if_ath_keycache.c	Mon Nov 19 23:42:46 2012	(r243317)
+++ head/sys/dev/ath/if_ath_keycache.c	Mon Nov 19 23:54:05 2012	(r243318)
@@ -214,6 +214,15 @@ ath_keyset(struct ath_softc *sc, struct 
 		hk.kv_type = HAL_CIPHER_CLR;
 
 	/*
+	 * If we're installing a clear cipher key and
+	 * the hardware doesn't support that, just succeed.
+	 * Leave it up to the net80211 layer to figure it out.
+	 */
+	if (hk.kv_type == HAL_CIPHER_CLR && sc->sc_hasclrkey == 0) {
+		return (1);
+	}
+
+	/*
 	 * XXX TODO: check this:
 	 * 
 	 * Group keys on hardware that supports multicast frame
@@ -364,6 +373,14 @@ key_alloc_single(struct ath_softc *sc,
 #define	N(a)	(sizeof(a)/sizeof(a[0]))
 	u_int i, keyix;
 
+	if (sc->sc_hasclrkey == 0) {
+		/*
+		 * Map to slot 0 for the AR5210.
+		 */
+		*txkeyix = *rxkeyix = 0;
+		return (1);
+	}
+
 	/* XXX try i,i+32,i+64,i+32+64 to minimize key pair conflicts */
 	for (i = 0; i < N(sc->sc_keymap); i++) {
 		u_int8_t b = sc->sc_keymap[i];



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