56#include <sys/sysctl.h>
58#include <sys/malloc.h>
61#include <sys/kernel.h>
62#include <sys/socket.h>
63#include <sys/sockio.h>
65#include <sys/callout.h>
67#include <sys/endian.h>
68#include <sys/kthread.h>
69#include <sys/taskqueue.h>
71#include <sys/module.h>
75#include <machine/bus.h>
78#include <net/if_var.h>
80#include <net/if_media.h>
81#include <net/if_types.h>
82#include <net/if_arp.h>
83#include <net/ethernet.h>
84#include <net/if_llc.h>
86#include <net80211/ieee80211_var.h>
87#include <net80211/ieee80211_regdomain.h>
88#ifdef IEEE80211_SUPPORT_SUPERG
89#include <net80211/ieee80211_superg.h>
91#ifdef IEEE80211_SUPPORT_TDMA
92#include <net80211/ieee80211_tdma.h>
98#include <netinet/in.h>
99#include <netinet/if_ether.h>
126#include <dev/ath/ath_tx99/ath_tx99.h>
155 const char [IFNAMSIZ],
int,
enum ieee80211_opmode,
int,
162static int ath_transmit(
struct ieee80211com *,
struct mbuf *);
179static struct ieee80211_node *
ath_node_alloc(
struct ieee80211vap *,
202static void ath_update_chw(
struct ieee80211com *);
206static int ath_newstate(
struct ieee80211vap *,
enum ieee80211_state,
int);
210 struct ieee80211_regdomain *,
int,
211 struct ieee80211_channel []);
213 struct ieee80211_channel []);
226#ifdef IEEE80211_SUPPORT_TDMA
235 0,
"long chip calibration interval (secs)");
238 0,
"short chip calibration interval (msecs)");
241 0,
"reset chip calibration results (secs)");
244 0,
"ANI calibration (msecs)");
248 0,
"rx buffers allocated");
251 0,
"tx buffers allocated");
254 0,
"tx (mgmt) buffers allocated");
258 0,
"max missed beacon xmits before chip reset");
302 const char *file,
int line)
306 DPRINTF(sc, ATH_DEBUG_PWRSAVE,
"%s: (%s:%d) state=%d, refcnt=%d, target=%d, cur=%d\n",
360 DPRINTF(sc, ATH_DEBUG_PWRSAVE,
"%s: (%s:%d) state=%d, refcnt=%d\n",
395 DPRINTF(sc, ATH_DEBUG_PWRSAVE,
"%s: (%s:%d) state=%d, refcnt=%d\n",
434 DPRINTF(sc, ATH_DEBUG_PWRSAVE,
"%s: (%s:%d) refcnt=%d, target state=%d\n",
442 device_printf(sc->
sc_dev,
"%s: refcnt=0?\n", __func__);
486 device_printf(sc->
sc_dev,
"configuring for %s\n",
488 "CUS198" :
"CUS230");
492 device_printf(sc->
sc_dev,
"CUS217 card detected\n");
495 device_printf(sc->
sc_dev,
"CUS252 card detected\n");
498 device_printf(sc->
sc_dev,
"WB335 1-ANT card detected\n");
501 device_printf(sc->
sc_dev,
"WB335 2-ANT card detected\n");
505 "Bluetooth Antenna Diversity card detected\n");
508 device_printf(sc->
sc_dev,
"Killer Wireless card detected\n");
517 if (sc->
sc_pci_devinfo & (ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_AR9565_2ANT)) {
519 pCap->hw_caps &= ~ATH9K_HW_CAP_ANT_DIV_COMB;
523 pCap->hw_caps |= ATH9K_HW_CAP_BT_ANT_DIV;
524 device_printf(sc->
sc_dev,
"Set BT/WLAN RX diversity capability\n");
530 device_printf(sc->
sc_dev,
"Enable WAR for ASPM D3/L1\n");
535 ah->config.no_pll_pwrsave =
true;
536 device_printf(sc->
sc_dev,
"Disable PLL PowerSave\n");
561 snprintf(devid_str, 32,
"hint.%s.%d.macaddr",
562 device_get_name(sc->
sc_dev),
563 device_get_unit(sc->
sc_dev));
565 if ((local_macstr = kern_getenv(devid_str)) != NULL) {
566 uint32_t tmpmac[ETHER_ADDR_LEN];
572 "Overriding MAC address from environment: '%s'\n",
576 count = sscanf(local_macstr,
"%x%*c%x%*c%x%*c%x%*c%x%*c%x",
577 &tmpmac[0], &tmpmac[1],
578 &tmpmac[2], &tmpmac[3],
579 &tmpmac[4], &tmpmac[5]);
583 for (i = 0; i < ETHER_ADDR_LEN; i++)
584 macaddr[i] = tmpmac[i];
587 freeenv(local_macstr);
596#define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20)
597#define HAL_MODE_HT40 \
598 (HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS | \
599 HAL_MODE_11NA_HT40PLUS | HAL_MODE_11NA_HT40MINUS)
603 struct ieee80211com *ic = &sc->
sc_ic;
608 int rx_chainmask, tx_chainmask;
611 DPRINTF(sc, ATH_DEBUG_ANY,
"%s: devid 0x%x\n", __func__, devid);
614 ic->ic_name = device_get_nameunit(sc->
sc_dev);
629 "unable to attach hardware; HAL status %u\n", status);
692 "Warning, using only %u of %u key cache slots\n",
733 "failed to allocate TX descriptors: %d\n", error);
739 "failed to allocate TX descriptors: %d\n", error);
749 "failed to allocate RX descriptors: %d\n", error);
758 sc->
sc_tq = taskqueue_create(
"ath_taskq", M_NOWAIT,
759 taskqueue_thread_enqueue, &sc->
sc_tq);
760 taskqueue_start_threads(&sc->
sc_tq, 1, PI_NET,
"%s taskq",
761 device_get_nameunit(sc->
sc_dev));
782 "unable to setup a beacon xmit queue!\n");
788 device_printf(sc->
sc_dev,
"unable to setup CAB xmit queue!\n");
795 "unable to setup xmit queue for %s traffic!\n",
796 ieee80211_wme_acnames[WME_AC_BK]);
810 if (sc->
sc_ac2q[WME_AC_VI] != NULL)
812 if (sc->
sc_ac2q[WME_AC_BE] != NULL)
835 if (sc->
sc_rc == NULL) {
843 "%s: unable to attach DFS\n", __func__);
851 "%s: unable to attach spectral\n", __func__);
859 "%s: unable to attach bluetooth coexistence\n", __func__);
867 "%s: unable to attach LNA diversity\n", __func__);
906 ic->ic_phytype = IEEE80211_T_OFDM;
907 ic->ic_opmode = IEEE80211_M_STA;
912 | IEEE80211_C_MONITOR
916 | IEEE80211_C_SHPREAMBLE
919#ifndef ATH_ENABLE_11N
927 | IEEE80211_C_SWSLEEP
933 ic->ic_cryptocaps |= IEEE80211_CRYPTO_WEP;
935 ic->ic_cryptocaps |= IEEE80211_CRYPTO_AES_OCB;
937 ic->ic_cryptocaps |= IEEE80211_CRYPTO_AES_CCM;
939 ic->ic_cryptocaps |= IEEE80211_CRYPTO_CKIP;
941 ic->ic_cryptocaps |= IEEE80211_CRYPTO_TKIP;
948 ic->ic_cryptocaps |= IEEE80211_CRYPTO_TKIPMIC;
978 for (i = 0; i < IEEE80211_WEP_NKID; i++) {
993 ic->ic_caps |= IEEE80211_C_TXPMGT;
1000 ic->ic_caps |= IEEE80211_C_WME;
1005 ic->ic_caps |= IEEE80211_C_BURST;
1017 device_printf(sc->
sc_dev,
"RX timestamp: %d bits\n", i);
1021 device_printf(sc->
sc_dev,
"TX timestamp: %d bits\n", i);
1043 if (sc->
sc_pci_devinfo & (ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_AR9565_2ANT)) {
1044 device_printf(sc->
sc_dev,
"%s: WB335: disabling LNA mixer diversity\n",
1051 ic->ic_caps |= IEEE80211_C_FF;
1054 ic->ic_caps |= IEEE80211_C_TURBOP;
1055#ifdef IEEE80211_SUPPORT_TDMA
1057 ic->ic_caps |= IEEE80211_C_TDMA;
1108 if (resource_int_value(device_get_name(sc->
sc_dev),
1109 device_get_unit(sc->
sc_dev),
"rx_chainmask",
1110 &rx_chainmask) == 0) {
1111 device_printf(sc->
sc_dev,
"Setting RX chainmask to 0x%x\n",
1115 if (resource_int_value(device_get_name(sc->
sc_dev),
1116 device_get_unit(sc->
sc_dev),
"tx_chainmask",
1117 &tx_chainmask) == 0) {
1118 device_printf(sc->
sc_dev,
"Setting TX chainmask to 0x%x\n",
1144#ifdef ATH_ENABLE_11N
1153 device_printf(sc->
sc_dev,
"[HT] enabling HT modes\n");
1157 ic->ic_htcaps = IEEE80211_HTC_HT
1158 | IEEE80211_HTC_AMPDU
1159 | IEEE80211_HTC_AMSDU
1160 | IEEE80211_HTCAP_MAXAMSDU_3839
1162 | IEEE80211_HTCAP_SMPS_OFF;
1172 device_printf(sc->
sc_dev,
1173 "[HT] enabling short-GI in 20MHz mode\n");
1174 ic->ic_htcaps |= IEEE80211_HTCAP_SHORTGI20;
1178 ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40
1179 | IEEE80211_HTCAP_SHORTGI40;
1188 ic->ic_txstream = txs;
1189 ic->ic_rxstream = rxs;
1201 device_printf(sc->
sc_dev,
1202 "[HT] 1 stream STBC receive enabled\n");
1203 ic->ic_htcaps |= IEEE80211_HTCAP_RXSTBC_1STREAM;
1208 device_printf(sc->
sc_dev,
1209 "[HT] 1 stream STBC transmit enabled\n");
1210 ic->ic_htcaps |= IEEE80211_HTCAP_TXSTBC;
1216 device_printf(sc->
sc_dev,
1217 "[HT] RTS aggregates limited to %d KiB\n",
1224 ==
HAL_OK && (ldpc == 1)) {
1226 device_printf(sc->
sc_dev,
1227 "[HT] LDPC transmit/receive enabled\n");
1228 ic->ic_htcaps |= IEEE80211_HTCAP_LDPC |
1229 IEEE80211_HTC_TXLDPC;
1232 device_printf(sc->
sc_dev,
1233 "[HT] %d RX streams; %d TX streams\n", rxs, txs);
1255 device_printf(sc->
sc_dev,
1256 "Enabling register serialisation\n");
1269 ic->ic_flags |= IEEE80211_F_DATAPAD;
1296 ieee80211_ifattach(ic);
1322#ifdef ATH_ENABLE_11N
1336 ic->ic_update_chw = ath_update_chw;
1340#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT
1345 ieee80211_radiotap_attachv(ic,
1354 ieee80211_radiotap_attach(ic,
1382 ieee80211_announce(ic);
1440 ieee80211_ifdetach(&sc->
sc_ic);
1441 taskqueue_free(sc->
sc_tq);
1476 for (i = 0; i < 8; i++)
1480 mac[0] |= (i << 2)|0x2;
1492 int i = mac[0] >> 2;
1499 for (i = 1; i < 8; i++)
1501 mask &= ~((i<<2)|0x2);
1518 for (slot = 0; slot <
ATH_BCBUF; slot++)
1529static struct ieee80211vap *
1531 enum ieee80211_opmode opmode,
int flags,
1537 struct ieee80211vap *vap;
1539 int needbeacon, error;
1540 enum ieee80211_opmode ic_opmode;
1542 avp = malloc(
sizeof(
struct ath_vap), M_80211_VAP, M_WAITOK | M_ZERO);
1544 IEEE80211_ADDR_COPY(mac, mac0);
1549 case IEEE80211_M_STA:
1551 device_printf(sc->
sc_dev,
"only 1 sta vap supported\n");
1559 flags |= IEEE80211_CLONE_NOBEACONS;
1561 if (flags & IEEE80211_CLONE_NOBEACONS) {
1565 ic_opmode = IEEE80211_M_HOSTAP;
1568 case IEEE80211_M_IBSS:
1570 device_printf(sc->
sc_dev,
1571 "only 1 ibss vap supported\n");
1576 case IEEE80211_M_AHDEMO:
1577#ifdef IEEE80211_SUPPORT_TDMA
1578 if (flags & IEEE80211_CLONE_TDMA) {
1580 device_printf(sc->
sc_dev,
1581 "only 1 tdma vap supported\n");
1585 flags |= IEEE80211_CLONE_NOBEACONS;
1589 case IEEE80211_M_MONITOR:
1590 if (sc->
sc_nvaps != 0 && ic->ic_opmode != opmode) {
1597 ic_opmode = ic->ic_opmode;
1600 case IEEE80211_M_HOSTAP:
1601 case IEEE80211_M_MBSS:
1604 case IEEE80211_M_WDS:
1605 if (sc->
sc_nvaps != 0 && ic->ic_opmode == IEEE80211_M_STA) {
1606 device_printf(sc->
sc_dev,
1607 "wds not supported in sta mode\n");
1615 flags &= ~IEEE80211_CLONE_BSSID;
1617 ic_opmode = IEEE80211_M_HOSTAP;
1619 ic_opmode = ic->ic_opmode;
1622 device_printf(sc->
sc_dev,
"unknown opmode %d\n", opmode);
1628 if (needbeacon & TAILQ_EMPTY(&sc->
sc_bbuf)) {
1629 device_printf(sc->
sc_dev,
"no beacon buffer available\n");
1634 if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS || opmode == IEEE80211_M_STA) {
1642 error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid);
1645 device_printf(sc->
sc_dev,
"%s: error %d creating vap\n",
1682 vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_8;
1689 vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K;
1690 vap->iv_ampdu_limit = IEEE80211_HTCAP_MAXRXAMPDU_64K;
1701 if (opmode != IEEE80211_M_IBSS || !sc->
sc_hasveol) {
1708 (
"beacon slot %u not empty", avp->
av_bslot));
1723 ic->ic_opmode = ic_opmode;
1724 if (opmode != IEEE80211_M_WDS) {
1726 if (opmode == IEEE80211_M_STA)
1728 if (opmode == IEEE80211_M_MBSS)
1731 switch (ic_opmode) {
1732 case IEEE80211_M_IBSS:
1735 case IEEE80211_M_STA:
1738 case IEEE80211_M_AHDEMO:
1739#ifdef IEEE80211_SUPPORT_TDMA
1740 if (vap->iv_caps & IEEE80211_C_TDMA) {
1751 case IEEE80211_M_HOSTAP:
1752 case IEEE80211_M_MBSS:
1755 case IEEE80211_M_MONITOR:
1768 if (flags & IEEE80211_CLONE_NOBEACONS) {
1777 ieee80211_vap_attach(vap, ieee80211_media_change,
1778 ieee80211_media_status, mac);
1784 free(avp, M_80211_VAP);
1792 struct ieee80211com *ic = vap->iv_ic;
1801 DPRINTF(sc, ATH_DEBUG_RESET,
"%s: called\n", __func__);
1817 ieee80211_vap_detach(vap);
1864 if (vap->iv_opmode == IEEE80211_M_STA) {
1868 }
else if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
1869 vap->iv_opmode == IEEE80211_M_STA ||
1870 vap->iv_opmode == IEEE80211_M_MBSS) {
1873 if (vap->iv_opmode == IEEE80211_M_MBSS)
1876 if (vap->iv_opmode != IEEE80211_M_WDS)
1878#ifdef IEEE80211_SUPPORT_TDMA
1885 free(avp, M_80211_VAP);
1893 device_printf(sc->
sc_dev,
1894 "%s: unable to restart recv logic\n", __func__);
1896#ifdef IEEE80211_SUPPORT_TDMA
1914 struct ieee80211com *ic = &sc->
sc_ic;
1918 ieee80211_suspend_all(ic);
1934 taskqueue_block(sc->
sc_tq);
1957 struct ieee80211com *ic = &sc->
sc_ic;
1967 ieee80211_crypto_reload_keys(ic);
1983 if (IEEE80211_IS_CHAN_HT(chan)) {
1990 "%s: TX chainmask is now 0x%x, RX is now 0x%x\n",
1999 struct ieee80211com *ic = &sc->
sc_ic;
2056 ieee80211_resume_all(ic);
2096 "%s: in reset, ignoring: status=0x%x\n",
2107 DPRINTF(sc, ATH_DEBUG_ANY,
"%s: invalid; ignored\n", __func__);
2123 DPRINTF(sc, ATH_DEBUG_ANY,
"%s: ic_nrunning %d sc_running %d\n",
2142 DPRINTF(sc, ATH_DEBUG_INTR,
"%s: status 0x%x\n", __func__, status);
2143 ATH_KTR(sc, ATH_KTR_INTERRUPTS, 1,
"ath_intr: mask=0x%.8x", status);
2148#ifdef ATH_KTR_INTR_DEBUG
2149 ATH_KTR(sc, ATH_KTR_INTERRUPTS, 5,
2150 "ath_intr: ISR=0x%.8x, ISR_S0=0x%.8x, ISR_S1=0x%.8x, ISR_S2=0x%.8x, ISR_S5=0x%.8x",
2161 for (i = 0; i < 32; i++)
2169 if (status == 0x0) {
2203#ifdef IEEE80211_SUPPORT_TDMA
2206 struct ieee80211com *ic = &sc->
sc_ic;
2207 struct ieee80211vap *vap =
2208 TAILQ_FIRST(&ic->ic_vaps);
2211 vap->iv_tdma->tdma_bintval;
2218#ifdef IEEE80211_SUPPORT_SUPERG
2230 ATH_KTR(sc, ATH_KTR_ERROR, 0,
"ath_intr: RXEOL");
2298 ATH_KTR(sc, ATH_KTR_INTERRUPTS, 3,
2299 "ath_intr: TX; txqs=0x%08x, txq_active was 0x%08x, now 0x%08x",
2341 ATH_KTR(sc, ATH_KTR_ERROR, 0,
"ath_intr: RXORN");
2356 device_printf(sc->
sc_dev,
"%s: TSFOOR\n", __func__);
2382 device_printf(sc->
sc_dev,
"hardware error; resetting\n");
2389 KASSERT(len >= 6*
sizeof(u_int32_t), (
"len %u bytes", len));
2391 device_printf(sc->
sc_dev,
2392 "0x%08x 0x%08x 0x%08x, 0x%08x 0x%08x 0x%08x\n", state[0],
2393 state[1] , state[2], state[3], state[4], state[5]);
2401 struct ath_softc *sc = vap->iv_ic->ic_softc;
2421 if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) {
2425 u_int bmisstimeout =
2426 vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024;
2429 "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n",
2430 __func__, (
unsigned long long) tsf,
2431 (
unsigned long long)(tsf - lastrx),
2432 (
unsigned long long) lastrx, bmisstimeout);
2434 if (tsf - lastrx <= bmisstimeout) {
2462 "%s: forced awake; force syncbeacon=1\n", __func__);
2463 if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) {
2482 KASSERT(rsize ==
sizeof(uint32_t), (
"resultsize %u", rsize));
2483 *hangs = *(uint32_t *)sp;
2493 DPRINTF(sc, ATH_DEBUG_ANY,
"%s: pending %u\n", __func__, pending);
2509 device_printf(sc->
sc_dev,
2510 "bb hang detected (0x%x), resetting\n", hangs);
2513 ieee80211_beacon_miss(&sc->
sc_ic);
2536 DPRINTF(sc, ATH_DEBUG_ANY,
"%s: pending %u\n", __func__, pending);
2566 struct ieee80211com *ic = &sc->
sc_ic;
2568 if ((ic->ic_cryptocaps & IEEE80211_CRYPTO_TKIP) && !sc->
sc_wmetkipmic) {
2569 if (ic->ic_flags & IEEE80211_F_WME) {
2571 ic->ic_cryptocaps &= ~IEEE80211_CRYPTO_TKIPMIC;
2574 ic->ic_cryptocaps |= IEEE80211_CRYPTO_TKIPMIC;
2582 struct ieee80211com *ic = &sc->
sc_ic;
2583 struct ieee80211vap *vap;
2586 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2596 struct ieee80211com *ic = &sc->
sc_ic;
2629 device_printf(sc->
sc_dev,
2630 "unable to reset hardware; hal status %u\n", status);
2690 device_printf(sc->
sc_dev,
"unable to start recv logic\n");
2727 if (sc->
sc_needmib && ic->ic_opmode == IEEE80211_M_STA)
2736 if (ic->ic_opmode == IEEE80211_M_STA)
2743 DPRINTF(sc, ATH_DEBUG_RESET,
"%s: imask=0x%x\n",
2821#define MAX_TXRX_ITERATIONS 100
2840 msleep(sc, &sc->
sc_pcu_mtx, 0,
"ath_txrx_stop",
2841 msecs_to_ticks(10));
2846 device_printf(sc->
sc_dev,
2847 "%s: didn't finish after %d iterations\n",
2850#undef MAX_TXRX_ITERATIONS
2869 taskqueue_unblock(sc->
sc_tq);
2888#define MAX_RESET_ITERATIONS 25
2910 pause(
"ath_reset_grablock", msecs_to_ticks(100));
2923 device_printf(sc->
sc_dev,
2924 "%s: didn't finish after %d iterations\n",
2928 device_printf(sc->
sc_dev,
2929 "%s: warning, recursive reset path!\n",
2934#undef MAX_RESET_ITERATIONS
2947 struct ieee80211com *ic = &sc->
sc_ic;
2952 DPRINTF(sc, ATH_DEBUG_RESET,
"%s: called\n", __func__);
2959 taskqueue_block(sc->
sc_tq);
2977 device_printf(sc->
sc_dev,
"%s: concurrent reset! Danger!\n",
3013 ah_reset_type, &status))
3014 device_printf(sc->
sc_dev,
3015 "%s: unable to reset hardware; hal status %u\n",
3048 device_printf(sc->
sc_dev,
3049 "%s: unable to start recv logic\n", __func__);
3057#ifdef IEEE80211_SUPPORT_TDMA
3133 struct ieee80211com *ic = vap->iv_ic;
3138 case IEEE80211_IOC_TXPOWER:
3177 TAILQ_REMOVE(&sc->
sc_txbuf, bf, bf_list);
3186 device_printf(sc->
sc_dev,
3187 "%s: sc_txbuf_cnt < 0?\n",
3197 DPRINTF(sc, ATH_DEBUG_XMIT,
"%s: %s\n", __func__,
3198 TAILQ_FIRST(&sc->
sc_txbuf) == NULL ?
3199 "out of xmit buffers" :
"xmit buffer busy");
3260 KASSERT((bf->
bf_node != NULL), (
"%s: bf_node=NULL!", __func__));
3276 if (bf->
bf_m != NULL) {
3281 BUS_DMASYNC_POSTWRITE);
3309 DPRINTF(sc, ATH_DEBUG_XMIT,
"%s: stop queue\n", __func__);
3325 struct ieee80211_node *ni;
3337 "%s: sc_inreset_cnt > 0; bailing\n", __func__);
3340 ATH_KTR(sc, ATH_KTR_TX, 0,
"ath_start_task: OACTIVE, finish");
3351 ATH_KTR(sc, ATH_KTR_TX, 0,
"ath_transmit: start");
3361 ni = (
struct ieee80211_node *) m->m_pkthdr.rcvif;
3376 if ((!(m->m_flags & M_EAPOL)) &&
3399 if ((!(m->m_flags & M_EAPOL)) &&
3416 if (m->m_flags & M_EAPOL)
3445 if ((m->m_flags & M_FRAG) &&
3448 "%s: out of txfrag buffers\n", __func__);
3450 if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1);
3455 ieee80211_free_mbuf(m);
3480 if (m->m_flags & M_FRAG) {
3483 struct mbuf *fm = m->m_nextpkt;
3491 TAILQ_FOREACH(n_fbf, &frags, bf_list) {
3517 next = m->m_nextpkt;
3520 if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1);
3538 ieee80211_free_node(ni);
3553 if (ni->ni_vap->iv_state != IEEE80211_S_RUN) {
3555 "%s: flush fragmented packet, state %s\n",
3557 ieee80211_state_name[ni->ni_vap->iv_state]);
3559 ieee80211_free_mbuf(next);
3563 bf = TAILQ_FIRST(&frags);
3564 KASSERT(bf != NULL, (
"no buf for txfrag"));
3565 TAILQ_REMOVE(&frags, bf, bf_list);
3589 ATH_KTR(sc, ATH_KTR_TX, 0,
"ath_transmit: finished");
3603 struct ath_softc *sc = vap->iv_ic->ic_softc;
3605 DPRINTF(sc, ATH_DEBUG_KEYCACHE,
"%s:\n", __func__);
3606 taskqueue_block(sc->
sc_tq);
3612 struct ath_softc *sc = vap->iv_ic->ic_softc;
3614 DPRINTF(sc, ATH_DEBUG_KEYCACHE,
"%s:\n", __func__);
3615 taskqueue_unblock(sc->
sc_tq);
3632 DPRINTF(sc, ATH_DEBUG_MODE,
"%s: RX filter 0x%x\n", __func__, rfilt);
3638 uint32_t val, *mfilt = arg;
3644 val = le32dec(dl + 0);
3645 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
3646 val = le32dec(dl + 3);
3647 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
3649 mfilt[pos / 32] |= (1 << (pos % 32));
3662 struct ieee80211com *ic = &sc->
sc_ic;
3666 if (ic->ic_allmulti == 0) {
3667 struct ieee80211vap *vap;
3672 mfilt[0] = mfilt[1] = 0;
3673 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
3676 mfilt[0] = mfilt[1] = ~0;
3680 DPRINTF(sc, ATH_DEBUG_MODE,
"%s: MC filter %08x:%08x\n",
3681 __func__, mfilt[0], mfilt[1]);
3707 struct ieee80211com *ic = &sc->
sc_ic;
3733 struct ieee80211com *ic = &sc->
sc_ic;
3737 if (IEEE80211_IS_CHAN_HALF(ic->ic_curchan))
3739 else if (IEEE80211_IS_CHAN_QUARTER(ic->ic_curchan))
3741 else if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) {
3744 if (ic->ic_flags & IEEE80211_F_SHSLOT)
3752 "%s: chan %u MHz flags 0x%x %s slot, %u usec\n",
3753 __func__, ic->ic_curchan->ic_freq, ic->ic_curchan->ic_flags,
3754 ic->ic_flags & IEEE80211_F_SHSLOT ?
"short" :
"long", usec);
3781 if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
3782 ic->ic_opmode == IEEE80211_M_MBSS)
3799 TAILQ_CONCAT(&dst->axq_q, &src->axq_q, bf_list);
3819 device_printf(sc->
sc_dev,
"%s: resetting\n", __func__);
3834 device_printf(sc->
sc_dev,
"bb hang detected (0x%x)\n", hangs);
3841 device_printf(sc->
sc_dev,
"stuck beacon; resetting (bmiss count %u)\n",
3900static struct ieee80211_node *
3903 struct ieee80211com *ic = vap->iv_ic;
3905 const size_t space =
sizeof(
struct ath_node) + sc->sc_rc->arc_space;
3908 an = malloc(space, M_80211_NODE, M_NOWAIT|M_ZERO);
3917 device_get_nameunit(sc->
sc_dev), an);
3927 DPRINTF(sc, ATH_DEBUG_NODE,
"%s: %6D: an %p\n", __func__, mac,
":", an);
3934 struct ieee80211com *ic = ni->ni_ic;
3937 DPRINTF(sc, ATH_DEBUG_NODE,
"%s: %6D: an %p\n", __func__,
3938 ni->ni_macaddr,
":",
ATH_NODE(ni));
3949 struct ieee80211com *ic = ni->ni_ic;
3952 DPRINTF(sc, ATH_DEBUG_NODE,
"%s: %6D: an %p\n", __func__,
3953 ni->ni_macaddr,
":",
ATH_NODE(ni));
3954 mtx_destroy(&
ATH_NODE(ni)->an_mtx);
3961 struct ieee80211com *ic = ni->ni_ic;
3965 *rssi = ic->ic_node_getrssi(ni);
3966 if (ni->ni_chan != IEEE80211_CHAN_ANYC)
3998 TAILQ_INIT(&txq->axq_q);
3999 TAILQ_INIT(&txq->axq_tidq);
4000 TAILQ_INIT(&txq->
fifo.axq_q);
4014 memset(&qi, 0,
sizeof(qi));
4046 if (qnum >= nitems(sc->
sc_txq)) {
4047 device_printf(sc->
sc_dev,
4048 "hal qnum %u out of range, max %zu!\n",
4049 qnum, nitems(sc->
sc_txq));
4057 return &sc->
sc_txq[qnum];
4074 if (ac >= nitems(sc->
sc_ac2q)) {
4075 device_printf(sc->
sc_dev,
"AC %u out of range, max %zu!\n",
4094#define ATH_EXPONENT_TO_VALUE(v) ((1<<v)-1)
4095 struct ieee80211com *ic = &sc->
sc_ic;
4097 struct chanAccParams chp;
4098 struct wmeParams *wmep;
4102 ieee80211_wme_ic_getparams(ic, &chp);
4103 wmep = &chp.cap_wmeParams[ac];
4106#ifdef IEEE80211_SUPPORT_TDMA
4144 qi.
tqi_burstTime = IEEE80211_TXOP_TO_US(wmep->wmep_txopLimit);
4145#ifdef IEEE80211_SUPPORT_TDMA
4150 "%s: Q%u qflags 0x%x aifs %u cwmin %u cwmax %u burstTime %u\n",
4155 device_printf(sc->
sc_dev,
"unable to update hardware queue "
4156 "parameters for %s traffic!\n", ieee80211_wme_acnames[ac]);
4162#undef ATH_EXPONENT_TO_VALUE
4214 return (rix == 0xff ? 0 : rix);
4221 struct ieee80211_node *ni = bf->
bf_node;
4222 struct ieee80211com *ic = &sc->
sc_ic;
4238 pri = M_WME_GETAC(bf->
bf_m);
4239 if (pri >= WME_AC_VO)
4240 ic->ic_wme.wme_hipri_traffic++;
4243 ni->ni_inact = ni->ni_inact_reload;
4256 if (bf->
bf_m->m_flags & M_FF)
4301 device_printf(sc->
sc_dev,
4302 "%s: bf %p: seqno %d: dobaw should've been cleared!\n",
4308 device_printf(sc->
sc_dev,
4309 "%s: bf %p: seqno %d: bf_next not NULL!\n",
4350 int rc_framelen,
int nframes,
int nbad)
4386 struct ieee80211_node *ni = bf->
bf_node;
4439 struct ieee80211_node *ni;
4440#ifdef IEEE80211_SUPPORT_SUPERG
4441 struct ieee80211com *ic = &sc->
sc_ic;
4446 DPRINTF(sc, ATH_DEBUG_TX_PROC,
"%s: tx queue %u head %p link %p\n",
4451 ATH_KTR(sc, ATH_KTR_TXCOMP, 4,
4452 "ath_tx_processq: txq=%u head %p link %p depth %p",
4462 bf = TAILQ_FIRST(&txq->axq_q);
4472 if (sc->
sc_debug & ATH_DEBUG_XMIT_DESC)
4473 ath_printtxbuf(sc, bf, txq->
axq_qnum, 0,
4475 else if ((sc->
sc_debug & ATH_DEBUG_RESET) && (dosched == 0))
4476 ath_printtxbuf(sc, bf, txq->
axq_qnum, 0,
4489 ATH_KTR(sc, ATH_KTR_TXCOMP, 3,
4490 "ath_tx_processq: txq=%u, bf=%p ds=%p, HAL_EINPROGRESS",
4501 device_printf(sc->
sc_dev,
4502 "%s: TXQ=%d: bf=%p, bfs_tx_queue=%d\n",
4509 device_printf(sc->
sc_dev,
4510 "%s: TXQ=%d: bf_last=%p, bfs_tx_queue=%d\n",
4539 ATH_KTR(sc, ATH_KTR_TXCOMP, 5,
4540 "ath_tx_processq: txq=%u, bf=%p, ds=%p, ni=%p, ts_status=0x%08x",
4565#ifdef IEEE80211_SUPPORT_SUPERG
4570 ieee80211_ff_flush(ic, txq->
axq_ac);
4580 ATH_KTR(sc, ATH_KTR_TXCOMP, 1,
4581 "ath_tx_processq: txq=%u: done",
4587#define TXQACTIVE(t, q) ( (t) & (1 << (q)))
4609 ATH_KTR(sc, ATH_KTR_TXCOMP, 1,
4610 "ath_tx_proc_q0: txqs=0x%08x", txqs);
4654 ATH_KTR(sc, ATH_KTR_TXCOMP, 1,
4655 "ath_tx_proc_q0123: txqs=0x%08x", txqs);
4710 ATH_KTR(sc, ATH_KTR_TXCOMP, 1,
"ath_tx_proc: txqs=0x%08x", txqs);
4752 device_printf(sc->
sc_dev,
4753 "%s: sc_inreset_cnt > 0; skipping\n", __func__);
4791 TAILQ_INSERT_TAIL(&sc->
sc_txbuf, bf, bf_list);
4794 device_printf(sc->
sc_dev,
4795 "%s: sc_txbuf_cnt > %d?\n",
4812 TAILQ_INSERT_HEAD(&sc->
sc_txbuf, bf, bf_list);
4815 device_printf(sc->
sc_dev,
4816 "%s: sc_txbuf_cnt > %d?\n",
4863 device_printf(sc->
sc_dev,
"%s: bf=%p: invalid tx queue (%d)\n",
4899 KASSERT((bf->
bf_node == NULL), (
"%s: bf->bf_node != NULL\n", __func__));
4900 KASSERT((bf->
bf_m == NULL), (
"%s: bf->bf_m != NULL\n", __func__));
4929 struct ieee80211_node *ni = bf->
bf_node;
4930 struct mbuf *m0 = bf->
bf_m;
4937 if (bf->
bf_m != NULL) {
4939 BUS_DMASYNC_POSTWRITE);
4950 ieee80211_tx_complete(ni, m0, status);
4964 bf = TAILQ_FIRST(&txq->
fifo.axq_q);
4972 device_printf(sc->
sc_dev,
4973 "%s: Q%d: fifo_depth=0, fifo.axq_depth=%d?\n",
4988 device_printf(sc->
sc_dev,
4989 "%s: Q%d: fifo_depth=%d, fifo.axq_depth=%d\n",
4999 bf = TAILQ_FIRST(&txq->axq_q);
5021 for (ix = 0;; ix++) {
5031 if (sc->
sc_debug & ATH_DEBUG_RESET) {
5032 struct ieee80211com *ic = &sc->
sc_ic;
5046 ath_printtxbuf(sc, bf, txq->
axq_qnum, ix, status);
5047 ieee80211_dump_pkt(ic, mtod(bf->
bf_m,
const uint8_t *),
5048 bf->
bf_m->m_len, 0, -1);
5090 "%s: tx queue [%u] %p, active=%d, hwpending=%d, flags 0x%08x, "
5091 "link %p, holdingbf=%p\n",
5106 if ((sc->
sc_debug & ATH_DEBUG_RESET)
5125 DPRINTF(sc, ATH_DEBUG_RESET,
"%s: tx queue [%u] %p, link %p\n",
5154 if (! (sc->
sc_debug & ATH_DEBUG_RESET))
5157 device_printf(sc->
sc_dev,
"%s: Q%d: begin\n",
5159 TAILQ_FOREACH(bf, &txq->axq_q, bf_list) {
5160 ath_printtxbuf(sc, bf, txq->
axq_qnum, i,
5165 device_printf(sc->
sc_dev,
"%s: Q%d: end\n",
5192 if (sc->
sc_debug & ATH_DEBUG_RESET)
5224 if (sc->
sc_debug & ATH_DEBUG_RESET) {
5226 if (bf != NULL && bf->
bf_m != NULL) {
5227 ath_printtxbuf(sc, bf, sc->
sc_bhalq, 0,
5230 ieee80211_dump_pkt(&sc->
sc_ic,
5231 mtod(bf->
bf_m,
const uint8_t *), bf->
bf_m->m_len,
5245 enum ieee80211_phymode mode;
5251 mode = ieee80211_chan2mode(chan);
5266 struct ieee80211com *ic = &sc->
sc_ic;
5275 taskqueue_block(sc->
sc_tq);
5284 device_printf(sc->
sc_dev,
"%s: concurrent reset! Danger!\n",
5293 DPRINTF(sc, ATH_DEBUG_RESET,
"%s: %u (%u MHz, flags 0x%x)\n",
5294 __func__, ieee80211_chan2ieee(ic, chan),
5295 chan->ic_freq, chan->ic_flags);
5323 device_printf(sc->
sc_dev,
"%s: unable to reset "
5324 "channel %u (%u MHz, flags 0x%x), hal status %u\n",
5325 __func__, ieee80211_chan2ieee(ic, chan),
5326 chan->ic_freq, chan->ic_flags, status);
5365 device_printf(sc->
sc_dev,
5366 "%s: unable to restart recv logic\n", __func__);
5382#ifdef IEEE80211_SUPPORT_TDMA
5420 struct ieee80211com *ic = &sc->
sc_ic;
5436 if (ic->ic_flags & IEEE80211_F_SCAN)
5443 DPRINTF(sc, ATH_DEBUG_CALIBRATE,
"%s: shortCal=%d; longCal=%d; aniCal=%d\n", __func__, shortCal, longCal, aniCal);
5458 DPRINTF(sc, ATH_DEBUG_CALIBRATE,
5459 "%s: rfgain change\n", __func__);
5482 if (shortCal || longCal) {
5493 "%s: calibration of channel %u failed\n",
5543 DPRINTF(sc, ATH_DEBUG_CALIBRATE,
"%s: next +%u (%sisCalDone)\n",
5544 __func__, nextcal, isCalDone ?
"" :
"!");
5547 DPRINTF(sc, ATH_DEBUG_CALIBRATE,
"%s: calibration disabled\n",
5578 DPRINTF(sc, ATH_DEBUG_STATE,
"%s: RX filter 0x%x bssid %s aid 0\n",
5579 __func__, rfilt, ether_sprintf(ieee80211broadcastaddr));
5601 DPRINTF(sc, ATH_DEBUG_STATE,
"%s: RX filter 0x%x bssid %s aid 0x%x\n",
5606#ifdef ATH_ENABLE_11N
5623ath_update_chw(
struct ieee80211com *ic)
5628 device_printf(sc->
sc_dev,
"%s: called\n", __func__);
5674 struct ieee80211_quiet_ie *q;
5675 struct ieee80211vap *vap = ni->ni_vap;
5677 struct ieee80211com *ic = vap->iv_ic;
5680 if (vap->iv_opmode != IEEE80211_M_STA)
5685 DPRINTF(sc, ATH_DEBUG_QUIETIE,
5686 "%s: called; NULL IE, disabling\n", __func__);
5694 if (ie[0] != IEEE80211_ELEMID_QUIET)
5706 if ((q->period == avp->
quiet_ie.period) &&
5707 (le16dec(&q->duration) == le16dec(&avp->
quiet_ie.duration)) &&
5708 (le16dec(&q->offset) == le16dec(&avp->
quiet_ie.offset)))
5711 DPRINTF(sc, ATH_DEBUG_QUIETIE,
5712 "%s: called; tbttcount=%d, period=%d, duration=%d, offset=%d\n",
5716 (
int) le16dec(&q->duration),
5717 (
int) le16dec(&q->offset));
5722 if ((le16dec(&q->duration) == 0) ||
5723 (le16dec(&q->duration) >= ni->ni_intval)) {
5724 DPRINTF(sc, ATH_DEBUG_QUIETIE,
5725 "%s: invalid duration (%d)\n", __func__,
5726 le16dec(&q->duration));
5733 if (le16dec(&q->duration) + le16dec(&q->offset) >= ni->ni_intval) {
5734 DPRINTF(sc, ATH_DEBUG_QUIETIE,
5735 "%s: invalid duration + offset (%d+%d)\n", __func__,
5736 le16dec(&q->duration),
5737 le16dec(&q->offset));
5740 if (q->tbttcount == 0) {
5741 DPRINTF(sc, ATH_DEBUG_QUIETIE,
5742 "%s: invalid tbttcount (0)\n", __func__);
5745 if (q->period == 0) {
5746 DPRINTF(sc, ATH_DEBUG_QUIETIE,
5747 "%s: invalid period (0)\n", __func__);
5755 if (q->tbttcount == 1) {
5756 DPRINTF(sc, ATH_DEBUG_QUIETIE,
5757 "%s: programming\n", __func__);
5759 q->period * ni->ni_intval,
5760 le16dec(&q->duration),
5761 le16dec(&q->offset) + ni->ni_intval,
5769 memcpy(&avp->
quiet_ie, ie,
sizeof(
struct ieee80211_quiet_ie));
5792 if (!sc->
sc_scanning && ic->ic_curchan == ic->ic_bsschan)
5804 struct ieee80211com *ic = this->iv_ic;
5805 struct ieee80211vap *vap;
5807 IEEE80211_LOCK_ASSERT(ic);
5809 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
5810 if (vap !=
this && vap->iv_state >= IEEE80211_S_RUN)
5817ath_newstate(
struct ieee80211vap *vap,
enum ieee80211_state nstate,
int arg)
5819 struct ieee80211com *ic = vap->iv_ic;
5823 struct ieee80211_node *ni = NULL;
5824 int i, error, stamode;
5826 int csa_run_transition = 0;
5827 enum ieee80211_state ostate = vap->iv_state;
5840 DPRINTF(sc, ATH_DEBUG_STATE,
"%s: %s -> %s\n", __func__,
5841 ieee80211_state_name[ostate],
5842 ieee80211_state_name[nstate]);
5851 IEEE80211_LOCK_ASSERT(ic);
5863 if (nstate != IEEE80211_S_SLEEP)
5878 if (ostate == IEEE80211_S_CSA && nstate == IEEE80211_S_RUN)
5879 csa_run_transition = 1;
5883 if (nstate == IEEE80211_S_SCAN) {
5901 taskqueue_unblock(sc->
sc_tq);
5904 ni = ieee80211_ref_node(vap->iv_bss);
5906 stamode = (vap->iv_opmode == IEEE80211_M_STA ||
5907 vap->iv_opmode == IEEE80211_M_AHDEMO ||
5908 vap->iv_opmode == IEEE80211_M_IBSS);
5914 if (stamode && nstate == IEEE80211_S_RUN) {
5916 IEEE80211_ADDR_COPY(sc->
sc_curbssid, ni->ni_bssid);
5919 DPRINTF(sc, ATH_DEBUG_STATE,
"%s: RX filter 0x%x bssid %s aid 0x%x\n",
5924 if (vap->iv_opmode != IEEE80211_M_STA &&
5925 (vap->iv_flags & IEEE80211_F_PRIVACY)) {
5926 for (i = 0; i < IEEE80211_WEP_NKID; i++)
5942 IEEE80211_LOCK_ASSERT(ic);
5994 if (nstate == IEEE80211_S_RUN) {
5996 ieee80211_free_node(ni);
5997 ni = ieee80211_ref_node(vap->iv_bss);
6000 "%s(RUN): iv_flags 0x%08x bintvl %d bssid %s "
6001 "capinfo 0x%04x chan %d\n", __func__,
6002 vap->iv_flags, ni->ni_intval, ether_sprintf(ni->ni_bssid),
6003 ni->ni_capinfo, ieee80211_chan2ieee(ic, ic->ic_curchan));
6005 switch (vap->iv_opmode) {
6006#ifdef IEEE80211_SUPPORT_TDMA
6007 case IEEE80211_M_AHDEMO:
6008 if ((vap->iv_caps & IEEE80211_C_TDMA) == 0)
6012 case IEEE80211_M_HOSTAP:
6013 case IEEE80211_M_IBSS:
6014 case IEEE80211_M_MBSS:
6045 if (vap->iv_opmode == IEEE80211_M_IBSS &&
6046 ni->ni_tstamp.tsf != 0) {
6049#ifdef IEEE80211_SUPPORT_TDMA
6050 if (vap->iv_caps & IEEE80211_C_TDMA)
6058 case IEEE80211_M_STA:
6078 if (ostate != IEEE80211_S_RUN &&
6079 ostate != IEEE80211_S_SLEEP) {
6081 if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) {
6083 "%s: STA; syncbeacon=1\n", __func__);
6085 if (csa_run_transition)
6104 if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) {
6109 case IEEE80211_M_MONITOR:
6117 case IEEE80211_M_WDS:
6149 DPRINTF(sc, ATH_DEBUG_CALIBRATE,
6150 "%s: calibration disabled\n", __func__);
6154 taskqueue_unblock(sc->
sc_tq);
6155 }
else if (nstate == IEEE80211_S_INIT) {
6170 taskqueue_block(sc->
sc_tq);
6184#ifdef IEEE80211_SUPPORT_TDMA
6187 }
else if (nstate == IEEE80211_S_SLEEP) {
6191 vap->iv_opmode == IEEE80211_M_STA) {
6224 }
else if (nstate == IEEE80211_S_SCAN) {
6242 DPRINTF(sc, ATH_DEBUG_CALIBRATE,
6243 "%s: calibration disabled\n", __func__);
6248 ieee80211_free_node(ni);
6271 struct ieee80211vap *vap = ni->ni_vap;
6272 struct ath_softc *sc = vap->iv_ic->ic_softc;
6273 ieee80211_keyix keyix, rxkeyix;
6276 if (!
ath_key_alloc(vap, &ni->ni_ucastkey, &keyix, &rxkeyix)) {
6285 ni->ni_ucastkey.wk_keyix = keyix;
6286 ni->ni_ucastkey.wk_rxkeyix = rxkeyix;
6288 ni->ni_ucastkey.wk_flags |= IEEE80211_KEY_DEVKEY;
6289 IEEE80211_ADDR_COPY(ni->ni_ucastkey.wk_macaddr, ni->ni_macaddr);
6291 ath_keyset(sc, vap, &ni->ni_ucastkey, vap->iv_bss);
6304 struct ieee80211vap *vap = ni->ni_vap;
6305 struct ath_softc *sc = vap->iv_ic->ic_softc;
6306 const struct ieee80211_txparam *tp = ni->ni_txparms;
6311 DPRINTF(sc, ATH_DEBUG_NODE,
"%s: %6D: reassoc; isnew=%d, is_powersave=%d\n",
6323 (vap->iv_flags & IEEE80211_F_PRIVACY) == 0 && sc->
sc_hasclrkey &&
6324 ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE)
6338 "%s: %6D: reassoc; is_powersave=%d\n",
6355 int nchans,
struct ieee80211_channel chans[])
6361 DPRINTF(sc, ATH_DEBUG_REGDOMAIN,
6362 "%s: rd %u cc %u location %c%s\n",
6363 __func__, reg->regdomain, reg->country, reg->location,
6364 reg->ecm ?
" ecm" :
"");
6367 reg->country, reg->regdomain);
6369 DPRINTF(sc, ATH_DEBUG_REGDOMAIN,
"%s: failed, status %u\n",
6379 int maxchans,
int *nchans,
struct ieee80211_channel chans[])
6384 DPRINTF(sc, ATH_DEBUG_REGDOMAIN,
"%s: use rd %u cc %d\n",
6385 __func__, SKU_DEBUG, CTRY_DEFAULT);
6396 struct ieee80211com *ic = &sc->
sc_ic;
6406 device_printf(sc->
sc_dev,
6407 "%s: unable to collect channel list from hal, status %d\n",
6415 ic->ic_regdomain.regdomain = (uint16_t) sc->
sc_eerd;
6416 ic->ic_regdomain.country = (uint16_t) sc->
sc_eecc;
6417 ic->ic_regdomain.isocc[0] =
' ';
6418 ic->ic_regdomain.isocc[1] =
' ';
6420 ic->ic_regdomain.ecm = 1;
6421 ic->ic_regdomain.location =
'I';
6423 DPRINTF(sc, ATH_DEBUG_REGDOMAIN,
6424 "%s: eeprom rd %u cc %u (mapped rd %u cc %u) location %c%s\n",
6426 ic->ic_regdomain.regdomain, ic->ic_regdomain.country,
6427 ic->ic_regdomain.location, ic->ic_regdomain.ecm ?
" ecm" :
"");
6438 case IEEE80211_MODE_11A:
6441 case IEEE80211_MODE_HALF:
6444 case IEEE80211_MODE_QUARTER:
6447 case IEEE80211_MODE_11B:
6450 case IEEE80211_MODE_11G:
6453 case IEEE80211_MODE_TURBO_A:
6456 case IEEE80211_MODE_TURBO_G:
6459 case IEEE80211_MODE_STURBO_A:
6462 case IEEE80211_MODE_11NA:
6465 case IEEE80211_MODE_11NG:
6469 DPRINTF(sc, ATH_DEBUG_ANY,
"%s: invalid mode %u\n",
6474 return (rt != NULL);
6481 static const struct {
6507 KASSERT(rt != NULL, (
"no h/w rate set for phy mode %u", mode));
6509 uint8_t ieeerate = rt->
info[i].
dot11Rate & IEEE80211_RATE_VAL;
6510 if (rt->
info[i].
phy != IEEE80211_T_HT)
6513 sc->
sc_rixmap[ieeerate | IEEE80211_RATE_MCS] = i;
6516 for (i = 0; i < nitems(sc->
sc_hwmap); i++) {
6524 if (rt->
info[i].
phy == IEEE80211_T_HT)
6528 rt->
info[i].
phy == IEEE80211_T_OFDM)
6531 for (j = 0; j < nitems(blinkrates)-1; j++)
6545 if (mode == IEEE80211_MODE_11G)
6556 struct ieee80211com *ic = &sc->
sc_ic;
6568 device_printf(sc->
sc_dev,
"%s hang detected (0x%x)\n",
6569 hangs & 0xff ?
"bb" :
"mac", hangs);
6571 device_printf(sc->
sc_dev,
"device timeout\n");
6573 counter_u64_add(ic->ic_oerrors, 1);
6589 callout_schedule(&sc->
sc_wd_ch, hz);
6596 int error = EDOOFUS;
6599 if (ic->ic_nrunning > 0) {
6634 ieee80211_start_all(ic);
6646 device_printf(sc->
sc_dev,
"%s mac %d.%d RF%s phy %d.%d\n",
6649 device_printf(sc->
sc_dev,
"2GHz radio: 0x%.4x; 5GHz radio: 0x%.4x\n",
6653 for (i = 0; i <= WME_AC_VO; i++) {
6655 device_printf(sc->
sc_dev,
6656 "Use hw queue %u for %s traffic\n",
6657 txq->
axq_qnum, ieee80211_wme_acnames[i]);
6659 device_printf(sc->
sc_dev,
"Use hw queue %u for CAB traffic\n",
6661 device_printf(sc->
sc_dev,
"Use hw queue %u for beacons\n",
6669 device_printf(sc->
sc_dev,
"using multicast key search\n");
6676 struct ieee80211com *ic = &sc->
sc_ic;
6700 ieee80211_dfs_notify_radar(ic, sc->
sc_curchan);
6701 IEEE80211_UNLOCK(ic);
6716 struct ieee80211com *ic = ni->ni_ic;
6722 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: %6D: enable=%d\n",
6783 struct ieee80211com *ic = ni->ni_ic;
6819 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
6820 "%s: %6D: enable=%d, tim_set=1, ignoring\n",
6826 }
else if (enable) {
6827 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
6828 "%s: %6D: enable=%d, enabling TIM\n",
6838 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
6839 "%s: %6D: enable=%d, an_swq_depth == 0, disabling\n",
6851 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
6852 "%s: %6D: enable=%d, an_pwrsave=0, disabling\n",
6867 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
6868 "%s: %6D: enable=%d, an_swq_depth > 0, ignoring\n",
6940 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
6941 "%s: %6D: swq_depth>0, tim_set=0, set!\n",
6959 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
6960 "%s: %6D: swq_depth=0, tim_set=1, psq_set=0,"
6988 struct ieee80211com *ic = ni->ni_ic;
6999 if (ni->ni_associd == 0)
7041 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
7042 "%s: %6D: not in powersave?\n",
7067 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
7068 "%s: %6D: SWQ empty; punting to net80211\n",
7080 for (tid = IEEE80211_TID_SIZE - 1; tid >= 0; tid--) {
7095 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
7096 "%s: %6D: leaking frame to TID %d\n",
7109 DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
7110 "%s: %6D: TIDs empty, but ath_node showed traffic?!\n",
7125#if defined(IEEE80211_ALQ) || defined(AH_DEBUG_ALQ) || defined(ATH_DEBUG_ALQ)
void ath_hal_process_noisefloor(struct ath_hal *ah)
void ath_hal_setcca(struct ath_hal *ah, int ena)
struct ath_hal * ath_hal_attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_OPS_CONFIG *ah_config, HAL_STATUS *error)
const char * ath_hal_mac_name(struct ath_hal *ah)
u_int ath_hal_getwirelessmodes(struct ath_hal *ah)
const char * ath_hal_rf_name(struct ath_hal *ah)
@ HAL_MODE_11A_QUARTER_RATE
HAL_STATUS __ahdecl ath_hal_set_channels(struct ath_hal *, struct ieee80211_channel *chans, int nchans, HAL_CTRY_CODE cc, HAL_REG_DOMAIN regDmn)
#define HAL_NUM_TX_QUEUES
@ HAL_CAP_ENTERPRISE_MODE
@ HAL_TXQ_TXDESCINT_ENABLE
@ HAL_TXQ_ARB_LOCKOUT_GLOBAL
@ HAL_TXQ_TXERRINT_ENABLE
@ HAL_TXQ_TXURNINT_ENABLE
@ HAL_TXQ_TXEOLINT_ENABLE
@ HAL_TXQ_BACKOFF_DISABLE
HAL_STATUS __ahdecl ath_hal_getchannels(struct ath_hal *, struct ieee80211_channel *chans, u_int maxchans, int *nchans, u_int modeSelect, HAL_CTRY_CODE cc, HAL_REG_DOMAIN regDmn, HAL_BOOL enableExtendedChannels)
#define HAL_TXQ_USEDEFAULT
HAL_STATUS __ahdecl ath_hal_init_channels(struct ath_hal *, struct ieee80211_channel *chans, u_int maxchans, int *nchans, u_int modeSelect, HAL_CTRY_CODE cc, HAL_REG_DOMAIN rd, HAL_BOOL enableExtendedChannels)
@ HAL_QUIET_ADD_CURRENT_TSF
#define HAL_TXERR_TIMER_EXPIRED
#define HAL_TX_DESC_CFG_ERR
#define HAL_TX_DELIM_UNDERRUN
#define HAL_TX_DATA_UNDERRUN
#define IEEE80211_ADDR_LEN
void ath_rate_node_init(struct ath_softc *sc, struct ath_node *an)
void ath_rate_newassoc(struct ath_softc *sc, struct ath_node *an, int isnew)
void ath_rate_detach(struct ath_ratectrl *arc)
struct ath_ratectrl * ath_rate_attach(struct ath_softc *sc)
void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, const struct ath_rc_series *rc, const struct ath_tx_status *ts, int frame_size, int rc_framesize, int nframes, int nbad)
void ath_rate_node_cleanup(struct ath_softc *sc, struct ath_node *an)
int ath_dfs_attach(struct ath_softc *sc)
int ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan)
int ath_dfs_detach(struct ath_softc *sc)
int ath_dfs_process_radar_event(struct ath_softc *sc, struct ieee80211_channel *chan)
int ath_tx_findrix(const struct ath_softc *sc, uint8_t rate)
void _ath_power_set_power_state(struct ath_softc *sc, int power_state, const char *file, int line)
int ath_hal_gethangstate(struct ath_hal *ah, uint32_t mask, uint32_t *hangs)
static struct ath_buf * ath_tx_draintxq_get_one(struct ath_softc *sc, struct ath_txq *txq)
static void ath_tx_proc(void *, int)
void ath_setslottime(struct ath_softc *sc)
static void ath_txq_init(struct ath_softc *sc, struct ath_txq *, int)
static int ath_longcalinterval
MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers")
int ath_detach(struct ath_softc *sc)
static void ath_tx_cleanup(struct ath_softc *)
void ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_rc_series *rc, struct ath_tx_status *ts, int frmlen, int rc_framelen, int nframes, int nbad)
static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *)
static void reclaim_address(struct ath_softc *sc, const uint8_t mac[IEEE80211_ADDR_LEN])
static void ath_set_channel(struct ieee80211com *)
MODULE_VERSION(ath_main, 1)
static void ath_setup_stationkey(struct ieee80211_node *)
void ath_shutdown(struct ath_softc *sc)
void _ath_power_set_selfgen(struct ath_softc *sc, int power_state, const char *file, int line)
void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
static void ath_bstuck_proc(void *, int)
static void ath_txrx_stop_locked(struct ath_softc *sc)
void ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf, int status)
static int ath_transmit(struct ieee80211com *, struct mbuf *)
void ath_legacy_attach_comp_func(struct ath_softc *sc)
static void ath_key_update_begin(struct ieee80211vap *)
static void ath_tx_proc_q0(void *, int)
struct ath_buf * ath_buf_clone(struct ath_softc *sc, struct ath_buf *bf)
static void ath_node_powersave(struct ieee80211_node *, int)
void ath_mode_init(struct ath_softc *sc)
static void ath_fatal_proc(void *, int)
MODULE_DEPEND(ath_main, wlan, 1, 1, 1)
static void ath_getradiocaps(struct ieee80211com *, int, int *, struct ieee80211_channel[])
static int ath_setregdomain(struct ieee80211com *, struct ieee80211_regdomain *, int, struct ieee80211_channel[])
static void ath_node_recv_pspoll(struct ieee80211_node *, struct mbuf *)
static void ath_vap_delete(struct ieee80211vap *)
static void ath_scan_start(struct ieee80211com *)
static void ath_watchdog(void *)
static void ath_update_mcast_hw(struct ath_softc *)
static void ath_tx_proc_q0123(void *, int)
static void ath_key_update_end(struct ieee80211vap *)
static int ath_txq_update(struct ath_softc *sc, int ac)
static void ath_node_free(struct ieee80211_node *)
static void ath_parent(struct ieee80211com *)
static void ath_node_cleanup(struct ieee80211_node *)
void ath_resume(struct ath_softc *sc)
static void ath_setup_hal_config(struct ath_softc *sc, HAL_OPS_CONFIG *ah_config)
static void ath_update_chainmasks(struct ath_softc *sc, struct ieee80211_channel *chan)
struct ath_buf * ath_getbuf(struct ath_softc *sc, ath_buf_type_t btype)
static int ath_shortcalinterval
static void assign_address(struct ath_softc *sc, uint8_t mac[IEEE80211_ADDR_LEN], int clone)
static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode)
static void ath_stop(struct ath_softc *)
static int ath_anicalinterval
static struct ieee80211_node * ath_node_alloc(struct ieee80211vap *, const uint8_t[IEEE80211_ADDR_LEN])
void _ath_power_restore_power_state(struct ath_softc *sc, const char *file, int line)
static void ath_scan_end(struct ieee80211com *)
static void ath_tsfoor_proc(void *, int)
static void ath_newassoc(struct ieee80211_node *, int)
static int ath_newstate(struct ieee80211vap *, enum ieee80211_state, int)
void ath_txq_freeholdingbuf(struct ath_softc *sc, struct ath_txq *txq)
void ath_tx_default_comp(struct ath_softc *sc, struct ath_buf *bf, int fail)
static void ath_node_getsignal(const struct ieee80211_node *, int8_t *, int8_t *)
SYSCTL_INT(_hw_ath, OID_AUTO, longcal, CTLFLAG_RW, &ath_longcalinterval, 0, "long chip calibration interval (secs)")
int ath_wme_update(struct ieee80211com *ic)
int ath_reset(struct ath_softc *sc, ATH_RESET_TYPE reset_type, HAL_RESET_TYPE ah_reset_type)
static void ath_reset_keycache(struct ath_softc *sc)
static int ath_isanyrunningvaps(struct ieee80211vap *this)
static struct ieee80211vap * ath_vap_create(struct ieee80211com *, const char[IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t[IEEE80211_ADDR_LEN], const uint8_t[IEEE80211_ADDR_LEN])
static int ath_tx_setup(struct ath_softc *, int, int)
static void ath_txrx_start(struct ath_softc *sc)
void _ath_power_setpower(struct ath_softc *sc, int power_state, int selfgen, const char *file, int line)
#define MAX_TXRX_ITERATIONS
static void ath_bmiss_proc(void *, int)
static int ath_set_quiet_ie(struct ieee80211_node *, uint8_t *)
static int ath_getchannels(struct ath_softc *)
static int ath_reset_grablock(struct ath_softc *sc, int dowait)
static void ath_announce(struct ath_softc *)
static void ath_updateslot(struct ieee80211com *)
void ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni, int enable)
static void ath_settkipmic(struct ath_softc *sc)
void ath_returnbuf_tail(struct ath_softc *sc, struct ath_buf *bf)
static int ath_desc_alloc(struct ath_softc *)
static int assign_bslot(struct ath_softc *sc)
static u_int ath_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
static void ath_vap_clear_quiet_ie(struct ath_softc *sc)
static int ath_resetcalinterval
static int ath_init(struct ath_softc *)
static void ath_update_promisc(struct ieee80211com *)
static void ath_update_mcast(struct ieee80211com *)
static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *)
int ath_stoptxdma(struct ath_softc *sc)
static void ath_txq_sched_tasklet(void *, int)
void ath_suspend(struct ath_softc *sc)
#define ATH_EXPONENT_TO_VALUE(v)
struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc, ath_buf_type_t btype)
int ath_attach(u_int16_t devid, struct ath_softc *sc)
static void ath_dfs_tasklet(void *, int)
#define MAX_RESET_ITERATIONS
static void ath_txq_addholdingbuf(struct ath_softc *sc, struct ath_buf *bf)
static int ath_reset_vap(struct ieee80211vap *, u_long)
static int ath_rate_setup(struct ath_softc *, u_int mode)
static int ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched)
static struct ath_txq * ath_txq_setup(struct ath_softc *, int qtype, int subtype)
static int ath_fetch_mac_kenv(struct ath_softc *sc, uint8_t *macaddr)
void ath_setdefantenna(struct ath_softc *sc, u_int antenna)
void ath_txqmove(struct ath_txq *dst, struct ath_txq *src)
static void ath_desc_free(struct ath_softc *)
static void ath_tx_stopdma(struct ath_softc *sc, struct ath_txq *txq)
void ath_freebuf(struct ath_softc *sc, struct ath_buf *bf)
void ath_tx_process_buf_completion(struct ath_softc *sc, struct ath_txq *txq, struct ath_tx_status *ts, struct ath_buf *bf)
static void ath_reset_proc(void *, int)
void ath_legacy_tx_drain(struct ath_softc *sc, ATH_RESET_TYPE reset_type)
static int ath_node_set_tim(struct ieee80211_node *, int)
static void ath_tx_cleanupq(struct ath_softc *, struct ath_txq *)
void ath_returnbuf_head(struct ath_softc *sc, struct ath_buf *bf)
static void ath_bmiss_vap(struct ieee80211vap *)
static void ath_calibrate(void *)
static void ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, struct ath_buf *bf)
#define ATH_ALQ_EDMA_TXSTATUS
void if_ath_alq_tidyup(struct if_ath_alq *alq)
void if_ath_alq_init(struct if_ath_alq *alq, const char *devname)
#define ATH_ALQ_STUCK_BEACON
void if_ath_alq_setcfg(struct if_ath_alq *alq, uint32_t macVer, uint32_t macRev, uint32_t phyRev, uint32_t halMagic)
static int if_ath_alq_checkdebug(struct if_ath_alq *alq, uint16_t op)
static void if_ath_alq_post_intr(struct if_ath_alq *alq, uint32_t status, uint32_t *state, uint32_t sync_state)
void if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, uint16_t len, const char *buf)
void ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap)
void ath_beacon_update(struct ieee80211vap *vap, int item)
void ath_beacon_miss(struct ath_softc *sc)
void ath_beacon_free(struct ath_softc *sc)
int ath_beaconq_setup(struct ath_softc *sc)
int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni)
void ath_beacon_return(struct ath_softc *sc, struct ath_buf *bf)
void ath_beacon_proc(void *arg, int pending)
int ath_btcoex_detach(struct ath_softc *sc)
int ath_btcoex_enable(struct ath_softc *sc, const struct ieee80211_channel *chan)
int ath_btcoex_attach(struct ath_softc *sc)
void ath_btcoex_mci_intr(struct ath_softc *sc)
#define ATH_KTR(_sc, _km, _kf,...)
#define DPRINTF(sc, m, fmt,...)
void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head)
int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, int ds_size, int nbuf, int ndesc)
int ath_ioctl(struct ieee80211com *ic, u_long cmd, void *data)
int ath_keyset(struct ath_softc *sc, struct ieee80211vap *vap, const struct ieee80211_key *k, struct ieee80211_node *bss)
int ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix)
int ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k)
int ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k)
void ath_led_config(struct ath_softc *sc)
void ath_led_event(struct ath_softc *sc, int rix)
int ath_lna_div_detach(struct ath_softc *sc)
int ath_lna_div_attach(struct ath_softc *sc)
#define ath_power_restore_power_state(sc)
#define ath_power_setpower(sc, ps, sg)
void ath_tx_dump(struct ath_softc *sc, struct ath_txq *txq)
#define ath_power_set_power_state(sc, ps)
static void ath_tx_kick(struct ath_softc *sc)
#define ath_power_setselfgen(sc, ps)
u_int32_t ath_calcrxfilter(struct ath_softc *sc)
void ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf)
void ath_recv_setup_legacy(struct ath_softc *sc)
#define ath_rxdma_setup(_sc)
#define ath_rx_flush(_sc)
#define ath_startrecv(_sc)
#define ath_rxdma_teardown(_sc)
#define ath_stoprecv(_sc, _dodelay)
void ath_recv_setup_edma(struct ath_softc *sc)
int ath_spectral_enable(struct ath_softc *sc, struct ieee80211_channel *ch)
int ath_spectral_detach(struct ath_softc *sc)
int ath_spectral_attach(struct ath_softc *sc)
void ath_sysctl_hal_attach(struct ath_softc *sc)
void ath_sysctl_stats_attach(struct ath_softc *sc)
void ath_sysctlattach(struct ath_softc *sc)
void ath_tdma_update(struct ieee80211_node *ni, const struct ieee80211_tdma_param *tdma, int changed)
void ath_tdma_beacon_send(struct ath_softc *sc, struct ieee80211vap *vap)
void ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap)
void ath_tx_txq_drain(struct ath_softc *sc, struct ath_txq *txq)
int ath_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, const struct ieee80211_bpf_params *params)
int ath_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int dialogtoken, int baparamset, int batimeout)
void ath_txq_sched(struct ath_softc *sc, struct ath_txq *txq)
void ath_tx_node_sleep(struct ath_softc *sc, struct ath_node *an)
void ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status)
void ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
void ath_tx_node_reassoc(struct ath_softc *sc, struct ath_node *an)
void ath_addba_response_timeout(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
int ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0)
void ath_xmit_setup_legacy(struct ath_softc *sc)
void ath_tx_node_wakeup(struct ath_softc *sc, struct ath_node *an)
void ath_tx_tid_init(struct ath_softc *sc, struct ath_node *an)
void ath_txfrag_cleanup(struct ath_softc *sc, ath_bufhead *frags, struct ieee80211_node *ni)
void ath_tx_node_flush(struct ath_softc *sc, struct ath_node *an)
void ath_tx_tid_sched(struct ath_softc *sc, struct ath_tid *tid)
int ath_txfrag_setup(struct ath_softc *sc, ath_bufhead *frags, struct mbuf *m0, struct ieee80211_node *ni)
int ath_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status, int code, int batimeout)
#define ath_txq_restart_dma(_sc, _txq)
#define ATH_AGGR_SCHED_LOW
#define ath_txdma_teardown(_sc)
#define ATH_AGGR_MIN_QDEPTH
#define ath_draintxq(_sc, _rtype)
#define ath_txdma_setup(_sc)
#define ATH_AGGR_SCHED_HIGH
#define ATH_NONAGGR_MIN_QDEPTH
void ath_xmit_setup_edma(struct ath_softc *sc)
#define ATH_TX_RADIOTAP_PRESENT
#define ATH_IOCTL_STATS_NUM_TX_ANTENNA
#define ATH_RX_RADIOTAP_PRESENT
#define ath_hal_getmcastkeysearch(_ah)
#define ath_hal_getfatalstate(_ah, _outdata, _outsize)
#define ath_hal_gpioset(_ah, _gpio, _b)
#define ath_hal_detach(_ah)
#define ath_hal_setbssidmask(_ah, _mask)
#define ath_hal_hwphycounters(_ah)
#define ath_hal_haswmetkipmic(_ah)
#define ath_hal_calreset(_ah, _chan)
#define ath_hal_gettpc(_ah)
#define ath_hal_get_tx_tsf_prec(_ah, _pr)
#define ATH_PCI_AR9565_1ANT
#define ath_hal_setassocid(_ah, _bss, _associd)
#define ath_hal_getratetable(_ah, _mode)
#define ath_hal_phydisable(_ah)
#define ath_hal_keyisvalid(_ah, _ix)
#define ath_hal_getcountrycode(_ah, _pcc)
#define ATH_BUF_FLAGS_CLONE
#define ATH_PCI_BT_ANT_DIV
#define ATH_TXQ_LOCK_DESTROY(_tq)
#define ath_hal_hasenforcetxop(_ah)
#define ath_hal_setmcastfilter(_ah, _mfilt0, _mfilt1)
#define ath_hal_settkipmic(_ah, _v)
#define ath_hal_setenforcetxop(_ah, _v)
#define ath_hal_txqenabled(_ah, _qnum)
#define ath_hal_numtxpending(_ah, _q)
#define ATH_PCI_AR9565_2ANT
#define ATH_PCU_UNLOCK_ASSERT(_sc)
#define ath_hal_mibevent(_ah, _stats)
#define ATH_TXQ_REMOVE(_tq, _elm, _field)
#define ath_hal_getregdomain(_ah, _prd)
#define ath_hal_keyreset(_ah, _ix)
#define ath_hal_setledstate(_ah, _state)
#define ath_hal_getchannoise(_ah, _c)
#define ATH_TXBUF_LOCK(_sc)
#define ath_hal_settxpowlimit(_ah, _pow)
#define ath_hal_gettxchainmask(_ah, _ptxchainmask)
#define ATH_PCI_D3_L1_WAR
#define ath_hal_ani_poll(_ah, _chan)
#define ath_hal_gettxqueueprops(_ah, _q, _qi)
#define ath_hal_setrxchainmask(_ah, _rx)
#define ath_hal_hasbssidmask(_ah)
#define ath_hal_calibrateN(_ah, _chan, _lcal, _isdone)
#define ath_hal_settxqueueprops(_ah, _q, _qi)
#define ath_hal_hasedma(_ah)
#define ath_hal_setchainmasks(_ah, _txchainmask, _rxchainmask)
#define ATH_TXQ_LAST(_tq, _field)
#define ath_hal_reset(_ah, _opmode, _chan, _fullreset, _resettype, _pstatus)
#define ath_hal_enablepcie(_ah, _restore, _poweroff)
#define ath_hal_gettxintrtxqs(_ah, _txqs)
#define ath_hal_setmcastkeysearch(_ah, _v)
#define ATH_NODE_LOCK(_an)
#define ATH_TXQ_LOCK_ASSERT(_tq)
#define ath_hal_hastsfadjust(_ah)
#define ath_hal_getdiversity(_ah)
#define ATH_NODE_UNLOCK(_an)
#define ATH_TXQ_SETUP(sc, i)
#define ATH_UNLOCK_ASSERT(_sc)
#define ath_hal_settsfadjust(_ah, _onoff)
#define ATH_PCU_UNLOCK(_sc)
#define ath_hal_hasveol(_ah)
#define ath_hal_hasfastframes(_ah)
#define ath_hal_gettxbuf(_ah, _q)
#define ATH_TX_LOCK_ASSERT(_sc)
#define ath_hal_releasetxqueue(_ah, _q)
#define ath_hal_setselfgenpower(_ah, _mode)
#define ath_hal_hastpc(_ah)
#define ath_hal_getrxchainmask(_ah, _prxchainmask)
#define ath_hal_hasdivantcomb(_ah)
#define ath_hal_intrset(_ah, _mask)
#define ath_hal_setupxtxdesc(_ah, _ds, _txr1, _txtr1, _txr2, _txtr2, _txr3, _txtr3)
#define ATH_TXBUF_LOCK_ASSERT(_sc)
#define ath_hal_self_linked_final_rxdesc(_ah)
#define ATH_TXQ_LOCK(_tq)
#define ath_hal_keycachesize(_ah)
#define ATH_RSSI_LPF(x, y)
#define ath_hal_setslottime(_ah, _us)
#define ath_hal_set_quiet(_ah, _p, _d, _o, _f)
#define ATH_TXQ_LOCK_INIT(_sc, _tq)
#define ATH_TXQ_UNLOCK(_tq)
#define ath_hal_gettsf64(_ah)
#define ath_hal_hasbursting(_ah)
#define ATH_TX_UNLOCK(_sc)
#define ATH_TX_UNLOCK_ASSERT(_sc)
#define ath_hal_stoptxdma(_ah, _qnum)
#define ath_hal_getcapability(_ah, _cap, _param, _result)
#define ath_hal_setrxfilter(_ah, _filter)
#define ath_hal_updatetxtriglevel(_ah, _inc)
#define ath_hal_hastkipsplit(_ah)
#define ath_hal_gtxto_supported(_ah)
#define ATH_TXBUF_LOCK_DESTROY(_sc)
#define ATH_LOCK_ASSERT(_sc)
#define ATH_RSSI_DUMMY_MARKER
#define ATH_TXQ_UNLOCK_ASSERT(_tq)
#define ath_hal_getrfgain(_ah)
#define ath_hal_intrpend(_ah)
#define ath_hal_ciphersupported(_ah, _cipher)
#define ath_hal_get_rx_tsf_prec(_ah, _pr)
#define ATH_PCU_LOCK_ASSERT(_sc)
#define ath_hal_hasmcastkeysearch(_ah)
#define ath_hal_hasrxlnamixer(_ah)
#define ath_hal_setopmode(_ah)
#define ath_hal_resettxqueue(_ah, _q)
#define ath_hal_getmac(_ah, _mac)
#define ath_hal_hastxpowlimit(_ah)
#define ath_hal_txprocdesc(_ah, _ds, _ts)
#define ATH_PCU_LOCK(_sc)
#define ath_hal_getdefantenna(_ah)
#define ath_hal_getdiagstate(_ah, _id, _indata, _insize, _outdata, _outsize)
#define ath_hal_macversion(_ah)
#define ath_hal_getbssidmask(_ah, _mask)
#define ath_hal_settxchainmask(_ah, _tx)
#define ATH_TXBUF_LOCK_INIT(_sc)
#define ath_hal_gettxdesclinkptr(_ah, _ds, _linkptr)
#define ATH_TXBUF_UNLOCK_ASSERT(_sc)
#define ath_hal_setmac(_ah, _mac)
#define ath_hal_hasmybeacon(_ah)
#define ath_hal_setuptxqueue(_ah, _type, _irq)
#define ATH_NODE_UNLOCK_ASSERT(_an)
#define ath_hal_setpower(_ah, _mode)
#define ath_hal_hasbssidmatch(_ah)
#define ATH_TXBUF_UNLOCK(_sc)
#define ATH_RX_UNLOCK(_sc)
#define ath_hal_setdefantenna(_ah, _ant)
#define ath_hal_settkipsplit(_ah, _v)
#define ath_hal_getisr(_ah, _pmask)
#define ath_hal_keysetmac(_ah, _ix, _mac)
int ath_hal_ext_atten_margin_cfg
int ath_hal_ant_ctrl_comm2g_switch_enable
int ath_hal_ext_lna_ctl_gpio
struct HAL_RATE_TABLE::@3 info[64]
HAL_TX_QUEUE_SUBTYPE tqi_subtype
HAL_TX_QUEUE_FLAGS tqi_qflags
struct ath_desc_status bf_status
void(* bf_comp)(struct ath_softc *sc, struct ath_buf *bf, int fail)
struct ath_desc * bf_lastds
struct ath_rc_series bfs_rc[ATH_RC_NUM]
struct ath_buf::@32 bf_state
struct ieee80211_node * bf_node
uint16_t ah_analog2GhzRev
uint16_t ah_analog5GhzRev
u_int32_t sync_intr[ATH_IOCTL_INTR_NUM_SYNC_INTR]
struct ath_tid an_tid[IEEE80211_TID_SIZE]
struct ieee80211_node an_node
HAL_NODE_STATS an_node_stats
void(* recv_tasklet)(void *arg, int npending)
void(* recv_sched)(struct ath_softc *sc, int dosched)
void(* sc_addba_stop)(struct ieee80211_node *, struct ieee80211_tx_ampdu *)
struct ath_txq * sc_ac2q[5]
u_int8_t sc_keymap[ATH_KEYBYTES]
void(* sc_setdefantenna)(struct ath_softc *, u_int)
const HAL_RATE_TABLE * sc_currates
struct ath_intr_stats sc_intr_stats
HAL_POWER_MODE sc_target_powerstate
enum ieee80211_phymode sc_curmode
HAL_NODE_STATS sc_halstats
struct callout sc_ledtimer
const HAL_RATE_TABLE * sc_rates[IEEE80211_MODE_MAX]
int(* sc_addba_request)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int, int, int)
HAL_POWER_MODE sc_cur_powerstate
ath_bufhead sc_txbuf_mgmt
int sc_txq_node_psq_maxdepth
uint32_t sc_cur_rxchainmask
int sc_txq_mcastq_maxdepth
struct ath_stats sc_stats
uint32_t sc_rts_aggr_limit
struct ieee80211vap * sc_bslot[ATH_BCBUF]
u_int8_t sc_hwbssidmask[IEEE80211_ADDR_LEN]
struct ath_tx_radiotap_header sc_tx_th
u_int32_t sc_hasenforcetxop
uint32_t sc_cur_txchainmask
enum ath_softc::@35 sc_updateslot
void(* sc_node_cleanup)(struct ieee80211_node *)
ath_bufhead sc_rx_rxlist[HAL_NUM_RX_QUEUES]
struct task sc_bstucktask
int(* sc_addba_response)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int, int, int)
void(* sc_bar_response)(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status)
struct ath_descdma sc_txdma_mgmt
struct ath_tx99 * sc_tx99
struct task sc_tsfoortask
struct ath_softc::@34 sc_hwmap[32]
struct ath_rx_methods sc_rx
struct ath_txq sc_txq[HAL_NUM_TX_QUEUES]
struct ath_descdma sc_bdma
u_int8_t sc_curbssid[IEEE80211_ADDR_LEN]
struct ath_descdma sc_txdma
u_int32_t sc_ant_tx[ATH_IOCTL_STATS_NUM_TX_ANTENNA]
struct ath_tx_methods sc_tx
struct ieee80211_channel * sc_curchan
struct ath_ratectrl * sc_rc
void(* sc_addba_response_timeout)(struct ieee80211_node *, struct ieee80211_tx_ampdu *)
struct ieee80211com sc_ic
struct ath_rx_radiotap_header sc_rx_th
HAL_POWER_MODE sc_target_selfgen_state
void(* sc_node_free)(struct ieee80211_node *)
u_int32_t ast_per_calfail
u_int32_t ast_tx_desccfgerr
u_int32_t ast_tx_data_underrun
u_int32_t ast_bmiss_phantom
u_int32_t ast_tx_filtered
u_int32_t ast_tx_xretries
u_int32_t ast_tx_getnobuf
u_int32_t ast_tx_longretry
u_int32_t ast_tx_nodeq_overflow
u_int32_t ast_ant_defswitch
u_int32_t ast_tx_delim_underrun
u_int32_t ast_tx_timerexpired
u_int32_t ast_ant_tx[ATH_IOCTL_STATS_NUM_TX_ANTENNA]
u_int32_t ast_tx_shortretry
u_int32_t ast_tx_getbusybuf
void(* xmit_attach_comp_func)(struct ath_softc *sc)
struct ath_softc * axq_softc
struct ath_buf * axq_holdingbf
void(* av_recv_pspoll)(struct ieee80211_node *, struct mbuf *)
void(* av_recv_mgmt)(struct ieee80211_node *, struct mbuf *, int, const struct ieee80211_rx_stats *, int, int)
void(* av_node_ps)(struct ieee80211_node *, int)
int(* av_set_tim)(struct ieee80211_node *, int)
struct ieee80211_quiet_ie quiet_ie
int(* av_newstate)(struct ieee80211vap *, enum ieee80211_state, int)
struct ieee80211vap av_vap
struct ath_buf * av_bcbuf
void(* av_bmiss)(struct ieee80211vap *)