Commit dad142c3 authored by Zong-Zhe Yang's avatar Zong-Zhe Yang Committed by Kalle Valo
Browse files

wifi: rtw89: 8852c: update TX power tables to R63 with 6 GHz power type (3 of 3)



Update TX power tables to RF version R63.

TX power tables' changes:
* TX power byrate:
	tweak a bit
* TX power limit, TX power limit RU, TX power shape:
	configure values for MEXICO, UKRAINE, CHILE, QATAR
	tweak a bit on other configured values
* 6 GHz TX power limit, 6 GHz TX power limit RU:
	add an extra dimension for 6 GHz regulatory power type, i.e.
	STD (standard power), LPI (low power indoor), VLP (very low power)

Besides, we adjust TX power handling at 6 GHz in phy to consider 6 GHz
regulatory power type.

Signed-off-by: default avatarZong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230602150556.36777-8-pkshih@realtek.com
parent 2a8ec45f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3049,7 +3049,8 @@ struct rtw89_txpwr_rule_6ghz {
		       [RTW89_REGD_NUM][NUM_OF_RTW89_REG_6GHZ_POWER]
		       [RTW89_6G_CH_NUM];
	const s8 (*lmt_ru)[RTW89_RU_NUM][RTW89_NTX_NUM]
			  [RTW89_REGD_NUM][RTW89_6G_CH_NUM];
			  [RTW89_REGD_NUM][NUM_OF_RTW89_REG_6GHZ_POWER]
			  [RTW89_6G_CH_NUM];
};

struct rtw89_rfe_parms {
+6 −2
Original line number Diff line number Diff line
@@ -1881,8 +1881,10 @@ static s8 rtw89_phy_read_txpwr_limit_ru(struct rtw89_dev *rtwdev, u8 band,
	const struct rtw89_txpwr_rule_2ghz *rule_2ghz = &rfe_parms->rule_2ghz;
	const struct rtw89_txpwr_rule_5ghz *rule_5ghz = &rfe_parms->rule_5ghz;
	const struct rtw89_txpwr_rule_6ghz *rule_6ghz = &rfe_parms->rule_6ghz;
	struct rtw89_regulatory_info *regulatory = &rtwdev->regulatory;
	u8 ch_idx = rtw89_channel_to_idx(rtwdev, band, ch);
	u8 regd = rtw89_regd_get(rtwdev, band);
	u8 reg6 = regulatory->reg_6ghz_power;
	s8 lmt_ru = 0, sar;

	switch (band) {
@@ -1901,11 +1903,13 @@ static s8 rtw89_phy_read_txpwr_limit_ru(struct rtw89_dev *rtwdev, u8 band,
		lmt_ru = (*rule_5ghz->lmt_ru)[ru][ntx][RTW89_WW][ch_idx];
		break;
	case RTW89_BAND_6G:
		lmt_ru = (*rule_6ghz->lmt_ru)[ru][ntx][regd][ch_idx];
		lmt_ru = (*rule_6ghz->lmt_ru)[ru][ntx][regd][reg6][ch_idx];
		if (lmt_ru)
			break;

		lmt_ru = (*rule_6ghz->lmt_ru)[ru][ntx][RTW89_WW][ch_idx];
		lmt_ru = (*rule_6ghz->lmt_ru)[ru][ntx][RTW89_WW]
					     [RTW89_REG_6GHZ_POWER_DFLT]
					     [ch_idx];
		break;
	default:
		rtw89_warn(rtwdev, "unknown band type: %d\n", band);
+7298 −1153

File changed.

Preview size limit exceeded, changes collapsed.