Lines Matching +full:channel +full:- +full:spacing

1 /*-
2 * SPDX-License-Identifier: ISC
4 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
5 * Copyright (c) 2005-2006 Atheros Communications, Inc.
82 * with shared properties - max tx power, max antenna gain, channel width,
83 * channel spacing, DFS requirements and passive scanning requirements.
87 * or more frequency band entries for each of the channel modes
96 * zones. It uses combinations of frequency ranges - represented in
97 * a bitmask - to determine the requirements and limitations needed.
135 return AH_PRIVATE(ah)->ah_currentRD &~ WORLDWIDE_ROAMING_FLAG; in getEepromRD()
247 return (regpair != AH_NULL) ? regpair->singleCC : CTRY_DEFAULT; in getDefaultCountry()
257 bitnum = bit - byteOffset*64; in IS_BIT_SET()
291 regDmn = country->regDmnEnum; in getregstate()
295 if (country->countryCode == CTRY_DEFAULT) { in getregstate()
317 regDmn = country->regDmnEnum; in getregstate()
323 * Setup per-band state. in getregstate()
330 __func__, regDmn, country->countryCode); in getregstate()
333 rd5GHz = findRegDmn(regpair->regDmn5GHz); in getregstate()
337 __func__, regpair->regDmn5GHz, country->countryCode); in getregstate()
340 rd2GHz = findRegDmn(regpair->regDmn2GHz); in getregstate()
344 __func__, regpair->regDmn2GHz, country->countryCode); in getregstate()
352 __func__, regDmn, country->countryCode); in getregstate()
368 return (rd->chan11b); in getchannelBM()
370 return (rd->chan11g_quarter); in getchannelBM()
372 return (rd->chan11g_half); in getchannelBM()
377 return (rd->chan11g); in getchannelBM()
379 return (rd->chan11g_turbo); in getchannelBM()
381 return (rd->chan11a_quarter); in getchannelBM()
383 return (rd->chan11a_half); in getchannelBM()
388 return (rd->chan11a); in getchannelBM()
390 return (rd->chan11a_turbo); in getchannelBM()
392 return (rd->chan11a_dyn_turbo); in getchannelBM()
402 if (fband->usePassScan & rd->pscan) in setchannelflags()
403 c->ic_flags |= IEEE80211_CHAN_PASSIVE; in setchannelflags()
404 if (fband->useDfs & rd->dfsMask) in setchannelflags()
405 c->ic_flags |= IEEE80211_CHAN_DFS; in setchannelflags()
406 if (IEEE80211_IS_CHAN_5GHZ(c) && (rd->flags & DISALLOW_ADHOC_11A)) in setchannelflags()
407 c->ic_flags |= IEEE80211_CHAN_NOADHOC; in setchannelflags()
409 (rd->flags & DISALLOW_ADHOC_11A_TURB)) in setchannelflags()
410 c->ic_flags |= IEEE80211_CHAN_NOADHOC; in setchannelflags()
411 if (rd->flags & NO_HOSTAP) in setchannelflags()
412 c->ic_flags |= IEEE80211_CHAN_NOHOSTAP; in setchannelflags()
413 if (rd->flags & LIMIT_FRAME_4MS) in setchannelflags()
414 c->ic_flags |= IEEE80211_CHAN_4MSXMIT; in setchannelflags()
415 if (rd->flags & NEED_NFC) in setchannelflags()
416 c->ic_flags |= CHANNEL_NFCREQUIRED; in setchannelflags()
434 c->ic_freq = freq; in addchan()
435 c->ic_flags = flags; in addchan()
437 c->ic_maxregpower = fband->powerDfs; in addchan()
439 c->ic_maxantgain = fband->antennaMax; in addchan()
461 c[0] = c[-1]; in copychan_prev()
462 c->ic_freq = freq; in copychan_prev()
501 *hi_adj = -20; in adj_freq_ht40()
521 if (!ath_hal_getChannelEdges(ah, cm->flags, &freq_lo, &freq_hi)) { in add_chanlist_mode()
522 /* channel not supported by hardware, skip it */ in add_chanlist_mode()
525 __func__, cm->flags); in add_chanlist_mode()
529 channelBM = getchannelBM(cm->mode, rd); in add_chanlist_mode()
535 * 5G HT40 channels require 40Mhz channel separation. in add_chanlist_mode()
537 adj_freq_ht40(cm->mode, &low_adj, &hi_adj, &channelSep); in add_chanlist_mode()
546 fband = &cm->freqs[b]; in add_chanlist_mode()
548 if ((fband->usePassScan & IS_ECM_CHAN) && in add_chanlist_mode()
555 if ((fband->useDfs & rd->dfsMask) && in add_chanlist_mode()
556 (cm->flags & IEEE80211_CHAN_HT40)) { in add_chanlist_mode()
567 * be allowed to use channel 144 (pri or sec overlap.) in add_chanlist_mode()
570 bfreq_lo = MAX(fband->lowChannel + low_adj, freq_lo); in add_chanlist_mode()
571 bfreq_hi = MIN(fband->highChannel + hi_adj, freq_hi); in add_chanlist_mode()
574 * Don't start the 5GHz channel list at 5120MHz. in add_chanlist_mode()
576 * Unfortunately (sigh) the HT40 channel creation in add_chanlist_mode()
579 * HT40 channel, and everything goes messed up from there. in add_chanlist_mode()
581 if ((cm->flags & IEEE80211_CHAN_5GHZ) && in add_chanlist_mode()
582 (cm->flags & IEEE80211_CHAN_HT40U)) { in add_chanlist_mode()
588 * Same with HT40D - need to start at 5200 or the low in add_chanlist_mode()
591 if ((cm->flags & IEEE80211_CHAN_5GHZ) && in add_chanlist_mode()
592 (cm->flags & IEEE80211_CHAN_HT40D)) { in add_chanlist_mode()
597 if (fband->channelSep >= channelSep) in add_chanlist_mode()
598 step = fband->channelSep; in add_chanlist_mode()
600 step = roundup(channelSep, fband->channelSep); in add_chanlist_mode()
611 (int) fband->lowChannel, in add_chanlist_mode()
612 (int) fband->highChannel, in add_chanlist_mode()
616 (int) cm->flags); in add_chanlist_mode()
619 bfreq_lo, bfreq_hi, step, cm->flags, fband, rd); in add_chanlist_mode()
622 "%s: too many channels for channel table\n", in add_chanlist_mode()
641 if (isChanBitMaskZero(rd5GHz->chan11a) && in getmodesmask()
653 * Construct the channel list for the specified regulatory config.
684 if ((cm->mode & modesMask) == 0) { in getchannels()
687 __func__, cm->mode, cm->flags); in getchannels()
691 if (cm->flags & IEEE80211_CHAN_5GHZ) in getchannels()
693 else if (cm->flags & IEEE80211_CHAN_2GHZ) in getchannels()
697 __func__, cm->flags); in getchannels()
716 * Retrieve a channel list without affecting runtime state.
731 * and the channel is marked IEEE80211_CHAN_GSM.
741 return 3344 - freq; in ath_hal_mapgsm()
751 * Setup the internal/private channel state given a table of
754 * where we don't have net80211 channel context.
766 for (j = i-1; j >= 0; j--) in assignPrivateChannels()
767 if (chans[j].ic_freq == c->ic_freq) { in assignPrivateChannels()
768 c->ic_devdata = chans[j].ic_devdata; in assignPrivateChannels()
772 /* new entry, assign a private channel entry */ in assignPrivateChannels()
773 if (next >= N(AH_PRIVATE(ah)->ah_channels)) { in assignPrivateChannels()
776 __func__, N(AH_PRIVATE(ah)->ah_channels)); in assignPrivateChannels()
782 * down-converted. The 802.11 layer uses the in assignPrivateChannels()
786 ath_hal_mapgsm(sku, c->ic_freq) : c->ic_freq; in assignPrivateChannels()
789 "%s: private[%3u] %u/0x%x -> channel %u\n", in assignPrivateChannels()
790 __func__, next, c->ic_freq, c->ic_flags, freq); in assignPrivateChannels()
792 ic = &AH_PRIVATE(ah)->ah_channels[next]; in assignPrivateChannels()
796 * restarted and re-setup any per-channel state. in assignPrivateChannels()
799 ic->channel = freq; in assignPrivateChannels()
800 c->ic_devdata = next; in assignPrivateChannels()
804 AH_PRIVATE(ah)->ah_nchan = next; in assignPrivateChannels()
811 * Setup the channel list based on the information in the EEPROM.
826 assignPrivateChannels(ah, chans, *nchans, AH_PRIVATE(ah)->ah_currentRD)) { in ath_hal_init_channels()
827 AH_PRIVATE(ah)->ah_rd2GHz = rd2GHz; in ath_hal_init_channels()
828 AH_PRIVATE(ah)->ah_rd5GHz = rd5GHz; in ath_hal_init_channels()
830 ah->ah_countryCode = country->countryCode; in ath_hal_init_channels()
832 __func__, ah->ah_countryCode); in ath_hal_init_channels()
843 * Set the channel list.
861 * according to the sku to compensate for the down-converter. in ath_hal_set_channels()
862 * We use the FCC for these sku's as the mapped channel in ath_hal_set_channels()
872 rd = AH_PRIVATE(ah)->ah_currentRD; in ath_hal_set_channels()
876 AH_PRIVATE(ah)->ah_rd2GHz = rd2GHz; in ath_hal_set_channels()
877 AH_PRIVATE(ah)->ah_rd5GHz = rd5GHz; in ath_hal_set_channels()
879 ah->ah_countryCode = country->countryCode; in ath_hal_set_channels()
881 __func__, ah->ah_countryCode); in ath_hal_set_channels()
894 * Return the internal channel corresponding to a public channel.
900 HAL_CHANNEL_INTERNAL *cc = &AH_PRIVATE(ah)->ah_channels[c->ic_devdata]; in ath_hal_checkchannel()
902 if (c->ic_devdata < AH_PRIVATE(ah)->ah_nchan && in ath_hal_checkchannel()
903 (c->ic_freq == cc->channel || IEEE80211_IS_CHAN_GSM(c))) in ath_hal_checkchannel()
905 if (c->ic_devdata >= AH_PRIVATE(ah)->ah_nchan) { in ath_hal_checkchannel()
908 __func__, c->ic_devdata, AH_PRIVATE(ah)->ah_nchan); in ath_hal_checkchannel()
909 HALASSERT(c->ic_devdata < AH_PRIVATE(ah)->ah_nchan); in ath_hal_checkchannel()
912 "%s: no match for %u/0x%x devdata %u channel %u\n", in ath_hal_checkchannel()
913 __func__, c->ic_freq, c->ic_flags, c->ic_devdata, in ath_hal_checkchannel()
914 cc->channel); in ath_hal_checkchannel()
915 HALASSERT(c->ic_freq == cc->channel || IEEE80211_IS_CHAN_GSM(c)); in ath_hal_checkchannel()
926 * Return the test group for the specific channel based on
934 if (AH_PRIVATE(ah)->ah_rd2GHz == AH_PRIVATE(ah)->ah_rd5GHz || in ath_hal_getctl()
935 (ah->ah_countryCode == CTRY_DEFAULT && isWwrSKU(ah))) in ath_hal_getctl()
938 ctl = AH_PRIVATE(ah)->ah_rd2GHz->conformanceTestLimit; in ath_hal_getctl()
940 ctl = AH_PRIVATE(ah)->ah_rd5GHz->conformanceTestLimit; in ath_hal_getctl()
958 * Since FreeBSD/net80211 allows the channel set to change
965 const REG_DOMAIN *rd5GHz = AH_PRIVATE(ah)->ah_rd5GHz; in ath_hal_update_dfsdomain()
968 if (rd5GHz->dfsMask & DFS_FCC3) in ath_hal_update_dfsdomain()
970 if (rd5GHz->dfsMask & DFS_ETSI) in ath_hal_update_dfsdomain()
972 if (rd5GHz->dfsMask & DFS_MKK4) in ath_hal_update_dfsdomain()
974 AH_PRIVATE(ah)->ah_dfsDomain = dfsDomain; in ath_hal_update_dfsdomain()
976 __func__, AH_PRIVATE(ah)->ah_dfsDomain); in ath_hal_update_dfsdomain()
992 int8_t antennaMax = twiceGain - chan->ic_maxantgain*2; in ath_hal_getantennareduction()