Deleted Added
sdiff udiff text old ( 244790 ) new ( 244951 )
full compact
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 244951 2013-01-02 03:59:02Z 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

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

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>
113#include <dev/ath/if_ath_beacon.h>
114#include <dev/ath/if_ath_spectral.h>
115#include <dev/ath/if_athdfs.h>
116
117#ifdef ATH_TX99_DIAG
118#include <dev/ath/ath_tx99/ath_tx99.h>
119#endif
120
121#ifdef ATH_DEBUG_ALQ
122#include <dev/ath/if_ath_alq.h>

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

506 /* Attach DFS module */
507 if (! ath_dfs_attach(sc)) {
508 device_printf(sc->sc_dev,
509 "%s: unable to attach DFS\n", __func__);
510 error = EIO;
511 goto bad2;
512 }
513
514 /* Attach spectral module */
515 if (ath_spectral_attach(sc) < 0) {
516 device_printf(sc->sc_dev,
517 "%s: unable to attach spectral\n", __func__);
518 error = EIO;
519 goto bad2;
520 }
521
522 /* Start DFS processing tasklet */
523 TASK_INIT(&sc->sc_dfstask, 0, ath_dfs_tasklet, sc);
524
525 /* Configure LED state */
526 sc->sc_blinking = 0;
527 sc->sc_ledstate = 1;
528 sc->sc_ledon = 0; /* low true */
529 sc->sc_ledidle = (2700*hz)/1000; /* 2.7sec */

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

971 sc->sc_tx99->detach(sc->sc_tx99);
972#endif
973 ath_rate_detach(sc->sc_rc);
974
975#ifdef ATH_DEBUG_ALQ
976 if_ath_alq_tidyup(&sc->sc_alq);
977#endif
978
979 ath_spectral_detach(sc);
980 ath_dfs_detach(sc);
981 ath_desc_free(sc);
982 ath_txdma_teardown(sc);
983 ath_rxdma_teardown(sc);
984 ath_tx_cleanup(sc);
985 ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */
986
987 CURVNET_SET(ifp->if_vnet);

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

1494 ath_hal_reset(ah, sc->sc_opmode,
1495 sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan,
1496 AH_FALSE, &status);
1497 ath_reset_keycache(sc);
1498
1499 /* Let DFS at it in case it's a DFS channel */
1500 ath_dfs_radar_enable(sc, ic->ic_curchan);
1501
1502 /* Let spectral at in case spectral is enabled */
1503 ath_spectral_enable(sc, ic->ic_curchan);
1504
1505 /* Restore the LED configuration */
1506 ath_led_config(sc);
1507 ath_hal_setledstate(ah, HAL_LED_INIT);
1508
1509 if (sc->sc_resume_up)
1510 ieee80211_resume_all(ic);
1511
1512 /* XXX beacons ? */

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

1926 ATH_UNLOCK(sc);
1927 return;
1928 }
1929 ath_chan_change(sc, ic->ic_curchan);
1930
1931 /* Let DFS at it in case it's a DFS channel */
1932 ath_dfs_radar_enable(sc, ic->ic_curchan);
1933
1934 /* Let spectral at in case spectral is enabled */
1935 ath_spectral_enable(sc, ic->ic_curchan);
1936
1937 /*
1938 * Likewise this is set during reset so update
1939 * state cached in the driver.
1940 */
1941 sc->sc_diversity = ath_hal_getdiversity(ah);
1942 sc->sc_lastlongcal = 0;
1943 sc->sc_resetcal = 1;
1944 sc->sc_lastcalreset = 0;

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

2237 if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status))
2238 if_printf(ifp, "%s: unable to reset hardware; hal status %u\n",
2239 __func__, status);
2240 sc->sc_diversity = ath_hal_getdiversity(ah);
2241
2242 /* Let DFS at it in case it's a DFS channel */
2243 ath_dfs_radar_enable(sc, ic->ic_curchan);
2244
2245 /* Let spectral at in case spectral is enabled */
2246 ath_spectral_enable(sc, ic->ic_curchan);
2247
2248 if (ath_startrecv(sc) != 0) /* restart recv */
2249 if_printf(ifp, "%s: unable to start recv logic\n", __func__);
2250 /*
2251 * We may be doing a reset in response to an ioctl
2252 * that changes the channel so update any state that
2253 * might change as a result.
2254 */
2255 ath_chan_change(sc, ic->ic_curchan);

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

4416 ret = EIO;
4417 goto finish;
4418 }
4419 sc->sc_diversity = ath_hal_getdiversity(ah);
4420
4421 /* Let DFS at it in case it's a DFS channel */
4422 ath_dfs_radar_enable(sc, chan);
4423
4424 /* Let spectral at in case spectral is enabled */
4425 ath_spectral_enable(sc, chan);
4426
4427 /*
4428 * Re-enable rx framework.
4429 */
4430 if (ath_startrecv(sc) != 0) {
4431 if_printf(ifp, "%s: unable to restart recv logic\n",
4432 __func__);
4433 ret = EIO;
4434 goto finish;

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

5401#ifdef ATH_DIAGAPI
5402 case SIOCGATHDIAG:
5403 error = ath_ioctl_diag(sc, (struct ath_diag *) ifr);
5404 break;
5405 case SIOCGATHPHYERR:
5406 error = ath_ioctl_phyerr(sc,(struct ath_diag*) ifr);
5407 break;
5408#endif
5409 case SIOCGATHSPECTRAL:
5410 error = ath_ioctl_spectral(sc,(struct ath_diag*) ifr);
5411 break;
5412 case SIOCGATHNODERATESTATS:
5413 error = ath_ioctl_ratestats(sc, (struct ath_rateioctl *) ifr);
5414 break;
5415 case SIOCGIFADDR:
5416 error = ether_ioctl(ifp, cmd, data);
5417 break;
5418 default:
5419 error = EINVAL;

--- 337 unchanged lines hidden ---