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

rtw89: extend subband for 6G band



Split 6G band into 8 sub-bands where indexes are from 0 to 7,
i.e. RTW89_CH_6G_BAND_IDX[0-7]. Then, decide subband by both
band and channel instead of just channel because conflicts
between 5G channels and 6G channels.

Moreover, add default case to the existing use of switch (subband).

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/20220211075953.40421-4-pkshih@realtek.com
parent 0701a424
Loading
Loading
Loading
Loading
+49 −10
Original line number Diff line number Diff line
@@ -293,11 +293,19 @@ static void rtw89_get_channel_params(struct cfg80211_chan_def *chandef,
		break;
	}

	switch (band) {
	default:
	case RTW89_BAND_2G:
		switch (center_chan) {
		default:
		case 1 ... 14:
			subband = RTW89_CH_2G;
			break;
		}
		break;
	case RTW89_BAND_5G:
		switch (center_chan) {
		default:
		case 36 ... 64:
			subband = RTW89_CH_5G_BAND_1;
			break;
@@ -308,6 +316,37 @@ static void rtw89_get_channel_params(struct cfg80211_chan_def *chandef,
			subband = RTW89_CH_5G_BAND_4;
			break;
		}
		break;
	case RTW89_BAND_6G:
		switch (center_chan) {
		default:
		case 1 ... 29:
			subband = RTW89_CH_6G_BAND_IDX0;
			break;
		case 33 ... 61:
			subband = RTW89_CH_6G_BAND_IDX1;
			break;
		case 65 ... 93:
			subband = RTW89_CH_6G_BAND_IDX2;
			break;
		case 97 ... 125:
			subband = RTW89_CH_6G_BAND_IDX3;
			break;
		case 129 ... 157:
			subband = RTW89_CH_6G_BAND_IDX4;
			break;
		case 161 ... 189:
			subband = RTW89_CH_6G_BAND_IDX5;
			break;
		case 193 ... 221:
			subband = RTW89_CH_6G_BAND_IDX6;
			break;
		case 225 ... 253:
			subband = RTW89_CH_6G_BAND_IDX7;
			break;
		}
		break;
	}

	chan_param->center_chan = center_chan;
	chan_param->primary_chan = channel->hw_value;
+9 −0
Original line number Diff line number Diff line
@@ -61,6 +61,15 @@ enum rtw89_subband {
	RTW89_CH_5G_BAND_3 = 3,
	RTW89_CH_5G_BAND_4 = 4,

	RTW89_CH_6G_BAND_IDX0, /* Low */
	RTW89_CH_6G_BAND_IDX1, /* Low */
	RTW89_CH_6G_BAND_IDX2, /* Mid */
	RTW89_CH_6G_BAND_IDX3, /* Mid */
	RTW89_CH_6G_BAND_IDX4, /* High */
	RTW89_CH_6G_BAND_IDX5, /* High */
	RTW89_CH_6G_BAND_IDX6, /* Ultra-high */
	RTW89_CH_6G_BAND_IDX7, /* Ultra-high */

	RTW89_SUBBAND_NR,
};

+2 −0
Original line number Diff line number Diff line
@@ -2917,6 +2917,7 @@ static void _tssi_set_tmeter_tbl(struct rtw89_dev *rtwdev, enum rtw89_phy_idx ph
	u8 i, j;

	switch (subband) {
	default:
	case RTW89_CH_2G:
		thm_up_a = rtw89_8852a_trk_cfg.delta_swingidx_2ga_p;
		thm_down_a = rtw89_8852a_trk_cfg.delta_swingidx_2ga_n;
@@ -3101,6 +3102,7 @@ static void _tssi_pak(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
	u8 subband = rtwdev->hal.current_subband;

	switch (subband) {
	default:
	case RTW89_CH_2G:
		rtw89_rfk_parser_by_cond(rtwdev, path == RF_PATH_A,
					 &rtw8852a_tssi_pak_defs_a_2g_tbl,