Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ral/rt2860.c
Show First 20 Lines • Show All 1,077 Lines • ▼ Show 20 Lines | rt2860_intr_coherent(struct rt2860_softc *sc) | ||||
RAL_WRITE(sc, RT2860_WPDMA_GLO_CFG, tmp); | RAL_WRITE(sc, RT2860_WPDMA_GLO_CFG, tmp); | ||||
(void)rt2860_txrx_enable(sc); | (void)rt2860_txrx_enable(sc); | ||||
} | } | ||||
static void | static void | ||||
rt2860_drain_stats_fifo(struct rt2860_softc *sc) | rt2860_drain_stats_fifo(struct rt2860_softc *sc) | ||||
{ | { | ||||
struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; | |||||
struct ieee80211_node *ni; | struct ieee80211_node *ni; | ||||
uint32_t stat; | uint32_t stat; | ||||
int retrycnt; | |||||
uint8_t wcid, mcs, pid; | uint8_t wcid, mcs, pid; | ||||
/* drain Tx status FIFO (maxsize = 16) */ | /* drain Tx status FIFO (maxsize = 16) */ | ||||
txs->flags = IEEE80211_RATECTL_STATUS_LONG_RETRY; | |||||
while ((stat = RAL_READ(sc, RT2860_TX_STAT_FIFO)) & RT2860_TXQ_VLD) { | while ((stat = RAL_READ(sc, RT2860_TX_STAT_FIFO)) & RT2860_TXQ_VLD) { | ||||
DPRINTFN(4, ("tx stat 0x%08x\n", stat)); | DPRINTFN(4, ("tx stat 0x%08x\n", stat)); | ||||
wcid = (stat >> RT2860_TXQ_WCID_SHIFT) & 0xff; | wcid = (stat >> RT2860_TXQ_WCID_SHIFT) & 0xff; | ||||
ni = sc->wcid2ni[wcid]; | ni = sc->wcid2ni[wcid]; | ||||
/* if no ACK was requested, no feedback is available */ | /* if no ACK was requested, no feedback is available */ | ||||
if (!(stat & RT2860_TXQ_ACKREQ) || wcid == 0xff || ni == NULL) | if (!(stat & RT2860_TXQ_ACKREQ) || wcid == 0xff || ni == NULL) | ||||
continue; | continue; | ||||
/* update per-STA AMRR stats */ | /* update per-STA AMRR stats */ | ||||
if (stat & RT2860_TXQ_OK) { | if (stat & RT2860_TXQ_OK) { | ||||
/* | /* | ||||
* Check if there were retries, ie if the Tx success | * Check if there were retries, ie if the Tx success | ||||
* rate is different from the requested rate. Note | * rate is different from the requested rate. Note | ||||
* that it works only because we do not allow rate | * that it works only because we do not allow rate | ||||
* fallback from OFDM to CCK. | * fallback from OFDM to CCK. | ||||
*/ | */ | ||||
mcs = (stat >> RT2860_TXQ_MCS_SHIFT) & 0x7f; | mcs = (stat >> RT2860_TXQ_MCS_SHIFT) & 0x7f; | ||||
pid = (stat >> RT2860_TXQ_PID_SHIFT) & 0xf; | pid = (stat >> RT2860_TXQ_PID_SHIFT) & 0xf; | ||||
if (mcs + 1 != pid) | if (mcs + 1 != pid) | ||||
retrycnt = 1; | txs->long_retries = 1; | ||||
else | else | ||||
retrycnt = 0; | txs->long_retries = 0; | ||||
ieee80211_ratectl_tx_complete(ni->ni_vap, ni, | txs->status = IEEE80211_RATECTL_TX_SUCCESS; | ||||
IEEE80211_RATECTL_TX_SUCCESS, &retrycnt, NULL); | ieee80211_ratectl_tx_complete(ni, txs); | ||||
} else { | } else { | ||||
ieee80211_ratectl_tx_complete(ni->ni_vap, ni, | txs->status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED; | ||||
IEEE80211_RATECTL_TX_FAILURE, &retrycnt, NULL); | txs->long_retries = 1; /* XXX */ | ||||
ieee80211_ratectl_tx_complete(ni, txs); | |||||
if_inc_counter(ni->ni_vap->iv_ifp, | if_inc_counter(ni->ni_vap->iv_ifp, | ||||
IFCOUNTER_OERRORS, 1); | IFCOUNTER_OERRORS, 1); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
rt2860_tx_intr(struct rt2860_softc *sc, int qid) | rt2860_tx_intr(struct rt2860_softc *sc, int qid) | ||||
▲ Show 20 Lines • Show All 3,216 Lines • Show Last 20 Lines |