if_ath.c (228886) | if_ath.c (228887) |
---|---|
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 228886 2011-12-26 05:26:35Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 228887 2011-12-26 05:37:09Z 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 --- 56 unchanged lines hidden (view full) --- 96#include <dev/ath/if_athvar.h> 97#include <dev/ath/ath_hal/ah_devid.h> /* XXX for softled */ 98#include <dev/ath/ath_hal/ah_diagcodes.h> 99 100#include <dev/ath/if_ath_debug.h> 101#include <dev/ath/if_ath_misc.h> 102#include <dev/ath/if_ath_tx.h> 103#include <dev/ath/if_ath_sysctl.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 --- 56 unchanged lines hidden (view full) --- 96#include <dev/ath/if_athvar.h> 97#include <dev/ath/ath_hal/ah_devid.h> /* XXX for softled */ 98#include <dev/ath/ath_hal/ah_diagcodes.h> 99 100#include <dev/ath/if_ath_debug.h> 101#include <dev/ath/if_ath_misc.h> 102#include <dev/ath/if_ath_tx.h> 103#include <dev/ath/if_ath_sysctl.h> |
104#include <dev/ath/if_ath_led.h> |
|
104#include <dev/ath/if_ath_keycache.h> 105#include <dev/ath/if_athdfs.h> 106 107#ifdef ATH_TX99_DIAG 108#include <dev/ath/ath_tx99/ath_tx99.h> 109#endif 110 111#define ATH_KTR_INTR KTR_SPARE4 --- 87 unchanged lines hidden (view full) --- 199static void ath_setup_stationkey(struct ieee80211_node *); 200static void ath_newassoc(struct ieee80211_node *, int); 201static int ath_setregdomain(struct ieee80211com *, 202 struct ieee80211_regdomain *, int, 203 struct ieee80211_channel []); 204static void ath_getradiocaps(struct ieee80211com *, int, int *, 205 struct ieee80211_channel []); 206static int ath_getchannels(struct ath_softc *); | 105#include <dev/ath/if_ath_keycache.h> 106#include <dev/ath/if_athdfs.h> 107 108#ifdef ATH_TX99_DIAG 109#include <dev/ath/ath_tx99/ath_tx99.h> 110#endif 111 112#define ATH_KTR_INTR KTR_SPARE4 --- 87 unchanged lines hidden (view full) --- 200static void ath_setup_stationkey(struct ieee80211_node *); 201static void ath_newassoc(struct ieee80211_node *, int); 202static int ath_setregdomain(struct ieee80211com *, 203 struct ieee80211_regdomain *, int, 204 struct ieee80211_channel []); 205static void ath_getradiocaps(struct ieee80211com *, int, int *, 206 struct ieee80211_channel []); 207static int ath_getchannels(struct ath_softc *); |
207static void ath_led_event(struct ath_softc *, int); | |
208 209static int ath_rate_setup(struct ath_softc *, u_int mode); 210static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode); 211 212static void ath_announce(struct ath_softc *); 213 214static void ath_dfs_tasklet(void *, int); 215 --- 5735 unchanged lines hidden (view full) --- 5951 DPRINTF(sc, ATH_DEBUG_REGDOMAIN, 5952 "%s: eeprom rd %u cc %u (mapped rd %u cc %u) location %c%s\n", 5953 __func__, sc->sc_eerd, sc->sc_eecc, 5954 ic->ic_regdomain.regdomain, ic->ic_regdomain.country, 5955 ic->ic_regdomain.location, ic->ic_regdomain.ecm ? " ecm" : ""); 5956 return 0; 5957} 5958 | 208 209static int ath_rate_setup(struct ath_softc *, u_int mode); 210static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode); 211 212static void ath_announce(struct ath_softc *); 213 214static void ath_dfs_tasklet(void *, int); 215 --- 5735 unchanged lines hidden (view full) --- 5951 DPRINTF(sc, ATH_DEBUG_REGDOMAIN, 5952 "%s: eeprom rd %u cc %u (mapped rd %u cc %u) location %c%s\n", 5953 __func__, sc->sc_eerd, sc->sc_eecc, 5954 ic->ic_regdomain.regdomain, ic->ic_regdomain.country, 5955 ic->ic_regdomain.location, ic->ic_regdomain.ecm ? " ecm" : ""); 5956 return 0; 5957} 5958 |
5959static void 5960ath_led_done(void *arg) 5961{ 5962 struct ath_softc *sc = arg; 5963 5964 sc->sc_blinking = 0; 5965} 5966 5967/* 5968 * Turn the LED off: flip the pin and then set a timer so no 5969 * update will happen for the specified duration. 5970 */ 5971static void 5972ath_led_off(void *arg) 5973{ 5974 struct ath_softc *sc = arg; 5975 5976 ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon); 5977 callout_reset(&sc->sc_ledtimer, sc->sc_ledoff, ath_led_done, sc); 5978} 5979 5980/* 5981 * Blink the LED according to the specified on/off times. 5982 */ 5983static void 5984ath_led_blink(struct ath_softc *sc, int on, int off) 5985{ 5986 DPRINTF(sc, ATH_DEBUG_LED, "%s: on %u off %u\n", __func__, on, off); 5987 ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, sc->sc_ledon); 5988 sc->sc_blinking = 1; 5989 sc->sc_ledoff = off; 5990 callout_reset(&sc->sc_ledtimer, on, ath_led_off, sc); 5991} 5992 5993static void 5994ath_led_event(struct ath_softc *sc, int rix) 5995{ 5996 sc->sc_ledevent = ticks; /* time of last event */ 5997 if (sc->sc_blinking) /* don't interrupt active blink */ 5998 return; 5999 ath_led_blink(sc, sc->sc_hwmap[rix].ledon, sc->sc_hwmap[rix].ledoff); 6000} 6001 | |
6002static int 6003ath_rate_setup(struct ath_softc *sc, u_int mode) 6004{ 6005 struct ath_hal *ah = sc->sc_ah; 6006 const HAL_RATE_TABLE *rt; 6007 6008 switch (mode) { 6009 case IEEE80211_MODE_11A: --- 701 unchanged lines hidden --- | 5959static int 5960ath_rate_setup(struct ath_softc *sc, u_int mode) 5961{ 5962 struct ath_hal *ah = sc->sc_ah; 5963 const HAL_RATE_TABLE *rt; 5964 5965 switch (mode) { 5966 case IEEE80211_MODE_11A: --- 701 unchanged lines hidden --- |