diff options
author | sam <sam@FreeBSD.org> | 2006-04-26 16:02:36 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2006-04-26 16:02:36 +0000 |
commit | bae88d22bb1da8d2db77036b0ccc9808120f0820 (patch) | |
tree | 9ebd02b5b6452e86dbab4fda1b0b78ca270fd6a3 /sys | |
parent | c8ffa2a506733319004d3fa1e61175a7c57c8e77 (diff) | |
download | FreeBSD-src-bae88d22bb1da8d2db77036b0ccc9808120f0820.zip FreeBSD-src-bae88d22bb1da8d2db77036b0ccc9808120f0820.tar.gz |
intercept public safety channels and do explicit mapping of freq->ieee
channel number since we're not ready at the net80211 layer to deal with them;
note this mapping has to match what's done in ieee80211_mhz2ieee
MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ath/if_ath.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 146eb68..2ff530b 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -4586,6 +4586,9 @@ ath_getchannels(struct ath_softc *sc, u_int cc, HAL_BOOL outdoor, HAL_BOOL xchanmode) { #define COMPAT (CHANNEL_ALL_NOTURBO|CHANNEL_PASSIVE) +#define IS_CHAN_PUBLIC_SAFETY(_c) \ + (((_c)->channelFlags & CHANNEL_5GHZ) && \ + ((_c)->channel > 4940 && (_c)->channel < 4990)) struct ieee80211com *ic = &sc->sc_ic; struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; @@ -4618,7 +4621,16 @@ ath_getchannels(struct ath_softc *sc, u_int cc, HAL_CHANNEL *c = &chans[i]; u_int16_t flags; - ix = ath_hal_mhz2ieee(ah, c->channel, c->channelFlags); + /* + * XXX we're not ready to handle the ieee number mapping + * for public safety channels as they overlap with any + * 2GHz channels; for now use the non-public safety + * numbering which is non-overlapping. + */ + if (IS_CHAN_PUBLIC_SAFETY(c)) + ix = (c->channel - 4000) / 5; + else + ix = ath_hal_mhz2ieee(ah, c->channel, c->channelFlags); if (ix > IEEE80211_CHAN_MAX) { if_printf(ifp, "bad hal channel %d (%u/%x) ignored\n", ix, c->channel, c->channelFlags); @@ -4651,6 +4663,7 @@ ath_getchannels(struct ath_softc *sc, u_int cc, } free(chans, M_TEMP); return 0; +#undef IS_CHAN_PUBLIC_SAFETY #undef COMPAT } |