Lines Matching refs:chspec

209 wf_bw_chspec_to_mhz(chanspec_t chspec)  in wf_bw_chspec_to_mhz()  argument
213 bw = (chspec & WL_CHANSPEC_BW_MASK) >> WL_CHANSPEC_BW_SHIFT; in wf_bw_chspec_to_mhz()
291 wf_chspec_ntoa_ex(chanspec_t chspec, char *buf) in wf_chspec_ntoa_ex() argument
293 if (wf_chspec_ntoa(chspec, buf) == NULL) in wf_chspec_ntoa_ex()
294 snprintf(buf, CHANSPEC_STR_LEN, "invalid 0x%04x", chspec); in wf_chspec_ntoa_ex()
304 wf_chspec_ntoa(chanspec_t chspec, char *buf) in wf_chspec_ntoa() argument
309 if (wf_chspec_malformed(chspec)) in wf_chspec_ntoa()
315 if ((CHSPEC_IS2G(chspec) && CHSPEC_CHANNEL(chspec) > CH_MAX_2G_CHANNEL) || in wf_chspec_ntoa()
316 (CHSPEC_IS5G(chspec) && CHSPEC_CHANNEL(chspec) <= CH_MAX_2G_CHANNEL)) in wf_chspec_ntoa()
317 band = (CHSPEC_IS2G(chspec)) ? "2g" : "5g"; in wf_chspec_ntoa()
320 pri_chan = wf_chspec_primary20_chan(chspec); in wf_chspec_ntoa()
323 if (CHSPEC_IS20(chspec)) { in wf_chspec_ntoa()
325 } else if (!CHSPEC_IS8080(chspec)) { in wf_chspec_ntoa()
329 bw = wf_chspec_to_bw_str(chspec); in wf_chspec_ntoa()
333 if (CHSPEC_IS40(chspec) && CHSPEC_IS2G(chspec)) { in wf_chspec_ntoa()
334 sb = CHSPEC_SB_UPPER(chspec) ? "u" : "l"; in wf_chspec_ntoa()
340 if (CHSPEC_IS40(chspec)) { in wf_chspec_ntoa()
341 sb = CHSPEC_SB_UPPER(chspec) ? "u" : "l"; in wf_chspec_ntoa()
350 uint chan1 = (chspec & WL_CHANSPEC_CHAN1_MASK) >> WL_CHANSPEC_CHAN1_SHIFT; in wf_chspec_ntoa()
351 uint chan2 = (chspec & WL_CHANSPEC_CHAN2_MASK) >> WL_CHANSPEC_CHAN2_SHIFT; in wf_chspec_ntoa()
390 chanspec_t chspec; in wf_chspec_aton_ex() local
619 chspec = (chanspec_t)(chspec_ch | chspec_band | chspec_bw | chspec_sb); in wf_chspec_aton_ex()
621 if (wf_chspec_malformed(chspec)) in wf_chspec_aton_ex()
624 return chspec; in wf_chspec_aton_ex()
825 chanspec_t chspec; in wf_create_20MHz_chspec() local
830 chspec = band | WL_CHANSPEC_BW_20 | WL_CHANSPEC_CTL_SB_NONE | channel; in wf_create_20MHz_chspec()
831 if (!wf_chspec_valid(chspec)) { in wf_create_20MHz_chspec()
832 chspec = INVCHANSPEC; in wf_create_20MHz_chspec()
835 chspec = INVCHANSPEC; in wf_create_20MHz_chspec()
838 return chspec; in wf_create_20MHz_chspec()
853 wf_chspec_primary20_chan(chanspec_t chspec) in wf_chspec_primary20_chan() argument
859 ASSERT(!wf_chspec_malformed(chspec)); in wf_chspec_primary20_chan()
862 if (CHSPEC_IS20(chspec)) { in wf_chspec_primary20_chan()
863 return CHSPEC_CHANNEL(chspec); in wf_chspec_primary20_chan()
865 sb = CHSPEC_CTL_SB(chspec) >> WL_CHANSPEC_CTL_SB_SHIFT; in wf_chspec_primary20_chan()
867 if (CHSPEC_IS8080(chspec)) { in wf_chspec_primary20_chan()
871 uint chan_id = CHSPEC_CHAN1(chspec); in wf_chspec_primary20_chan()
879 bw_mhz = wf_bw_chspec_to_mhz(chspec); in wf_chspec_primary20_chan()
880 center_chan = CHSPEC_CHANNEL(chspec) >> WL_CHANSPEC_CHAN_SHIFT; in wf_chspec_primary20_chan()
889 BCMRAMFN(wf_chspec_to_bw_str)(chanspec_t chspec) in BCMRAMFN()
891 return wf_chspec_bw_str[(CHSPEC_BW(chspec) >> WL_CHANSPEC_BW_SHIFT)]; in BCMRAMFN()
898 wf_chspec_primary20_chspec(chanspec_t chspec) in wf_chspec_primary20_chspec() argument
900 chanspec_t pri_chspec = chspec; in wf_chspec_primary20_chspec()
903 ASSERT(!wf_chspec_malformed(chspec)); in wf_chspec_primary20_chspec()
906 if (!CHSPEC_IS20(chspec)) { in wf_chspec_primary20_chspec()
907 pri_chan = wf_chspec_primary20_chan(chspec); in wf_chspec_primary20_chspec()
909 pri_chspec |= CHSPEC_BAND(chspec); in wf_chspec_primary20_chspec()
920 uint16 chspec; in wf_channel2chspec() local
926 chspec = ((pri_ch <= CH_MAX_2G_CHANNEL) ? WL_CHANSPEC_BAND_2G : WL_CHANSPEC_BAND_5G); in wf_channel2chspec()
928 chspec |= bw; in wf_channel2chspec()
943 chspec |= pri_ch; in wf_channel2chspec()
944 return chspec; in wf_channel2chspec()
952 chspec |= center_ch[i]; in wf_channel2chspec()
953 chspec |= (sb << WL_CHANSPEC_CTL_SB_SHIFT); in wf_channel2chspec()
963 return chspec; in wf_channel2chspec()
971 extern chanspec_t wf_chspec_primary40_chspec(chanspec_t chspec) in wf_chspec_primary40_chspec() argument
973 chanspec_t chspec40 = chspec; in wf_chspec_primary40_chspec()
977 ASSERT(!wf_chspec_malformed(chspec)); in wf_chspec_primary40_chspec()
980 if (CHSPEC_IS8080(chspec) || CHSPEC_IS160(chspec)) { in wf_chspec_primary40_chspec()
981 chspec = wf_chspec_primary80_chspec(chspec); in wf_chspec_primary40_chspec()
985 if (CHSPEC_IS80(chspec)) { in wf_chspec_primary40_chspec()
986 center_chan = CHSPEC_CHANNEL(chspec); in wf_chspec_primary40_chspec()
987 sb = CHSPEC_CTL_SB(chspec); in wf_chspec_primary40_chspec()
1250 wf_chspec_primary80_chspec(chanspec_t chspec) in wf_chspec_primary80_chspec() argument
1256 ASSERT(!wf_chspec_malformed(chspec)); in wf_chspec_primary80_chspec()
1258 if (CHSPEC_IS80(chspec)) { in wf_chspec_primary80_chspec()
1259 chspec80 = chspec; in wf_chspec_primary80_chspec()
1261 else if (CHSPEC_IS8080(chspec)) { in wf_chspec_primary80_chspec()
1262 sb = CHSPEC_CTL_SB(chspec); in wf_chspec_primary80_chspec()
1265 center_chan = wf_chspec_get80Mhz_ch(CHSPEC_CHAN1(chspec)); in wf_chspec_primary80_chspec()
1270 else if (CHSPEC_IS160(chspec)) { in wf_chspec_primary80_chspec()
1271 center_chan = CHSPEC_CHANNEL(chspec); in wf_chspec_primary80_chspec()
1272 sb = CHSPEC_CTL_SB(chspec); in wf_chspec_primary80_chspec()
1298 wf_chspec_secondary80_chspec(chanspec_t chspec) in wf_chspec_secondary80_chspec() argument
1303 ASSERT(!wf_chspec_malformed(chspec)); in wf_chspec_secondary80_chspec()
1305 if (CHSPEC_IS8080(chspec)) { in wf_chspec_secondary80_chspec()
1307 center_chan = wf_chspec_get80Mhz_ch(CHSPEC_CHAN2(chspec)); in wf_chspec_secondary80_chspec()
1315 else if (CHSPEC_IS160(chspec)) { in wf_chspec_secondary80_chspec()
1316 center_chan = CHSPEC_CHANNEL(chspec); in wf_chspec_secondary80_chspec()
1318 if (CHSPEC_CTL_SB(chspec) < WL_CHANSPEC_CTL_SB_ULL) { in wf_chspec_secondary80_chspec()
1346 wf_chspec_get_80p80_channels(chanspec_t chspec, uint8 *ch) in wf_chspec_get_80p80_channels() argument
1349 if (CHSPEC_IS8080(chspec)) { in wf_chspec_get_80p80_channels()
1350 ch[0] = wf_chspec_get80Mhz_ch(CHSPEC_CHAN1(chspec)); in wf_chspec_get_80p80_channels()
1351 ch[1] = wf_chspec_get80Mhz_ch(CHSPEC_CHAN2(chspec)); in wf_chspec_get_80p80_channels()
1353 else if (CHSPEC_IS160(chspec)) { in wf_chspec_get_80p80_channels()
1354 uint8 center_chan = CHSPEC_CHANNEL(chspec); in wf_chspec_get_80p80_channels()
1360 ch[0] = CHSPEC_CHANNEL(chspec); in wf_chspec_get_80p80_channels()
1369 wf_chspec_channel(chanspec_t chspec) in wf_chspec_channel() argument
1371 if (CHSPEC_IS8080(chspec)) { in wf_chspec_channel()
1372 return wf_chspec_primary80_channel(chspec); in wf_chspec_channel()
1375 return ((uint8)((chspec) & WL_CHANSPEC_CHAN_MASK)); in wf_chspec_channel()
1433 wf_channel_create_opclass_frm_chspec(chanspec_t chspec) in wf_channel_create_opclass_frm_chspec() argument
1435 BCM_REFERENCE(chspec); in wf_channel_create_opclass_frm_chspec()
1448 wf_get_all_ext(chanspec_t chspec, uint8 *pext) in wf_get_all_ext() argument
1451 GET_ALL_SB(chspec, pext); in wf_get_all_ext()
1453 chanspec_t t = (CHSPEC_IS160(chspec) || CHSPEC_IS8080(chspec)) ? /* if bw > 80MHz */ in wf_get_all_ext()
1454 wf_chspec_primary80_chspec(chspec) : (chspec); /* extract primary 80 */ in wf_get_all_ext()
1457 if (CHSPEC_IS20(chspec)) return; /* nothing more to do since 20MHz chspec */ in wf_get_all_ext()
1460 if (CHSPEC_IS40(chspec)) return; /* nothing more to do since 40MHz chspec */ in wf_get_all_ext()
1462 t = wf_channel2chspec((uint)(pri_ch + (IS_CTL_IN_L40(chspec) ? in wf_get_all_ext()
1465 if (CHSPEC_IS80(chspec)) return; /* nothing more to do since 80MHz chspec */ in wf_get_all_ext()
1466 t = CH80MHZ_CHSPEC(wf_chspec_secondary80_channel(chspec), WL_CHANSPEC_CTL_SB_LLL); in wf_get_all_ext()
1492 channel_bw_to_width(chanspec_t chspec) in channel_bw_to_width() argument
1496 if (CHSPEC_IS80(chspec)) in channel_bw_to_width()
1498 else if (CHSPEC_IS160(chspec)) in channel_bw_to_width()
1500 else if (CHSPEC_IS8080(chspec)) in channel_bw_to_width()