Blame SOURCES/0024-rtw89-remove-cch_by_bw-which-is-not-used.patch

56e3f4
From 52ad252f9ecc9b83bd17b74280e10ae8fae15e44 Mon Sep 17 00:00:00 2001
56e3f4
From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= <ihuguet@redhat.com>
56e3f4
Date: Fri, 21 Jan 2022 08:49:03 +0100
56e3f4
Subject: [PATCH 24/36] rtw89: remove cch_by_bw which is not used
56e3f4
MIME-Version: 1.0
56e3f4
Content-Type: text/plain; charset=UTF-8
56e3f4
Content-Transfer-Encoding: 8bit
56e3f4
56e3f4
Bugzilla: http://bugzilla.redhat.com/2033291
56e3f4
56e3f4
commit c2258b29985eac9216a9e55f9d5bead9767f96da
56e3f4
Author: Zong-Zhe Yang <kevin_yang@realtek.com>
56e3f4
Date:   Wed Dec 1 16:09:01 2021 +0800
56e3f4
56e3f4
    rtw89: remove cch_by_bw which is not used
56e3f4
56e3f4
    Originally, cch_by_bw recorded center channels of each available
56e3f4
    bandwidths under current bandwidth. And the plan was to iterate
56e3f4
    cch_by_bw as parameters to query other configurations. However,
56e3f4
    we have not used it for the time being. Keeping it will disturb
56e3f4
    the follow-up things, such as bandwidth 160 MHz, so we remove it
56e3f4
    for now. If it's really needed at some point, we will redesign it.
56e3f4
56e3f4
    Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
56e3f4
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
56e3f4
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
56e3f4
    Link: https://lore.kernel.org/r/20211201080901.12125-1-pkshih@realtek.com
56e3f4
56e3f4
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
56e3f4
---
56e3f4
 drivers/net/wireless/realtek/rtw89/core.c | 23 -----------------------
56e3f4
 drivers/net/wireless/realtek/rtw89/core.h |  6 ------
56e3f4
 2 files changed, 29 deletions(-)
