Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bwi/if_bwi.c
Show First 20 Lines • Show All 3,315 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
_bwi_txeof(struct bwi_softc *sc, uint16_t tx_id, int acked, int data_txcnt) | _bwi_txeof(struct bwi_softc *sc, uint16_t tx_id, int acked, int data_txcnt) | ||||
{ | { | ||||
struct bwi_txbuf_data *tbd; | struct bwi_txbuf_data *tbd; | ||||
struct bwi_txbuf *tb; | struct bwi_txbuf *tb; | ||||
int ring_idx, buf_idx; | int ring_idx, buf_idx; | ||||
struct ieee80211_node *ni; | struct ieee80211_node *ni; | ||||
struct ieee80211vap *vap; | |||||
if (tx_id == 0) { | if (tx_id == 0) { | ||||
device_printf(sc->sc_dev, "%s: zero tx id\n", __func__); | device_printf(sc->sc_dev, "%s: zero tx id\n", __func__); | ||||
return; | return; | ||||
} | } | ||||
ring_idx = __SHIFTOUT(tx_id, BWI_TXH_ID_RING_MASK); | ring_idx = __SHIFTOUT(tx_id, BWI_TXH_ID_RING_MASK); | ||||
buf_idx = __SHIFTOUT(tx_id, BWI_TXH_ID_IDX_MASK); | buf_idx = __SHIFTOUT(tx_id, BWI_TXH_ID_IDX_MASK); | ||||
Show All 10 Lines | DPRINTF(sc, BWI_DBG_TXEOF, "txeof idx %d, " | ||||
"acked %d, data_txcnt %d, ni %p\n", | "acked %d, data_txcnt %d, ni %p\n", | ||||
buf_idx, acked, data_txcnt, tb->tb_ni); | buf_idx, acked, data_txcnt, tb->tb_ni); | ||||
bus_dmamap_unload(sc->sc_buf_dtag, tb->tb_dmap); | bus_dmamap_unload(sc->sc_buf_dtag, tb->tb_dmap); | ||||
if ((ni = tb->tb_ni) != NULL) { | if ((ni = tb->tb_ni) != NULL) { | ||||
const struct bwi_txbuf_hdr *hdr = | const struct bwi_txbuf_hdr *hdr = | ||||
mtod(tb->tb_mbuf, const struct bwi_txbuf_hdr *); | mtod(tb->tb_mbuf, const struct bwi_txbuf_hdr *); | ||||
vap = ni->ni_vap; | struct ieee80211_ratectl_tx_status txs; | ||||
/* NB: update rate control only for unicast frames */ | /* NB: update rate control only for unicast frames */ | ||||
if (hdr->txh_mac_ctrl & htole32(BWI_TXH_MAC_C_ACK)) { | if (hdr->txh_mac_ctrl & htole32(BWI_TXH_MAC_C_ACK)) { | ||||
/* | /* | ||||
* Feed back 'acked and data_txcnt'. Note that the | * Feed back 'acked and data_txcnt'. Note that the | ||||
* generic AMRR code only understands one tx rate | * generic AMRR code only understands one tx rate | ||||
* and the estimator doesn't handle real retry counts | * and the estimator doesn't handle real retry counts | ||||
* well so to avoid over-aggressive downshifting we | * well so to avoid over-aggressive downshifting we | ||||
* treat any number of retries as "1". | * treat any number of retries as "1". | ||||
*/ | */ | ||||
ieee80211_ratectl_tx_complete(vap, ni, | txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY; | ||||
(data_txcnt > 1) ? IEEE80211_RATECTL_TX_SUCCESS : | txs.long_retries = acked; | ||||
IEEE80211_RATECTL_TX_FAILURE, &acked, NULL); | if (data_txcnt > 1) | ||||
txs.status = IEEE80211_RATECTL_TX_SUCCESS; | |||||
else { | |||||
txs.status = | |||||
IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED; | |||||
} | |||||
ieee80211_ratectl_tx_complete(ni, &txs); | |||||
} | } | ||||
ieee80211_tx_complete(ni, tb->tb_mbuf, !acked); | ieee80211_tx_complete(ni, tb->tb_mbuf, !acked); | ||||
tb->tb_ni = NULL; | tb->tb_ni = NULL; | ||||
} else | } else | ||||
m_freem(tb->tb_mbuf); | m_freem(tb->tb_mbuf); | ||||
tb->tb_mbuf = NULL; | tb->tb_mbuf = NULL; | ||||
if (tbd->tbd_used == 0) | if (tbd->tbd_used == 0) | ||||
▲ Show 20 Lines • Show All 642 Lines • Show Last 20 Lines |