Deleted Added
full compact
if_ath.c (239204) if_ath.c (239205)
1/*-
2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 239204 2012-08-12 00:37:29Z adrian $");
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 239205 2012-08-12 00:46:15Z adrian $");
32
33/*
34 * Driver for the Atheros Wireless LAN controller.
35 *
36 * This software is derived from work of Atsushi Onoe; his contribution
37 * is greatly appreciated.
38 */
39

--- 3942 unchanged lines hidden (view full) ---

3982 /*
3983 * XXX the buffer used to be freed -after-, but the DMA map was
3984 * freed where ath_freebuf() now is. I've no idea what this
3985 * will do.
3986 */
3987}
3988
3989void
32
33/*
34 * Driver for the Atheros Wireless LAN controller.
35 *
36 * This software is derived from work of Atsushi Onoe; his contribution
37 * is greatly appreciated.
38 */
39

--- 3942 unchanged lines hidden (view full) ---

3982 /*
3983 * XXX the buffer used to be freed -after-, but the DMA map was
3984 * freed where ath_freebuf() now is. I've no idea what this
3985 * will do.
3986 */
3987}
3988
3989void
3990ath_legacy_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
3990ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
3991{
3992#ifdef ATH_DEBUG
3993 struct ath_hal *ah = sc->sc_ah;
3994#endif
3995 struct ath_buf *bf;
3996 u_int ix;
3997
3998 /*

--- 9 unchanged lines hidden (view full) ---

4008 bf->bf_flags &= ~ATH_BUF_BUSY;
4009 ATH_TXBUF_UNLOCK(sc);
4010
4011 for (ix = 0;; ix++) {
4012 ATH_TXQ_LOCK(txq);
4013 bf = TAILQ_FIRST(&txq->axq_q);
4014 if (bf == NULL) {
4015 txq->axq_link = NULL;
3991{
3992#ifdef ATH_DEBUG
3993 struct ath_hal *ah = sc->sc_ah;
3994#endif
3995 struct ath_buf *bf;
3996 u_int ix;
3997
3998 /*

--- 9 unchanged lines hidden (view full) ---

4008 bf->bf_flags &= ~ATH_BUF_BUSY;
4009 ATH_TXBUF_UNLOCK(sc);
4010
4011 for (ix = 0;; ix++) {
4012 ATH_TXQ_LOCK(txq);
4013 bf = TAILQ_FIRST(&txq->axq_q);
4014 if (bf == NULL) {
4015 txq->axq_link = NULL;
4016 /*
4017 * There's currently no flag that indicates
4018 * a buffer is on the FIFO. So until that
4019 * occurs, just clear the FIFO counter here.
4020 *
4021 * Yes, this means that if something in parallel
4022 * is pushing things onto this TXQ and pushing
4023 * _that_ into the hardware, things will get
4024 * very fruity very quickly.
4025 */
4026 txq->axq_fifo_depth = 0;
4016 ATH_TXQ_UNLOCK(txq);
4017 break;
4018 }
4019 ATH_TXQ_REMOVE(txq, bf, bf_list);
4020 if (bf->bf_state.bfs_aggr)
4021 txq->axq_aggr_depth--;
4022#ifdef ATH_DEBUG
4023 if (sc->sc_debug & ATH_DEBUG_RESET) {
4024 struct ieee80211com *ic = sc->sc_ifp->if_l2com;
4027 ATH_TXQ_UNLOCK(txq);
4028 break;
4029 }
4030 ATH_TXQ_REMOVE(txq, bf, bf_list);
4031 if (bf->bf_state.bfs_aggr)
4032 txq->axq_aggr_depth--;
4033#ifdef ATH_DEBUG
4034 if (sc->sc_debug & ATH_DEBUG_RESET) {
4035 struct ieee80211com *ic = sc->sc_ifp->if_l2com;
4036 int status = 0;
4025
4037
4026 ath_printtxbuf(sc, bf, txq->axq_qnum, ix,
4027 ath_hal_txprocdesc(ah, bf->bf_lastds,
4038 /*
4039 * EDMA operation has a TX completion FIFO
4040 * separate from the TX descriptor, so this
4041 * method of checking the "completion" status
4042 * is wrong.
4043 */
4044 if (! sc->sc_isedma) {
4045 status = (ath_hal_txprocdesc(ah,
4046 bf->bf_lastds,
4028 &bf->bf_status.ds_txstat) == HAL_OK);
4047 &bf->bf_status.ds_txstat) == HAL_OK);
4048 }
4049 ath_printtxbuf(sc, bf, txq->axq_qnum, ix, status);
4029 ieee80211_dump_pkt(ic, mtod(bf->bf_m, const uint8_t *),
4030 bf->bf_m->m_len, 0, -1);
4031 }
4032#endif /* ATH_DEBUG */
4033 /*
4034 * Since we're now doing magic in the completion
4035 * functions, we -must- call it for aggregation
4036 * destinations or BAW tracking will get upset.

--- 1246 unchanged lines hidden ---
4050 ieee80211_dump_pkt(ic, mtod(bf->bf_m, const uint8_t *),
4051 bf->bf_m->m_len, 0, -1);
4052 }
4053#endif /* ATH_DEBUG */
4054 /*
4055 * Since we're now doing magic in the completion
4056 * functions, we -must- call it for aggregation
4057 * destinations or BAW tracking will get upset.

--- 1246 unchanged lines hidden ---