* [PATCH 1/8] staging: rtl8192e: Remove unchanged variable RegRfPsLevel
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
@ 2023-04-16 7:19 ` Philipp Hortmann
2023-04-16 7:19 ` [PATCH 2/8] staging: rtl8192e: Remove unused function rtl92e_disable_nic Philipp Hortmann
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:19 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove unchanged variable RegRfPsLevel and equations that have always the
same result to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 9 +--------
drivers/staging/rtl8192e/rtllib.h | 1 -
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index dd666701138e..4b0ebe96302e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -1089,14 +1089,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
if (i >= MAX_DOZE_WAITING_TIMES_9x)
break;
}
- if (psc->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC &&
- !RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) {
- rtl92e_disable_nic(dev);
- RT_SET_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
- } else if (!(psc->RegRfPsLevel &
- RT_RF_OFF_LEVL_HALT_NIC)) {
- rtl92e_set_rf_off(dev);
- }
+ rtl92e_set_rf_off(dev);
break;
default:
bResult = false;
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index b1729d65f67f..1a0e7ae70ca6 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1237,7 +1237,6 @@ struct rt_pwr_save_ctrl {
u8 LPSAwakeIntvl;
u32 CurPsLevel;
- u32 RegRfPsLevel;
};
#define RT_RF_CHANGE_SOURCE u32
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/8] staging: rtl8192e: Remove unused function rtl92e_disable_nic
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
2023-04-16 7:19 ` [PATCH 1/8] staging: rtl8192e: Remove unchanged variable RegRfPsLevel Philipp Hortmann
@ 2023-04-16 7:19 ` Philipp Hortmann
2023-04-16 7:19 ` [PATCH 3/8] staging: rtl8192e: Remove unused macro RT_SET_PS_LEVEL Philipp Hortmann
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:19 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove unused function rtl92e_disable_nic to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 16 ----------------
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
2 files changed, 17 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index a644543015ee..a0c6d117211a 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2302,22 +2302,6 @@ bool rtl92e_enable_nic(struct net_device *dev)
return init_status;
}
-bool rtl92e_disable_nic(struct net_device *dev)
-{
- struct r8192_priv *priv = rtllib_priv(dev);
- u8 tmp_state = 0;
-
- priv->bdisable_nic = true;
- tmp_state = priv->rtllib->state;
- rtllib_softmac_stop_protocol(priv->rtllib, 0, false);
- priv->rtllib->state = tmp_state;
- _rtl92e_cancel_deferred_work(priv);
- rtl92e_irq_disable(dev);
-
- rtl92e_stop_adapter(dev, false);
- return true;
-}
-
module_pci_driver(rtl8192_pci_driver);
void rtl92e_check_rfctrl_gpio_timer(struct timer_list *t)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index b0aa76574738..51240cbde0d3 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -433,7 +433,6 @@ u8 rtl92e_rx_db_to_percent(s8 antpower);
void rtl92e_copy_mpdu_stats(struct rtllib_rx_stats *psrc_stats,
struct rtllib_rx_stats *ptarget_stats);
bool rtl92e_enable_nic(struct net_device *dev);
-bool rtl92e_disable_nic(struct net_device *dev);
bool rtl92e_set_rf_state(struct net_device *dev,
enum rt_rf_power_state state_to_set,
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/8] staging: rtl8192e: Remove unused macro RT_SET_PS_LEVEL
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
2023-04-16 7:19 ` [PATCH 1/8] staging: rtl8192e: Remove unchanged variable RegRfPsLevel Philipp Hortmann
2023-04-16 7:19 ` [PATCH 2/8] staging: rtl8192e: Remove unused function rtl92e_disable_nic Philipp Hortmann
@ 2023-04-16 7:19 ` Philipp Hortmann
2023-04-16 7:19 ` [PATCH 4/8] staging: rtl8192e: Remove second initialization of bActuallySet Philipp Hortmann
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:19 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove unused macro RT_SET_PS_LEVEL to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtllib.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 1a0e7ae70ca6..6e665e866f1f 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -100,7 +100,6 @@ static inline void *netdev_priv_rsl(struct net_device *dev)
((psc->CurPsLevel & _PS_FLAG) ? true : false)
#define RT_CLEAR_PS_LEVEL(psc, _PS_FLAG) \
(psc->CurPsLevel &= (~(_PS_FLAG)))
-#define RT_SET_PS_LEVEL(psc, _PS_FLAG) (psc->CurPsLevel |= _PS_FLAG)
/* defined for skb cb field */
/* At most 28 byte */
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/8] staging: rtl8192e: Remove second initialization of bActuallySet
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
` (2 preceding siblings ...)
2023-04-16 7:19 ` [PATCH 3/8] staging: rtl8192e: Remove unused macro RT_SET_PS_LEVEL Philipp Hortmann
@ 2023-04-16 7:19 ` Philipp Hortmann
2023-04-16 7:20 ` [PATCH 5/8] staging: rtl8192e: Remove set to true while true of bfirst_after_down Philipp Hortmann
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:19 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove second initialization of bActuallySet to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 93504d5a8578..7342ef591169 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -1539,8 +1539,6 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
enum rt_rf_power_state rf_power_state_to_set;
bool bActuallySet = false;
- bActuallySet = false;
-
if ((priv->up_first_time == 1) || (priv->being_init_adapter))
return;
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 5/8] staging: rtl8192e: Remove set to true while true of bfirst_after_down
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
` (3 preceding siblings ...)
2023-04-16 7:19 ` [PATCH 4/8] staging: rtl8192e: Remove second initialization of bActuallySet Philipp Hortmann
@ 2023-04-16 7:20 ` Philipp Hortmann
2023-04-16 7:20 ` [PATCH 6/8] staging: rtl8192e: Remove unchanged variable chan_forced Philipp Hortmann
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove set to true while true of bfirst_after_down to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 7342ef591169..ed8b39d3c856 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -1542,10 +1542,8 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
if ((priv->up_first_time == 1) || (priv->being_init_adapter))
return;
- if (priv->bfirst_after_down) {
- priv->bfirst_after_down = true;
+ if (priv->bfirst_after_down)
return;
- }
tmp1byte = rtl92e_readb(dev, GPI);
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 6/8] staging: rtl8192e: Remove unchanged variable chan_forced
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
` (4 preceding siblings ...)
2023-04-16 7:20 ` [PATCH 5/8] staging: rtl8192e: Remove set to true while true of bfirst_after_down Philipp Hortmann
@ 2023-04-16 7:20 ` Philipp Hortmann
2023-04-16 7:20 ` [PATCH 7/8] staging: rtl8192e: Remove unchanged variable frame_sync_monitor Philipp Hortmann
2023-04-16 7:20 ` [PATCH 8/8] staging: rtl8192e: Remove unchanged variables bfsync_processing and more Philipp Hortmann
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove unchanged variable chan_forced and equations that have always the
same result to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 ---
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 --
2 files changed, 5 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index a0c6d117211a..88ff54173a1f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -249,9 +249,6 @@ static void _rtl92e_set_chan(struct net_device *dev, short ch)
{
struct r8192_priv *priv = rtllib_priv(dev);
- if (priv->chan_forced)
- return;
-
priv->chan = ch;
if (priv->rf_set_chan)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 51240cbde0d3..0eca73e4540f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -392,8 +392,6 @@ struct r8192_priv {
bool reset_in_progress;
bool force_reset;
bool force_lps;
-
- bool chan_forced;
};
extern const struct ethtool_ops rtl819x_ethtool_ops;
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 7/8] staging: rtl8192e: Remove unchanged variable frame_sync_monitor
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
` (5 preceding siblings ...)
2023-04-16 7:20 ` [PATCH 6/8] staging: rtl8192e: Remove unchanged variable chan_forced Philipp Hortmann
@ 2023-04-16 7:20 ` Philipp Hortmann
2023-04-16 7:20 ` [PATCH 8/8] staging: rtl8192e: Remove unchanged variables bfsync_processing and more Philipp Hortmann
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove unchanged variable frame_sync_monitor and equations that have
always the same result to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 -
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 73 ++++++++------------
2 files changed, 30 insertions(+), 45 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 0eca73e4540f..c97e315a9091 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -382,8 +382,6 @@ struct r8192_priv {
u32 continue_diff_count;
bool bswitch_fsync;
u8 framesync;
- u8 frame_sync_monitor;
-
u32 reset_count;
enum reset_type rst_progress;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index ed8b39d3c856..43e335ab0733 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -1826,7 +1826,6 @@ static void _rtl92e_dm_init_fsync(struct net_device *dev)
priv->rtllib->fsync_firstdiff_ratethreshold = 100;
priv->rtllib->fsync_seconddiff_ratethreshold = 200;
priv->rtllib->fsync_state = Default_Fsync;
- priv->frame_sync_monitor = 1;
timer_setup(&priv->fsync_timer, _rtl92e_dm_fsync_timer_callback, 0);
}
@@ -2053,12 +2052,10 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
}
}
- if (priv->frame_sync_monitor) {
- if (reg_c38_State != RegC38_Fsync_AP_BCM) {
- rtl92e_writeb(dev, rOFDM0_RxDetector3, 0x95);
+ if (reg_c38_State != RegC38_Fsync_AP_BCM) {
+ rtl92e_writeb(dev, rOFDM0_RxDetector3, 0x95);
- reg_c38_State = RegC38_Fsync_AP_BCM;
- }
+ reg_c38_State = RegC38_Fsync_AP_BCM;
}
} else {
switch (priv->rtllib->fsync_state) {
@@ -2075,50 +2072,40 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
break;
}
- if (priv->frame_sync_monitor) {
- if (priv->rtllib->state == RTLLIB_LINKED) {
- if (priv->undecorated_smoothed_pwdb <=
- RegC38_TH) {
- if (reg_c38_State !=
- RegC38_NonFsync_Other_AP) {
- rtl92e_writeb(dev,
- rOFDM0_RxDetector3,
- 0x90);
-
- reg_c38_State =
- RegC38_NonFsync_Other_AP;
- }
- } else if (priv->undecorated_smoothed_pwdb >=
- (RegC38_TH+5)) {
- if (reg_c38_State) {
- rtl92e_writeb(dev,
- rOFDM0_RxDetector3,
- priv->framesync);
- reg_c38_State = RegC38_Default;
- }
+ if (priv->rtllib->state == RTLLIB_LINKED) {
+ if (priv->undecorated_smoothed_pwdb <=
+ RegC38_TH) {
+ if (reg_c38_State !=
+ RegC38_NonFsync_Other_AP) {
+ rtl92e_writeb(dev,
+ rOFDM0_RxDetector3,
+ 0x90);
+
+ reg_c38_State =
+ RegC38_NonFsync_Other_AP;
}
- } else {
+ } else if (priv->undecorated_smoothed_pwdb >=
+ (RegC38_TH+5)) {
if (reg_c38_State) {
- rtl92e_writeb(dev, rOFDM0_RxDetector3,
- priv->framesync);
+ rtl92e_writeb(dev,
+ rOFDM0_RxDetector3,
+ priv->framesync);
reg_c38_State = RegC38_Default;
}
}
+ } else {
+ if (reg_c38_State) {
+ rtl92e_writeb(dev, rOFDM0_RxDetector3,
+ priv->framesync);
+ reg_c38_State = RegC38_Default;
+ }
}
}
- if (priv->frame_sync_monitor) {
- if (priv->reset_count != reset_cnt) {
- rtl92e_writeb(dev, rOFDM0_RxDetector3,
- priv->framesync);
- reg_c38_State = RegC38_Default;
- reset_cnt = priv->reset_count;
- }
- } else {
- if (reg_c38_State) {
- rtl92e_writeb(dev, rOFDM0_RxDetector3,
- priv->framesync);
- reg_c38_State = RegC38_Default;
- }
+ if (priv->reset_count != reset_cnt) {
+ rtl92e_writeb(dev, rOFDM0_RxDetector3,
+ priv->framesync);
+ reg_c38_State = RegC38_Default;
+ reset_cnt = priv->reset_count;
}
}
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 8/8] staging: rtl8192e: Remove unchanged variables bfsync_processing and more
2023-04-16 7:19 [PATCH 0/8] staging: rtl8192e: Remove unchanged variables around rf_power_state Philipp Hortmann
` (6 preceding siblings ...)
2023-04-16 7:20 ` [PATCH 7/8] staging: rtl8192e: Remove unchanged variable frame_sync_monitor Philipp Hortmann
@ 2023-04-16 7:20 ` Philipp Hortmann
7 siblings, 0 replies; 9+ messages in thread
From: Philipp Hortmann @ 2023-04-16 7:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove unchanged variable bfsync_processing and
rfc_txpowertrackingindex_real to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 --
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 1 -
3 files changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 88ff54173a1f..27040d1e3230 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -786,7 +786,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->rtllib->short_slot = 1;
priv->promisc = (dev->flags & IFF_PROMISC) ? 1 : 0;
priv->bcck_in_ch14 = false;
- priv->bfsync_processing = false;
priv->cck_present_attn = 0;
priv->rfa_txpowertrackingindex = 0;
priv->rfc_txpowertrackingindex = 0;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index c97e315a9091..285dac32c074 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -357,7 +357,6 @@ struct r8192_priv {
u8 rfa_txpowertrackingindex_real;
u8 rfa_txpowertracking_default;
u8 rfc_txpowertrackingindex;
- u8 rfc_txpowertrackingindex_real;
bool btxpower_tracking;
bool bcck_in_ch14;
@@ -376,7 +375,6 @@ struct r8192_priv {
bool bcurrent_turbo_EDCA;
bool bis_cur_rdlstate;
- bool bfsync_processing;
u32 rate_record;
u32 rate_count_diff_rec;
u32 continue_diff_count;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 43e335ab0733..56a8ec517c06 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -998,7 +998,6 @@ void rtl92e_dm_backup_state(struct net_device *dev)
u32 bit_mask = bMaskByte0;
priv->bswitch_fsync = false;
- priv->bfsync_processing = false;
if (dm_digtable.dig_algorithm == DIG_ALGO_BY_RSSI)
return;
--
2.40.0
^ permalink raw reply related [flat|nested] 9+ messages in thread