diff mbox series

[1/2] wifi: rtw88: simplify rtw_chip_cfg_csi_rate()

Message ID 20231030093144.82504-1-dmantipov@yandex.ru (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show
Series [1/2] wifi: rtw88: simplify rtw_chip_cfg_csi_rate() | expand

Commit Message

Dmitry Antipov Oct. 30, 2023, 9:31 a.m. UTC
Since fix rate flag in 'rtw_dynamic_csi_rate()' is a hardcoded
zero and actually unused in an underlying 'rtw_bf_cfg_csi_rate()',
simplify 'rtw_chip_cfg_csi_rate()' by dropping last argument and
adjust '(*cfg_csi_rate)()' of 'struct rtw_chip_ops' accordingly.

Briefly tested on the following USB dongle:

usb 3-6: new high-speed USB device number 7 using xhci_hcd
usb 3-6: New USB device found, idVendor=0bda, idProduct=b812, bcdDevice=2.10
usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-6: Product: USB3.0 802.11ac 1200M Adapter
usb 3-6: Manufacturer: Realtek
usb 3-6: SerialNumber: 123456
rtw_8822bu 3-6:1.0: Firmware version 27.2.0, H2C version 13
usbcore: registered new interface driver rtw_8822bu

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/realtek/rtw88/bf.c   | 2 +-
 drivers/net/wireless/realtek/rtw88/bf.h   | 9 +++++----
 drivers/net/wireless/realtek/rtw88/main.c | 4 +---
 drivers/net/wireless/realtek/rtw88/main.h | 2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

Comments

Ping-Ke Shih Nov. 1, 2023, 12:48 a.m. UTC | #1
> -----Original Message-----
> From: Dmitry Antipov <dmantipov@yandex.ru>
> Sent: Monday, October 30, 2023 5:32 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; Dmitry Antipov <dmantipov@yandex.ru>
> Subject: [PATCH 1/2] wifi: rtw88: simplify rtw_chip_cfg_csi_rate()
> 
> Since fix rate flag in 'rtw_dynamic_csi_rate()' is a hardcoded
> zero and actually unused in an underlying 'rtw_bf_cfg_csi_rate()',
> simplify 'rtw_chip_cfg_csi_rate()' by dropping last argument and
> adjust '(*cfg_csi_rate)()' of 'struct rtw_chip_ops' accordingly.
> 
> Briefly tested on the following USB dongle:
> 
> usb 3-6: new high-speed USB device number 7 using xhci_hcd
> usb 3-6: New USB device found, idVendor=0bda, idProduct=b812, bcdDevice=2.10
> usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 3-6: Product: USB3.0 802.11ac 1200M Adapter
> usb 3-6: Manufacturer: Realtek
> usb 3-6: SerialNumber: 123456
> rtw_8822bu 3-6:1.0: Firmware version 27.2.0, H2C version 13
> usbcore: registered new interface driver rtw_8822bu
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
>  drivers/net/wireless/realtek/rtw88/bf.c   | 2 +-
>  drivers/net/wireless/realtek/rtw88/bf.h   | 9 +++++----
>  drivers/net/wireless/realtek/rtw88/main.c | 4 +---
>  drivers/net/wireless/realtek/rtw88/main.h | 2 +-
>  4 files changed, 8 insertions(+), 9 deletions(-)
> 

[...]

> diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
> index 4a33d2e47f33..4ea2f09709b0 100644
> --- a/drivers/net/wireless/realtek/rtw88/main.c
> +++ b/drivers/net/wireless/realtek/rtw88/main.c
> @@ -170,7 +170,6 @@ struct rtw_watch_dog_iter_data {
>  static void rtw_dynamic_csi_rate(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif)
>  {
>         struct rtw_bf_info *bf_info = &rtwdev->bf_info;
> -       u8 fix_rate_enable = 0;

rtw88 is still active and possible to tune this parameter for certain circumstances,
and this parameter is helpful to understand current configuration, so I would tend
to not merge this patchset. 

Ping-Ke
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/bf.c b/drivers/net/wireless/realtek/rtw88/bf.c
index c827c4a2814b..8cf87c30adc2 100644
--- a/drivers/net/wireless/realtek/rtw88/bf.c
+++ b/drivers/net/wireless/realtek/rtw88/bf.c
@@ -379,7 +379,7 @@  void rtw_bf_phy_init(struct rtw_dev *rtwdev)
 EXPORT_SYMBOL(rtw_bf_phy_init);
 
 void rtw_bf_cfg_csi_rate(struct rtw_dev *rtwdev, u8 rssi, u8 cur_rate,
-			 u8 fixrate_en, u8 *new_rate)
+			 u8 *new_rate)
 {
 	u32 csi_cfg;
 	u16 cur_rrsr;
diff --git a/drivers/net/wireless/realtek/rtw88/bf.h b/drivers/net/wireless/realtek/rtw88/bf.h
index 7b40c2c03856..1f47c6324240 100644
--- a/drivers/net/wireless/realtek/rtw88/bf.h
+++ b/drivers/net/wireless/realtek/rtw88/bf.h
@@ -91,7 +91,8 @@  void rtw_bf_set_gid_table(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
 			  struct ieee80211_bss_conf *conf);
 void rtw_bf_phy_init(struct rtw_dev *rtwdev);
 void rtw_bf_cfg_csi_rate(struct rtw_dev *rtwdev, u8 rssi, u8 cur_rate,
-			 u8 fixrate_en, u8 *new_rate);
+			 u8 *new_rate);
+
 static inline void rtw_chip_config_bfee(struct rtw_dev *rtwdev, struct rtw_vif *vif,
 					struct rtw_bfee *bfee, bool enable)
 {
@@ -107,11 +108,11 @@  static inline void rtw_chip_set_gid_table(struct rtw_dev *rtwdev,
 		rtwdev->chip->ops->set_gid_table(rtwdev, vif, conf);
 }
 
-static inline void rtw_chip_cfg_csi_rate(struct rtw_dev *rtwdev, u8 rssi, u8 cur_rate,
-					 u8 fixrate_en, u8 *new_rate)
+static inline void rtw_chip_cfg_csi_rate(struct rtw_dev *rtwdev, u8 rssi,
+					 u8 cur_rate, u8 *new_rate)
 {
 	if (rtwdev->chip->ops->cfg_csi_rate)
 		rtwdev->chip->ops->cfg_csi_rate(rtwdev, rssi, cur_rate,
-						fixrate_en, new_rate);
+						new_rate);
 }
 #endif
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 4a33d2e47f33..4ea2f09709b0 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -170,7 +170,6 @@  struct rtw_watch_dog_iter_data {
 static void rtw_dynamic_csi_rate(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif)
 {
 	struct rtw_bf_info *bf_info = &rtwdev->bf_info;
-	u8 fix_rate_enable = 0;
 	u8 new_csi_rate_idx;
 
 	if (rtwvif->bfee.role != RTW_BFEE_SU &&
@@ -178,8 +177,7 @@  static void rtw_dynamic_csi_rate(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif)
 		return;
 
 	rtw_chip_cfg_csi_rate(rtwdev, rtwdev->dm_info.min_rssi,
-			      bf_info->cur_csi_rpt_rate,
-			      fix_rate_enable, &new_csi_rate_idx);
+			      bf_info->cur_csi_rpt_rate, &new_csi_rate_idx);
 
 	if (new_csi_rate_idx != bf_info->cur_csi_rpt_rate)
 		bf_info->cur_csi_rpt_rate = new_csi_rate_idx;
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index b6bfd4c02e2d..835898a170df 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -872,7 +872,7 @@  struct rtw_chip_ops {
 			      struct ieee80211_vif *vif,
 			      struct ieee80211_bss_conf *conf);
 	void (*cfg_csi_rate)(struct rtw_dev *rtwdev, u8 rssi, u8 cur_rate,
-			     u8 fixrate_en, u8 *new_rate);
+			     u8 *new_rate);
 	void (*adaptivity_init)(struct rtw_dev *rtwdev);
 	void (*adaptivity)(struct rtw_dev *rtwdev);
 	void (*cfo_init)(struct rtw_dev *rtwdev);