mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-26 11:47:31 +00:00
style(9) changes. This shouldn't change functionality.
This commit is contained in:
parent
504f7cf5bb
commit
d4365d165b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229949
@ -435,7 +435,8 @@ ath_tx_setds_11n(struct ath_softc *sc, struct ath_buf *bf_first)
|
||||
* Setup the last descriptor in the list.
|
||||
* bf_prev points to the last; bf is NULL here.
|
||||
*/
|
||||
ath_hal_setuplasttxdesc(sc->sc_ah, bf_prev->bf_desc, bf_first->bf_desc);
|
||||
ath_hal_setuplasttxdesc(sc->sc_ah, bf_prev->bf_desc,
|
||||
bf_first->bf_desc);
|
||||
|
||||
/*
|
||||
* Set the first descriptor bf_lastds field to point to
|
||||
@ -481,7 +482,8 @@ ath_tx_handoff_mcast(struct ath_softc *sc, struct ath_txq *txq,
|
||||
* Hand-off packet to a hardware queue.
|
||||
*/
|
||||
static void
|
||||
ath_tx_handoff_hw(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf)
|
||||
ath_tx_handoff_hw(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct ath_buf *bf)
|
||||
{
|
||||
struct ath_hal *ah = sc->sc_ah;
|
||||
|
||||
@ -548,7 +550,8 @@ ath_tx_handoff_hw(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf)
|
||||
* frame at SWBA.
|
||||
*/
|
||||
if (!qbusy) {
|
||||
ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
|
||||
ath_hal_puttxbuf(ah, txq->axq_qnum,
|
||||
bf->bf_daddr);
|
||||
txq->axq_flags &= ~ATH_TXQ_PUTPENDING;
|
||||
DPRINTF(sc, ATH_DEBUG_XMIT,
|
||||
"%s: TXDP[%u] = %p (%p) depth %d\n",
|
||||
@ -566,7 +569,8 @@ ath_tx_handoff_hw(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf)
|
||||
DPRINTF(sc, ATH_DEBUG_XMIT,
|
||||
"%s: link[%u](%p)=%p (%p) depth %d\n", __func__,
|
||||
txq->axq_qnum, txq->axq_link,
|
||||
(caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth);
|
||||
(caddr_t)bf->bf_daddr, bf->bf_desc,
|
||||
txq->axq_depth);
|
||||
if ((txq->axq_flags & ATH_TXQ_PUTPENDING) && !qbusy) {
|
||||
/*
|
||||
* The q was busy when we previously tried
|
||||
@ -599,7 +603,8 @@ ath_tx_handoff_hw(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf)
|
||||
DPRINTF(sc, ATH_DEBUG_XMIT,
|
||||
"%s: link[%u](%p)=%p (%p) depth %d\n", __func__,
|
||||
txq->axq_qnum, txq->axq_link,
|
||||
(caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth);
|
||||
(caddr_t)bf->bf_daddr, bf->bf_desc,
|
||||
txq->axq_depth);
|
||||
}
|
||||
#endif /* IEEE80211_SUPPORT_TDMA */
|
||||
if (bf->bf_state.bfs_aggr)
|
||||
@ -652,7 +657,8 @@ ath_tx_handoff(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf)
|
||||
|
||||
static int
|
||||
ath_tx_tag_crypto(struct ath_softc *sc, struct ieee80211_node *ni,
|
||||
struct mbuf *m0, int iswep, int isfrag, int *hdrlen, int *pktlen, int *keyix)
|
||||
struct mbuf *m0, int iswep, int isfrag, int *hdrlen, int *pktlen,
|
||||
int *keyix)
|
||||
{
|
||||
if (iswep) {
|
||||
const struct ieee80211_cipher *cip;
|
||||
@ -671,7 +677,7 @@ ath_tx_tag_crypto(struct ath_softc *sc, struct ieee80211_node *ni,
|
||||
* 802.11 layer counts failures and provides
|
||||
* debugging/diagnostics.
|
||||
*/
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
/*
|
||||
* Adjust the packet + header lengths for the crypto
|
||||
@ -698,7 +704,7 @@ ath_tx_tag_crypto(struct ath_softc *sc, struct ieee80211_node *ni,
|
||||
} else
|
||||
(*keyix) = HAL_TXKEYIX_INVALID;
|
||||
|
||||
return 1;
|
||||
return (1);
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
@ -720,7 +726,7 @@ ath_tx_get_rtscts_rate(struct ath_hal *ah, const HAL_RATE_TABLE *rt,
|
||||
if (shortPreamble)
|
||||
ctsrate |= rt->info[cix].shortPreamble;
|
||||
|
||||
return ctsrate;
|
||||
return (ctsrate);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -737,7 +743,7 @@ ath_tx_calc_ctsduration(struct ath_hal *ah, int rix, int cix,
|
||||
if (rt->info[cix].phy == IEEE80211_T_HT) {
|
||||
printf("%s: HT rate where it shouldn't be (0x%x)\n",
|
||||
__func__, rt->info[cix].rateCode);
|
||||
return -1;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -765,7 +771,7 @@ ath_tx_calc_ctsduration(struct ath_hal *ah, int rix, int cix,
|
||||
ctsduration += rt->info[rix].lpAckDuration;
|
||||
}
|
||||
|
||||
return ctsduration;
|
||||
return (ctsduration);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1906,9 +1912,11 @@ ath_tx_addto_baw(struct ath_softc *sc, struct ath_node *an,
|
||||
|
||||
if (bf->bf_state.bfs_addedbaw)
|
||||
device_printf(sc->sc_dev,
|
||||
"%s: re-added? tid=%d, seqno %d; window %d:%d; baw head=%d tail=%d\n",
|
||||
"%s: re-added? tid=%d, seqno %d; window %d:%d; "
|
||||
"baw head=%d tail=%d\n",
|
||||
__func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno),
|
||||
tap->txa_start, tap->txa_wnd, tid->baw_head, tid->baw_tail);
|
||||
tap->txa_start, tap->txa_wnd, tid->baw_head,
|
||||
tid->baw_tail);
|
||||
|
||||
/*
|
||||
* ni->ni_txseqs[] is the currently allocated seqno.
|
||||
@ -1917,9 +1925,11 @@ ath_tx_addto_baw(struct ath_softc *sc, struct ath_node *an,
|
||||
index = ATH_BA_INDEX(tap->txa_start, SEQNO(bf->bf_state.bfs_seqno));
|
||||
cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
|
||||
"%s: tid=%d, seqno %d; window %d:%d; index=%d cindex=%d baw head=%d tail=%d\n",
|
||||
"%s: tid=%d, seqno %d; window %d:%d; index=%d cindex=%d "
|
||||
"baw head=%d tail=%d\n",
|
||||
__func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno),
|
||||
tap->txa_start, tap->txa_wnd, index, cindex, tid->baw_head, tid->baw_tail);
|
||||
tap->txa_start, tap->txa_wnd, index, cindex, tid->baw_head,
|
||||
tid->baw_tail);
|
||||
|
||||
|
||||
#if 0
|
||||
@ -1941,7 +1951,8 @@ ath_tx_addto_baw(struct ath_softc *sc, struct ath_node *an,
|
||||
}
|
||||
tid->tx_buf[cindex] = bf;
|
||||
|
||||
if (index >= ((tid->baw_tail - tid->baw_head) & (ATH_TID_MAX_BUFS - 1))) {
|
||||
if (index >= ((tid->baw_tail - tid->baw_head) &
|
||||
(ATH_TID_MAX_BUFS - 1))) {
|
||||
tid->baw_tail = cindex;
|
||||
INCR(tid->baw_tail, ATH_TID_MAX_BUFS);
|
||||
}
|
||||
@ -2019,7 +2030,8 @@ ath_tx_update_baw(struct ath_softc *sc, struct ath_node *an,
|
||||
cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
|
||||
"%s: tid=%d, baw=%d:%d, seqno=%d, index=%d, cindex=%d, baw head=%d, tail=%d\n",
|
||||
"%s: tid=%d, baw=%d:%d, seqno=%d, index=%d, cindex=%d, "
|
||||
"baw head=%d, tail=%d\n",
|
||||
__func__, tid->tid, tap->txa_start, tap->txa_wnd, seqno, index,
|
||||
cindex, tid->baw_head, tid->baw_tail);
|
||||
|
||||
@ -2044,11 +2056,13 @@ ath_tx_update_baw(struct ath_softc *sc, struct ath_node *an,
|
||||
|
||||
tid->tx_buf[cindex] = NULL;
|
||||
|
||||
while (tid->baw_head != tid->baw_tail && !tid->tx_buf[tid->baw_head]) {
|
||||
while (tid->baw_head != tid->baw_tail &&
|
||||
!tid->tx_buf[tid->baw_head]) {
|
||||
INCR(tap->txa_start, IEEE80211_SEQ_RANGE);
|
||||
INCR(tid->baw_head, ATH_TID_MAX_BUFS);
|
||||
}
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: baw is now %d:%d, baw head=%d\n",
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
|
||||
"%s: baw is now %d:%d, baw head=%d\n",
|
||||
__func__, tap->txa_start, tap->txa_wnd, tid->baw_head);
|
||||
}
|
||||
|
||||
@ -2248,24 +2262,34 @@ ath_tx_swq(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_txq *txq,
|
||||
ATH_TXQ_LOCK(txq);
|
||||
if (atid->paused) {
|
||||
/* TID is paused, queue */
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: paused\n", __func__);
|
||||
ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
|
||||
} else if (ath_tx_ampdu_pending(sc, an, tid)) {
|
||||
/* AMPDU pending; queue */
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pending\n", __func__);
|
||||
ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
|
||||
/* XXX sched? */
|
||||
} else if (ath_tx_ampdu_running(sc, an, tid)) {
|
||||
/* AMPDU running, attempt direct dispatch if possible */
|
||||
if (txq->axq_depth < sc->sc_hwq_limit)
|
||||
if (txq->axq_depth < sc->sc_hwq_limit) {
|
||||
ath_tx_xmit_aggr(sc, an, bf);
|
||||
else {
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX,
|
||||
"%s: xmit_aggr\n",
|
||||
__func__);
|
||||
} else {
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX,
|
||||
"%s: ampdu; swq'ing\n",
|
||||
__func__);
|
||||
ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
|
||||
ath_tx_tid_sched(sc, atid);
|
||||
}
|
||||
} else if (txq->axq_depth < sc->sc_hwq_limit) {
|
||||
/* AMPDU not running, attempt direct dispatch */
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_normal\n", __func__);
|
||||
ath_tx_xmit_normal(sc, txq, bf);
|
||||
} else {
|
||||
/* Busy; queue */
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: swq'ing\n", __func__);
|
||||
ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
|
||||
ath_tx_tid_sched(sc, atid);
|
||||
}
|
||||
@ -2374,8 +2398,8 @@ ath_tx_tid_resume(struct ath_softc *sc, struct ath_tid *tid)
|
||||
* forward.
|
||||
*/
|
||||
static void
|
||||
ath_tx_tid_drain(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid,
|
||||
ath_bufhead *bf_cq)
|
||||
ath_tx_tid_drain(struct ath_softc *sc, struct ath_node *an,
|
||||
struct ath_tid *tid, ath_bufhead *bf_cq)
|
||||
{
|
||||
struct ath_buf *bf;
|
||||
struct ieee80211_tx_ampdu *tap;
|
||||
@ -2398,8 +2422,8 @@ ath_tx_tid_drain(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid,
|
||||
device_printf(sc->sc_dev,
|
||||
"%s: node %p: tid %d: txq_depth=%d, "
|
||||
"txq_aggr_depth=%d, sched=%d, paused=%d, "
|
||||
"hwq_depth=%d, incomp=%d, baw_head=%d, baw_tail=%d "
|
||||
"txa_start=%d, ni_txseqs=%d\n",
|
||||
"hwq_depth=%d, incomp=%d, baw_head=%d, "
|
||||
"baw_tail=%d txa_start=%d, ni_txseqs=%d\n",
|
||||
__func__, ni, tid->tid, txq->axq_depth,
|
||||
txq->axq_aggr_depth, tid->sched, tid->paused,
|
||||
tid->hwq_depth, tid->incomp, tid->baw_head,
|
||||
@ -2644,7 +2668,8 @@ ath_tx_cleanup(struct ath_softc *sc, struct ath_node *an, int tid)
|
||||
if (! bf->bf_state.bfs_addedbaw)
|
||||
device_printf(sc->sc_dev,
|
||||
"%s: wasn't added: seqno %d\n",
|
||||
__func__, SEQNO(bf->bf_state.bfs_seqno));
|
||||
__func__,
|
||||
SEQNO(bf->bf_state.bfs_seqno));
|
||||
}
|
||||
bf->bf_state.bfs_dobaw = 0;
|
||||
/*
|
||||
@ -3061,7 +3086,8 @@ ath_tx_comp_cleanup_aggr(struct ath_softc *sc, struct ath_buf *bf_first)
|
||||
* not the last descriptor in the first frame.
|
||||
*/
|
||||
static void
|
||||
ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail)
|
||||
ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first,
|
||||
int fail)
|
||||
{
|
||||
//struct ath_desc *ds = bf->bf_lastds;
|
||||
struct ieee80211_node *ni = bf_first->bf_node;
|
||||
@ -3148,7 +3174,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail)
|
||||
memcpy(rc, bf_first->bf_state.bfs_rc, sizeof(rc));
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
|
||||
"%s: txa_start=%d, tx_ok=%d, status=%.8x, flags=%.8x, isaggr=%d, seq_st=%d, hasba=%d, ba=%.8x, %.8x\n",
|
||||
"%s: txa_start=%d, tx_ok=%d, status=%.8x, flags=%.8x, "
|
||||
"isaggr=%d, seq_st=%d, hasba=%d, ba=%.8x, %.8x\n",
|
||||
__func__, tap->txa_start, tx_ok, ts.ts_status, ts.ts_flags,
|
||||
isaggr, seq_st, hasba, ba[0], ba[1]);
|
||||
|
||||
@ -3162,7 +3189,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail)
|
||||
/* AR5416 BA bug; this requires an interface reset */
|
||||
if (isaggr && tx_ok && (! hasba)) {
|
||||
device_printf(sc->sc_dev,
|
||||
"%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, seq_st=%d\n",
|
||||
"%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, "
|
||||
"seq_st=%d\n",
|
||||
__func__, hasba, tx_ok, isaggr, seq_st);
|
||||
/* XXX TODO: schedule an interface reset */
|
||||
}
|
||||
@ -3193,7 +3221,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail)
|
||||
*/
|
||||
while (bf) {
|
||||
nframes++;
|
||||
ba_index = ATH_BA_INDEX(seq_st, SEQNO(bf->bf_state.bfs_seqno));
|
||||
ba_index = ATH_BA_INDEX(seq_st,
|
||||
SEQNO(bf->bf_state.bfs_seqno));
|
||||
bf_next = bf->bf_next;
|
||||
bf->bf_next = NULL; /* Remove it from the aggr list */
|
||||
|
||||
@ -3245,7 +3274,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail)
|
||||
* control code.
|
||||
*/
|
||||
if (fail == 0)
|
||||
ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, nbad);
|
||||
ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes,
|
||||
nbad);
|
||||
|
||||
/*
|
||||
* send bar if we dropped any frames
|
||||
@ -3313,8 +3343,10 @@ ath_tx_aggr_comp_unaggr(struct ath_softc *sc, struct ath_buf *bf, int fail)
|
||||
if (tid == IEEE80211_NONQOS_TID)
|
||||
device_printf(sc->sc_dev, "%s: TID=16!\n", __func__);
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: tid=%d, hwq_depth=%d\n",
|
||||
__func__, bf, bf->bf_state.bfs_tid, atid->hwq_depth);
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX,
|
||||
"%s: bf=%p: tid=%d, hwq_depth=%d, seqno=%d\n",
|
||||
__func__, bf, bf->bf_state.bfs_tid, atid->hwq_depth,
|
||||
SEQNO(bf->bf_state.bfs_seqno));
|
||||
|
||||
atid->hwq_depth--;
|
||||
if (atid->hwq_depth < 0)
|
||||
@ -3329,6 +3361,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc *sc, struct ath_buf *bf, int fail)
|
||||
*/
|
||||
if (atid->cleanup_inprogress) {
|
||||
ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: cleanup_unaggr\n",
|
||||
__func__);
|
||||
ath_tx_comp_cleanup_unaggr(sc, bf);
|
||||
return;
|
||||
}
|
||||
@ -3339,6 +3373,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc *sc, struct ath_buf *bf, int fail)
|
||||
*/
|
||||
if (fail == 0 && ts->ts_status & HAL_TXERR_XRETRY) {
|
||||
ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: retry_unaggr\n",
|
||||
__func__);
|
||||
ath_tx_aggr_retry_unaggr(sc, bf);
|
||||
return;
|
||||
}
|
||||
@ -3419,7 +3455,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct ath_node *an,
|
||||
* data frame), schedule it directly; continue.
|
||||
*/
|
||||
if (! bf->bf_state.bfs_dobaw) {
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: non-baw packet\n",
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
|
||||
"%s: non-baw packet\n",
|
||||
__func__);
|
||||
ATH_TXQ_REMOVE(tid, bf, bf_list);
|
||||
bf->bf_state.bfs_aggr = 0;
|
||||
@ -3489,7 +3526,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct ath_node *an,
|
||||
sc->sc_aggr_stats.aggr_single_pkt++;
|
||||
} else {
|
||||
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
|
||||
"%s: multi-frame aggregate: %d frames, length %d\n",
|
||||
"%s: multi-frame aggregate: %d frames, "
|
||||
"length %d\n",
|
||||
__func__, bf->bf_state.bfs_nframes,
|
||||
bf->bf_state.bfs_al);
|
||||
bf->bf_state.bfs_aggr = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user