if_ath.c (244790) | if_ath.c (244951) |
---|---|
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 244790 2012-12-28 21:59:47Z bapt $"); | 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> | 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> |
|
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#ifdef ATH_DEBUG_ALQ 121#include <dev/ath/if_ath_alq.h> --- 383 unchanged lines hidden (view full) --- 505 /* Attach DFS module */ 506 if (! ath_dfs_attach(sc)) { 507 device_printf(sc->sc_dev, 508 "%s: unable to attach DFS\n", __func__); 509 error = EIO; 510 goto bad2; 511 } 512 | 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 |
|
513 /* Start DFS processing tasklet */ 514 TASK_INIT(&sc->sc_dfstask, 0, ath_dfs_tasklet, sc); 515 516 /* Configure LED state */ 517 sc->sc_blinking = 0; 518 sc->sc_ledstate = 1; 519 sc->sc_ledon = 0; /* low true */ 520 sc->sc_ledidle = (2700*hz)/1000; /* 2.7sec */ --- 441 unchanged lines hidden (view full) --- 962 sc->sc_tx99->detach(sc->sc_tx99); 963#endif 964 ath_rate_detach(sc->sc_rc); 965 966#ifdef ATH_DEBUG_ALQ 967 if_ath_alq_tidyup(&sc->sc_alq); 968#endif 969 | 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); |
|
970 ath_dfs_detach(sc); 971 ath_desc_free(sc); 972 ath_txdma_teardown(sc); 973 ath_rxdma_teardown(sc); 974 ath_tx_cleanup(sc); 975 ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ 976 977 CURVNET_SET(ifp->if_vnet); --- 506 unchanged lines hidden (view full) --- 1484 ath_hal_reset(ah, sc->sc_opmode, 1485 sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, 1486 AH_FALSE, &status); 1487 ath_reset_keycache(sc); 1488 1489 /* Let DFS at it in case it's a DFS channel */ 1490 ath_dfs_radar_enable(sc, ic->ic_curchan); 1491 | 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 |
|
1492 /* Restore the LED configuration */ 1493 ath_led_config(sc); 1494 ath_hal_setledstate(ah, HAL_LED_INIT); 1495 1496 if (sc->sc_resume_up) 1497 ieee80211_resume_all(ic); 1498 1499 /* XXX beacons ? */ --- 413 unchanged lines hidden (view full) --- 1913 ATH_UNLOCK(sc); 1914 return; 1915 } 1916 ath_chan_change(sc, ic->ic_curchan); 1917 1918 /* Let DFS at it in case it's a DFS channel */ 1919 ath_dfs_radar_enable(sc, ic->ic_curchan); 1920 | 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 |
|
1921 /* 1922 * Likewise this is set during reset so update 1923 * state cached in the driver. 1924 */ 1925 sc->sc_diversity = ath_hal_getdiversity(ah); 1926 sc->sc_lastlongcal = 0; 1927 sc->sc_resetcal = 1; 1928 sc->sc_lastcalreset = 0; --- 292 unchanged lines hidden (view full) --- 2221 if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status)) 2222 if_printf(ifp, "%s: unable to reset hardware; hal status %u\n", 2223 __func__, status); 2224 sc->sc_diversity = ath_hal_getdiversity(ah); 2225 2226 /* Let DFS at it in case it's a DFS channel */ 2227 ath_dfs_radar_enable(sc, ic->ic_curchan); 2228 | 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 |
|
2229 if (ath_startrecv(sc) != 0) /* restart recv */ 2230 if_printf(ifp, "%s: unable to start recv logic\n", __func__); 2231 /* 2232 * We may be doing a reset in response to an ioctl 2233 * that changes the channel so update any state that 2234 * might change as a result. 2235 */ 2236 ath_chan_change(sc, ic->ic_curchan); --- 2160 unchanged lines hidden (view full) --- 4397 ret = EIO; 4398 goto finish; 4399 } 4400 sc->sc_diversity = ath_hal_getdiversity(ah); 4401 4402 /* Let DFS at it in case it's a DFS channel */ 4403 ath_dfs_radar_enable(sc, chan); 4404 | 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 |
|
4405 /* 4406 * Re-enable rx framework. 4407 */ 4408 if (ath_startrecv(sc) != 0) { 4409 if_printf(ifp, "%s: unable to restart recv logic\n", 4410 __func__); 4411 ret = EIO; 4412 goto finish; --- 966 unchanged lines hidden (view full) --- 5379#ifdef ATH_DIAGAPI 5380 case SIOCGATHDIAG: 5381 error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); 5382 break; 5383 case SIOCGATHPHYERR: 5384 error = ath_ioctl_phyerr(sc,(struct ath_diag*) ifr); 5385 break; 5386#endif | 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; |
|
5387 case SIOCGATHNODERATESTATS: 5388 error = ath_ioctl_ratestats(sc, (struct ath_rateioctl *) ifr); 5389 break; 5390 case SIOCGIFADDR: 5391 error = ether_ioctl(ifp, cmd, data); 5392 break; 5393 default: 5394 error = EINVAL; --- 337 unchanged lines hidden --- | 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 --- |