Deleted Added
full compact
if_ath.c (251099) if_ath.c (251342)
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 251099 2013-05-29 05:10:11Z adrian $");
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 251342 2013-06-03 19:39:37Z 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

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

2323 /* Ensure ATH_LOCK isn't held; ath_rx_proc can't be locked */
2324 ATH_PCU_UNLOCK_ASSERT(sc);
2325 ATH_UNLOCK_ASSERT(sc);
2326
2327 /* Try to (stop any further TX/RX from occuring */
2328 taskqueue_block(sc->sc_tq);
2329
2330 ATH_PCU_LOCK(sc);
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

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

2323 /* Ensure ATH_LOCK isn't held; ath_rx_proc can't be locked */
2324 ATH_PCU_UNLOCK_ASSERT(sc);
2325 ATH_UNLOCK_ASSERT(sc);
2326
2327 /* Try to (stop any further TX/RX from occuring */
2328 taskqueue_block(sc->sc_tq);
2329
2330 ATH_PCU_LOCK(sc);
2331 ath_hal_intrset(ah, 0); /* disable interrupts */
2332 ath_txrx_stop_locked(sc); /* Ensure TX/RX is stopped */
2331
2332 /*
2333 * Grab the reset lock before TX/RX is stopped.
2334 *
2335 * This is needed to ensure that when the TX/RX actually does finish,
2336 * no further TX/RX/reset runs in parallel with this.
2337 */
2333 if (ath_reset_grablock(sc, 1) == 0) {
2334 device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n",
2335 __func__);
2336 }
2338 if (ath_reset_grablock(sc, 1) == 0) {
2339 device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n",
2340 __func__);
2341 }
2342
2343 /* disable interrupts */
2344 ath_hal_intrset(ah, 0);
2345
2346 /*
2347 * Now, ensure that any in progress TX/RX completes before we
2348 * continue.
2349 */
2350 ath_txrx_stop_locked(sc);
2351
2337 ATH_PCU_UNLOCK(sc);
2338
2339 /*
2340 * Should now wait for pending TX/RX to complete
2341 * and block future ones from occuring. This needs to be
2342 * done before the TX queue is drained.
2343 */
2344 ath_draintxq(sc, reset_type); /* stop xmit side */

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

4866 /* Treat this as an interface reset */
4867 ATH_PCU_UNLOCK_ASSERT(sc);
4868 ATH_UNLOCK_ASSERT(sc);
4869
4870 /* (Try to) stop TX/RX from occuring */
4871 taskqueue_block(sc->sc_tq);
4872
4873 ATH_PCU_LOCK(sc);
2352 ATH_PCU_UNLOCK(sc);
2353
2354 /*
2355 * Should now wait for pending TX/RX to complete
2356 * and block future ones from occuring. This needs to be
2357 * done before the TX queue is drained.
2358 */
2359 ath_draintxq(sc, reset_type); /* stop xmit side */

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

4881 /* Treat this as an interface reset */
4882 ATH_PCU_UNLOCK_ASSERT(sc);
4883 ATH_UNLOCK_ASSERT(sc);
4884
4885 /* (Try to) stop TX/RX from occuring */
4886 taskqueue_block(sc->sc_tq);
4887
4888 ATH_PCU_LOCK(sc);
4874 ath_hal_intrset(ah, 0); /* Stop new RX/TX completion */
4875 ath_txrx_stop_locked(sc); /* Stop pending RX/TX completion */
4889
4890 /* Stop new RX/TX/interrupt completion */
4876 if (ath_reset_grablock(sc, 1) == 0) {
4877 device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n",
4878 __func__);
4879 }
4891 if (ath_reset_grablock(sc, 1) == 0) {
4892 device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n",
4893 __func__);
4894 }
4895
4896 ath_hal_intrset(ah, 0);
4897
4898 /* Stop pending RX/TX completion */
4899 ath_txrx_stop_locked(sc);
4900
4880 ATH_PCU_UNLOCK(sc);
4881
4882 DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz, flags 0x%x)\n",
4883 __func__, ieee80211_chan2ieee(ic, chan),
4884 chan->ic_freq, chan->ic_flags);
4885 if (chan != sc->sc_curchan) {
4886 HAL_STATUS status;
4887 /*

--- 1572 unchanged lines hidden ---
4901 ATH_PCU_UNLOCK(sc);
4902
4903 DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz, flags 0x%x)\n",
4904 __func__, ieee80211_chan2ieee(ic, chan),
4905 chan->ic_freq, chan->ic_flags);
4906 if (chan != sc->sc_curchan) {
4907 HAL_STATUS status;
4908 /*

--- 1572 unchanged lines hidden ---