Remove dead code leftover from previous patches.
Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s)
Transferred this patch over wlan connection of rtl8192e.
Philipp Hortmann (6):
staging: rtl8192e: Remove unchanged variable dig_enable_flag
staging: rtl8192e: Remove unchanged variable dig_algorithm
staging: rtl8192e: Remove
_rtl92e_dm_ctrl_initgain_byrssi_false_alarm()
staging: rtl8192e: Remove unchanged variable dig_algorithm_switch
staging: rtl8192e: Remove unused variable dig_state
staging: rtl8192e: Remove unused enums dm_dig_sta and dm_dig_alg
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 11 --
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 156 +-----------------
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 25 ---
3 files changed, 1 insertion(+), 191 deletions(-)
--
2.42.0
Remove variable dig_enable_flag as its value is set to 1 at
initialization. No further writes to dig_enable_flag are done. The
equations result accordingly. Remove dead code.
Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 11 -----------
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 1 -
2 files changed, 12 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 01abe1e48468..bbd18b6cc252 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -913,8 +913,6 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- dm_digtable.dig_enable_flag = true;
-
dm_digtable.dig_algorithm = DIG_ALGO_BY_RSSI;
dm_digtable.dig_algorithm_switch = 0;
@@ -941,9 +939,6 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
static void _rtl92e_dm_ctrl_initgain_byrssi(struct net_device *dev)
{
- if (!dm_digtable.dig_enable_flag)
- return;
-
if (dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM)
_rtl92e_dm_ctrl_initgain_byrssi_false_alarm(dev);
else if (dm_digtable.dig_algorithm == DIG_ALGO_BY_RSSI)
@@ -976,9 +971,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
u8 i;
static u8 fw_dig;
- if (!dm_digtable.dig_enable_flag)
- return;
-
if (dm_digtable.dig_algorithm_switch)
fw_dig = 0;
if (fw_dig <= 3) {
@@ -1007,9 +999,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
struct r8192_priv *priv = rtllib_priv(dev);
u8 i;
- if (!dm_digtable.dig_enable_flag)
- return;
-
if (dm_digtable.dig_algorithm_switch) {
dm_digtable.dig_state = DM_STA_DIG_MAX;
for (i = 0; i < 3; i++)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
index 5ae2bf467158..faf08763c340 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
@@ -50,7 +50,6 @@
/*------------------------------Define structure----------------------------*/
struct dig_t {
- u8 dig_enable_flag;
u8 dig_algorithm;
u8 dig_algorithm_switch;
--
2.42.0
Remove function _rtl92e_dm_ctrl_initgain_byrssi_false_alarm() as it is
unused. Remove in above function called function
_rtl92e_dm_ctrl_initgain_byrssi_highpwr() as well.
Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 115 ---------------------
1 file changed, 115 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 2bbc6a67188c..e69c22e5d205 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -163,9 +163,7 @@ static void _rtl92e_dm_check_tx_power_tracking(struct net_device *dev);
static void _rtl92e_dm_dig_init(struct net_device *dev);
static void _rtl92e_dm_ctrl_initgain_byrssi(struct net_device *dev);
-static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev);
static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev);
-static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev);
static void _rtl92e_dm_initial_gain(struct net_device *dev);
static void _rtl92e_dm_pd_th(struct net_device *dev);
static void _rtl92e_dm_cs_ratio(struct net_device *dev);
@@ -987,119 +985,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state;
}
-static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
-{
- struct r8192_priv *priv = rtllib_priv(dev);
- u8 i;
-
- if (dm_digtable.dig_algorithm_switch) {
- dm_digtable.dig_state = DM_STA_DIG_MAX;
- for (i = 0; i < 3; i++)
- rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x1);
- dm_digtable.dig_algorithm_switch = 0;
- }
-
- if (priv->rtllib->link_state != MAC80211_LINKED)
- return;
-
- if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_low_thresh) &&
- (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_thresh))
- return;
- if (priv->undecorated_smoothed_pwdb <= dm_digtable.rssi_low_thresh) {
- if (dm_digtable.dig_state == DM_STA_DIG_OFF)
- return;
-
- dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
- dm_digtable.dig_state = DM_STA_DIG_OFF;
-
- rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x8);
-
- rtl92e_writeb(dev, rOFDM0_XAAGCCore1, 0x17);
- rtl92e_writeb(dev, rOFDM0_XBAGCCore1, 0x17);
- rtl92e_writeb(dev, rOFDM0_XCAGCCore1, 0x17);
- rtl92e_writeb(dev, rOFDM0_XDAGCCore1, 0x17);
-
- if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20)
- rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x00);
- else
- rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x42);
-
- rtl92e_writeb(dev, 0xa0a, 0x08);
-
- return;
- }
-
- if (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh) {
- u8 reset_flag = 0;
-
- if (dm_digtable.dig_state == DM_STA_DIG_ON) {
- _rtl92e_dm_ctrl_initgain_byrssi_highpwr(dev);
- return;
- }
-
- dm_digtable.dig_state = DM_STA_DIG_ON;
-
- if (reset_flag == 1) {
- rtl92e_writeb(dev, rOFDM0_XAAGCCore1, 0x2c);
- rtl92e_writeb(dev, rOFDM0_XBAGCCore1, 0x2c);
- rtl92e_writeb(dev, rOFDM0_XCAGCCore1, 0x2c);
- rtl92e_writeb(dev, rOFDM0_XDAGCCore1, 0x2c);
- } else {
- rtl92e_writeb(dev, rOFDM0_XAAGCCore1, 0x20);
- rtl92e_writeb(dev, rOFDM0_XBAGCCore1, 0x20);
- rtl92e_writeb(dev, rOFDM0_XCAGCCore1, 0x20);
- rtl92e_writeb(dev, rOFDM0_XDAGCCore1, 0x20);
- }
-
- if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20)
- rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20);
- else
- rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44);
-
- rtl92e_writeb(dev, 0xa0a, 0xcd);
-
- rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x1);
- }
- _rtl92e_dm_ctrl_initgain_byrssi_highpwr(dev);
-}
-
-static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev)
-{
- struct r8192_priv *priv = rtllib_priv(dev);
-
- if ((priv->undecorated_smoothed_pwdb >
- dm_digtable.rssi_high_power_lowthresh) &&
- (priv->undecorated_smoothed_pwdb <
- dm_digtable.rssi_high_power_highthresh))
- return;
-
- if (priv->undecorated_smoothed_pwdb >=
- dm_digtable.rssi_high_power_highthresh) {
- if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON)
- return;
- dm_digtable.dig_highpwr_state = DM_STA_DIG_ON;
-
- if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20)
- rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x10);
- else
- rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x43);
- } else {
- if (dm_digtable.dig_highpwr_state == DM_STA_DIG_OFF)
- return;
- dm_digtable.dig_highpwr_state = DM_STA_DIG_OFF;
-
- if ((priv->undecorated_smoothed_pwdb <
- dm_digtable.rssi_high_power_lowthresh) &&
- (priv->undecorated_smoothed_pwdb >=
- dm_digtable.rssi_high_thresh)) {
- if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20)
- rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20);
- else
- rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44);
- }
- }
-}
-
static void _rtl92e_dm_initial_gain(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
--
2.42.0
Remove variable dig_algorithm_switch as its value is set to 0 at
initialization. The equations result accordingly. Remove dead code.
Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 18 ------------------
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 2 --
2 files changed, 20 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index e69c22e5d205..0bd9211500ac 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -911,8 +911,6 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- dm_digtable.dig_algorithm_switch = 0;
-
dm_digtable.dig_state = DM_STA_DIG_MAX;
dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT;
@@ -962,8 +960,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
u8 i;
static u8 fw_dig;
- if (dm_digtable.dig_algorithm_switch)
- fw_dig = 0;
if (fw_dig <= 3) {
for (i = 0; i < 3; i++)
rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x8);
@@ -980,8 +976,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
_rtl92e_dm_initial_gain(dev);
_rtl92e_dm_pd_th(dev);
_rtl92e_dm_cs_ratio(dev);
- if (dm_digtable.dig_algorithm_switch)
- dm_digtable.dig_algorithm_switch = 0;
dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state;
}
@@ -991,10 +985,6 @@ static void _rtl92e_dm_initial_gain(struct net_device *dev)
u8 initial_gain = 0;
static u8 initialized, force_write;
- if (dm_digtable.dig_algorithm_switch) {
- initialized = 0;
- }
-
if (rtllib_act_scanning(priv->rtllib, true)) {
force_write = 1;
return;
@@ -1040,10 +1030,6 @@ static void _rtl92e_dm_pd_th(struct net_device *dev)
struct r8192_priv *priv = rtllib_priv(dev);
static u8 initialized, force_write;
- if (dm_digtable.dig_algorithm_switch) {
- initialized = 0;
- }
-
if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) {
if (dm_digtable.rssi_val >=
@@ -1100,10 +1086,6 @@ static void _rtl92e_dm_cs_ratio(struct net_device *dev)
{
static u8 initialized, force_write;
- if (dm_digtable.dig_algorithm_switch) {
- initialized = 0;
- }
-
if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) {
if (dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
index 15af490d2dcd..12b7d426b6b9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
@@ -50,8 +50,6 @@
/*------------------------------Define structure----------------------------*/
struct dig_t {
- u8 dig_algorithm_switch;
-
long rssi_low_thresh;
long rssi_high_thresh;
--
2.42.0
Remove variable dig_algorithm as its value is set to DIG_ALGO_BY_RSSI at
initialization. No further writes to dig_algorithm are done. The
equations result accordingly. Remove dead code.
Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 11 -----------
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 9 +--------
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 1 -
3 files changed, 1 insertion(+), 20 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 875540a2079d..bc06c2cab35d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -920,9 +920,6 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)
case IG_Backup:
initial_gain = SCAN_RX_INITIAL_GAIN;
BitMask = bMaskByte0;
- if (dm_digtable.dig_algorithm ==
- DIG_ALGO_BY_FALSE_ALARM)
- rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x8);
priv->initgain_backup.xaagccore1 =
rtl92e_get_bb_reg(dev, rOFDM0_XAAGCCore1,
BitMask);
@@ -947,10 +944,6 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)
break;
case IG_Restore:
BitMask = 0x7f;
- if (dm_digtable.dig_algorithm ==
- DIG_ALGO_BY_FALSE_ALARM)
- rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x8);
-
rtl92e_set_bb_reg(dev, rOFDM0_XAAGCCore1, BitMask,
(u32)priv->initgain_backup.xaagccore1);
rtl92e_set_bb_reg(dev, rOFDM0_XBAGCCore1, BitMask,
@@ -965,10 +958,6 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)
rtl92e_set_tx_power(dev,
priv->rtllib->current_network.channel);
-
- if (dm_digtable.dig_algorithm ==
- DIG_ALGO_BY_FALSE_ALARM)
- rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x1);
break;
}
}
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index bbd18b6cc252..2bbc6a67188c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -913,8 +913,6 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- dm_digtable.dig_algorithm = DIG_ALGO_BY_RSSI;
-
dm_digtable.dig_algorithm_switch = 0;
dm_digtable.dig_state = DM_STA_DIG_MAX;
@@ -939,12 +937,7 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
static void _rtl92e_dm_ctrl_initgain_byrssi(struct net_device *dev)
{
- if (dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM)
- _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(dev);
- else if (dm_digtable.dig_algorithm == DIG_ALGO_BY_RSSI)
- _rtl92e_dm_ctrl_initgain_byrssi_driver(dev);
- else
- return;
+ _rtl92e_dm_ctrl_initgain_byrssi_driver(dev);
}
/*-----------------------------------------------------------------------------
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
index faf08763c340..15af490d2dcd 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
@@ -50,7 +50,6 @@
/*------------------------------Define structure----------------------------*/
struct dig_t {
- u8 dig_algorithm;
u8 dig_algorithm_switch;
long rssi_low_thresh;
--
2.42.0
Remove variable dig_state as it is unused. Remove unused variable
dig_highpwr_state as well.
Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 3 ---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 2 --
2 files changed, 5 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 0bd9211500ac..97de404840df 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -911,8 +911,6 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- dm_digtable.dig_state = DM_STA_DIG_MAX;
- dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT;
dm_digtable.pre_sta_connect_state = DIG_STA_DISCONNECT;
@@ -964,7 +962,6 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
for (i = 0; i < 3; i++)
rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x8);
fw_dig++;
- dm_digtable.dig_state = DM_STA_DIG_OFF;
}
if (priv->rtllib->link_state == MAC80211_LINKED)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
index 12b7d426b6b9..80ac77e269fd 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
@@ -56,8 +56,6 @@ struct dig_t {
long rssi_high_power_lowthresh;
long rssi_high_power_highthresh;
- u8 dig_state;
- u8 dig_highpwr_state;
u8 cur_sta_connect_state;
u8 pre_sta_connect_state;
--
2.42.0
Remove unused enums dm_dig_sta and dm_dig_alg. Remove unused entries of
enum dm_dig_connect.
Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
index 80ac77e269fd..84e673452be4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
@@ -74,12 +74,6 @@ struct dig_t {
long rssi_val;
};
-enum dm_dig_sta {
- DM_STA_DIG_OFF = 0,
- DM_STA_DIG_ON,
- DM_STA_DIG_MAX
-};
-
enum dm_ratr_sta {
DM_RATR_STA_HIGH = 0,
DM_RATR_STA_MIDDLE = 1,
@@ -87,22 +81,9 @@ enum dm_ratr_sta {
DM_RATR_STA_MAX
};
-enum dm_dig_alg {
- DIG_ALGO_BY_FALSE_ALARM = 0,
- DIG_ALGO_BY_RSSI = 1,
- DIG_ALGO_BEFORE_CONNECT_BY_RSSI_AND_ALARM = 2,
- DIG_ALGO_BY_TOW_PORT = 3,
- DIG_ALGO_MAX
-};
-
enum dm_dig_connect {
DIG_STA_DISCONNECT = 0,
DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_AP_DISCONNECT = 3,
- DIG_AP_CONNECT = 4,
- DIG_AP_ADD_STATION = 5,
- DIG_CONNECT_MAX
};
enum dm_dig_pd_th {
--
2.42.0
On Fri, Oct 13, 2023 at 04:43:37PM +0200, Philipp Hortmann wrote:
> Remove dead code leftover from previous patches.
>
> Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s)
> Transferred this patch over wlan connection of rtl8192e.
>
Your patchsets are always very good, Philipp.
Reviewed-by: Dan Carpenter <[email protected]>
regards,
dan carpenter