Lines Matching +full:3 +full:cg +full:- +full:2019

1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2 /* Copyright(c) 2018-2019 Realtek Corporation
19 const struct rtw_regd *__r = &__d->regd; \
23 __r->regulatory->alpha2[0], \
24 __r->regulatory->alpha2[1], \
25 __r->regulatory->txpwr_regd_2g, \
26 __r->regulatory->txpwr_regd_5g, \
27 __r->dfs_region); \
76 COUNTRY_REGD_ENT("CG", RTW_REGD_ETSI, RTW_REGD_ETSI),
283 struct rtw_dev *rtwdev = hw->priv;
284 struct rtw_efuse *efuse = &rtwdev->efuse;
287 if (efuse->hw_cap.bw & BIT(RTW_CHANNEL_WIDTH_80))
290 sband = wiphy->bands[NL80211_BAND_2GHZ];
294 for (i = 0; i < sband->n_channels; i++) {
295 ch = &sband->channels[i];
296 ch->flags |= IEEE80211_CHAN_NO_80MHZ;
300 sband = wiphy->bands[NL80211_BAND_5GHZ];
304 for (i = 0; i < sband->n_channels; i++) {
305 ch = &sband->channels[i];
306 ch->flags |= IEEE80211_CHAN_NO_80MHZ;
317 return memcmp(reg->alpha2, alpha2, 2) == 0;
338 struct wiphy *wiphy = rtwdev->hw->wiphy;
342 return -EINVAL;
344 wiphy->reg_notifier = rtw_regd_notifier;
346 chip_reg = rtw_reg_find_by_name(rtwdev->efuse.country_code);
348 rtwdev->regd.state = RTW_REGD_STATE_PROGRAMMED;
354 wiphy->regulatory_flags |= REGULATORY_STRICT_REG;
355 wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
357 rtwdev->regd.state = RTW_REGD_STATE_WORLDWIDE;
360 rtwdev->regd.regulatory = &rtw_reg_ww;
361 rtwdev->regd.dfs_region = NL80211_DFS_UNSET;
362 rtw_dbg_regd_dump(rtwdev, "regd init state %d: ", rtwdev->regd.state);
371 struct wiphy *wiphy = rtwdev->hw->wiphy;
375 return -EINVAL;
377 if (rtwdev->regd.state == RTW_REGD_STATE_PROGRAMMED) {
380 rtwdev->efuse.country_code[0],
381 rtwdev->efuse.country_code[1]);
383 ret = regulatory_hint(wiphy, rtwdev->efuse.country_code);
398 struct wiphy *wiphy = rtwdev->hw->wiphy;
400 next_regd->state = RTW_REGD_STATE_WORLDWIDE;
402 if (request->initiator == NL80211_REGDOM_SET_BY_USER &&
403 !rtw_reg_is_ww(next_regd->regulatory)) {
404 next_regd->state = RTW_REGD_STATE_SETTING;
405 wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
415 if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
416 rtw_reg_match(next_regd->regulatory, rtwdev->efuse.country_code)) {
417 next_regd->state = RTW_REGD_STATE_PROGRAMMED;
428 struct wiphy *wiphy = rtwdev->hw->wiphy;
430 if (request->initiator != NL80211_REGDOM_SET_BY_USER)
433 next_regd->state = RTW_REGD_STATE_SETTING;
435 if (rtw_reg_is_ww(next_regd->regulatory)) {
436 next_regd->state = RTW_REGD_STATE_WORLDWIDE;
437 wiphy->regulatory_flags &= ~REGULATORY_COUNTRY_IE_IGNORE;
454 next_regd->regulatory = rtw_reg_find_by_name(request->alpha2);
455 next_regd->dfs_region = request->dfs_region;
456 return rtw_regd_handler[rtwdev->regd.state](rtwdev, next_regd, request);
463 struct rtw_dev *rtwdev = hw->priv;
464 struct rtw_hal *hal = &rtwdev->hal;
472 rtwdev->regd.state,
473 request->alpha2[0],
474 request->alpha2[1],
475 request->initiator);
479 rtw_dbg(rtwdev, RTW_DBG_REGD, "regd state: %d -> %d\n",
480 rtwdev->regd.state, next_regd.state);
482 mutex_lock(&rtwdev->mutex);
483 rtwdev->regd = next_regd;
485 request->alpha2[0],
486 request->alpha2[1],
487 request->initiator);
490 rtw_phy_set_tx_power_level(rtwdev, hal->current_channel);
491 mutex_unlock(&rtwdev->mutex);
496 struct rtw_hal *hal = &rtwdev->hal;
497 u8 band = hal->current_band_type;
500 rtwdev->regd.regulatory->txpwr_regd_2g :
501 rtwdev->regd.regulatory->txpwr_regd_5g;
507 struct rtw_regd *regd = &rtwdev->regd;
509 return rtw_reg_match(regd->regulatory, "CN");