if_ath.c (155485) | if_ath.c (155486) |
---|---|
1/*- 2 * Copyright (c) 2002-2005 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 --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGES. 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2005 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 --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGES. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 155485 2006-02-09 21:23:44Z sam $"); | 38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 155486 2006-02-09 21:28:11Z sam $"); |
39 40/* 41 * Driver for the Atheros Wireless LAN controller. 42 * 43 * This software is derived from work of Atsushi Onoe; his contribution 44 * is greatly appreciated. 45 */ 46 --- 33 unchanged lines hidden (view full) --- 80#include <netinet/if_ether.h> 81#endif 82 83#define AR_DEBUG 84#include <dev/ath/if_athvar.h> 85#include <contrib/dev/ath/ah_desc.h> 86#include <contrib/dev/ath/ah_devid.h> /* XXX for softled */ 87 | 39 40/* 41 * Driver for the Atheros Wireless LAN controller. 42 * 43 * This software is derived from work of Atsushi Onoe; his contribution 44 * is greatly appreciated. 45 */ 46 --- 33 unchanged lines hidden (view full) --- 80#include <netinet/if_ether.h> 81#endif 82 83#define AR_DEBUG 84#include <dev/ath/if_athvar.h> 85#include <contrib/dev/ath/ah_desc.h> 86#include <contrib/dev/ath/ah_devid.h> /* XXX for softled */ 87 |
88#ifdef ATH_TX99_DIAG 89#include <dev/ath/ath_tx99/ath_tx99.h> 90#endif 91 |
|
88/* unaligned little endian access */ 89#define LE_READ_2(p) \ 90 ((u_int16_t) \ 91 ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8))) 92#define LE_READ_4(p) \ 93 ((u_int32_t) \ 94 ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8) | \ 95 (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) --- 532 unchanged lines hidden (view full) --- 628 * o reclaim the tx queue data structures after calling 629 * the 802.11 layer as we'll get called back to reclaim 630 * node state and potentially want to use them 631 * o to cleanup the tx queues the hal is called, so detach 632 * it last 633 * Other than that, it's straightforward... 634 */ 635 ieee80211_ifdetach(&sc->sc_ic); | 92/* unaligned little endian access */ 93#define LE_READ_2(p) \ 94 ((u_int16_t) \ 95 ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8))) 96#define LE_READ_4(p) \ 97 ((u_int32_t) \ 98 ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8) | \ 99 (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) --- 532 unchanged lines hidden (view full) --- 632 * o reclaim the tx queue data structures after calling 633 * the 802.11 layer as we'll get called back to reclaim 634 * node state and potentially want to use them 635 * o to cleanup the tx queues the hal is called, so detach 636 * it last 637 * Other than that, it's straightforward... 638 */ 639 ieee80211_ifdetach(&sc->sc_ic); |
640#ifdef ATH_TX99_DIAG 641 if (sc->sc_tx99 != NULL) 642 sc->sc_tx99->detach(sc->sc_tx99); 643#endif |
|
636 ath_rate_detach(sc->sc_rc); 637 ath_desc_free(sc); 638 ath_tx_cleanup(sc); 639 ath_hal_detach(sc->sc_ah); 640 if_free(ifp); 641 642 return 0; 643} --- 278 unchanged lines hidden (view full) --- 922 ic->ic_state = IEEE80211_S_INIT; 923 924 /* 925 * The hardware should be ready to go now so it's safe 926 * to kick the 802.11 state machine as it's likely to 927 * immediately call back to us to send mgmt frames. 928 */ 929 ath_chan_change(sc, ic->ic_curchan); | 644 ath_rate_detach(sc->sc_rc); 645 ath_desc_free(sc); 646 ath_tx_cleanup(sc); 647 ath_hal_detach(sc->sc_ah); 648 if_free(ifp); 649 650 return 0; 651} --- 278 unchanged lines hidden (view full) --- 930 ic->ic_state = IEEE80211_S_INIT; 931 932 /* 933 * The hardware should be ready to go now so it's safe 934 * to kick the 802.11 state machine as it's likely to 935 * immediately call back to us to send mgmt frames. 936 */ 937 ath_chan_change(sc, ic->ic_curchan); |
938#ifdef ATH_TX99_DIAG 939 if (sc->sc_tx99 != NULL) 940 sc->sc_tx99->start(sc->sc_tx99); 941 else 942#endif |
|
930 if (ic->ic_opmode != IEEE80211_M_MONITOR) { 931 if (ic->ic_roaming != IEEE80211_ROAMING_MANUAL) 932 ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); 933 } else 934 ieee80211_new_state(ic, IEEE80211_S_RUN, -1); 935done: 936 ATH_UNLOCK(sc); 937} --- 20 unchanged lines hidden (view full) --- 958 * clear receive machinery 959 * drain and release tx queues 960 * reclaim beacon resources 961 * power down hardware 962 * 963 * Note that some of this work is not possible if the 964 * hardware is gone (invalid). 965 */ | 943 if (ic->ic_opmode != IEEE80211_M_MONITOR) { 944 if (ic->ic_roaming != IEEE80211_ROAMING_MANUAL) 945 ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); 946 } else 947 ieee80211_new_state(ic, IEEE80211_S_RUN, -1); 948done: 949 ATH_UNLOCK(sc); 950} --- 20 unchanged lines hidden (view full) --- 971 * clear receive machinery 972 * drain and release tx queues 973 * reclaim beacon resources 974 * power down hardware 975 * 976 * Note that some of this work is not possible if the 977 * hardware is gone (invalid). 978 */ |
979#ifdef ATH_TX99_DIAG 980 if (sc->sc_tx99 != NULL) 981 sc->sc_tx99->stop(sc->sc_tx99); 982#endif |
|
966 ieee80211_new_state(ic, IEEE80211_S_INIT, -1); 967 ifp->if_drv_flags &= ~IFF_DRV_RUNNING; 968 ifp->if_timer = 0; 969 if (!sc->sc_invalid) { 970 if (sc->sc_softled) { 971 callout_stop(&sc->sc_ledtimer); 972 ath_hal_gpioset(ah, sc->sc_ledpin, 973 !sc->sc_ledon); --- 4069 unchanged lines hidden --- | 983 ieee80211_new_state(ic, IEEE80211_S_INIT, -1); 984 ifp->if_drv_flags &= ~IFF_DRV_RUNNING; 985 ifp->if_timer = 0; 986 if (!sc->sc_invalid) { 987 if (sc->sc_softled) { 988 callout_stop(&sc->sc_ledtimer); 989 ath_hal_gpioset(ah, sc->sc_ledpin, 990 !sc->sc_ledon); --- 4069 unchanged lines hidden --- |