Lines Matching +full:country +full:- +full:code
41 * maxpwr[0] - channels [34-48]
42 * maxpwr[1] - channels [52-60]
43 * maxpwr[2] - channels [62-64]
44 * maxpwr[3] - channels [100-140]
45 * maxpwr[4] - channels [149-165]
60 #define BRCM_2GHZ_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 19, 0)
61 #define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, \
64 #define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, \
66 #define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, \
69 #define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, \
72 #define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, \
88 /* locale per-channel tx power limits for MIMO frames
90 * by sub-band for 5 GHz limits using CHANNEL_POWER_IDX_5G(channel)
99 /* Country names and abbreviations with locale defined from ISO 3166 */
106 struct country_info country; member
117 * MIMO Locale Definitions - 2.4 GHz
133 * MIMO Locale Definitions - 5 GHz
147 .country = LOCALES(bn, 11n),
169 * Indicates whether the country provided is valid to pass
185 * do not match ISO 3166-1 user assigned country codes in brcms_c_country_valid()
190 ccode[0] == 'X' || /* XA - XZ */ in brcms_c_country_valid()
191 (ccode[0] == 'Q' && /* QM - QZ */ in brcms_c_country_valid()
207 if (!strncmp(regdom, cntry_locales[i].regdomain->alpha2, len)) { in brcms_world_regd()
221 /* JP, J1 - J10 are Japan ccodes */
237 txpwr->cck[j] = min(txpwr->cck[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
241 txpwr->ofdm[j] = min(txpwr->ofdm[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
245 txpwr->ofdm_cdd[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
246 min(txpwr->ofdm_cdd[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
250 txpwr->ofdm_40_siso[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
251 min(txpwr->ofdm_40_siso[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
255 txpwr->ofdm_40_cdd[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
256 min(txpwr->ofdm_40_cdd[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
258 /* 20MHz MCS 0-7 SISO */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
260 txpwr->mcs_20_siso[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
261 min(txpwr->mcs_20_siso[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
263 /* 20MHz MCS 0-7 CDD */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
265 txpwr->mcs_20_cdd[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
266 min(txpwr->mcs_20_cdd[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
268 /* 20MHz MCS 0-7 STBC */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
270 txpwr->mcs_20_stbc[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
271 min(txpwr->mcs_20_stbc[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
273 /* 20MHz MCS 8-15 MIMO */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
275 txpwr->mcs_20_mimo[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
276 min(txpwr->mcs_20_mimo[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
278 /* 40MHz MCS 0-7 SISO */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
280 txpwr->mcs_40_siso[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
281 min(txpwr->mcs_40_siso[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
283 /* 40MHz MCS 0-7 CDD */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
285 txpwr->mcs_40_cdd[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
286 min(txpwr->mcs_40_cdd[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
288 /* 40MHz MCS 0-7 STBC */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
290 txpwr->mcs_40_stbc[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
291 min(txpwr->mcs_40_stbc[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
293 /* 40MHz MCS 8-15 MIMO */ in brcms_c_channel_min_txpower_limits_with_local_constraint()
295 txpwr->mcs_40_mimo[j] = in brcms_c_channel_min_txpower_limits_with_local_constraint()
296 min(txpwr->mcs_40_mimo[j], local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
299 txpwr->mcs32 = min(txpwr->mcs32, local_constraint_qdbm); in brcms_c_channel_min_txpower_limits_with_local_constraint()
304 * set the driver's current country and regulatory information
305 * using a country code as the source. Look up built in country
306 * information found with the country code.
312 struct brcms_c_info *wlc = wlc_cm->wlc; in brcms_c_set_country()
314 if ((wlc->pub->_n_enab & SUPPORT_11N) != in brcms_c_set_country()
315 wlc->protection->nmode_user) in brcms_c_set_country()
318 brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]); in brcms_c_set_country()
319 brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]); in brcms_c_set_country()
321 brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false); in brcms_c_set_country()
329 struct brcms_pub *pub = wlc->pub; in brcms_c_channel_mgr_attach()
330 struct ssb_sprom *sprom = &wlc->hw->d11core->bus->sprom; in brcms_c_channel_mgr_attach()
331 const char *ccode = sprom->alpha2; in brcms_c_channel_mgr_attach()
332 int ccode_len = sizeof(sprom->alpha2); in brcms_c_channel_mgr_attach()
337 wlc_cm->pub = pub; in brcms_c_channel_mgr_attach()
338 wlc_cm->wlc = wlc; in brcms_c_channel_mgr_attach()
339 wlc->cmi = wlc_cm; in brcms_c_channel_mgr_attach()
341 /* store the country code for passing up as a regulatory hint */ in brcms_c_channel_mgr_attach()
342 wlc_cm->world_regd = brcms_world_regd(ccode, ccode_len); in brcms_c_channel_mgr_attach()
344 memcpy(wlc->pub->srom_ccode, ccode, ccode_len); in brcms_c_channel_mgr_attach()
350 if (!wlc_cm->world_regd) { in brcms_c_channel_mgr_attach()
351 wlc_cm->world_regd = brcms_default_world_regd(); in brcms_c_channel_mgr_attach()
352 ccode = wlc_cm->world_regd->regdomain->alpha2; in brcms_c_channel_mgr_attach()
353 ccode_len = BRCM_CNTRY_BUF_SZ - 1; in brcms_c_channel_mgr_attach()
356 /* save default country for exiting 11d regulatory mode */ in brcms_c_channel_mgr_attach()
357 memcpy(wlc->country_default, ccode, ccode_len); in brcms_c_channel_mgr_attach()
360 memcpy(wlc->autocountry_default, ccode, ccode_len); in brcms_c_channel_mgr_attach()
362 brcms_c_set_country(wlc_cm, wlc_cm->world_regd); in brcms_c_channel_mgr_attach()
376 struct brcms_c_info *wlc = wlc_cm->wlc; in brcms_c_channel_set_chanspec()
377 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.chandef.chan; in brcms_c_channel_set_chanspec()
387 if (ch->flags & IEEE80211_CHAN_NO_OFDM) in brcms_c_channel_set_chanspec()
390 brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false); in brcms_c_channel_set_chanspec()
392 brcms_b_set_chanspec(wlc->hw, chanspec, in brcms_c_channel_set_chanspec()
393 !!(ch->flags & IEEE80211_CHAN_NO_IR), in brcms_c_channel_set_chanspec()
401 struct brcms_c_info *wlc = wlc_cm->wlc; in brcms_c_channel_reg_limits()
402 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.chandef.chan; in brcms_c_channel_reg_limits()
407 const struct country_info *country; in brcms_c_channel_reg_limits() local
420 country = &wlc_cm->world_regd->country; in brcms_c_channel_reg_limits()
423 band = wlc->bandstate[chspec_bandunit(chanspec)]; in brcms_c_channel_reg_limits()
424 li_mimo = (band->bandtype == BRCM_BAND_5G) ? in brcms_c_channel_reg_limits()
425 brcms_c_get_mimo_5g(country->locale_mimo_5G) : in brcms_c_channel_reg_limits()
426 brcms_c_get_mimo_2g(country->locale_mimo_2G); in brcms_c_channel_reg_limits()
428 delta = band->antgain; in brcms_c_channel_reg_limits()
430 if (band->bandtype == BRCM_BAND_2G) in brcms_c_channel_reg_limits()
433 maxpwr = QDB(ch->max_power) - delta; in brcms_c_channel_reg_limits()
438 if (band->bandtype == BRCM_BAND_2G) { in brcms_c_channel_reg_limits()
440 txpwr->cck[i] = (u8) maxpwr; in brcms_c_channel_reg_limits()
444 txpwr->ofdm[i] = (u8) maxpwr; in brcms_c_channel_reg_limits()
448 * MCS0-7 rate unless overriden by the locale specific code. in brcms_c_channel_reg_limits()
450 * a possibility) and then copy the MCS0-7 value to the 40 MHz in brcms_c_channel_reg_limits()
453 txpwr->ofdm_40_siso[i] = 0; in brcms_c_channel_reg_limits()
455 txpwr->ofdm_cdd[i] = (u8) maxpwr; in brcms_c_channel_reg_limits()
457 txpwr->ofdm_40_cdd[i] = 0; in brcms_c_channel_reg_limits()
461 if (band->antgain > QDB(6)) in brcms_c_channel_reg_limits()
462 delta = band->antgain - QDB(6); /* Excess over 6 dB */ in brcms_c_channel_reg_limits()
464 if (band->bandtype == BRCM_BAND_2G) in brcms_c_channel_reg_limits()
465 maxpwr_idx = (chan - 1); in brcms_c_channel_reg_limits()
469 maxpwr20 = li_mimo->maxpwr20[maxpwr_idx]; in brcms_c_channel_reg_limits()
470 maxpwr40 = li_mimo->maxpwr40[maxpwr_idx]; in brcms_c_channel_reg_limits()
472 maxpwr20 = maxpwr20 - delta; in brcms_c_channel_reg_limits()
474 maxpwr40 = maxpwr40 - delta; in brcms_c_channel_reg_limits()
477 /* Fill in the MCS 0-7 (SISO) rates */ in brcms_c_channel_reg_limits()
482 * unless overriden by the locale specific code. in brcms_c_channel_reg_limits()
484 txpwr->mcs_20_siso[i] = txpwr->ofdm[i]; in brcms_c_channel_reg_limits()
485 txpwr->mcs_40_siso[i] = 0; in brcms_c_channel_reg_limits()
488 /* Fill in the MCS 0-7 CDD rates */ in brcms_c_channel_reg_limits()
490 txpwr->mcs_20_cdd[i] = (u8) maxpwr20; in brcms_c_channel_reg_limits()
491 txpwr->mcs_40_cdd[i] = (u8) maxpwr40; in brcms_c_channel_reg_limits()
506 txpwr->mcs_20_siso[i] = (u8) maxpwr20; in brcms_c_channel_reg_limits()
507 txpwr->mcs_40_siso[i] = (u8) maxpwr40; in brcms_c_channel_reg_limits()
511 /* Fill in the MCS 0-7 STBC rates */ in brcms_c_channel_reg_limits()
513 txpwr->mcs_20_stbc[i] = 0; in brcms_c_channel_reg_limits()
514 txpwr->mcs_40_stbc[i] = 0; in brcms_c_channel_reg_limits()
517 /* Fill in the MCS 8-15 SDM rates */ in brcms_c_channel_reg_limits()
519 txpwr->mcs_20_mimo[i] = (u8) maxpwr20; in brcms_c_channel_reg_limits()
520 txpwr->mcs_40_mimo[i] = (u8) maxpwr40; in brcms_c_channel_reg_limits()
524 txpwr->mcs32 = (u8) maxpwr40; in brcms_c_channel_reg_limits()
527 if (txpwr->ofdm_40_cdd[i] == 0) in brcms_c_channel_reg_limits()
528 txpwr->ofdm_40_cdd[i] = txpwr->mcs_40_cdd[j]; in brcms_c_channel_reg_limits()
531 if (txpwr->ofdm_40_cdd[i] == 0) in brcms_c_channel_reg_limits()
532 txpwr->ofdm_40_cdd[i] = txpwr->mcs_40_cdd[j]; in brcms_c_channel_reg_limits()
537 * Copy the 40 MHZ MCS 0-7 CDD value to the 40 MHZ MCS 0-7 SISO in brcms_c_channel_reg_limits()
541 if (txpwr->mcs_40_siso[i] == 0) in brcms_c_channel_reg_limits()
542 txpwr->mcs_40_siso[i] = txpwr->mcs_40_cdd[i]; in brcms_c_channel_reg_limits()
546 if (txpwr->ofdm_40_siso[i] == 0) in brcms_c_channel_reg_limits()
547 txpwr->ofdm_40_siso[i] = txpwr->mcs_40_siso[j]; in brcms_c_channel_reg_limits()
550 if (txpwr->ofdm_40_siso[i] == 0) in brcms_c_channel_reg_limits()
551 txpwr->ofdm_40_siso[i] = txpwr->mcs_40_siso[j]; in brcms_c_channel_reg_limits()
556 * Copy the 20 and 40 MHz MCS0-7 CDD values to the corresponding in brcms_c_channel_reg_limits()
560 if (txpwr->mcs_20_stbc[i] == 0) in brcms_c_channel_reg_limits()
561 txpwr->mcs_20_stbc[i] = txpwr->mcs_20_cdd[i]; in brcms_c_channel_reg_limits()
563 if (txpwr->mcs_40_stbc[i] == 0) in brcms_c_channel_reg_limits()
564 txpwr->mcs_40_stbc[i] = txpwr->mcs_40_cdd[i]; in brcms_c_channel_reg_limits()
604 struct brcms_c_info *wlc = wlc_cm->wlc; in brcms_c_valid_chanspec_ext()
609 brcms_err(wlc->hw->d11core, "wl%d: malformed chanspec 0x%x\n", in brcms_c_valid_chanspec_ext()
610 wlc->pub->unit, chspec); in brcms_c_valid_chanspec_ext()
614 if (CHANNEL_BANDUNIT(wlc_cm->wlc, channel) != in brcms_c_valid_chanspec_ext()
637 sband = wiphy->bands[NL80211_BAND_5GHZ]; in brcms_reg_apply_radar_flags()
641 for (i = 0; i < sband->n_channels; i++) { in brcms_reg_apply_radar_flags()
642 ch = &sband->channels[i]; in brcms_reg_apply_radar_flags()
644 if (!brcms_is_radar_freq(ch->center_freq)) in brcms_reg_apply_radar_flags()
651 if (!(ch->flags & IEEE80211_CHAN_DISABLED)) in brcms_reg_apply_radar_flags()
652 ch->flags |= IEEE80211_CHAN_RADAR | in brcms_reg_apply_radar_flags()
667 sband = wiphy->bands[band]; in brcms_reg_apply_beaconing_flags()
671 for (i = 0; i < sband->n_channels; i++) { in brcms_reg_apply_beaconing_flags()
672 ch = &sband->channels[i]; in brcms_reg_apply_beaconing_flags()
674 if (ch->flags & in brcms_reg_apply_beaconing_flags()
680 MHZ_TO_KHZ(ch->center_freq)); in brcms_reg_apply_beaconing_flags()
684 if (!(rule->flags & NL80211_RRF_NO_IR)) in brcms_reg_apply_beaconing_flags()
685 ch->flags &= ~IEEE80211_CHAN_NO_IR; in brcms_reg_apply_beaconing_flags()
686 } else if (ch->beacon_found) { in brcms_reg_apply_beaconing_flags()
687 ch->flags &= ~IEEE80211_CHAN_NO_IR; in brcms_reg_apply_beaconing_flags()
697 struct brcms_info *wl = hw->priv; in brcms_reg_notifier()
698 struct brcms_c_info *wlc = wl->wlc; in brcms_reg_notifier()
706 if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) in brcms_reg_notifier()
707 brcms_reg_apply_beaconing_flags(wiphy, request->initiator); in brcms_reg_notifier()
711 sband = wiphy->bands[band]; in brcms_reg_notifier()
715 for (i = 0; !ch_found && i < sband->n_channels; i++) { in brcms_reg_notifier()
716 ch = &sband->channels[i]; in brcms_reg_notifier()
718 if (!(ch->flags & IEEE80211_CHAN_DISABLED)) in brcms_reg_notifier()
724 mboolclr(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE); in brcms_reg_notifier()
726 mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE); in brcms_reg_notifier()
727 brcms_err(wlc->hw->d11core, in brcms_reg_notifier()
729 wlc->pub->unit, __func__, request->alpha2); in brcms_reg_notifier()
732 if (wlc->pub->_nbands > 1 || wlc->band->bandtype == BRCM_BAND_2G) in brcms_reg_notifier()
733 wlc_phy_chanspec_ch14_widefilter_set(wlc->band->pi, in brcms_reg_notifier()
734 brcms_c_japan_ccode(request->alpha2)); in brcms_reg_notifier()
739 struct wiphy *wiphy = wlc->wiphy; in brcms_c_regd_init()
740 const struct brcms_regd *regd = wlc->cmi->world_regd; in brcms_c_regd_init()
748 for (band_idx = 0; band_idx < wlc->pub->_nbands; band_idx++) { in brcms_c_regd_init()
749 band = wlc->bandstate[band_idx]; in brcms_c_regd_init()
751 wlc_phy_chanspec_band_validch(band->pi, band->bandtype, in brcms_c_regd_init()
755 sband = wiphy->bands[NL80211_BAND_2GHZ]; in brcms_c_regd_init()
757 sband = wiphy->bands[NL80211_BAND_5GHZ]; in brcms_c_regd_init()
759 for (i = 0; i < sband->n_channels; i++) { in brcms_c_regd_init()
760 ch = &sband->channels[i]; in brcms_c_regd_init()
761 if (!isset(sup_chan.vec, ch->hw_value)) in brcms_c_regd_init()
762 ch->flags |= IEEE80211_CHAN_DISABLED; in brcms_c_regd_init()
766 wlc->wiphy->reg_notifier = brcms_reg_notifier; in brcms_c_regd_init()
767 wlc->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | in brcms_c_regd_init()
769 wiphy_apply_custom_regulatory(wlc->wiphy, regd->regdomain); in brcms_c_regd_init()