if_ath.c (117055) | if_ath.c (117516) |
---|---|
1/*- 2 * Copyright (c) 2002, 2003 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, 2003 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 117055 2003-06-30 04:51:11Z sam $"); | 38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 117516 2003-07-13 17:07:25Z 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 --- 96 unchanged lines hidden (view full) --- 143 144/* XXX validate sysctl values */ 145static int ath_dwelltime = 200; /* 5 channels/second */ 146SYSCTL_INT(_hw_ath, OID_AUTO, dwell, CTLFLAG_RW, &ath_dwelltime, 147 0, "channel dwell time (ms) for AP/station scanning"); 148static int ath_calinterval = 30; /* calibrate every 30 secs */ 149SYSCTL_INT(_hw_ath, OID_AUTO, calibrate, CTLFLAG_RW, &ath_calinterval, 150 0, "chip calibration interval (secs)"); | 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 --- 96 unchanged lines hidden (view full) --- 143 144/* XXX validate sysctl values */ 145static int ath_dwelltime = 200; /* 5 channels/second */ 146SYSCTL_INT(_hw_ath, OID_AUTO, dwell, CTLFLAG_RW, &ath_dwelltime, 147 0, "channel dwell time (ms) for AP/station scanning"); 148static int ath_calinterval = 30; /* calibrate every 30 secs */ 149SYSCTL_INT(_hw_ath, OID_AUTO, calibrate, CTLFLAG_RW, &ath_calinterval, 150 0, "chip calibration interval (secs)"); |
151static int ath_outdoor = AH_TRUE; /* outdoor operation */ 152SYSCTL_INT(_hw_ath, OID_AUTO, outdoor, CTLFLAG_RD, &ath_outdoor, 153 0, "enable/disable outdoor operation"); 154static int ath_countrycode = CTRY_DEFAULT; /* country code */ 155SYSCTL_INT(_hw_ath, OID_AUTO, countrycode, CTLFLAG_RD, &ath_countrycode, 156 0, "country code"); 157static int ath_regdomain = 0; /* regulatory domain */ 158SYSCTL_INT(_hw_ath, OID_AUTO, regdomain, CTLFLAG_RD, &ath_regdomain, 159 0, "regulatory domain"); |
|
151 152static int ath_bmisshack = 1; 153SYSCTL_INT(_hw_ath, OID_AUTO, bmisshack, CTLFLAG_RW, &ath_bmisshack, 154 0, "enable/disable hack to discard bmiss interrupts"); 155 156#ifdef AR_DEBUG 157int ath_debug = 0; 158SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, --- 34 unchanged lines hidden (view full) --- 193 error = ENXIO; 194 goto bad; 195 } 196 sc->sc_ah = ah; 197 198 /* 199 * Collect the channel list using the default country 200 * code and including outdoor channels. The 802.11 layer | 160 161static int ath_bmisshack = 1; 162SYSCTL_INT(_hw_ath, OID_AUTO, bmisshack, CTLFLAG_RW, &ath_bmisshack, 163 0, "enable/disable hack to discard bmiss interrupts"); 164 165#ifdef AR_DEBUG 166int ath_debug = 0; 167SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, --- 34 unchanged lines hidden (view full) --- 202 error = ENXIO; 203 goto bad; 204 } 205 sc->sc_ah = ah; 206 207 /* 208 * Collect the channel list using the default country 209 * code and including outdoor channels. The 802.11 layer |
201 * is resposible for filtering this list to a set of 202 * channels that it considers ok to use. | 210 * is resposible for filtering this list based on settings 211 * like the phy mode. |
203 */ | 212 */ |
204 error = ath_getchannels(sc, CTRY_DEFAULT, AH_TRUE); | 213 error = ath_getchannels(sc, ath_countrycode, ath_outdoor); |
205 if (error != 0) 206 goto bad; | 214 if (error != 0) 215 goto bad; |
216 /* 217 * Copy these back; they are set as a side effect 218 * of constructing the channel list. 219 */ 220 ath_regdomain = ath_hal_getregdomain(ah); 221 ath_countrycode = ath_hal_getcountrycode(ah); |
|
207 208 /* 209 * Setup rate tables for all potential media types. 210 */ 211 ath_rate_setup(sc, IEEE80211_MODE_11A); 212 ath_rate_setup(sc, IEEE80211_MODE_11B); 213 ath_rate_setup(sc, IEEE80211_MODE_11G); 214 ath_rate_setup(sc, IEEE80211_MODE_TURBO); --- 2071 unchanged lines hidden (view full) --- 2286 2287 sc->sc_have11g = 0; 2288 chans = malloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL), 2289 M_TEMP, M_NOWAIT); 2290 if (chans == NULL) { 2291 if_printf(ifp, "unable to allocate channel table\n"); 2292 return ENOMEM; 2293 } | 222 223 /* 224 * Setup rate tables for all potential media types. 225 */ 226 ath_rate_setup(sc, IEEE80211_MODE_11A); 227 ath_rate_setup(sc, IEEE80211_MODE_11B); 228 ath_rate_setup(sc, IEEE80211_MODE_11G); 229 ath_rate_setup(sc, IEEE80211_MODE_TURBO); --- 2071 unchanged lines hidden (view full) --- 2301 2302 sc->sc_have11g = 0; 2303 chans = malloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL), 2304 M_TEMP, M_NOWAIT); 2305 if (chans == NULL) { 2306 if_printf(ifp, "unable to allocate channel table\n"); 2307 return ENOMEM; 2308 } |
2294 /* XXX where does the country code, et. al. come from? */ | |
2295 if (!ath_hal_init_channels(ah, chans, IEEE80211_CHAN_MAX, &nchan, | 2309 if (!ath_hal_init_channels(ah, chans, IEEE80211_CHAN_MAX, &nchan, |
2296 CTRY_DEFAULT, HAL_MODE_ALL, AH_TRUE)) { | 2310 cc, HAL_MODE_ALL, outdoor)) { |
2297 if_printf(ifp, "unable to collect channel list from hal\n"); 2298 free(chans, M_TEMP); 2299 return EINVAL; 2300 } 2301 2302 /* 2303 * Convert HAL channels to ieee80211 ones and insert 2304 * them in the table according to their channel number. --- 247 unchanged lines hidden --- | 2311 if_printf(ifp, "unable to collect channel list from hal\n"); 2312 free(chans, M_TEMP); 2313 return EINVAL; 2314 } 2315 2316 /* 2317 * Convert HAL channels to ieee80211 ones and insert 2318 * them in the table according to their channel number. --- 247 unchanged lines hidden --- |