public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further
@ 2023-12-13 16:51 Philipp Hortmann
  2023-12-13 16:51 ` [PATCH 01/10] staging: rtl8192e: Remove variable bCurrent_AMSDU_Support Philipp Hortmann
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Remove unused or unchanged variables.

Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s)
Transferred this patch over wlan connection of rtl8192e.
Tested in b,g,n mode and n mode in channels 2, 9, 13

Philipp Hortmann (10):
  staging: rtl8192e: Remove variable bCurrent_AMSDU_Support
  staging: rtl8192e: Remove unused variable nMaxAMSDUSize
  staging: rtl8192e: Remove constant variable self_mimo_ps
  staging: rtl8192e: Remove constant variable peer_mimo_ps
  staging: rtl8192e: Remove constant variable forced_short_gi
  staging: rtl8192e: Remove unused variable ht_info->amsdu_support
  staging: rtl8192e: Remove variable ht_info->mpdu_density
  staging: rtl8192e: Remove variable ht_info->RT2RT_HT_Mode
  staging: rtl8192e: Remove constant variable reg_rt2rt_aggregation
  staging: rtl8192e: Remove constant variable reg_rx_reorder_enable

 .../staging/rtl8192e/rtl8192e/r8192E_dev.c    |  5 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c  |  1 -
 drivers/staging/rtl8192e/rtl819x_HT.h         | 11 ---
 drivers/staging/rtl8192e/rtl819x_HTProc.c     | 77 ++++---------------
 drivers/staging/rtl8192e/rtllib_tx.c          |  5 --
 5 files changed, 17 insertions(+), 82 deletions(-)

-- 
2.43.0


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

* [PATCH 01/10] staging: rtl8192e: Remove variable bCurrent_AMSDU_Support
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
@ 2023-12-13 16:51 ` Philipp Hortmann
  2023-12-13 16:51 ` [PATCH 02/10] staging: rtl8192e: Remove unused variable nMaxAMSDUSize Philipp Hortmann
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

bCurrent_AMSDU_Support and nCurrent_AMSDU_MaxSize are set but never
evaluated.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     | 2 --
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 9 ---------
 2 files changed, 11 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index 0f27c820ffc5..bf87106dd784 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -103,8 +103,6 @@ struct rt_hi_throughput {
 	u8 PeerHTInfoBuf[32];
 	u8 amsdu_support;
 	u16 amsdu_max_size;
-	u8 bCurrent_AMSDU_Support;
-	u16 nCurrent_AMSDU_MaxSize;
 	u8 ampdu_enable;
 	u8 current_ampdu_enable;
 	u8 ampdu_factor;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 0197782e0ab6..cb8150137858 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -471,15 +471,8 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 	ht_info->cur_short_gi_20mhz = ((pPeerHTCap->ShortGI20Mhz == 1) ? true : false);
 	ht_info->cur_short_gi_40mhz = ((pPeerHTCap->ShortGI40Mhz == 1) ? true : false);
 
-	ht_info->bCurrent_AMSDU_Support = ht_info->amsdu_support;
-
 	nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935;
 
-	if (ht_info->amsdu_max_size > nMaxAMSDUSize)
-		ht_info->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize;
-	else
-		ht_info->nCurrent_AMSDU_MaxSize = ht_info->amsdu_max_size;
-
 	ht_info->current_ampdu_enable = ht_info->ampdu_enable;
 	if (ieee->rtllib_ap_sec_type &&
 	    (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) {
@@ -547,8 +540,6 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
 	ht_info->cur_short_gi_40mhz = false;
 	ht_info->forced_short_gi = false;
 
-	ht_info->bCurrent_AMSDU_Support = false;
-	ht_info->nCurrent_AMSDU_MaxSize = ht_info->amsdu_max_size;
 	ht_info->current_mpdu_density = ht_info->mpdu_density;
 	ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor;
 
-- 
2.43.0


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

* [PATCH 02/10] staging: rtl8192e: Remove unused variable nMaxAMSDUSize
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
  2023-12-13 16:51 ` [PATCH 01/10] staging: rtl8192e: Remove variable bCurrent_AMSDU_Support Philipp Hortmann
