mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
wifi: rtw89: regd: indicate if regd_UK TX power settings follow regd_ETSI
Before adopting regd_UK TX power settings, some certifications are needed and might be platform-level. Without that, should adopt regd_ETSI TX power settings. But for now, there is no way to inform driver of it yet. So, add a flag first. But for now, comprehensively use regd_ETSI TX power settings to restrict regd_UK. Plan to define an ACPI DSM function to inform driver whether to use regd_UK own TX power settings or not afterwards. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20250416081241.36138-4-pkshih@realtek.com
This commit is contained in:
parent
20aac091a1
commit
f64801d6f1
|
|
@ -5267,6 +5267,8 @@ struct rtw89_regulatory_info {
|
|||
const struct rtw89_regd *regd;
|
||||
enum rtw89_reg_6ghz_power reg_6ghz_power;
|
||||
struct rtw89_reg_6ghz_tpe reg_6ghz_tpe;
|
||||
bool txpwr_uk_follow_etsi;
|
||||
|
||||
DECLARE_BITMAP(block_unii4, RTW89_REGD_MAX_COUNTRY_NUM);
|
||||
DECLARE_BITMAP(block_6ghz, RTW89_REGD_MAX_COUNTRY_NUM);
|
||||
DECLARE_BITMAP(block_6ghz_sp, RTW89_REGD_MAX_COUNTRY_NUM);
|
||||
|
|
@ -6885,9 +6887,14 @@ static inline void rtw89_load_txpwr_table(struct rtw89_dev *rtwdev,
|
|||
|
||||
static inline u8 rtw89_regd_get(struct rtw89_dev *rtwdev, u8 band)
|
||||
{
|
||||
const struct rtw89_regd *regd = rtwdev->regulatory.regd;
|
||||
const struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
|
||||
const struct rtw89_regd *regd = regulatory->regd;
|
||||
u8 txpwr_regd = regd->txpwr_regd[band];
|
||||
|
||||
return regd->txpwr_regd[band];
|
||||
if (regulatory->txpwr_uk_follow_etsi && txpwr_regd == RTW89_UK)
|
||||
return RTW89_ETSI;
|
||||
|
||||
return txpwr_regd;
|
||||
}
|
||||
|
||||
static inline void rtw89_ctrl_btg_bt_rx(struct rtw89_dev *rtwdev, bool en,
|
||||
|
|
|
|||
|
|
@ -857,11 +857,14 @@ static ssize_t __print_txpwr_map(struct rtw89_dev *rtwdev, char *buf, size_t buf
|
|||
static int __print_regd(struct rtw89_dev *rtwdev, char *buf, size_t bufsz,
|
||||
const struct rtw89_chan *chan)
|
||||
{
|
||||
const struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
|
||||
char *p = buf, *end = buf + bufsz;
|
||||
u8 band = chan->band_type;
|
||||
u8 regd = rtw89_regd_get(rtwdev, band);
|
||||
|
||||
p += scnprintf(p, end - p, "%s\n", rtw89_regd_get_string(regd));
|
||||
p += scnprintf(p, end - p, "\t(txpwr UK follow ETSI: %s)\n",
|
||||
str_yes_no(regulatory->txpwr_uk_follow_etsi));
|
||||
|
||||
return p - buf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -636,6 +636,7 @@ int rtw89_regd_setup(struct rtw89_dev *rtwdev)
|
|||
}
|
||||
|
||||
regulatory->reg_6ghz_power = RTW89_REG_6GHZ_POWER_DFLT;
|
||||
regulatory->txpwr_uk_follow_etsi = true;
|
||||
|
||||
if (!wiphy)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user