Lines Matching full:channel
29 /* A chanspec holds the channel number, band, bandwidth and primary 20MHz sub-band */
35 /* channel defines */
43 #define CH_MIN_2G_CHANNEL 1u /* Min channel in 2G band */
44 #define CH_MAX_2G_CHANNEL 14u /* Max channel in 2G band */
45 #define CH_MIN_2G_40M_CHANNEL 3u /* Min 40MHz center channel in 2G band */
46 #define CH_MAX_2G_40M_CHANNEL 11u /* Max 40MHz center channel in 2G band */
48 #define CH_MIN_6G_CHANNEL 1u /* Min 20MHz channel in 6G band */
49 #define CH_MAX_6G_CHANNEL 253u /* Max 20MHz channel in 6G band */
50 #define CH_MIN_6G_40M_CHANNEL 3u /* Min 40MHz center channel in 6G band */
51 #define CH_MAX_6G_40M_CHANNEL 227u /* Max 40MHz center channel in 6G band */
52 #define CH_MIN_6G_80M_CHANNEL 7u /* Min 80MHz center channel in 6G band */
53 #define CH_MAX_6G_80M_CHANNEL 215u /* Max 80MHz center channel in 6G band */
54 #define CH_MIN_6G_160M_CHANNEL 15u /* Min 160MHz center channel in 6G band */
55 #define CH_MAX_6G_160M_CHANNEL 207u /* Max 160MHz center channel in 6G band */
56 #define CH_MIN_6G_240M_CHANNEL 23u /* Min 240MHz center channel in 6G band */
57 #define CH_MAX_6G_240M_CHANNEL 167u /* Max 240MHz center channel in 6G band */
58 #define CH_MIN_6G_320M_CHANNEL 31u /* Min 320MHz center channel in 6G band */
59 #define CH_MAX_6G_320M_CHANNEL 199u /* Max 320MHz center channel in 6G band */
65 #define MAXCHANNEL_NUM (MAXCHANNEL - 1) /* max channel number */
67 #define INVCHANNEL 255u /* error value for a bad channel */
69 /* length of channel vector bitmap is the MAXCHANNEL we want to handle rounded up to a byte */
82 /* channel bitvec */
87 /* make sure channel num is within valid range */
97 /* For contiguous channel bandwidth other than 240MHz/320Mhz */
101 /* For contiguous channel bandwidth >= 240MHz */
105 /* For discontiguous channel bandwidth */
111 /* Non-320/Non-240 Mhz channel sideband indication */
132 /* channel sideband indication for frequency >= 240MHz */
165 /* channel defines */
166 #define LOWER_20_SB(channel) (((channel) > CH_10MHZ_APART) ? \ argument
167 ((channel) - CH_10MHZ_APART) : 0)
168 #define UPPER_20_SB(channel) (((channel) < (MAXCHANNEL - CH_10MHZ_APART)) ? \ argument
169 ((channel) + CH_10MHZ_APART) : 0)
171 /* pass a 80MHz channel number (uint8) to get respective LL, UU, LU, UL */
172 #define LL_20_SB(channel) (((channel) > 3 * CH_10MHZ_APART) ? ((channel) - 3 * CH_10MHZ_APART) : 0) argument
173 #define UU_20_SB(channel) (((channel) < (MAXCHANNEL - 3 * CH_10MHZ_APART)) ? \ argument
174 ((channel) + 3 * CH_10MHZ_APART) : 0)
175 #define LU_20_SB(channel) LOWER_20_SB(channel) argument
176 #define UL_20_SB(channel) UPPER_20_SB(channel) argument
178 #define LOWER_40_SB(channel) ((channel) - CH_20MHZ_APART) argument
179 #define UPPER_40_SB(channel) ((channel) + CH_20MHZ_APART) argument
185 #define CH20MHZ_CHSPEC(channel) (chanspec_t)((chanspec_t)(channel) | WL_CHANSPEC_BW_20 | \ argument
186 WL_CHANNEL_BAND(channel))
187 #define NEXT_20MHZ_CHAN(channel) (((channel) < (MAXCHANNEL - CH_20MHZ_APART)) ? \ argument
188 ((channel) + CH_20MHZ_APART) : 0)
189 #define CH40MHZ_CHSPEC(channel, ctlsb) (chanspec_t) \ argument
190 ((channel) | (ctlsb) | WL_CHANSPEC_BW_40 | \
191 WL_CHANNEL_BAND(channel))
192 #define CH80MHZ_CHSPEC(channel, ctlsb) (chanspec_t) \ argument
193 ((channel) | (ctlsb) | \
195 #define CH160MHZ_CHSPEC(channel, ctlsb) (chanspec_t) \ argument
196 ((channel) | (ctlsb) | \
238 /* pass a center channel and get channel offset from it by 10MHz */
239 #define CH_OFF_10MHZ_MULTIPLES(channel, offset) \ argument
241 (((channel) > (WL_CHANSPEC_CHAN_MASK & ((uint16)((-(offset)) * CH_10MHZ_APART)))) ? \
242 ((channel) + (offset) * CH_10MHZ_APART) : 0) : \
243 ((((uint16)(channel) + (uint16)(offset) * CH_10MHZ_APART) < (uint16)MAXCHANNEL) ? \
244 ((channel) + (offset) * CH_10MHZ_APART) : 0)))
249 /* pass a 160MHz center channel to get 20MHz subband channel numbers */
250 #define LLL_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, -7) argument
251 #define LLU_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, -5) argument
252 #define LUL_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, -3) argument
253 #define LUU_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, -1) argument
254 #define ULL_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, 1) argument
255 #define ULU_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, 3) argument
256 #define UUL_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, 5) argument
257 #define UUU_20_SB_160(channel) CH_OFF_10MHZ_MULTIPLES(channel, 7) argument
277 /* call this with chspec and a valid 20MHz sideband of this channel to get the next 20MHz sideband
279 * resolves to 0 if called with upper most channel
281 #define CH_NEXT_20_SB(chspec, channel) ((uint8) (\ argument
282 ((uint8) ((channel) + CH_20MHZ_APART) > CH_LAST_20_SB(chspec) ? 0 : \
283 ((channel) + CH_20MHZ_APART))))
287 #define LLL_20_SB_160(channel) 0 argument
288 #define LLU_20_SB_160(channel) 0 argument
289 #define LUL_20_SB_160(channel) 0 argument
290 #define LUU_20_SB_160(channel) 0 argument
291 #define ULL_20_SB_160(channel) 0 argument
292 #define ULU_20_SB_160(channel) 0 argument
293 #define UUL_20_SB_160(channel) 0 argument
294 #define UUU_20_SB_160(channel) 0 argument
311 /* call this with chspec and a valid 20MHz sideband of this channel to get the next 20MHz sideband
313 * resolves to 0 if called with upper most channel
315 #define CH_NEXT_20_SB(chspec, channel) ((uint8) (\ argument
316 ((uint8) ((channel) + CH_20MHZ_APART) > CH_LAST_20_SB(chspec) ? 0 : \
317 ((channel) + CH_20MHZ_APART))))
321 /* Iterator for 20MHz side bands of a chanspec: (chanspec_t chspec, uint8 channel)
323 * 'channel' must be a variable (not an expression).
325 #define FOREACH_20_SB(chspec, channel) \ argument
326 for (channel = (uint8)wf_chspec_first_20_sb(chspec); channel; \
327 channel = CH_NEXT_20_SB((chspec), channel))
334 uint8 channel, idx = 0; \
336 FOREACH_20_SB(chspec_local, channel) \
337 (psb)[idx++] = channel; \
390 * Addition to primary20 channel, the function checks for side band for 2g 40 channels
444 #define CH20MHZ_LCHSPEC(channel) \ argument
445 (chanspec_t)((chanspec_t)(channel) | WL_LCHANSPEC_BW_20 | \
446 WL_LCHANSPEC_CTL_SB_NONE | (((channel) <= CH_MAX_2G_CHANNEL) ? \
452 * WF_CHAN_FACTOR_* constants are used to calculate channel frequency
453 * given a channel number.
458 * Channel Factor for the starting frequence of 2.4 GHz channels.
464 * Channel Factor for the starting frequence of 4.9 GHz channels.
470 * Channel Factor for the starting frequence of 5 GHz channels.
476 * Channel Factor for the starting frequence of 6 GHz channels.
481 #define WLC_2G_25MHZ_OFFSET 5 /* 2.4GHz band channel offset */
521 * Verify the chanspec specifies a valid channel according to 802.11.
526 * Verify that the channel is a valid 20MHz channel according to 802.11.
528 bool wf_valid_20MHz_chan(uint channel, chanspec_band_t band);
531 * Verify that the center channel is a valid 40MHz center channel according to 802.11.
536 * Verify that the center channel is a valid 80MHz center channel according to 802.11.
541 * Verify that the center channel is a valid 160MHz center channel according to 802.11.
546 * Verify that the center channel is a valid 240MHz center channel according to 802.11.
551 * Verify that the center channel is a valid 320MHz center channel according to 802.11.
558 chanspec_t wf_create_20MHz_chspec(uint channel, chanspec_band_t band);
561 * Returns the chanspec for a 40MHz channel given the primary 20MHz channel number,
562 * the center channel number, and the band.
568 * Returns the chanspec for a 40MHz channel given the primary 20MHz channel number,
569 * the sub-band for the primary 20MHz channel, and the band.
575 * Returns the chanspec for an 80MHz channel given the primary 20MHz channel number,
576 * the center channel number, and the band.
582 * Returns the chanspec for an 160MHz channel given the primary 20MHz channel number,
583 * the center channel number, and the band.
589 * Returns the chanspec for an 240MHz channel given the primary 20MHz channel number,
590 * the center channel number, and the band.
596 * Returns the chanspec for an 320MHz channel given the primary 20MHz channel number,
597 * the center channel number, and the band.
603 * Returns the chanspec for an 80+80MHz channel given the primary 20MHz channel number,
604 * the center channel numbers for each frequency segment, and the band.
610 * Returns the chanspec for an 160+160MHz channel given the primary 20MHz channel number,
611 * the center channel numbers for each frequency segment, and the band.
616 * Returns the chanspec given the primary 20MHz channel number,
617 * the center channel number, channel width, and the band.
619 * The channel width must be 20, 40, 80, or 160 MHz.
625 * Returns the chanspec given the primary 20MHz channel number,
626 * channel width, and the band.
632 * Returns the chanspec given the index of primary 20MHz channel within whole
633 * channel, the center channel number, channel width, and the band.
635 * The channel width must be 20, 40, 80, or 160 MHz.
641 * Returns the chanspec for an 160+160MHz channel given the index of primary 20MHz
642 * channel within whole channel pair (0-3 if within chan0, 4-7 if within chan1),
643 * the center channel numbers for each frequency segment, and the band.
649 * Return the primary 20MHz channel.
665 * Return the primary 40MHz chanspec for a 40MHz or wider channel
670 * Return the channel number for a given frequency and base frequency
675 * Return the center frequency in MHz of the given channel and base frequency.
677 int wf_channel2mhz(uint channel, uint start_factor);
680 * Returns the chanspec 80Mhz channel corresponding to the following input
683 * primary_channel - primary 20Mhz channel
684 * center_channel - center frequecny of the 80Mhz channel
695 * @param ctl_ch channel
706 * primary_20mhz - Primary 20 MHz channel
707 * chan0_80MHz - center channel number of one frequency segment
708 * chan1_80MHz - center channel number of the other frequency segment
710 * Parameters chan0_80MHz and chan1_80MHz are channel numbers in {42, 58, 106, 122, 138, 155}.
711 * The primary channel must be contained in one of the 80MHz channels. This routine
722 * Returns the center channel of the primary 80 MHz sub-band of the provided chanspec
726 * @return center channel number of the primary 80MHz sub-band of the input.
727 * Will return the center channel of an input 80MHz chspec.
733 * Returns the center channel of the secondary 80 MHz sub-band of the provided chanspec
737 * @return center channel number of the secondary 80MHz sub-band of the input.
743 * Returns the chanspec for the primary 80MHz sub-band of an 160MHz or 80+80 channel
754 * Returns the chanspec for the secondary 80MHz sub-band of an 160MHz or 80+80 channel
756 * does not contain the primary 20MHz channel.
766 * Returns the center channel of the primary 160MHz sub-band of the provided chanspec
770 * @return center channel number of the primary 160MHz sub-band of the input.
771 * Will return the center channel of an input 160MHz chspec.
777 * Returns the chanspec for the primary 160MHz sub-band of an 320MHz channel