diff options
author | sam <sam@FreeBSD.org> | 2008-05-03 21:52:05 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-05-03 21:52:05 +0000 |
commit | 41da951d6c93945bee7b6a5e08257ef43b6b16b2 (patch) | |
tree | 7a5f46d4efaaaea2c796a4935b02cebe3b5d8e1a /sys/dev/ath | |
parent | bee6ac39c33338d9c3cdc03f6b2cb7b9985627d1 (diff) | |
download | FreeBSD-src-41da951d6c93945bee7b6a5e08257ef43b6b16b2.zip FreeBSD-src-41da951d6c93945bee7b6a5e08257ef43b6b16b2.tar.gz |
add back sysctl's to display the regdomain and country code from eeprom;
useful for debugging
Diffstat (limited to 'sys/dev/ath')
-rw-r--r-- | sys/dev/ath/if_ath.c | 17 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index b104c50..80ec1ed 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -5941,7 +5941,6 @@ ath_getchannels(struct ath_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; - u_int32_t rd, cc; int error; /* @@ -5949,19 +5948,19 @@ ath_getchannels(struct ath_softc *sc) */ error = getchannels(sc, &ic->ic_nchans, ic->ic_channels, CTRY_DEFAULT, AH_TRUE, AH_FALSE); - (void) ath_hal_getregdomain(ah, &rd); - ath_hal_getcountrycode(ah, &cc); /* NB: cannot fail */ + (void) ath_hal_getregdomain(ah, &sc->sc_eerd); + ath_hal_getcountrycode(ah, &sc->sc_eecc); /* NB: cannot fail */ if (error) { if_printf(ifp, "%s: unable to collect channel list from hal, " "error %d\n", __func__, error); if (error == EINVAL) { if_printf(ifp, "%s: regdomain likely %u country code %u\n", - __func__, rd, cc); + __func__, sc->sc_eerd, sc->sc_eecc); } return error; } - ic->ic_regdomain.regdomain = ath_mapregdomain(sc, rd); - ic->ic_regdomain.country = cc; + ic->ic_regdomain.regdomain = ath_mapregdomain(sc, sc->sc_eerd); + ic->ic_regdomain.country = sc->sc_eecc; ic->ic_regdomain.ecm = 1; ic->ic_regdomain.location = 'I'; ic->ic_regdomain.isocc[0] = ' '; /* XXX don't know */ @@ -6585,6 +6584,12 @@ ath_sysctlattach(struct ath_softc *sc) struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); struct ath_hal *ah = sc->sc_ah; + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "countrycode", CTLFLAG_RD, &sc->sc_eecc, 0, + "EEPROM country code"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "regdomain", CTLFLAG_RD, &sc->sc_eerd, 0, + "EEPROM regdomain code"); #ifdef ATH_DEBUG sc->sc_debug = ath_debug; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 257c6ee..4af480c 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -246,6 +246,8 @@ struct ath_softc { sc_swbmiss : 1,/* sta mode using sw bmiss */ sc_stagbeacons:1,/* use staggered beacons */ sc_wmetkipmic:1;/* can do WME+TKIP MIC */ + uint32_t sc_eerd; /* regdomain from EEPROM */ + uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */ #define IEEE80211_MODE_HALF (IEEE80211_MODE_MAX+0) #define IEEE80211_MODE_QUARTER (IEEE80211_MODE_MAX+1) |