From 8e4ce17ba282f8053da77cd6821d84eff3614cba Mon Sep 17 00:00:00 2001 From: adrian Date: Sat, 7 Apr 2012 02:01:26 +0000 Subject: [PATCH] Remove duplicate txflags field from ath_buf. rename bf_state.bfs_flags to bf_state.bfs_txflags, as that is what it effectively is. --- sys/dev/ath/if_ath.c | 9 ++++----- sys/dev/ath/if_ath_debug.c | 5 ++--- sys/dev/ath/if_ath_tx.c | 18 ++++++++---------- sys/dev/ath/if_ath_tx_ht.c | 10 +++++----- sys/dev/ath/if_athvar.h | 3 +-- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index b71f5b12b50e..3866ba1f1a1a 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -2273,7 +2273,6 @@ ath_buf_clone(struct ath_softc *sc, const struct ath_buf *bf) /* Copy basics */ tbf->bf_next = NULL; tbf->bf_nseg = bf->bf_nseg; - tbf->bf_txflags = bf->bf_txflags; tbf->bf_flags = bf->bf_flags & ~ATH_BUF_BUSY; tbf->bf_status = bf->bf_status; tbf->bf_m = bf->bf_m; @@ -4747,7 +4746,7 @@ ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, pri = M_WME_GETAC(bf->bf_m); if (pri >= WME_AC_VO) ic->ic_wme.wme_hipri_traffic++; - if ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0) + if ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0) ni->ni_inact = ni->ni_inact_reload; } else { if (ts->ts_status & HAL_TXERR_XRETRY) @@ -4794,7 +4793,7 @@ ath_tx_default_comp(struct ath_softc *sc, struct ath_buf *bf, int fail) if (fail == 1) st = -1; else - st = ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0) ? + st = ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0) ? ts->ts_status : HAL_TXERR_XRETRY; if (bf->bf_state.bfs_dobaw) @@ -4947,7 +4946,7 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched) * workaround phantom bmiss interrupts. */ if (ni != NULL && ts->ts_status == 0 && - ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0)) { + ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) { nacked++; sc->sc_stats.ast_tx_rssi = ts->ts_rssi; ATH_RSSI_LPF(sc->sc_halstats.ns_avgtxrssi, @@ -4972,7 +4971,7 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched) */ if (bf->bf_comp == NULL) { if ((ts->ts_status & HAL_TXERR_FILT) == 0 && - (bf->bf_txflags & HAL_TXDESC_NOACK) == 0) { + (bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0) { /* * XXX assume this isn't an aggregate * frame. diff --git a/sys/dev/ath/if_ath_debug.c b/sys/dev/ath/if_ath_debug.c index 73cf15077f45..b438455a53d8 100644 --- a/sys/dev/ath/if_ath_debug.c +++ b/sys/dev/ath/if_ath_debug.c @@ -137,10 +137,9 @@ ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:%04x%s\n", ds, (const struct ath_desc *)bf->bf_daddr + i, - ds->ds_link, ds->ds_data, bf->bf_txflags, + ds->ds_link, ds->ds_data, bf->bf_state.bfs_txflags, !done ? "" : (ts->ts_status == 0) ? " *" : " !"); - printf(" TXF: %04x Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n", - bf->bf_state.bfs_flags, + printf(" Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n", bf->bf_state.bfs_seqno, bf->bf_state.bfs_retries, bf->bf_state.bfs_addedbaw, diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c index e510833cdcc0..7cd953363a65 100644 --- a/sys/dev/ath/if_ath_tx.c +++ b/sys/dev/ath/if_ath_tx.c @@ -424,7 +424,7 @@ ath_tx_setds_11n(struct ath_softc *sc, struct ath_buf *bf_first) ath_hal_setupfirsttxdesc(sc->sc_ah, bf_first->bf_desc, bf_first->bf_state.bfs_al, - bf_first->bf_state.bfs_flags | HAL_TXDESC_INTREQ, + bf_first->bf_state.bfs_txflags | HAL_TXDESC_INTREQ, bf_first->bf_state.bfs_txpower, bf_first->bf_state.bfs_txrate0, bf_first->bf_state.bfs_try0, @@ -812,7 +812,7 @@ ath_tx_set_rtscts(struct ath_softc *sc, struct ath_buf *bf) /* * No RTS/CTS enabled? Don't bother. */ - if ((bf->bf_state.bfs_flags & + if ((bf->bf_state.bfs_txflags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) == 0) { /* XXX is this really needed? */ bf->bf_state.bfs_ctsrate = 0; @@ -847,7 +847,7 @@ ath_tx_set_rtscts(struct ath_softc *sc, struct ath_buf *bf) if (! ath_tx_is_11n(sc)) ctsduration = ath_tx_calc_ctsduration(sc->sc_ah, rix, cix, bf->bf_state.bfs_shpream, bf->bf_state.bfs_pktlen, - rt, bf->bf_state.bfs_flags); + rt, bf->bf_state.bfs_txflags); /* Squirrel away in ath_buf */ bf->bf_state.bfs_ctsrate = ctsrate; @@ -881,7 +881,7 @@ ath_tx_setds(struct ath_softc *sc, struct ath_buf *bf) , bf->bf_state.bfs_try0 /* series 0 rate/tries */ , bf->bf_state.bfs_keyix /* key cache index */ , bf->bf_state.bfs_txantenna /* antenna mode */ - , bf->bf_state.bfs_flags /* flags */ + , bf->bf_state.bfs_txflags /* flags */ , bf->bf_state.bfs_ctsrate /* rts/cts rate */ , bf->bf_state.bfs_ctsduration /* rts/cts duration */ ); @@ -1352,8 +1352,7 @@ ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni, bf->bf_state.bfs_try0 = try0; bf->bf_state.bfs_keyix = keyix; bf->bf_state.bfs_txantenna = sc->sc_txantenna; - bf->bf_state.bfs_flags = flags; - bf->bf_txflags = flags; + bf->bf_state.bfs_txflags = flags; bf->bf_state.bfs_shpream = shortPreamble; /* XXX this should be done in ath_tx_setrate() */ @@ -1698,8 +1697,7 @@ ath_tx_raw_start(struct ath_softc *sc, struct ieee80211_node *ni, bf->bf_state.bfs_try0 = try0; bf->bf_state.bfs_keyix = keyix; bf->bf_state.bfs_txantenna = txantenna; - bf->bf_state.bfs_flags = flags; - bf->bf_txflags = flags; + bf->bf_state.bfs_txflags = flags; bf->bf_state.bfs_shpream = !! (params->ibp_flags & IEEE80211_BPF_SHORTPRE); @@ -2999,7 +2997,7 @@ ath_tx_normal_comp(struct ath_softc *sc, struct ath_buf *bf, int fail) * punt to rate control if we're not being cleaned up * during a hw queue drain and the frame wanted an ACK. */ - if (fail == 0 && ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0)) + if (fail == 0 && ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, ts, bf->bf_state.bfs_pktlen, 1, (ts->ts_status == 0) ? 0 : 1); @@ -3754,7 +3752,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc *sc, struct ath_buf *bf, int fail) * * Do it outside of the TXQ lock. */ - if (fail == 0 && ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0)) + if (fail == 0 && ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, &bf->bf_status.ds_txstat, bf->bf_state.bfs_pktlen, diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index 9a0487f29b71..976464cb9dfa 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -245,7 +245,7 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf) */ rc[i].ratecode = rate; - if (bf->bf_state.bfs_flags & + if (bf->bf_state.bfs_txflags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) rc[i].flags |= ATH_RC_RTSCTS_FLAG; @@ -445,7 +445,7 @@ ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni, const HAL_RATE_TABLE *rt = sc->sc_currates; int i; int pktlen; - int flags = bf->bf_state.bfs_flags; + int flags = bf->bf_state.bfs_txflags; struct ath_rc_series *rc = bf->bf_state.bfs_rc; if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && @@ -566,7 +566,7 @@ ath_buf_set_rate(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_hal *ah = sc->sc_ah; int is_pspoll = (bf->bf_state.bfs_atype == HAL_PKT_TYPE_PSPOLL); int ctsrate = bf->bf_state.bfs_ctsrate; - int flags = bf->bf_state.bfs_flags; + int flags = bf->bf_state.bfs_txflags; /* Setup rate scenario */ memset(&series, 0, sizeof(series)); @@ -822,11 +822,11 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, * XXX enforce ACK for aggregate frames (this needs to be * XXX handled more gracefully? */ - if (bf->bf_state.bfs_flags & HAL_TXDESC_NOACK) { + if (bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) { device_printf(sc->sc_dev, "%s: HAL_TXDESC_NOACK set for an aggregate frame?\n", __func__); - bf->bf_state.bfs_flags &= (~HAL_TXDESC_NOACK); + bf->bf_state.bfs_txflags &= (~HAL_TXDESC_NOACK); } /* diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 2fd8b972b017..04b7c301fafe 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -175,7 +175,6 @@ struct ath_buf { TAILQ_ENTRY(ath_buf) bf_list; struct ath_buf * bf_next; /* next buffer in the aggregate */ int bf_nseg; - uint16_t bf_txflags; /* tx descriptor flags */ uint16_t bf_flags; /* status flags (below) */ struct ath_desc *bf_desc; /* virtual addr of desc */ struct ath_desc_status bf_status; /* tx/rx status */ @@ -229,7 +228,7 @@ struct ath_buf { int bfs_pktlen; /* length of this packet */ int bfs_hdrlen; /* length of this packet header */ uint16_t bfs_al; /* length of aggregate */ - int bfs_flags; /* HAL descriptor flags */ + int bfs_txflags; /* HAL (tx) descriptor flags */ int bfs_txrate0; /* first TX rate */ int bfs_try0; /* first try count */ uint8_t bfs_ctsrate0; /* Non-zero - use this as ctsrate */