@ 2023-12-13 16:51 ` Philipp Hortmann
  2023-12-13 16:51 ` [PATCH 03/10] staging: rtl8192e: Remove constant variable self_mimo_ps Philipp Hortmann
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Remove unused variables nMaxAMSDUSize and amsdu_max_size.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ----
 2 files changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index bf87106dd784..ff0eb0d01022 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -102,7 +102,6 @@ struct rt_hi_throughput {
 	u8 PeerHTCapBuf[32];
 	u8 PeerHTInfoBuf[32];
 	u8 amsdu_support;
-	u16 amsdu_max_size;
 	u8 ampdu_enable;
 	u8 current_ampdu_enable;
 	u8 ampdu_factor;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index cb8150137858..379934a71f87 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -71,7 +71,6 @@ void ht_update_default_setting(struct rtllib_device *ieee)
 {
 	struct rt_hi_throughput *ht_info = ieee->ht_info;
 
-	ht_info->amsdu_max_size = 7935UL;
 	ht_info->amsdu_support = 0;
 
 	ht_info->ampdu_enable = 1;
@@ -436,7 +435,6 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 	struct rt_hi_throughput *ht_info = ieee->ht_info;
 	struct ht_capab_ele *pPeerHTCap = NULL;
 	struct ht_info_ele *pPeerHTInfo = NULL;
-	u16 nMaxAMSDUSize = 0;
 	u8 *pMcsFilter = NULL;
 
 	static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 };
@@ -471,8 +469,6 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 	ht_info->cur_short_gi_20mhz = ((pPeerHTCap->ShortGI20Mhz == 1) ? true : false);
 	ht_info->cur_short_gi_40mhz = ((pPeerHTCap->ShortGI40Mhz == 1) ? true : false);
 
-	nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935;
-
 	ht_info->current_ampdu_enable = ht_info->ampdu_enable;
 	if (ieee->rtllib_ap_sec_type &&
 	    (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) {
-- 
2.43.0


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

* [PATCH 03/10] staging: rtl8192e: Remove constant variable self_mimo_ps
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
  2023-12-13 16:51 ` [PATCH 01/10] staging: rtl8192e: Remove variable bCurrent_AMSDU_Support Philipp Hortmann
  2023-12-13 16:51 ` [PATCH 02/10] staging: rtl8192e: Remove unused variable nMaxAMSDUSize Philipp Hortmann
@ 2023-12-13 16:51 ` Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 04/10] staging: rtl8192e: Remove constant variable peer_mimo_ps Philipp Hortmann
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Remove constant variable self_mimo_ps and replace it at the place of
usage with the value.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 5 +----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index ff0eb0d01022..eb2cfeab97d6 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -112,7 +112,6 @@ struct rt_hi_throughput {
 	u8 forced_mpdu_density;
 	u8 forced_short_gi;
 	u8 current_op_mode;
-	u8 self_mimo_ps;
 	u8 peer_mimo_ps;
 	enum ht_extchnl_offset CurSTAExtChnlOffset;
 	u8 cur_tx_bw40mhz;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 379934a71f87..71d5b6f32869 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -77,9 +77,6 @@ void ht_update_default_setting(struct rtllib_device *ieee)
 	ht_info->ampdu_factor = 2;
 	ht_info->mpdu_density = 0;
 
-	ht_info->self_mimo_ps = 3;
-	if (ht_info->self_mimo_ps == 2)
-		ht_info->self_mimo_ps = 3;
 	ieee->tx_dis_rate_fallback = 0;
 	ieee->tx_use_drv_assinged_rate = 0;
 
@@ -266,7 +263,7 @@ void ht_construct_capability_element(struct rtllib_device *ieee, u8 *posHTCap,
 	else
 		pCapELE->ChlWidth = 1;
 
-	pCapELE->MimoPwrSave		= pHT->self_mimo_ps;
+	pCapELE->MimoPwrSave		= 3;
 	pCapELE->GreenField		= 0;
 	pCapELE->ShortGI20Mhz		= 1;
 	pCapELE->ShortGI40Mhz		= 1;
-- 
2.43.0


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

* [PATCH 04/10] staging: rtl8192e: Remove constant variable peer_mimo_ps
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
                   ` (2 preceding siblings ...)
  2023-12-13 16:51 ` [PATCH 03/10] staging: rtl8192e: Remove constant variable self_mimo_ps Philipp Hortmann
@ 2023-12-13 16:52 ` Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 05/10] staging: rtl8192e: Remove constant variable forced_short_gi Philipp Hortmann
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

MimoPwrSave is set to 3 and not changed. peer_mimo_ps is set to
MimoPwrSave and not changed. All evaluations of peer_mimo_ps with 0 will
have a constant result and can be removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 5 +----
 drivers/staging/rtl8192e/rtl819x_HT.h          | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c      | 6 +-----
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index e6d51abd0d01..763ecaad6652 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1753,10 +1753,7 @@ void rtl92e_update_ratr_table(struct net_device *dev)
 		ratr_value &= 0x00000FF7;
 		break;
 	case WIRELESS_MODE_N_24G:
-		if (ieee->ht_info->peer_mimo_ps == 0)
-			ratr_value &= 0x0007F007;
-		else
-			ratr_value &= 0x000FF007;
+		ratr_value &= 0x000FF007;
 		break;
 	default:
 		break;
diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index eb2cfeab97d6..43472b2250c2 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -112,7 +112,6 @@ struct rt_hi_throughput {
 	u8 forced_mpdu_density;
 	u8 forced_short_gi;
 	u8 current_op_mode;
-	u8 peer_mimo_ps;
 	enum ht_extchnl_offset CurSTAExtChnlOffset;
 	u8 cur_tx_bw40mhz;
 	u8 sw_bw_in_progress;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 71d5b6f32869..d424b7729a01 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -507,11 +507,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 
 	HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11ht_oper_rate_set);
 
-	ht_info->peer_mimo_ps = pPeerHTCap->MimoPwrSave;
-	if (ht_info->peer_mimo_ps == MIMO_PS_STATIC)
-		pMcsFilter = MCS_FILTER_1SS;
-	else
-		pMcsFilter = MCS_FILTER_ALL;
+	pMcsFilter = MCS_FILTER_ALL;
 	ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee,
 						       ieee->dot11ht_oper_rate_set,
 						       pMcsFilter);
-- 
2.43.0


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

* [PATCH 05/10] staging: rtl8192e: Remove constant variable forced_short_gi
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
                   ` (3 preceding siblings ...)
  2023-12-13 16:52 ` [PATCH 04/10] staging: rtl8192e: Remove constant variable peer_mimo_ps Philipp Hortmann
@ 2023-12-13 16:52 ` Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 06/10] staging: rtl8192e: Remove unused variable ht_info->amsdu_support Philipp Hortmann
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

ht_info->forced_short_gi is set to 0 and unchanged. Therefore all equations
result accordingly and ht_info->forced_short_gi can be removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 1 -
 drivers/staging/rtl8192e/rtllib_tx.c      | 5 -----
 3 files changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index 43472b2250c2..e6cd906dc0ac 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -110,7 +110,6 @@ struct rt_hi_throughput {
 	u8 current_mpdu_density;
 	u8 forced_ampdu_factor;
 	u8 forced_mpdu_density;
-	u8 forced_short_gi;
 	u8 current_op_mode;
 	enum ht_extchnl_offset CurSTAExtChnlOffset;
 	u8 cur_tx_bw40mhz;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index d424b7729a01..578d9276035f 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -527,7 +527,6 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
 
 	ht_info->cur_short_gi_20mhz = false;
 	ht_info->cur_short_gi_40mhz = false;
-	ht_info->forced_short_gi = false;
 
 	ht_info->current_mpdu_density = ht_info->mpdu_density;
 	ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor;
diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c
index 0fa6f674a844..f7098a2ba8b0 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -340,11 +340,6 @@ static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee,
 	if (!ht_info->current_ht_support || !ht_info->enable_ht)
 		return;
 
-	if (ht_info->forced_short_gi) {
-		tcb_desc->bUseShortGI = true;
-		return;
-	}
-
 	if (ht_info->cur_bw_40mhz && ht_info->cur_short_gi_40mhz)
 		tcb_desc->bUseShortGI = true;
 	else if (!ht_info->cur_bw_40mhz && ht_info->cur_short_gi_20mhz)
-- 
2.43.0


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

* [PATCH 06/10] staging: rtl8192e: Remove unused variable ht_info->amsdu_support
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
                   ` (4 preceding siblings ...)
  2023-12-13 16:52 ` [PATCH 05/10] staging: rtl8192e: Remove constant variable forced_short_gi Philipp Hortmann
@ 2023-12-13 16:52 ` Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 07/10] staging: rtl8192e: Remove variable ht_info->mpdu_density Philipp Hortmann
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Remove unused variable ht_info->amsdu_support.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 --
 2 files changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index e6cd906dc0ac..c4af9968cd67 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -101,7 +101,6 @@ struct rt_hi_throughput {
 	struct ht_capab_ele SelfHTCap;
 	u8 PeerHTCapBuf[32];
 	u8 PeerHTInfoBuf[32];
-	u8 amsdu_support;
 	u8 ampdu_enable;
 	u8 current_ampdu_enable;
 	u8 ampdu_factor;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 578d9276035f..044bfe44d213 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -71,8 +71,6 @@ void ht_update_default_setting(struct rtllib_device *ieee)
 {
 	struct rt_hi_throughput *ht_info = ieee->ht_info;
 
-	ht_info->amsdu_support = 0;
-
 	ht_info->ampdu_enable = 1;
 	ht_info->ampdu_factor = 2;
 	ht_info->mpdu_density = 0;
-- 
2.43.0


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

* [PATCH 07/10] staging: rtl8192e: Remove variable ht_info->mpdu_density
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
                   ` (5 preceding siblings ...)
  2023-12-13 16:52 ` [PATCH 06/10] staging: rtl8192e: Remove unused variable ht_info->amsdu_support Philipp Hortmann
@ 2023-12-13 16:52 ` Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 08/10] staging: rtl8192e: Remove variable ht_info->RT2RT_HT_Mode Philipp Hortmann
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

ht_info->mpdu_density is set to 0 and unchanged. Therefore all equations
result accordingly and ht_info->forced_short_gi can be removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 ++----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index c4af9968cd67..1da56f1c04eb 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -105,7 +105,6 @@ struct rt_hi_throughput {
 	u8 current_ampdu_enable;
 	u8 ampdu_factor;
 	u8 CurrentAMPDUFactor;
-	u8 mpdu_density;
 	u8 current_mpdu_density;
 	u8 forced_ampdu_factor;
 	u8 forced_mpdu_density;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 044bfe44d213..14e6f46a65ed 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -73,7 +73,6 @@ void ht_update_default_setting(struct rtllib_device *ieee)
 
 	ht_info->ampdu_enable = 1;
 	ht_info->ampdu_factor = 2;
-	ht_info->mpdu_density = 0;
 
 	ieee->tx_dis_rate_fallback = 0;
 	ieee->tx_use_drv_assinged_rate = 0;
@@ -491,8 +490,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 							    HT_AGG_SIZE_32K);
 		}
 	}
-	ht_info->current_mpdu_density = max_t(u8, ht_info->mpdu_density,
-					      pPeerHTCap->MPDUDensity);
+	ht_info->current_mpdu_density = pPeerHTCap->MPDUDensity;
 	if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) {
 		ht_info->current_ampdu_enable = false;
 	}
@@ -526,7 +524,7 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
 	ht_info->cur_short_gi_20mhz = false;
 	ht_info->cur_short_gi_40mhz = false;
 
-	ht_info->current_mpdu_density = ht_info->mpdu_density;
+	ht_info->current_mpdu_density = 0;
 	ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor;
 
 	memset((void *)(&ht_info->SelfHTCap), 0,
-- 
2.43.0


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

* [PATCH 08/10] staging: rtl8192e: Remove variable ht_info->RT2RT_HT_Mode
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
                   ` (6 preceding siblings ...)
  2023-12-13 16:52 ` [PATCH 07/10] staging: rtl8192e: Remove variable ht_info->mpdu_density Philipp Hortmann
@ 2023-12-13 16:52 ` Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 09/10] staging: rtl8192e: Remove constant variable reg_rt2rt_aggregation Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 10/10] staging: rtl8192e: Remove constant variable reg_rx_reorder_enable Philipp Hortmann
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Remove variable ht_info->RT2RT_HT_Mode as it is always set but never
evaluated.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
 drivers/staging/rtl8192e/rtl819x_HT.h        | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c    | 4 ----
 3 files changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 72e89ccfb184..bef042233117 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -287,7 +287,6 @@ static void _rtl92e_update_beacon(void *data)
 	if (ieee->ht_info->current_ht_support)
 		HT_update_self_and_peer_setting(ieee, net);
 	ieee->ht_info->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time;
