Commit 548534d9 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Remove unchanged variable frame_sync_monitor

Remove unchanged variable frame_sync_monitor and equations that have
always the same result to shorten code.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/0c4bdca5f5dbb93bb05c6b7f32136d4dfb3b0e4b.1681627603.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dc8aaa4f
...@@ -382,8 +382,6 @@ struct r8192_priv { ...@@ -382,8 +382,6 @@ struct r8192_priv {
u32 continue_diff_count; u32 continue_diff_count;
bool bswitch_fsync; bool bswitch_fsync;
u8 framesync; u8 framesync;
u8 frame_sync_monitor;
u32 reset_count; u32 reset_count;
enum reset_type rst_progress; enum reset_type rst_progress;
......
...@@ -1826,7 +1826,6 @@ static void _rtl92e_dm_init_fsync(struct net_device *dev) ...@@ -1826,7 +1826,6 @@ static void _rtl92e_dm_init_fsync(struct net_device *dev)
priv->rtllib->fsync_firstdiff_ratethreshold = 100; priv->rtllib->fsync_firstdiff_ratethreshold = 100;
priv->rtllib->fsync_seconddiff_ratethreshold = 200; priv->rtllib->fsync_seconddiff_ratethreshold = 200;
priv->rtllib->fsync_state = Default_Fsync; priv->rtllib->fsync_state = Default_Fsync;
priv->frame_sync_monitor = 1;
timer_setup(&priv->fsync_timer, _rtl92e_dm_fsync_timer_callback, 0); 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) ...@@ -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) {
if (reg_c38_State != RegC38_Fsync_AP_BCM) { rtl92e_writeb(dev, rOFDM0_RxDetector3, 0x95);
rtl92e_writeb(dev, rOFDM0_RxDetector3, 0x95);
reg_c38_State = RegC38_Fsync_AP_BCM; reg_c38_State = RegC38_Fsync_AP_BCM;
}
} }
} else { } else {
switch (priv->rtllib->fsync_state) { switch (priv->rtllib->fsync_state) {
...@@ -2075,50 +2072,40 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) ...@@ -2075,50 +2072,40 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
break; break;
} }
if (priv->frame_sync_monitor) { if (priv->rtllib->state == RTLLIB_LINKED) {
if (priv->rtllib->state == RTLLIB_LINKED) { if (priv->undecorated_smoothed_pwdb <=
if (priv->undecorated_smoothed_pwdb <= RegC38_TH) {
RegC38_TH) { if (reg_c38_State !=
if (reg_c38_State != RegC38_NonFsync_Other_AP) {
RegC38_NonFsync_Other_AP) { rtl92e_writeb(dev,
rtl92e_writeb(dev, rOFDM0_RxDetector3,
rOFDM0_RxDetector3, 0x90);
0x90);
reg_c38_State =
reg_c38_State = RegC38_NonFsync_Other_AP;
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;
}
} }
} else { } else if (priv->undecorated_smoothed_pwdb >=
(RegC38_TH+5)) {
if (reg_c38_State) { if (reg_c38_State) {
rtl92e_writeb(dev, rOFDM0_RxDetector3, rtl92e_writeb(dev,
priv->framesync); rOFDM0_RxDetector3,
priv->framesync);
reg_c38_State = RegC38_Default; 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) {
if (priv->reset_count != reset_cnt) { rtl92e_writeb(dev, rOFDM0_RxDetector3,
rtl92e_writeb(dev, rOFDM0_RxDetector3, priv->framesync);
priv->framesync); reg_c38_State = RegC38_Default;
reg_c38_State = RegC38_Default; reset_cnt = priv->reset_count;
reset_cnt = priv->reset_count;
}
} else {
if (reg_c38_State) {
rtl92e_writeb(dev, rOFDM0_RxDetector3,
priv->framesync);
reg_c38_State = RegC38_Default;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment