if_ath_rx_edma.c (331722) | if_ath_rx_edma.c (337951) |
---|---|
1/*- 2 * Copyright (c) 2012 Adrian Chadd <adrian@FreeBSD.org> 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) 2012 Adrian Chadd <adrian@FreeBSD.org> 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: stable/11/sys/dev/ath/if_ath_rx_edma.c 331722 2018-03-29 02:50:57Z eadler $"); | 31__FBSDID("$FreeBSD: stable/11/sys/dev/ath/if_ath_rx_edma.c 337951 2018-08-17 03:05:09Z kevans $"); |
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 --- 121 unchanged lines hidden (view full) --- 161 struct ath_hal *ah = sc->sc_ah; 162 163 ATH_RX_LOCK(sc); 164 165 ath_hal_stoppcurecv(ah); 166 ath_hal_setrxfilter(ah, 0); 167 168 /* | 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 --- 121 unchanged lines hidden (view full) --- 161 struct ath_hal *ah = sc->sc_ah; 162 163 ATH_RX_LOCK(sc); 164 165 ath_hal_stoppcurecv(ah); 166 ath_hal_setrxfilter(ah, 0); 167 168 /* |
169 * | 169 * |
170 */ 171 if (ath_hal_stopdmarecv(ah) == AH_TRUE) 172 sc->sc_rx_stopped = 1; 173 174 /* 175 * Give the various bus FIFOs (not EDMA descriptor FIFO) 176 * time to finish flushing out data. 177 */ --- 544 unchanged lines hidden (view full) --- 722 int error; 723 724 ATH_RX_LOCK_ASSERT(sc); 725 726 /* Allocate buffer */ 727 bf = TAILQ_FIRST(&sc->sc_rxbuf); 728 /* XXX shouldn't happen upon startup? */ 729 if (bf == NULL) { | 170 */ 171 if (ath_hal_stopdmarecv(ah) == AH_TRUE) 172 sc->sc_rx_stopped = 1; 173 174 /* 175 * Give the various bus FIFOs (not EDMA descriptor FIFO) 176 * time to finish flushing out data. 177 */ --- 544 unchanged lines hidden (view full) --- 722 int error; 723 724 ATH_RX_LOCK_ASSERT(sc); 725 726 /* Allocate buffer */ 727 bf = TAILQ_FIRST(&sc->sc_rxbuf); 728 /* XXX shouldn't happen upon startup? */ 729 if (bf == NULL) { |
730 device_printf(sc->sc_dev, "%s: nothing on rxbuf?!\n", | 730 DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: nothing on rxbuf?!\n", |
731 __func__); 732 return (NULL); 733 } 734 735 /* Remove it from the free list */ 736 TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); 737 738 /* Assign RX mbuf to it */ --- 64 unchanged lines hidden (view full) --- 803 re->m_fifo_depth--; 804 /* XXX check it's not < 0 */ 805 re->m_fifo[re->m_fifo_tail] = NULL; 806 } 807 808 bf = ath_edma_rxbuf_alloc(sc); 809 /* XXX should ensure the FIFO is not NULL? */ 810 if (bf == NULL) { | 731 __func__); 732 return (NULL); 733 } 734 735 /* Remove it from the free list */ 736 TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); 737 738 /* Assign RX mbuf to it */ --- 64 unchanged lines hidden (view full) --- 803 re->m_fifo_depth--; 804 /* XXX check it's not < 0 */ 805 re->m_fifo[re->m_fifo_tail] = NULL; 806 } 807 808 bf = ath_edma_rxbuf_alloc(sc); 809 /* XXX should ensure the FIFO is not NULL? */ 810 if (bf == NULL) { |
811 device_printf(sc->sc_dev, | 811 DPRINTF(sc, ATH_DEBUG_EDMA_RX, |
812 "%s: Q%d: alloc failed: i=%d, nbufs=%d?\n", 813 __func__, 814 qtype, 815 i, 816 nbufs); 817 break; 818 } 819 --- 100 unchanged lines hidden (view full) --- 920static int 921ath_edma_rxfifo_free(struct ath_softc *sc, HAL_RX_QUEUE qtype) 922{ 923 struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; 924 925 device_printf(sc->sc_dev, "%s: called; qtype=%d\n", 926 __func__, 927 qtype); | 812 "%s: Q%d: alloc failed: i=%d, nbufs=%d?\n", 813 __func__, 814 qtype, 815 i, 816 nbufs); 817 break; 818 } 819 --- 100 unchanged lines hidden (view full) --- 920static int 921ath_edma_rxfifo_free(struct ath_softc *sc, HAL_RX_QUEUE qtype) 922{ 923 struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; 924 925 device_printf(sc->sc_dev, "%s: called; qtype=%d\n", 926 __func__, 927 qtype); |
928 | 928 |
929 free(re->m_fifo, M_ATHDEV); 930 931 return (0); 932} 933 934static int 935ath_edma_dma_rxsetup(struct ath_softc *sc) 936{ --- 72 unchanged lines hidden --- | 929 free(re->m_fifo, M_ATHDEV); 930 931 return (0); 932} 933 934static int 935ath_edma_dma_rxsetup(struct ath_softc *sc) 936{ --- 72 unchanged lines hidden --- |