-	ieee->ht_info->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode;
 	_rtl92e_update_cap(dev, net->capability);
 }
 
diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index 1da56f1c04eb..315905fa4b2c 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -113,7 +113,6 @@ struct rt_hi_throughput {
 	u8 cur_tx_bw40mhz;
 	u8 sw_bw_in_progress;
 	u8 reg_rt2rt_aggregation;
-	u8 RT2RT_HT_Mode;
 	u8 current_rt2rt_aggregation;
 	u8 current_rt2rt_long_slot_time;
 	u8 sz_rt2rt_agg_buf[10];
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 14e6f46a65ed..6bd4afe32f61 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -540,7 +540,6 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
 
 	ht_info->current_rt2rt_aggregation = false;
 	ht_info->current_rt2rt_long_slot_time = false;
-	ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0;
 
 	ht_info->iot_peer = 0;
 	ht_info->iot_action = 0;
@@ -601,11 +600,9 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee,
 				 pNetwork->bssht.bd_rt2rt_aggregation;
 			ht_info->current_rt2rt_long_slot_time =
 				 pNetwork->bssht.bd_rt2rt_long_slot_time;
-			ht_info->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode;
 		} else {
 			ht_info->current_rt2rt_aggregation = false;
 			ht_info->current_rt2rt_long_slot_time = false;
-			ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0;
 		}
 
 		ht_iot_peer_determine(ieee);