56e3f4
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
56e3f4
index 8212496ae9ef..00ae86807dc2 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/core.c
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/core.c
56e3f4
@@ -143,20 +143,15 @@ static void rtw89_get_channel_params(struct cfg80211_chan_def *chandef,
56e3f4
 {
56e3f4
 	struct ieee80211_channel *channel = chandef->chan;
56e3f4
 	enum nl80211_chan_width width = chandef->width;
56e3f4
-	u8 *cch_by_bw = chan_param->cch_by_bw;
56e3f4
 	u32 primary_freq, center_freq;
56e3f4
 	u8 center_chan;
56e3f4
 	u8 bandwidth = RTW89_CHANNEL_WIDTH_20;
56e3f4
 	u8 primary_chan_idx = 0;
56e3f4
-	u8 i;
56e3f4
 
56e3f4
 	center_chan = channel->hw_value;
56e3f4
 	primary_freq = channel->center_freq;
56e3f4
 	center_freq = chandef->center_freq1;
56e3f4
 
56e3f4
-	/* assign the center channel used while 20M bw is selected */
56e3f4
-	cch_by_bw[RTW89_CHANNEL_WIDTH_20] = channel->hw_value;
56e3f4
-
56e3f4
 	switch (width) {
56e3f4
 	case NL80211_CHAN_WIDTH_20_NOHT:
56e3f4
 	case NL80211_CHAN_WIDTH_20:
56e3f4
@@ -183,10 +178,6 @@ static void rtw89_get_channel_params(struct cfg80211_chan_def *chandef,
56e3f4
 				primary_chan_idx = RTW89_SC_20_UPMOST;
56e3f4
 				center_chan -= 6;
56e3f4
 			}
56e3f4
-			/* assign the center channel used
56e3f4
-			 * while 40M bw is selected
56e3f4
-			 */
56e3f4
-			cch_by_bw[RTW89_CHANNEL_WIDTH_40] = center_chan + 4;
56e3f4
 		} else {
56e3f4
 			if (center_freq - primary_freq == 10) {
56e3f4
 				primary_chan_idx = RTW89_SC_20_LOWER;
56e3f4
@@ -195,10 +186,6 @@ static void rtw89_get_channel_params(struct cfg80211_chan_def *chandef,
56e3f4
 				primary_chan_idx = RTW89_SC_20_LOWEST;
56e3f4
 				center_chan += 6;
56e3f4
 			}
56e3f4
-			/* assign the center channel used
56e3f4
-			 * while 40M bw is selected
56e3f4
-			 */
56e3f4
-			cch_by_bw[RTW89_CHANNEL_WIDTH_40] = center_chan - 4;
56e3f4
 		}
56e3f4
 		break;
56e3f4
 	default:
56e3f4
@@ -210,12 +197,6 @@ static void rtw89_get_channel_params(struct cfg80211_chan_def *chandef,
56e3f4
 	chan_param->primary_chan = channel->hw_value;
56e3f4
 	chan_param->bandwidth = bandwidth;
56e3f4
 	chan_param->pri_ch_idx = primary_chan_idx;
56e3f4
-
56e3f4
-	/* assign the center channel used while current bw is selected */
56e3f4
-	cch_by_bw[bandwidth] = center_chan;
56e3f4
-
56e3f4
-	for (i = bandwidth + 1; i <= RTW89_MAX_CHANNEL_WIDTH; i++)
56e3f4
-		cch_by_bw[i] = 0;
56e3f4
 }
56e3f4
 
56e3f4
 void rtw89_set_channel(struct rtw89_dev *rtwdev)
56e3f4
@@ -228,7 +209,6 @@ void rtw89_set_channel(struct rtw89_dev *rtwdev)
56e3f4
 	u8 center_chan, bandwidth;
56e3f4
 	u8 band_type;
56e3f4
 	bool band_changed;
56e3f4
-	u8 i;
56e3f4
 
56e3f4
 	rtw89_get_channel_params(&hw->conf.chandef, &ch_param);
56e3f4
 	if (WARN(ch_param.center_chan == 0, "Invalid channel\n"))
56e3f4
@@ -261,9 +241,6 @@ void rtw89_set_channel(struct rtw89_dev *rtwdev)
56e3f4
 		break;
56e3f4
 	}
56e3f4
 
56e3f4
-	for (i = RTW89_CHANNEL_WIDTH_20; i <= RTW89_MAX_CHANNEL_WIDTH; i++)
56e3f4
-		hal->cch_by_bw[i] = ch_param.cch_by_bw[i];
56e3f4
-
56e3f4
 	rtw89_chip_set_channel_prepare(rtwdev, &bak;;
56e3f4
 
56e3f4
 	chip->ops->set_channel(rtwdev, &ch_param);
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
56e3f4
index 7066335adcee..c03e3a13bd56 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/core.h
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/core.h
56e3f4
@@ -547,7 +547,6 @@ enum rtw89_ps_mode {
56e3f4
 	RTW89_PS_MODE_PWR_GATED	= 3,
56e3f4
 };
56e3f4
 
56e3f4
-#define RTW89_MAX_CHANNEL_WIDTH RTW89_CHANNEL_WIDTH_80
56e3f4
 #define RTW89_2G_BW_NUM (RTW89_CHANNEL_WIDTH_40 + 1)
56e3f4
 #define RTW89_5G_BW_NUM (RTW89_CHANNEL_WIDTH_80 + 1)
56e3f4
 #define RTW89_PPE_BW_NUM (RTW89_CHANNEL_WIDTH_80 + 1)
56e3f4
@@ -574,7 +573,6 @@ struct rtw89_channel_params {
56e3f4
 	u8 primary_chan;
56e3f4
 	u8 bandwidth;
56e3f4
 	u8 pri_ch_idx;
56e3f4
-	u8 cch_by_bw[RTW89_MAX_CHANNEL_WIDTH + 1];
56e3f4
 };
56e3f4
 
56e3f4
 struct rtw89_channel_help_params {
56e3f4
@@ -2354,10 +2352,6 @@ struct rtw89_hal {
56e3f4
 	enum rtw89_subband current_subband;
56e3f4
 	u8 current_band_width;
56e3f4
 	u8 current_band_type;
56e3f4
-	/* center channel for different available bandwidth,
56e3f4
-	 * val of (bw > current_band_width) is invalid
56e3f4
-	 */
56e3f4
-	u8 cch_by_bw[RTW89_MAX_CHANNEL_WIDTH + 1];
56e3f4
 	u32 sw_amsdu_max_size;
56e3f4
 	u32 antenna_tx;
56e3f4
 	u32 antenna_rx;
56e3f4
-- 
56e3f4
2.13.6
56e3f4