if_ath.c (219180) | if_ath.c (219185) |
---|---|
1/*- 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 219180 2011-03-02 16:03:19Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 219185 2011-03-02 17:19:54Z adrian $"); |
32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 48 unchanged lines hidden (view full) --- 88#include <dev/ath/if_athvar.h> 89#include <dev/ath/ath_hal/ah_devid.h> /* XXX for softled */ 90#include <dev/ath/ath_hal/ah_diagcodes.h> 91 92#include <dev/ath/if_ath_debug.h> 93#include <dev/ath/if_ath_misc.h> 94#include <dev/ath/if_ath_tx.h> 95#include <dev/ath/if_ath_sysctl.h> | 32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 48 unchanged lines hidden (view full) --- 88#include <dev/ath/if_athvar.h> 89#include <dev/ath/ath_hal/ah_devid.h> /* XXX for softled */ 90#include <dev/ath/ath_hal/ah_diagcodes.h> 91 92#include <dev/ath/if_ath_debug.h> 93#include <dev/ath/if_ath_misc.h> 94#include <dev/ath/if_ath_tx.h> 95#include <dev/ath/if_ath_sysctl.h> |
96#include <dev/ath/if_ath_keycache.h> |
|
96 97#ifdef ATH_TX99_DIAG 98#include <dev/ath/ath_tx99/ath_tx99.h> 99#endif 100 101/* 102 * ATH_BCBUF determines the number of vap's that can transmit 103 * beacons and also (currently) the number of vap's that can --- 21 unchanged lines hidden (view full) --- 125static void ath_start(struct ifnet *); 126static int ath_reset_vap(struct ieee80211vap *, u_long); 127static int ath_media_change(struct ifnet *); 128static void ath_watchdog(void *); 129static int ath_ioctl(struct ifnet *, u_long, caddr_t); 130static void ath_fatal_proc(void *, int); 131static void ath_bmiss_vap(struct ieee80211vap *); 132static void ath_bmiss_proc(void *, int); | 97 98#ifdef ATH_TX99_DIAG 99#include <dev/ath/ath_tx99/ath_tx99.h> 100#endif 101 102/* 103 * ATH_BCBUF determines the number of vap's that can transmit 104 * beacons and also (currently) the number of vap's that can --- 21 unchanged lines hidden (view full) --- 126static void ath_start(struct ifnet *); 127static int ath_reset_vap(struct ieee80211vap *, u_long); 128static int ath_media_change(struct ifnet *); 129static void ath_watchdog(void *); 130static int ath_ioctl(struct ifnet *, u_long, caddr_t); 131static void ath_fatal_proc(void *, int); 132static void ath_bmiss_vap(struct ieee80211vap *); 133static void ath_bmiss_proc(void *, int); |
133static int ath_keyset(struct ath_softc *, const struct ieee80211_key *, 134 struct ieee80211_node *); 135static int ath_key_alloc(struct ieee80211vap *, 136 struct ieee80211_key *, 137 ieee80211_keyix *, ieee80211_keyix *); 138static int ath_key_delete(struct ieee80211vap *, 139 const struct ieee80211_key *); 140static int ath_key_set(struct ieee80211vap *, const struct ieee80211_key *, 141 const u_int8_t mac[IEEE80211_ADDR_LEN]); | |
142static void ath_key_update_begin(struct ieee80211vap *); 143static void ath_key_update_end(struct ieee80211vap *); 144static void ath_update_mcast(struct ifnet *); 145static void ath_update_promisc(struct ifnet *); 146static void ath_mode_init(struct ath_softc *); 147static void ath_setslottime(struct ath_softc *); 148static void ath_updateslot(struct ifnet *); 149static int ath_beaconq_setup(struct ath_hal *); --- 1696 unchanged lines hidden (view full) --- 1846static int 1847ath_media_change(struct ifnet *ifp) 1848{ 1849 int error = ieee80211_media_change(ifp); 1850 /* NB: only the fixed rate can change and that doesn't need a reset */ 1851 return (error == ENETRESET ? 0 : error); 1852} 1853 | 134static void ath_key_update_begin(struct ieee80211vap *); 135static void ath_key_update_end(struct ieee80211vap *); 136static void ath_update_mcast(struct ifnet *); 137static void ath_update_promisc(struct ifnet *); 138static void ath_mode_init(struct ath_softc *); 139static void ath_setslottime(struct ath_softc *); 140static void ath_updateslot(struct ifnet *); 141static int ath_beaconq_setup(struct ath_hal *); --- 1696 unchanged lines hidden (view full) --- 1838static int 1839ath_media_change(struct ifnet *ifp) 1840{ 1841 int error = ieee80211_media_change(ifp); 1842 /* NB: only the fixed rate can change and that doesn't need a reset */ 1843 return (error == ENETRESET ? 0 : error); 1844} 1845 |
1854#ifdef ATH_DEBUG 1855static void 1856ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix, 1857 const HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN]) 1858{ 1859 static const char *ciphers[] = { 1860 "WEP", 1861 "AES-OCB", 1862 "AES-CCM", 1863 "CKIP", 1864 "TKIP", 1865 "CLR", 1866 }; 1867 int i, n; 1868 1869 printf("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]); 1870 for (i = 0, n = hk->kv_len; i < n; i++) 1871 printf("%02x", hk->kv_val[i]); 1872 printf(" mac %s", ether_sprintf(mac)); 1873 if (hk->kv_type == HAL_CIPHER_TKIP) { 1874 printf(" %s ", sc->sc_splitmic ? "mic" : "rxmic"); 1875 for (i = 0; i < sizeof(hk->kv_mic); i++) 1876 printf("%02x", hk->kv_mic[i]); 1877 if (!sc->sc_splitmic) { 1878 printf(" txmic "); 1879 for (i = 0; i < sizeof(hk->kv_txmic); i++) 1880 printf("%02x", hk->kv_txmic[i]); 1881 } 1882 } 1883 printf("\n"); 1884} 1885#endif 1886 | |
1887/* | 1846/* |
1888 * Set a TKIP key into the hardware. This handles the 1889 * potential distribution of key state to multiple key 1890 * cache slots for TKIP. 1891 */ 1892static int 1893ath_keyset_tkip(struct ath_softc *sc, const struct ieee80211_key *k, 1894 HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN]) 1895{ 1896#define IEEE80211_KEY_XR (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV) 1897 static const u_int8_t zerobssid[IEEE80211_ADDR_LEN]; 1898 struct ath_hal *ah = sc->sc_ah; 1899 1900 KASSERT(k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP, 1901 ("got a non-TKIP key, cipher %u", k->wk_cipher->ic_cipher)); 1902 if ((k->wk_flags & IEEE80211_KEY_XR) == IEEE80211_KEY_XR) { 1903 if (sc->sc_splitmic) { 1904 /* 1905 * TX key goes at first index, RX key at the rx index. 1906 * The hal handles the MIC keys at index+64. 1907 */ 1908 memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic)); 1909 KEYPRINTF(sc, k->wk_keyix, hk, zerobssid); 1910 if (!ath_hal_keyset(ah, k->wk_keyix, hk, zerobssid)) 1911 return 0; 1912 1913 memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); 1914 KEYPRINTF(sc, k->wk_keyix+32, hk, mac); 1915 /* XXX delete tx key on failure? */ 1916 return ath_hal_keyset(ah, k->wk_keyix+32, hk, mac); 1917 } else { 1918 /* 1919 * Room for both TX+RX MIC keys in one key cache 1920 * slot, just set key at the first index; the hal 1921 * will handle the rest. 1922 */ 1923 memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); 1924 memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic)); 1925 KEYPRINTF(sc, k->wk_keyix, hk, mac); 1926 return ath_hal_keyset(ah, k->wk_keyix, hk, mac); 1927 } 1928 } else if (k->wk_flags & IEEE80211_KEY_XMIT) { 1929 if (sc->sc_splitmic) { 1930 /* 1931 * NB: must pass MIC key in expected location when 1932 * the keycache only holds one MIC key per entry. 1933 */ 1934 memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_txmic)); 1935 } else 1936 memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic)); 1937 KEYPRINTF(sc, k->wk_keyix, hk, mac); 1938 return ath_hal_keyset(ah, k->wk_keyix, hk, mac); 1939 } else if (k->wk_flags & IEEE80211_KEY_RECV) { 1940 memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); 1941 KEYPRINTF(sc, k->wk_keyix, hk, mac); 1942 return ath_hal_keyset(ah, k->wk_keyix, hk, mac); 1943 } 1944 return 0; 1945#undef IEEE80211_KEY_XR 1946} 1947 1948/* 1949 * Set a net80211 key into the hardware. This handles the 1950 * potential distribution of key state to multiple key 1951 * cache slots for TKIP with hardware MIC support. 1952 */ 1953static int 1954ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k, 1955 struct ieee80211_node *bss) 1956{ 1957#define N(a) (sizeof(a)/sizeof(a[0])) 1958 static const u_int8_t ciphermap[] = { 1959 HAL_CIPHER_WEP, /* IEEE80211_CIPHER_WEP */ 1960 HAL_CIPHER_TKIP, /* IEEE80211_CIPHER_TKIP */ 1961 HAL_CIPHER_AES_OCB, /* IEEE80211_CIPHER_AES_OCB */ 1962 HAL_CIPHER_AES_CCM, /* IEEE80211_CIPHER_AES_CCM */ 1963 (u_int8_t) -1, /* 4 is not allocated */ 1964 HAL_CIPHER_CKIP, /* IEEE80211_CIPHER_CKIP */ 1965 HAL_CIPHER_CLR, /* IEEE80211_CIPHER_NONE */ 1966 }; 1967 struct ath_hal *ah = sc->sc_ah; 1968 const struct ieee80211_cipher *cip = k->wk_cipher; 1969 u_int8_t gmac[IEEE80211_ADDR_LEN]; 1970 const u_int8_t *mac; 1971 HAL_KEYVAL hk; 1972 1973 memset(&hk, 0, sizeof(hk)); 1974 /* 1975 * Software crypto uses a "clear key" so non-crypto 1976 * state kept in the key cache are maintained and 1977 * so that rx frames have an entry to match. 1978 */ 1979 if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) == 0) { 1980 KASSERT(cip->ic_cipher < N(ciphermap), 1981 ("invalid cipher type %u", cip->ic_cipher)); 1982 hk.kv_type = ciphermap[cip->ic_cipher]; 1983 hk.kv_len = k->wk_keylen; 1984 memcpy(hk.kv_val, k->wk_key, k->wk_keylen); 1985 } else 1986 hk.kv_type = HAL_CIPHER_CLR; 1987 1988 if ((k->wk_flags & IEEE80211_KEY_GROUP) && sc->sc_mcastkey) { 1989 /* 1990 * Group keys on hardware that supports multicast frame 1991 * key search use a MAC that is the sender's address with 1992 * the multicast bit set instead of the app-specified address. 1993 */ 1994 IEEE80211_ADDR_COPY(gmac, bss->ni_macaddr); 1995 gmac[0] |= 0x01; 1996 mac = gmac; 1997 } else 1998 mac = k->wk_macaddr; 1999 2000 if (hk.kv_type == HAL_CIPHER_TKIP && 2001 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { 2002 return ath_keyset_tkip(sc, k, &hk, mac); 2003 } else { 2004 KEYPRINTF(sc, k->wk_keyix, &hk, mac); 2005 return ath_hal_keyset(ah, k->wk_keyix, &hk, mac); 2006 } 2007#undef N 2008} 2009 2010/* 2011 * Allocate tx/rx key slots for TKIP. We allocate two slots for 2012 * each key, one for decrypt/encrypt and the other for the MIC. 2013 */ 2014static u_int16_t 2015key_alloc_2pair(struct ath_softc *sc, 2016 ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix) 2017{ 2018#define N(a) (sizeof(a)/sizeof(a[0])) 2019 u_int i, keyix; 2020 2021 KASSERT(sc->sc_splitmic, ("key cache !split")); 2022 /* XXX could optimize */ 2023 for (i = 0; i < N(sc->sc_keymap)/4; i++) { 2024 u_int8_t b = sc->sc_keymap[i]; 2025 if (b != 0xff) { 2026 /* 2027 * One or more slots in this byte are free. 2028 */ 2029 keyix = i*NBBY; 2030 while (b & 1) { 2031 again: 2032 keyix++; 2033 b >>= 1; 2034 } 2035 /* XXX IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV */ 2036 if (isset(sc->sc_keymap, keyix+32) || 2037 isset(sc->sc_keymap, keyix+64) || 2038 isset(sc->sc_keymap, keyix+32+64)) { 2039 /* full pair unavailable */ 2040 /* XXX statistic */ 2041 if (keyix == (i+1)*NBBY) { 2042 /* no slots were appropriate, advance */ 2043 continue; 2044 } 2045 goto again; 2046 } 2047 setbit(sc->sc_keymap, keyix); 2048 setbit(sc->sc_keymap, keyix+64); 2049 setbit(sc->sc_keymap, keyix+32); 2050 setbit(sc->sc_keymap, keyix+32+64); 2051 DPRINTF(sc, ATH_DEBUG_KEYCACHE, 2052 "%s: key pair %u,%u %u,%u\n", 2053 __func__, keyix, keyix+64, 2054 keyix+32, keyix+32+64); 2055 *txkeyix = keyix; 2056 *rxkeyix = keyix+32; 2057 return 1; 2058 } 2059 } 2060 DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__); 2061 return 0; 2062#undef N 2063} 2064 2065/* 2066 * Allocate tx/rx key slots for TKIP. We allocate two slots for 2067 * each key, one for decrypt/encrypt and the other for the MIC. 2068 */ 2069static u_int16_t 2070key_alloc_pair(struct ath_softc *sc, 2071 ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix) 2072{ 2073#define N(a) (sizeof(a)/sizeof(a[0])) 2074 u_int i, keyix; 2075 2076 KASSERT(!sc->sc_splitmic, ("key cache split")); 2077 /* XXX could optimize */ 2078 for (i = 0; i < N(sc->sc_keymap)/4; i++) { 2079 u_int8_t b = sc->sc_keymap[i]; 2080 if (b != 0xff) { 2081 /* 2082 * One or more slots in this byte are free. 2083 */ 2084 keyix = i*NBBY; 2085 while (b & 1) { 2086 again: 2087 keyix++; 2088 b >>= 1; 2089 } 2090 if (isset(sc->sc_keymap, keyix+64)) { 2091 /* full pair unavailable */ 2092 /* XXX statistic */ 2093 if (keyix == (i+1)*NBBY) { 2094 /* no slots were appropriate, advance */ 2095 continue; 2096 } 2097 goto again; 2098 } 2099 setbit(sc->sc_keymap, keyix); 2100 setbit(sc->sc_keymap, keyix+64); 2101 DPRINTF(sc, ATH_DEBUG_KEYCACHE, 2102 "%s: key pair %u,%u\n", 2103 __func__, keyix, keyix+64); 2104 *txkeyix = *rxkeyix = keyix; 2105 return 1; 2106 } 2107 } 2108 DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__); 2109 return 0; 2110#undef N 2111} 2112 2113/* 2114 * Allocate a single key cache slot. 2115 */ 2116static int 2117key_alloc_single(struct ath_softc *sc, 2118 ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix) 2119{ 2120#define N(a) (sizeof(a)/sizeof(a[0])) 2121 u_int i, keyix; 2122 2123 /* XXX try i,i+32,i+64,i+32+64 to minimize key pair conflicts */ 2124 for (i = 0; i < N(sc->sc_keymap); i++) { 2125 u_int8_t b = sc->sc_keymap[i]; 2126 if (b != 0xff) { 2127 /* 2128 * One or more slots are free. 2129 */ 2130 keyix = i*NBBY; 2131 while (b & 1) 2132 keyix++, b >>= 1; 2133 setbit(sc->sc_keymap, keyix); 2134 DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: key %u\n", 2135 __func__, keyix); 2136 *txkeyix = *rxkeyix = keyix; 2137 return 1; 2138 } 2139 } 2140 DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of space\n", __func__); 2141 return 0; 2142#undef N 2143} 2144 2145/* 2146 * Allocate one or more key cache slots for a uniacst key. The 2147 * key itself is needed only to identify the cipher. For hardware 2148 * TKIP with split cipher+MIC keys we allocate two key cache slot 2149 * pairs so that we can setup separate TX and RX MIC keys. Note 2150 * that the MIC key for a TKIP key at slot i is assumed by the 2151 * hardware to be at slot i+64. This limits TKIP keys to the first 2152 * 64 entries. 2153 */ 2154static int 2155ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, 2156 ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) 2157{ 2158 struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; 2159 2160 /* 2161 * Group key allocation must be handled specially for 2162 * parts that do not support multicast key cache search 2163 * functionality. For those parts the key id must match 2164 * the h/w key index so lookups find the right key. On 2165 * parts w/ the key search facility we install the sender's 2166 * mac address (with the high bit set) and let the hardware 2167 * find the key w/o using the key id. This is preferred as 2168 * it permits us to support multiple users for adhoc and/or 2169 * multi-station operation. 2170 */ 2171 if (k->wk_keyix != IEEE80211_KEYIX_NONE) { 2172 /* 2173 * Only global keys should have key index assigned. 2174 */ 2175 if (!(&vap->iv_nw_keys[0] <= k && 2176 k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { 2177 /* should not happen */ 2178 DPRINTF(sc, ATH_DEBUG_KEYCACHE, 2179 "%s: bogus group key\n", __func__); 2180 return 0; 2181 } 2182 if (vap->iv_opmode != IEEE80211_M_HOSTAP || 2183 !(k->wk_flags & IEEE80211_KEY_GROUP) || 2184 !sc->sc_mcastkey) { 2185 /* 2186 * XXX we pre-allocate the global keys so 2187 * have no way to check if they've already 2188 * been allocated. 2189 */ 2190 *keyix = *rxkeyix = k - vap->iv_nw_keys; 2191 return 1; 2192 } 2193 /* 2194 * Group key and device supports multicast key search. 2195 */ 2196 k->wk_keyix = IEEE80211_KEYIX_NONE; 2197 } 2198 2199 /* 2200 * We allocate two pair for TKIP when using the h/w to do 2201 * the MIC. For everything else, including software crypto, 2202 * we allocate a single entry. Note that s/w crypto requires 2203 * a pass-through slot on the 5211 and 5212. The 5210 does 2204 * not support pass-through cache entries and we map all 2205 * those requests to slot 0. 2206 */ 2207 if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { 2208 return key_alloc_single(sc, keyix, rxkeyix); 2209 } else if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP && 2210 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { 2211 if (sc->sc_splitmic) 2212 return key_alloc_2pair(sc, keyix, rxkeyix); 2213 else 2214 return key_alloc_pair(sc, keyix, rxkeyix); 2215 } else { 2216 return key_alloc_single(sc, keyix, rxkeyix); 2217 } 2218} 2219 2220/* 2221 * Delete an entry in the key cache allocated by ath_key_alloc. 2222 */ 2223static int 2224ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) 2225{ 2226 struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; 2227 struct ath_hal *ah = sc->sc_ah; 2228 const struct ieee80211_cipher *cip = k->wk_cipher; 2229 u_int keyix = k->wk_keyix; 2230 2231 DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: delete key %u\n", __func__, keyix); 2232 2233 ath_hal_keyreset(ah, keyix); 2234 /* 2235 * Handle split tx/rx keying required for TKIP with h/w MIC. 2236 */ 2237 if (cip->ic_cipher == IEEE80211_CIPHER_TKIP && 2238 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic) 2239 ath_hal_keyreset(ah, keyix+32); /* RX key */ 2240 if (keyix >= IEEE80211_WEP_NKID) { 2241 /* 2242 * Don't touch keymap entries for global keys so 2243 * they are never considered for dynamic allocation. 2244 */ 2245 clrbit(sc->sc_keymap, keyix); 2246 if (cip->ic_cipher == IEEE80211_CIPHER_TKIP && 2247 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { 2248 clrbit(sc->sc_keymap, keyix+64); /* TX key MIC */ 2249 if (sc->sc_splitmic) { 2250 /* +32 for RX key, +32+64 for RX key MIC */ 2251 clrbit(sc->sc_keymap, keyix+32); 2252 clrbit(sc->sc_keymap, keyix+32+64); 2253 } 2254 } 2255 } 2256 return 1; 2257} 2258 2259/* 2260 * Set the key cache contents for the specified key. Key cache 2261 * slot(s) must already have been allocated by ath_key_alloc. 2262 */ 2263static int 2264ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, 2265 const u_int8_t mac[IEEE80211_ADDR_LEN]) 2266{ 2267 struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; 2268 2269 return ath_keyset(sc, k, vap->iv_bss); 2270} 2271 2272/* | |
2273 * Block/unblock tx+rx processing while a key change is done. 2274 * We assume the caller serializes key management operations 2275 * so we only need to worry about synchronization with other 2276 * uses that originate in the driver. 2277 */ 2278static void 2279ath_key_update_begin(struct ieee80211vap *vap) 2280{ --- 3727 unchanged lines hidden --- | 1847 * Block/unblock tx+rx processing while a key change is done. 1848 * We assume the caller serializes key management operations 1849 * so we only need to worry about synchronization with other 1850 * uses that originate in the driver. 1851 */ 1852static void 1853ath_key_update_begin(struct ieee80211vap *vap) 1854{ --- 3727 unchanged lines hidden --- |