@@ -621,7 +618,6 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee,
 		ht_info->current_ht_support = false;
 		ht_info->current_rt2rt_aggregation = false;
 		ht_info->current_rt2rt_long_slot_time = false;
-		ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0;
 
 		ht_info->iot_action = 0;
 		ht_info->iot_ra_func = 0;
-- 
2.43.0


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

* [PATCH 09/10] staging: rtl8192e: Remove constant variable reg_rt2rt_aggregation
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
                   ` (7 preceding siblings ...)
  2023-12-13 16:52 ` [PATCH 08/10] staging: rtl8192e: Remove variable ht_info->RT2RT_HT_Mode Philipp Hortmann
@ 2023-12-13 16:52 ` Philipp Hortmann
  2023-12-13 16:52 ` [PATCH 10/10] staging: rtl8192e: Remove constant variable reg_rx_reorder_enable Philipp Hortmann
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

ht_info->reg_rt2rt_aggregation is set to 1 and unchanged. Therefore all
equations result accordingly and ht_info->reg_rt2rt_aggregation can be
removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     |  1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 37 +++++++----------------
 2 files changed, 11 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index 315905fa4b2c..514ac9e1f3f8 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -112,7 +112,6 @@ struct rt_hi_throughput {
 	enum ht_extchnl_offset CurSTAExtChnlOffset;
 	u8 cur_tx_bw40mhz;
 	u8 sw_bw_in_progress;
-	u8 reg_rt2rt_aggregation;
 	u8 current_rt2rt_aggregation;
 	u8 current_rt2rt_long_slot_time;
 	u8 sz_rt2rt_agg_buf[10];
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 6bd4afe32f61..d9561e3a76d6 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -79,8 +79,6 @@ void ht_update_default_setting(struct rtllib_device *ieee)
 
 	ieee->tx_enable_fw_calc_dur = 1;
 
-	ht_info->reg_rt2rt_aggregation = 1;
-
 	ht_info->reg_rx_reorder_enable = 1;
 	ht_info->rx_reorder_win_size = 64;
 	ht_info->rx_reorder_pending_time = 30;
@@ -471,25 +469,17 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 			ht_info->current_ampdu_enable = false;
 	}
 
