Lines Matching +full:nc +full:- +full:si
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); \
192 COUNTRY_REGD_ENT("NC", RTW_REGD_ETSI, RTW_REGD_ETSI),
229 COUNTRY_REGD_ENT("SI", RTW_REGD_ETSI, RTW_REGD_ETSI),
283 struct rtw_dev *rtwdev = hw->priv; in rtw_regd_apply_hw_cap_flags()
284 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw_regd_apply_hw_cap_flags()
287 if (efuse->hw_cap.bw & BIT(RTW_CHANNEL_WIDTH_80)) in rtw_regd_apply_hw_cap_flags()
290 sband = wiphy->bands[NL80211_BAND_2GHZ]; in rtw_regd_apply_hw_cap_flags()
294 for (i = 0; i < sband->n_channels; i++) { in rtw_regd_apply_hw_cap_flags()
295 ch = &sband->channels[i]; in rtw_regd_apply_hw_cap_flags()
296 ch->flags |= IEEE80211_CHAN_NO_80MHZ; in rtw_regd_apply_hw_cap_flags()
300 sband = wiphy->bands[NL80211_BAND_5GHZ]; in rtw_regd_apply_hw_cap_flags()
304 for (i = 0; i < sband->n_channels; i++) { in rtw_regd_apply_hw_cap_flags()
305 ch = &sband->channels[i]; in rtw_regd_apply_hw_cap_flags()
306 ch->flags |= IEEE80211_CHAN_NO_80MHZ; in rtw_regd_apply_hw_cap_flags()
317 return memcmp(reg->alpha2, alpha2, 2) == 0; in rtw_reg_match()
338 struct wiphy *wiphy = rtwdev->hw->wiphy; in rtw_regd_init()
342 return -EINVAL; in rtw_regd_init()
344 wiphy->reg_notifier = rtw_regd_notifier; in rtw_regd_init()
346 chip_reg = rtw_reg_find_by_name(rtwdev->efuse.country_code); in rtw_regd_init()
348 rtwdev->regd.state = RTW_REGD_STATE_PROGRAMMED; in rtw_regd_init()
354 wiphy->regulatory_flags |= REGULATORY_STRICT_REG; in rtw_regd_init()
355 wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; in rtw_regd_init()
357 rtwdev->regd.state = RTW_REGD_STATE_WORLDWIDE; in rtw_regd_init()
360 rtwdev->regd.regulatory = &rtw_reg_ww; in rtw_regd_init()
361 rtwdev->regd.dfs_region = NL80211_DFS_UNSET; in rtw_regd_init()
362 rtw_dbg_regd_dump(rtwdev, "regd init state %d: ", rtwdev->regd.state); in rtw_regd_init()
371 struct wiphy *wiphy = rtwdev->hw->wiphy; in rtw_regd_hint()
375 return -EINVAL; in rtw_regd_hint()
377 if (rtwdev->regd.state == RTW_REGD_STATE_PROGRAMMED) { in rtw_regd_hint()
380 rtwdev->efuse.country_code[0], in rtw_regd_hint()
381 rtwdev->efuse.country_code[1]); in rtw_regd_hint()
383 ret = regulatory_hint(wiphy, rtwdev->efuse.country_code); in rtw_regd_hint()
398 struct wiphy *wiphy = rtwdev->hw->wiphy; in rtw_regd_mgmt_worldwide()
400 next_regd->state = RTW_REGD_STATE_WORLDWIDE; in rtw_regd_mgmt_worldwide()
402 if (request->initiator == NL80211_REGDOM_SET_BY_USER && in rtw_regd_mgmt_worldwide()
403 !rtw_reg_is_ww(next_regd->regulatory)) { in rtw_regd_mgmt_worldwide()
404 next_regd->state = RTW_REGD_STATE_SETTING; in rtw_regd_mgmt_worldwide()
405 wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; in rtw_regd_mgmt_worldwide()
415 if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER && in rtw_regd_mgmt_programmed()
416 rtw_reg_match(next_regd->regulatory, rtwdev->efuse.country_code)) { in rtw_regd_mgmt_programmed()
417 next_regd->state = RTW_REGD_STATE_PROGRAMMED; in rtw_regd_mgmt_programmed()
428 struct wiphy *wiphy = rtwdev->hw->wiphy; in rtw_regd_mgmt_setting()
430 if (request->initiator != NL80211_REGDOM_SET_BY_USER) in rtw_regd_mgmt_setting()
433 next_regd->state = RTW_REGD_STATE_SETTING; in rtw_regd_mgmt_setting()
435 if (rtw_reg_is_ww(next_regd->regulatory)) { in rtw_regd_mgmt_setting()
436 next_regd->state = RTW_REGD_STATE_WORLDWIDE; in rtw_regd_mgmt_setting()
437 wiphy->regulatory_flags &= ~REGULATORY_COUNTRY_IE_IGNORE; in rtw_regd_mgmt_setting()
454 next_regd->regulatory = rtw_reg_find_by_name(request->alpha2); in rtw_regd_state_hdl()
455 next_regd->dfs_region = request->dfs_region; in rtw_regd_state_hdl()
456 return rtw_regd_handler[rtwdev->regd.state](rtwdev, next_regd, request); in rtw_regd_state_hdl()
463 struct rtw_dev *rtwdev = hw->priv; in rtw_regd_notifier()
464 struct rtw_hal *hal = &rtwdev->hal; in rtw_regd_notifier()
472 rtwdev->regd.state, in rtw_regd_notifier()
473 request->alpha2[0], in rtw_regd_notifier()
474 request->alpha2[1], in rtw_regd_notifier()
475 request->initiator); in rtw_regd_notifier()
479 rtw_dbg(rtwdev, RTW_DBG_REGD, "regd state: %d -> %d\n", in rtw_regd_notifier()
480 rtwdev->regd.state, next_regd.state); in rtw_regd_notifier()
482 mutex_lock(&rtwdev->mutex); in rtw_regd_notifier()
483 rtwdev->regd = next_regd; in rtw_regd_notifier()
485 request->alpha2[0], in rtw_regd_notifier()
486 request->alpha2[1], in rtw_regd_notifier()
487 request->initiator); in rtw_regd_notifier()
490 rtw_phy_set_tx_power_level(rtwdev, hal->current_channel); in rtw_regd_notifier()
491 mutex_unlock(&rtwdev->mutex); in rtw_regd_notifier()
496 struct rtw_hal *hal = &rtwdev->hal; in rtw_regd_get()
497 u8 band = hal->current_band_type; in rtw_regd_get()
500 rtwdev->regd.regulatory->txpwr_regd_2g : in rtw_regd_get()
501 rtwdev->regd.regulatory->txpwr_regd_5g; in rtw_regd_get()
507 struct rtw_regd *regd = &rtwdev->regd; in rtw_regd_srrc()
509 return rtw_reg_match(regd->regulatory, "CN"); in rtw_regd_srrc()