Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage
@ 2019-09-10 19:04 Michael Straube
  2019-09-10 19:04 ` [PATCH 1/3] rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version Michael Straube
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Michael Straube @ 2019-09-10 19:04 UTC (permalink / raw)
  To: kvalo
  Cc: pkshih, davem, linux-wireless, netdev, linux-kernel, Michael Straube

Functions _rtl92{c,d}_evm_db_to_percentage are functionally identical
to the generic version rtl_evm_db_to percentage. This series converts
rtl8192ce, rtl8192cu and rtl8192de to use the generic version.

Michael Straube (3):
  rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic
    version
  rtlwifi: rtl8192cu: replace _rtl92c_evm_db_to_percentage with generic
    version
  rtlwifi: rtl8192de: replace _rtl92d_evm_db_to_percentage with generic
    version

 .../wireless/realtek/rtlwifi/rtl8192ce/trx.c  | 23 +------------------
 .../wireless/realtek/rtlwifi/rtl8192cu/mac.c  | 18 +--------------
 .../wireless/realtek/rtlwifi/rtl8192de/trx.c  | 18 ++-------------
 3 files changed, 4 insertions(+), 55 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version
  2019-09-10 19:04 [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Michael Straube
@ 2019-09-10 19:04 ` Michael Straube
  2019-09-13 15:07   ` Kalle Valo
  2019-09-10 19:04 ` [PATCH 2/3] rtlwifi: rtl8192cu: " Michael Straube
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Michael Straube @ 2019-09-10 19:04 UTC (permalink / raw)
  To: kvalo
  Cc: pkshih, davem, linux-wireless, netdev, linux-kernel, Michael Straube

Function _rtl92c_evm_db_to_percentage is functionally identical
to the generic version rtl_evm_db_to_percentage, so remove
_rtl92c_evm_db_to_percentage and use the generic version instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 .../wireless/realtek/rtlwifi/rtl8192ce/trx.c  | 23 +------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
index 123dbf0903a1..fc9a3aae047f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
@@ -33,27 +33,6 @@ static u8 _rtl92c_query_rxpwrpercentage(s8 antpower)
 		return 100 + antpower;
 }
 
