From owner-svn-src-head@FreeBSD.ORG Mon Nov 19 23:54:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8B36887; Mon, 19 Nov 2012 23:54:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD5F18FC12; Mon, 19 Nov 2012 23:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJNs591069993; Mon, 19 Nov 2012 23:54:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJNs51P069992; Mon, 19 Nov 2012 23:54:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211192354.qAJNs51P069992@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Nov 2012 23:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243318 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 23:54:05 -0000 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];