-	if (!ht_info->reg_rt2rt_aggregation) {
-		if (ht_info->ampdu_factor > pPeerHTCap->MaxRxAMPDUFactor)
+	if (ieee->current_network.bssht.bd_rt2rt_aggregation) {
+		if (ieee->pairwise_key_type != KEY_TYPE_NA)
 			ht_info->CurrentAMPDUFactor =
-						 pPeerHTCap->MaxRxAMPDUFactor;
+					 pPeerHTCap->MaxRxAMPDUFactor;
 		else
-			ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor;
-
+			ht_info->CurrentAMPDUFactor = HT_AGG_SIZE_64K;
 	} else {
-		if (ieee->current_network.bssht.bd_rt2rt_aggregation) {
-			if (ieee->pairwise_key_type != KEY_TYPE_NA)
-				ht_info->CurrentAMPDUFactor =
-						 pPeerHTCap->MaxRxAMPDUFactor;
-			else
-				ht_info->CurrentAMPDUFactor = HT_AGG_SIZE_64K;
-		} else {
-			ht_info->CurrentAMPDUFactor = min_t(u32, pPeerHTCap->MaxRxAMPDUFactor,
-							    HT_AGG_SIZE_32K);
-		}
+		ht_info->CurrentAMPDUFactor = min_t(u32, pPeerHTCap->MaxRxAMPDUFactor,
+						    HT_AGG_SIZE_32K);
 	}
+
 	ht_info->current_mpdu_density = pPeerHTCap->MPDUDensity;
 	if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) {
 		ht_info->current_ampdu_enable = false;
@@ -595,15 +585,10 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee,
 			       pNetwork->bssht.bd_ht_info_buf,
 			       pNetwork->bssht.bd_ht_info_len);
 
-		if (ht_info->reg_rt2rt_aggregation) {
-			ht_info->current_rt2rt_aggregation =
-				 pNetwork->bssht.bd_rt2rt_aggregation;
-			ht_info->current_rt2rt_long_slot_time =
-				 pNetwork->bssht.bd_rt2rt_long_slot_time;
-		} else {
-			ht_info->current_rt2rt_aggregation = false;
-			ht_info->current_rt2rt_long_slot_time = false;
-		}
+		ht_info->current_rt2rt_aggregation =
+			 pNetwork->bssht.bd_rt2rt_aggregation;
+		ht_info->current_rt2rt_long_slot_time =
+			 pNetwork->bssht.bd_rt2rt_long_slot_time;
 
 		ht_iot_peer_determine(ieee);
 
-- 
2.43.0


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

* [PATCH 10/10] staging: rtl8192e: Remove constant variable reg_rx_reorder_enable
  2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
                   ` (8 preceding siblings ...)
  2023-12-13 16:52 ` [PATCH 09/10] staging: rtl8192e: Remove constant variable reg_rt2rt_aggregation Philipp Hortmann
@ 2023-12-13 16:52 ` Philipp Hortmann
  9 siblings, 0 replies; 11+ messages in thread
From: Philipp Hortmann @ 2023-12-13 16:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Remove constant variable reg_rx_reorder_enable and replace it at the place
of usage with the value.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_HT.h     | 1 -
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index 514ac9e1f3f8..2911ea82dd17 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -115,7 +115,6 @@ struct rt_hi_throughput {
 	u8 current_rt2rt_aggregation;
 	u8 current_rt2rt_long_slot_time;
 	u8 sz_rt2rt_agg_buf[10];
-	u8 reg_rx_reorder_enable;
 	u8 cur_rx_reorder_enable;
 	u8 rx_reorder_win_size;
 	u8 rx_reorder_pending_time;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index d9561e3a76d6..00bf5c706157 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -79,7 +79,6 @@ void ht_update_default_setting(struct rtllib_device *ieee)
 
 	ieee->tx_enable_fw_calc_dur = 1;
 
-	ht_info->reg_rx_reorder_enable = 1;
 	ht_info->rx_reorder_win_size = 64;
 	ht_info->rx_reorder_pending_time = 30;
 }
@@ -484,7 +483,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 	if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) {
 		ht_info->current_ampdu_enable = false;
 	}
-	ht_info->cur_rx_reorder_enable = ht_info->reg_rx_reorder_enable;
+	ht_info->cur_rx_reorder_enable = 1;
 
 	if (pPeerHTCap->MCS[0] == 0)
 		pPeerHTCap->MCS[0] = 0xff;
-- 
2.43.0


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

end of thread, other threads:[~2023-12-13 16:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 16:51 [PATCH 00/10] staging: rtl8192e: Remove variable nMaxAMSDUSize and further Philipp Hortmann
2023-12-13 16:51 ` [PATCH 01/10] staging: rtl8192e: Remove variable bCurrent_AMSDU_Support Philipp Hortmann
2023-12-13 16:51 ` [PATCH 02/10] staging: rtl8192e: Remove unused variable nMaxAMSDUSize Philipp Hortmann
2023-12-13 16:51 ` [PATCH 03/10] staging: rtl8192e: Remove constant variable self_mimo_ps Philipp Hortmann
2023-12-13 16:52 ` [PATCH 04/10] staging: rtl8192e: Remove constant variable peer_mimo_ps Philipp Hortmann
2023-12-13 16:52 ` [PATCH 05/10] staging: rtl8192e: Remove constant variable forced_short_gi Philipp Hortmann
2023-12-13 16:52 ` [PATCH 06/10] staging: rtl8192e: Remove unused variable ht_info->amsdu_support Philipp Hortmann
2023-12-13 16:52 ` [PATCH 07/10] staging: rtl8192e: Remove variable ht_info->mpdu_density Philipp Hortmann
2023-12-13 16:52 ` [PATCH 08/10] staging: rtl8192e: Remove variable ht_info->RT2RT_HT_Mode Philipp Hortmann
2023-12-13 16:52 ` [PATCH 09/10] staging: rtl8192e: Remove constant variable reg_rt2rt_aggregation Philipp Hortmann
2023-12-13 16:52 ` [PATCH 10/10] staging: rtl8192e: Remove constant variable reg_rx_reorder_enable Philipp Hortmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox