Lines Matching refs:bw

182 #define WFC_BW_EQ(bw, val)	WFC_2VALS_EQ(bw, val)  argument
184 #define WFC_BW_EQ(bw, val) (FALSE) argument
188 static chanspec_bw_t wf_iter_next_bw(chanspec_bw_t bw);
191 static int wf_chanspec_iter_next_5g_range(wf_chanspec_iter_t *iter, chanspec_bw_t bw);
192 static void wf_chanspec_iter_6g_range_init(wf_chanspec_iter_t *iter, chanspec_bw_t bw);
206 uint bw; in wf_bw_chspec_to_mhz() local
208 bw = (chspec & WL_CHANSPEC_BW_MASK) >> WL_CHANSPEC_BW_SHIFT; in wf_bw_chspec_to_mhz()
209 return (bw >= WF_NUM_BW ? 0 : wf_chspec_bw_mhz[bw]); in wf_bw_chspec_to_mhz()
216 center_chan_to_edge(chanspec_bw_t bw) in center_chan_to_edge() argument
223 if (bw == WL_CHANSPEC_BW_40) { in center_chan_to_edge()
226 } else if (bw == WL_CHANSPEC_BW_80) { in center_chan_to_edge()
229 } else if (bw == WL_CHANSPEC_BW_160) { in center_chan_to_edge()
232 } else if (WFC_BW_EQ(bw, WL_CHANSPEC_BW_240)) { in center_chan_to_edge()
235 } else if (WFC_BW_EQ(bw, WL_CHANSPEC_BW_320)) { in center_chan_to_edge()
246 channel_low_edge(uint center_ch, chanspec_bw_t bw) in channel_low_edge() argument
248 return (center_ch - center_chan_to_edge(bw)); in channel_low_edge()
255 channel_to_sb(uint center_ch, uint primary_ch, chanspec_bw_t bw) in channel_to_sb() argument
257 uint lowest = channel_low_edge(center_ch, bw); in channel_to_sb()
271 if ((bw == WL_CHANSPEC_BW_20 && sb >= 1) || in channel_to_sb()
272 (bw == WL_CHANSPEC_BW_40 && sb >= 2) || in channel_to_sb()
273 (bw == WL_CHANSPEC_BW_80 && sb >= 4) || in channel_to_sb()
274 (bw == WL_CHANSPEC_BW_160 && sb >= 8) || in channel_to_sb()
275 (WFC_BW_EQ(bw, WL_CHANSPEC_BW_240) && sb >= 12) || in channel_to_sb()
276 (WFC_BW_EQ(bw, WL_CHANSPEC_BW_320) && sb >= 16)) { in channel_to_sb()
286 channel_to_primary20_chan(uint center_ch, chanspec_bw_t bw, uint sb) in channel_to_primary20_chan() argument
288 return (channel_low_edge(center_ch, bw) + sb * 4); in channel_to_primary20_chan()
526 const char *bw; in wf_chspec_ntoa() local
528 bw = wf_chspec_to_bw_str(chspec); in wf_chspec_ntoa()
530 snprintf(buf, CHANSPEC_STR_LEN, "%s%d/%s", band, pri_chan, bw); in wf_chspec_ntoa()
533 const char *bw; in wf_chspec_ntoa() local
535 bw = wf_chspec_to_bw_str(chspec); in wf_chspec_ntoa()
537 snprintf(buf, CHANSPEC_STR_LEN, "%s%d/%s", band, pri_chan, bw); in wf_chspec_ntoa()
539 const char *bw; in wf_chspec_ntoa() local
542 bw = wf_chspec_to_bw_str(chspec); in wf_chspec_ntoa()
550 snprintf(buf, CHANSPEC_STR_LEN, "%s%d/%s%s", band, pri_chan, bw, sb); in wf_chspec_ntoa()
557 snprintf(buf, CHANSPEC_STR_LEN, "%s%d/%s", band, pri_chan, bw); in wf_chspec_ntoa()
598 uint bw; in wf_chspec_aton() local
602 bw = 20; in wf_chspec_aton()
655 if (!read_uint(&a, &bw)) in wf_chspec_aton()
659 if (bw == 20) { in wf_chspec_aton()
661 } else if (bw == 40) { in wf_chspec_aton()
663 } else if (bw == 80) { in wf_chspec_aton()
665 } else if (bw == 160) { in wf_chspec_aton()
667 } else if (WFC_BW_EQ(bw, 240)) { in wf_chspec_aton()
669 } else if (WFC_BW_EQ(bw, 320)) { in wf_chspec_aton()
682 if (chspec_band == WL_CHANSPEC_BAND_2G && bw == 40) { in wf_chspec_aton()
944 wf_chanspec_iter_init(wf_chanspec_iter_t *iter, chanspec_band_t band, chanspec_bw_t bw) in wf_chanspec_iter_init() argument
969 if (!(bw == INVCHANSPEC || in wf_chanspec_iter_init()
970 bw == WL_CHANSPEC_BW_20 || in wf_chanspec_iter_init()
971 bw == WL_CHANSPEC_BW_40 || in wf_chanspec_iter_init()
973 (bw == WL_CHANSPEC_BW_80 || in wf_chanspec_iter_init()
974 bw == WL_CHANSPEC_BW_160 || in wf_chanspec_iter_init()
975 WFC_BW_EQ(bw, WL_CHANSPEC_BW_240) || in wf_chanspec_iter_init()
976 WFC_BW_EQ(bw, WL_CHANSPEC_BW_320))))) { in wf_chanspec_iter_init()
988 iter->bw = bw; in wf_chanspec_iter_init()
1002 chanspec_bw_t bw = iter->bw; in wf_chanspec_iter_firstchan() local
1006 if (bw == INVCHANSPEC) { in wf_chanspec_iter_firstchan()
1007 bw = WL_CHANSPEC_BW_20; in wf_chanspec_iter_firstchan()
1015 if (bw == WL_CHANSPEC_BW_20) { in wf_chanspec_iter_firstchan()
1018 chspec = (WL_CHANSPEC_BAND_2G | bw | WL_CHANSPEC_CTL_SB_L | in wf_chanspec_iter_firstchan()
1023 wf_chanspec_iter_next_5g_range(iter, bw); in wf_chanspec_iter_firstchan()
1025 wf_chanspec_iter_6g_range_init(iter, bw); in wf_chanspec_iter_firstchan()
1027 chspec = wf_create_chspec_from_primary(iter->range.start, bw, band); in wf_chanspec_iter_firstchan()
1085 wf_iter_next_bw(chanspec_bw_t bw) in wf_iter_next_bw() argument
1087 switch (bw) { in wf_iter_next_bw()
1089 bw = WL_CHANSPEC_BW_40; in wf_iter_next_bw()
1092 bw = WL_CHANSPEC_BW_80; in wf_iter_next_bw()
1095 bw = WL_CHANSPEC_BW_160; in wf_iter_next_bw()
1099 bw = WL_CHANSPEC_BW_240; in wf_iter_next_bw()
1102 bw = WL_CHANSPEC_BW_320; in wf_iter_next_bw()
1106 bw = INVCHANSPEC; in wf_iter_next_bw()
1109 return bw; in wf_iter_next_bw()
1125 } else if (iter->bw == INVCHANSPEC) { in wf_chanspec_iter_next_2g()
1168 chanspec_bw_t bw = CHSPEC_BW(chspec); in wf_chanspec_iter_next_5g() local
1178 } else if (wf_chanspec_iter_next_5g_range(iter, bw)) { in wf_chanspec_iter_next_5g()
1181 } else if (iter->bw == INVCHANSPEC) { in wf_chanspec_iter_next_5g()
1183 bw = wf_iter_next_bw(bw); in wf_chanspec_iter_next_5g()
1184 if (bw != INVCHANSPEC) { in wf_chanspec_iter_next_5g()
1187 wf_chanspec_iter_next_5g_range(iter, bw); in wf_chanspec_iter_next_5g()
1200 chspec = wf_create_chspec_from_primary(ch, bw, WL_CHANSPEC_BAND_5G); in wf_chanspec_iter_next_5g()
1223 wf_chanspec_iter_next_5g_range(wf_chanspec_iter_t *iter, chanspec_bw_t bw) in wf_chanspec_iter_next_5g_range() argument
1229 if (bw == WL_CHANSPEC_BW_20) { in wf_chanspec_iter_next_5g_range()
1245 if (bw == WL_CHANSPEC_BW_40) { in wf_chanspec_iter_next_5g_range()
1248 } else if (bw == WL_CHANSPEC_BW_80) { in wf_chanspec_iter_next_5g_range()
1251 } else if (bw == WL_CHANSPEC_BW_160) { in wf_chanspec_iter_next_5g_range()
1265 uint offset = center_chan_to_edge(bw); in wf_chanspec_iter_next_5g_range()
1287 chanspec_bw_t bw = CHSPEC_BW(chspec); in wf_chanspec_iter_next_6g() local
1301 chspec = wf_create_chspec_from_primary(ch, bw, WL_CHANSPEC_BAND_6G); in wf_chanspec_iter_next_6g()
1317 iter->bw == INVCHANSPEC && in wf_chanspec_iter_next_6g()
1318 (bw = wf_iter_next_bw(bw)) != INVCHANSPEC) { in wf_chanspec_iter_next_6g()
1321 chspec = wf_create_chspec_from_primary(ch, bw, WL_CHANSPEC_BAND_6G); in wf_chanspec_iter_next_6g()
1338 wf_chanspec_iter_6g_range_init(wf_chanspec_iter_t *iter, chanspec_bw_t bw) in wf_chanspec_iter_6g_range_init() argument
1340 switch (bw) { in wf_chanspec_iter_6g_range_init()
2015 chanspec_bw_t bw, chanspec_band_t band) in wf_create_chspec() argument
2022 if (bw == WL_CHANSPEC_BW_20 && primary_channel == center_channel) { in wf_create_chspec()
2026 } else if (bw == WL_CHANSPEC_BW_40 || in wf_create_chspec()
2027 bw == WL_CHANSPEC_BW_80 || in wf_create_chspec()
2028 bw == WL_CHANSPEC_BW_160 || in wf_create_chspec()
2029 WFC_BW_EQ(bw, WL_CHANSPEC_BW_240) || in wf_create_chspec()
2030 WFC_BW_EQ(bw, WL_CHANSPEC_BW_320)) { in wf_create_chspec()
2033 sb = channel_to_sb(center_channel, primary_channel, bw); in wf_create_chspec()
2040 if (WFC_BW_EQ(bw, WL_CHANSPEC_BW_240)) { in wf_create_chspec()
2047 } else if (WFC_BW_EQ(bw, WL_CHANSPEC_BW_320)) { in wf_create_chspec()
2057 chspec = center_channel | band | bw | in wf_create_chspec()
2094 wf_create_chspec_from_primary(uint primary_channel, chanspec_bw_t bw, chanspec_band_t band) in wf_create_chspec_from_primary() argument
2098 if (bw == WL_CHANSPEC_BW_20) { in wf_create_chspec_from_primary()
2107 if (band == WL_CHANSPEC_BAND_2G && bw == WL_CHANSPEC_BW_40) { in wf_create_chspec_from_primary()
2111 if (bw == WL_CHANSPEC_BW_40) { in wf_create_chspec_from_primary()
2114 } else if (bw == WL_CHANSPEC_BW_80) { in wf_create_chspec_from_primary()
2117 } else if (bw == WL_CHANSPEC_BW_160) { in wf_create_chspec_from_primary()
2125 chspec = wf_create_chspec(primary_channel, center_ch[i], bw, band); in wf_create_chspec_from_primary()
2139 if (bw == WL_CHANSPEC_BW_40) { in wf_create_chspec_from_primary()
2141 } else if (bw == WL_CHANSPEC_BW_80) { in wf_create_chspec_from_primary()
2143 } else if (bw == WL_CHANSPEC_BW_160) { in wf_create_chspec_from_primary()
2145 } else if (WFC_BW_EQ(bw, WL_CHANSPEC_BW_240)) { in wf_create_chspec_from_primary()
2147 } else if (WFC_BW_EQ(bw, WL_CHANSPEC_BW_320)) { in wf_create_chspec_from_primary()
2161 center = base + center_chan_to_edge(bw); in wf_create_chspec_from_primary()
2163 chspec = wf_create_chspec(primary_channel, center, bw, band); in wf_create_chspec_from_primary()
2185 chanspec_bw_t bw; in wf_chspec_primary20_chan() local
2202 bw = WL_CHANSPEC_BW_240; in wf_chspec_primary20_chan()
2210 bw = WL_CHANSPEC_BW_320; in wf_chspec_primary20_chan()
2219 bw = CHSPEC_BW(chspec); in wf_chspec_primary20_chan()
2223 return (uint8)(channel_to_primary20_chan((uint8)center_chan, bw, sb)); in wf_chspec_primary20_chan()
2276 wf_channel2chspec(uint pri_ch, uint bw) in wf_channel2chspec() argument
2286 chspec |= bw; in wf_channel2chspec()
2288 if (bw == WL_CHANSPEC_BW_40) { in wf_channel2chspec()
2296 } else if (bw == WL_CHANSPEC_BW_80) { in wf_channel2chspec()
2299 } else if (bw == WL_CHANSPEC_BW_160) { in wf_channel2chspec()
2302 } else if (bw == WL_CHANSPEC_BW_20) { in wf_channel2chspec()
2310 sb = channel_to_sb(center_ch[i], pri_ch, (chanspec_bw_t)bw); in wf_channel2chspec()
2942 wf_create_chspec_sb(uint sb, uint center_channel, chanspec_bw_t bw, chanspec_band_t band) in wf_create_chspec_sb() argument
2948 chspec = center_channel | band | bw | ((uint)sb << WL_CHANSPEC_CTL_SB_SHIFT); in wf_create_chspec_sb()