Deleted Added
full compact
if_ath.c (238708) if_ath.c (238710)
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 238708 2012-07-23 02:26:33Z adrian $");
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 238710 2012-07-23 03:52:18Z 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

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

104#include <dev/ath/if_ath_misc.h>
105#include <dev/ath/if_ath_tsf.h>
106#include <dev/ath/if_ath_tx.h>
107#include <dev/ath/if_ath_sysctl.h>
108#include <dev/ath/if_ath_led.h>
109#include <dev/ath/if_ath_keycache.h>
110#include <dev/ath/if_ath_rx.h>
111#include <dev/ath/if_ath_rx_edma.h>
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

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

104#include <dev/ath/if_ath_misc.h>
105#include <dev/ath/if_ath_tsf.h>
106#include <dev/ath/if_ath_tx.h>
107#include <dev/ath/if_ath_sysctl.h>
108#include <dev/ath/if_ath_led.h>
109#include <dev/ath/if_ath_keycache.h>
110#include <dev/ath/if_ath_rx.h>
111#include <dev/ath/if_ath_rx_edma.h>
112#include <dev/ath/if_ath_tx_edma.h>
112#include <dev/ath/if_ath_beacon.h>
113#include <dev/ath/if_athdfs.h>
114
115#ifdef ATH_TX99_DIAG
116#include <dev/ath/ath_tx99/ath_tx99.h>
117#endif
118
119/*

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

301 * Setup the DMA/EDMA functions based on the current
302 * hardware support.
303 *
304 * This is required before the descriptors are allocated.
305 */
306 if (ath_hal_hasedma(sc->sc_ah)) {
307 sc->sc_isedma = 1;
308 ath_recv_setup_edma(sc);
113#include <dev/ath/if_ath_beacon.h>
114#include <dev/ath/if_athdfs.h>
115
116#ifdef ATH_TX99_DIAG
117#include <dev/ath/ath_tx99/ath_tx99.h>
118#endif
119
120/*

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

302 * Setup the DMA/EDMA functions based on the current
303 * hardware support.
304 *
305 * This is required before the descriptors are allocated.
306 */
307 if (ath_hal_hasedma(sc->sc_ah)) {
308 sc->sc_isedma = 1;
309 ath_recv_setup_edma(sc);
309 } else
310 ath_xmit_setup_edma(sc);
311 } else {
310 ath_recv_setup_legacy(sc);
312 ath_recv_setup_legacy(sc);
313 ath_xmit_setup_legacy(sc);
314 }
311
312 /*
313 * Check if the MAC has multi-rate retry support.
314 * We do this by trying to setup a fake extended
315 * descriptor. MAC's that don't have support will
316 * return false w/o doing anything. MAC's that do
317 * support it will return true w/o doing anything.
318 */

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

362 ath_rate_setup(sc, IEEE80211_MODE_11NG);
363 ath_rate_setup(sc, IEEE80211_MODE_HALF);
364 ath_rate_setup(sc, IEEE80211_MODE_QUARTER);
365
366 /* NB: setup here so ath_rate_update is happy */
367 ath_setcurmode(sc, IEEE80211_MODE_11A);
368
369 /*
315
316 /*
317 * Check if the MAC has multi-rate retry support.
318 * We do this by trying to setup a fake extended
319 * descriptor. MAC's that don't have support will
320 * return false w/o doing anything. MAC's that do
321 * support it will return true w/o doing anything.
322 */

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

366 ath_rate_setup(sc, IEEE80211_MODE_11NG);
367 ath_rate_setup(sc, IEEE80211_MODE_HALF);
368 ath_rate_setup(sc, IEEE80211_MODE_QUARTER);
369
370 /* NB: setup here so ath_rate_update is happy */
371 ath_setcurmode(sc, IEEE80211_MODE_11A);
372
373 /*
370 * Allocate tx+rx descriptors and populate the lists.
374 * Allocate TX descriptors and populate the lists.
371 */
372 error = ath_desc_alloc(sc);
373 if (error != 0) {
375 */
376 error = ath_desc_alloc(sc);
377 if (error != 0) {
374 if_printf(ifp, "failed to allocate descriptors: %d\n", error);
378 if_printf(ifp, "failed to allocate TX descriptors: %d\n",
379 error);
375 goto bad;
376 }
380 goto bad;
381 }
382 error = ath_txdma_setup(sc);
383 if (error != 0) {
384 if_printf(ifp, "failed to allocate TX descriptors: %d\n",
385 error);
386 goto bad;
387 }
377
388
389 /*
390 * Allocate RX descriptors and populate the lists.
391 */
378 error = ath_rxdma_setup(sc);
379 if (error != 0) {
380 if_printf(ifp, "failed to allocate RX descriptors: %d\n",
381 error);
382 goto bad;
383 }
384
385 callout_init_mtx(&sc->sc_cal_ch, &sc->sc_mtx, 0);

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

853
854 if (bootverbose)
855 ieee80211_announce(ic);
856 ath_announce(sc);
857 return 0;
858bad2:
859 ath_tx_cleanup(sc);
860 ath_desc_free(sc);
392 error = ath_rxdma_setup(sc);
393 if (error != 0) {
394 if_printf(ifp, "failed to allocate RX descriptors: %d\n",
395 error);
396 goto bad;
397 }
398
399 callout_init_mtx(&sc->sc_cal_ch, &sc->sc_mtx, 0);

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

867
868 if (bootverbose)
869 ieee80211_announce(ic);
870 ath_announce(sc);
871 return 0;
872bad2:
873 ath_tx_cleanup(sc);
874 ath_desc_free(sc);
875 ath_txdma_teardown(sc);
861 ath_rxdma_teardown(sc);
862bad:
863 if (ah)
864 ath_hal_detach(ah);
865 if (ifp != NULL)
866 if_free(ifp);
867 sc->sc_invalid = 1;
868 return error;

--- 4322 unchanged lines hidden ---
876 ath_rxdma_teardown(sc);
877bad:
878 if (ah)
879 ath_hal_detach(ah);
880 if (ifp != NULL)
881 if_free(ifp);
882 sc->sc_invalid = 1;
883 return error;

--- 4322 unchanged lines hidden ---