Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ath/if_ath_tx_ht.c
Show First 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | |||||
* TODO: ensure this is only called for MCS rates. | * TODO: ensure this is only called for MCS rates. | ||||
* | * | ||||
* TODO: enforce MCS < 31 | * TODO: enforce MCS < 31 | ||||
*/ | */ | ||||
static int | static int | ||||
ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf, | ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf, | ||||
uint16_t pktlen, int is_first) | uint16_t pktlen, int is_first) | ||||
{ | { | ||||
#define MS(_v, _f) (((_v) & _f) >> _f##_S) | |||||
const HAL_RATE_TABLE *rt = sc->sc_currates; | const HAL_RATE_TABLE *rt = sc->sc_currates; | ||||
struct ieee80211_node *ni = first_bf->bf_node; | struct ieee80211_node *ni = first_bf->bf_node; | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
int ndelim, mindelim = 0; | int ndelim, mindelim = 0; | ||||
int mpdudensity; /* in 1/100'th of a microsecond */ | int mpdudensity; /* in 1/100'th of a microsecond */ | ||||
int peer_mpdudensity; /* net80211 value */ | int peer_mpdudensity; /* net80211 value */ | ||||
uint8_t rc, rix, flags; | uint8_t rc, rix, flags; | ||||
int width, half_gi; | int width, half_gi; | ||||
uint32_t nsymbits, nsymbols; | uint32_t nsymbits, nsymbols; | ||||
uint16_t minlen; | uint16_t minlen; | ||||
/* | /* | ||||
* Get the advertised density from the node. | * Get the advertised density from the node. | ||||
*/ | */ | ||||
peer_mpdudensity = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); | peer_mpdudensity = _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); | ||||
/* | /* | ||||
* vap->iv_ampdu_density is a net80211 value, rather than the actual | * vap->iv_ampdu_density is a net80211 value, rather than the actual | ||||
* density. Larger values are longer A-MPDU density spacing values, | * density. Larger values are longer A-MPDU density spacing values, | ||||
* and we want to obey larger configured / negotiated density values | * and we want to obey larger configured / negotiated density values | ||||
* per station if we get it. | * per station if we get it. | ||||
*/ | */ | ||||
if (vap->iv_ampdu_density > peer_mpdudensity) | if (vap->iv_ampdu_density > peer_mpdudensity) | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | if (pktlen < minlen) { | ||||
ndelim = MAX(mindelim, ndelim); | ndelim = MAX(mindelim, ndelim); | ||||
} | } | ||||
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, | DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, | ||||
"%s: pktlen=%d, minlen=%d, rix=%x, rc=%x, width=%d, hgi=%d, ndelim=%d\n", | "%s: pktlen=%d, minlen=%d, rix=%x, rc=%x, width=%d, hgi=%d, ndelim=%d\n", | ||||
__func__, pktlen, minlen, rix, rc, width, half_gi, ndelim); | __func__, pktlen, minlen, rix, rc, width, half_gi, ndelim); | ||||
return ndelim; | return ndelim; | ||||
#undef MS | |||||
} | } | ||||
/* | /* | ||||
* XXX TODO: put into net80211 | * XXX TODO: put into net80211 | ||||
*/ | */ | ||||
static int | static int | ||||
ath_rx_ampdu_to_byte(char a) | ath_rx_ampdu_to_byte(char a) | ||||
{ | { | ||||
Show All 23 Lines | |||||
* and per-peer limits in non-STA mode. | * and per-peer limits in non-STA mode. | ||||
*/ | */ | ||||
static int | static int | ||||
ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, | ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, | ||||
struct ath_buf *bf) | struct ath_buf *bf) | ||||
{ | { | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
#define MS(_v, _f) (((_v) & _f) >> _f##_S) | |||||
int amin = ATH_AGGR_MAXSIZE; | int amin = ATH_AGGR_MAXSIZE; | ||||
int i; | int i; | ||||
/* Extract out the maximum configured driver A-MPDU limit */ | /* Extract out the maximum configured driver A-MPDU limit */ | ||||
if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE) | if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE) | ||||
amin = sc->sc_aggr_limit; | amin = sc->sc_aggr_limit; | ||||
/* Check the vap configured transmit limit */ | /* Check the vap configured transmit limit */ | ||||
amin = MIN(amin, ath_rx_ampdu_to_byte(vap->iv_ampdu_limit)); | amin = MIN(amin, ath_rx_ampdu_to_byte(vap->iv_ampdu_limit)); | ||||
/* | /* | ||||
* Check the HTCAP field for the maximum size the node has | * Check the HTCAP field for the maximum size the node has | ||||
* negotiated. If it's smaller than what we have, cap it there. | * negotiated. If it's smaller than what we have, cap it there. | ||||
*/ | */ | ||||
amin = MIN(amin, ath_rx_ampdu_to_byte(MS(ni->ni_htparam, | amin = MIN(amin, ath_rx_ampdu_to_byte(_IEEE80211_MASKSHIFT(ni->ni_htparam, | ||||
IEEE80211_HTCAP_MAXRXAMPDU))); | IEEE80211_HTCAP_MAXRXAMPDU))); | ||||
for (i = 0; i < ATH_RC_NUM; i++) { | for (i = 0; i < ATH_RC_NUM; i++) { | ||||
if (bf->bf_state.bfs_rc[i].tries == 0) | if (bf->bf_state.bfs_rc[i].tries == 0) | ||||
continue; | continue; | ||||
amin = MIN(amin, bf->bf_state.bfs_rc[i].max4msframelen); | amin = MIN(amin, bf->bf_state.bfs_rc[i].max4msframelen); | ||||
} | } | ||||
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, | DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, | ||||
"%s: aggr_limit=%d, iv_ampdu_limit=%d, " | "%s: aggr_limit=%d, iv_ampdu_limit=%d, " | ||||
"peer maxrxampdu=%d, max frame len=%d\n", | "peer maxrxampdu=%d, max frame len=%d\n", | ||||
__func__, | __func__, | ||||
sc->sc_aggr_limit, | sc->sc_aggr_limit, | ||||
vap->iv_ampdu_limit, | vap->iv_ampdu_limit, | ||||
MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU), | _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU), | ||||
amin); | amin); | ||||
return amin; | return amin; | ||||
#undef MS | |||||
} | } | ||||
/* | /* | ||||
* Setup a 11n rate series structure | * Setup a 11n rate series structure | ||||
* | * | ||||
* This should be called for both legacy and MCS rates. | * This should be called for both legacy and MCS rates. | ||||
* | * | ||||
* This uses the rate series stuf from ath_tx_rate_fill_rcflags(). | * This uses the rate series stuf from ath_tx_rate_fill_rcflags(). | ||||
▲ Show 20 Lines • Show All 432 Lines • Show Last 20 Lines |