-static u8 _rtl92c_evm_db_to_percentage(s8 value)
-{
-	s8 ret_val;
-
-	ret_val = value;
-
-	if (ret_val >= 0)
-		ret_val = 0;
-
-	if (ret_val <= -33)
-		ret_val = -33;
-
-	ret_val = 0 - ret_val;
-	ret_val *= 3;
-
-	if (ret_val == 99)
-		ret_val = 100;
-
-	return ret_val;
-}
-
 static long _rtl92ce_signal_scale_mapping(struct ieee80211_hw *hw,
 		long currsig)
 {
@@ -243,7 +222,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
 			max_spatial_stream = 1;
 
 		for (i = 0; i < max_spatial_stream; i++) {
-			evm = _rtl92c_evm_db_to_percentage(p_drvinfo->rxevm[i]);
+			evm = rtl_evm_db_to_percentage(p_drvinfo->rxevm[i]);
 
 			if (packet_match_bssid) {
 				/* Fill value in RFD, Get the first
-- 
2.23.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] rtlwifi: rtl8192cu: replace _rtl92c_evm_db_to_percentage with generic version
  2019-09-10 19:04 [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Michael Straube
  2019-09-10 19:04 ` [PATCH 1/3] rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version Michael Straube
@ 2019-09-10 19:04 ` " Michael Straube
  2019-09-10 19:04 ` [PATCH 3/3] rtlwifi: rtl8192de: replace _rtl92d_evm_db_to_percentage " Michael Straube
  2019-09-11  1:31 ` [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Pkshih
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2019-09-10 19:04 UTC (permalink / raw)
  To: kvalo
  Cc: pkshih, davem, linux-wireless, netdev, linux-kernel, Michael Straube

Function _rtl92c_evm_db_to_percentage is functionally identical
to the generic version rtl_evm_db_to_percentage, so remove
_rtl92c_evm_db_to_percentage and use the generic version instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 .../wireless/realtek/rtlwifi/rtl8192cu/mac.c   | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
index c8daad1e749f..cec19b32c7e2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
@@ -577,22 +577,6 @@ static u8 _rtl92c_query_rxpwrpercentage(s8 antpower)
 		return 100 + antpower;
 }
 
-static u8 _rtl92c_evm_db_to_percentage(s8 value)
-{
-	s8 ret_val;
-
-	ret_val = value;
-	if (ret_val >= 0)
-		ret_val = 0;
-	if (ret_val <= -33)
-		ret_val = -33;
-	ret_val = 0 - ret_val;
-	ret_val *= 3;
-	if (ret_val == 99)
-		ret_val = 100;
-	return ret_val;
-}
-
 static long _rtl92c_signal_scale_mapping(struct ieee80211_hw *hw,
 		long currsig)
 {
@@ -743,7 +727,7 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
 		else
 			max_spatial_stream = 1;
 		for (i = 0; i < max_spatial_stream; i++) {
-			evm = _rtl92c_evm_db_to_percentage(p_drvinfo->rxevm[i]);
+			evm = rtl_evm_db_to_percentage(p_drvinfo->rxevm[i]);
 			if (packet_match_bssid) {
 				if (i == 0)
 					pstats->signalquality =
-- 
2.23.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] rtlwifi: rtl8192de: replace _rtl92d_evm_db_to_percentage with generic version
  2019-09-10 19:04 [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Michael Straube
  2019-09-10 19:04 ` [PATCH 1/3] rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version Michael Straube
  2019-09-10 19:04 ` [PATCH 2/3] rtlwifi: rtl8192cu: " Michael Straube
@ 2019-09-10 19:04 ` " Michael Straube
  2019-09-11  1:31 ` [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Pkshih
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2019-09-10 19:04 UTC (permalink / raw)
  To: kvalo
  Cc: pkshih, davem, linux-wireless, netdev, linux-kernel, Michael Straube

Function _rtl92d_evm_db_to_percentage is functionally identical
to the generic version rtl_evm_db_to_percentage, so remove
_rtl92d_evm_db_to_percentage and use the generic version instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 .../wireless/realtek/rtlwifi/rtl8192de/trx.c   | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
index d162884a9e00..2494e1f118f8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
@@ -4,6 +4,7 @@
 #include "../wifi.h"
 #include "../pci.h"
 #include "../base.h"
+#include "../stats.h"
 #include "reg.h"
 #include "def.h"
 #include "phy.h"
@@ -32,21 +33,6 @@ static u8 _rtl92d_query_rxpwrpercentage(s8 antpower)
 		return 100 + antpower;
 }
 
-static u8 _rtl92d_evm_db_to_percentage(s8 value)
-{
-	s8 ret_val = value;
-
-	if (ret_val >= 0)
-		ret_val = 0;
-	if (ret_val <= -33)
-		ret_val = -33;
-	ret_val = 0 - ret_val;
-	ret_val *= 3;
-	if (ret_val == 99)
-		ret_val = 100;
-	return ret_val;
-}
-
 static long _rtl92de_translate_todbm(struct ieee80211_hw *hw,
 				     u8 signal_strength_index)
 {
@@ -215,7 +201,7 @@ static void _rtl92de_query_rxphystatus(struct ieee80211_hw *hw,
 		else
 			max_spatial_stream = 1;
 		for (i = 0; i < max_spatial_stream; i++) {
-			evm = _rtl92d_evm_db_to_percentage(p_drvinfo->rxevm[i]);
+			evm = rtl_evm_db_to_percentage(p_drvinfo->rxevm[i]);
 			if (packet_match_bssid) {
 				if (i == 0)
 					pstats->signalquality =
-- 
2.23.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage
  2019-09-10 19:04 [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Michael Straube
                   ` (2 preceding siblings ...)
  2019-09-10 19:04 ` [PATCH 3/3] rtlwifi: rtl8192de: replace _rtl92d_evm_db_to_percentage " Michael Straube
@ 2019-09-11  1:31 ` Pkshih
  3 siblings, 0 replies; 6+ messages in thread
From: Pkshih @ 2019-09-11  1:31 UTC (permalink / raw)
  To: kvalo, straube.linux; +Cc: linux-wireless, davem, netdev, linux-kernel

On Tue, 2019-09-10 at 21:04 +0200, Michael Straube wrote:
> Functions _rtl92{c,d}_evm_db_to_percentage are functionally identical
> to the generic version rtl_evm_db_to percentage. This series converts
> rtl8192ce, rtl8192cu and rtl8192de to use the generic version.
> 
> Michael Straube (3):
>   rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic
>     version
>   rtlwifi: rtl8192cu: replace _rtl92c_evm_db_to_percentage with generic
>     version
>   rtlwifi: rtl8192de: replace _rtl92d_evm_db_to_percentage with generic
>     version
> 
>  .../wireless/realtek/rtlwifi/rtl8192ce/trx.c  | 23 +------------------
>  .../wireless/realtek/rtlwifi/rtl8192cu/mac.c  | 18 +--------------
>  .../wireless/realtek/rtlwifi/rtl8192de/trx.c  | 18 ++-------------
>  3 files changed, 4 insertions(+), 55 deletions(-)
> 

I checked the generic version and removed functions, and they are indeed
identical. Thanks for your patches.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version
  2019-09-10 19:04 ` [PATCH 1/3] rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version Michael Straube
@ 2019-09-13 15:07   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2019-09-13 15:07 UTC (permalink / raw)
  To: Michael Straube
  Cc: pkshih, davem, linux-wireless, netdev, linux-kernel, Michael Straube

Michael Straube <straube.linux@gmail.com> wrote:

> Function _rtl92c_evm_db_to_percentage is functionally identical
> to the generic version rtl_evm_db_to_percentage, so remove
> _rtl92c_evm_db_to_percentage and use the generic version instead.
> 
> Signed-off-by: Michael Straube <straube.linux@gmail.com>

3 patches applied to wireless-drivers-next.git, thanks.

1335ad27bd07 rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version
622c19ed3607 rtlwifi: rtl8192cu: replace _rtl92c_evm_db_to_percentage with generic version
3a1f85798e9f rtlwifi: rtl8192de: replace _rtl92d_evm_db_to_percentage with generic version

-- 
https://patchwork.kernel.org/patch/11140005/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 19:04 [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Michael Straube
2019-09-10 19:04 ` [PATCH 1/3] rtlwifi: rtl8192ce: replace _rtl92c_evm_db_to_percentage with generic version Michael Straube
2019-09-13 15:07   ` Kalle Valo
2019-09-10 19:04 ` [PATCH 2/3] rtlwifi: rtl8192cu: " Michael Straube
2019-09-10 19:04 ` [PATCH 3/3] rtlwifi: rtl8192de: replace _rtl92d_evm_db_to_percentage " Michael Straube
2019-09-11  1:31 ` [PATCH 0/3] rtlwifi: use generic rtl_evm_db_to_percentage Pkshih

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox