* [PATCH 0/4] staging: rtl8192e: Coding Syle of rtl_core.c improved
@ 2022-08-24 20:14 Philipp Hortmann
2022-08-24 20:14 ` [PATCH 1/4] staging: rtl8192e: Remove blank lines in rtl_core.c Philipp Hortmann
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Philipp Hortmann @ 2022-08-24 20:14 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Following Checkpatch errors are improved:
- blank lines
- CamelCase of TxCheckStuckHandler and RxCheckStuckHandler
- "Unnecessary ftrace-like logging"
- CamelCase of PHY_SetRFPowerState
Tested with rtl8192e
Transferred this patch over wlan connection of rtl8192e
Philipp Hortmann (4):
staging: rtl8192e: Remove blank lines in rtl_core.c
staging: rtl8192e: Rename Tx... and RxCheckStuckHandler
staging: rtl8192e: Remove Unnecessary ftrace-like logging
staging: rtl8192e: Remove PHY_SetRFPowerState and rename StateToSet
.../staging/rtl8192e/rtl8192e/r8192E_phy.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 166 ++----------------
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 6 +-
3 files changed, 18 insertions(+), 155 deletions(-)
--
2.37.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] staging: rtl8192e: Remove blank lines in rtl_core.c
2022-08-24 20:14 [PATCH 0/4] staging: rtl8192e: Coding Syle of rtl_core.c improved Philipp Hortmann
@ 2022-08-24 20:14 ` Philipp Hortmann
2022-08-24 20:14 ` [PATCH 2/4] staging: rtl8192e: Rename Tx... and RxCheckStuckHandler Philipp Hortmann
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Philipp Hortmann @ 2022-08-24 20:14 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove blank lines as requested by checkpatch. Reasons are "multiple
blank lines", "Blank lines aren't necessary after an open brace" and
"Blank lines aren't necessary before a close brace".
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 24 --------------------
1 file changed, 24 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index b9ce71848023..5b3b215448bc 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -25,7 +25,6 @@
int hwwep = 1;
static char *ifname = "wlan%d";
-
static const struct rtl819x_ops rtl819xp_ops = {
.nic_type = NIC_8192E,
.get_eeprom_size = rtl92e_get_eeprom_size,
@@ -189,7 +188,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
priv->rtllib->RfOffReason = 0;
bActionAllowed = true;
-
if (rtState == eRfOff &&
ChangeSource >= RF_CHANGE_BY_HW)
bConnectBySSID = true;
@@ -236,7 +234,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
__func__, StateToSet, priv->rtllib->RfOffReason);
PHY_SetRFPowerState(dev, StateToSet);
if (StateToSet == eRfOn) {
-
if (bConnectBySSID && priv->blinked_ingpio) {
schedule_delayed_work(
&ieee->associate_procedure_wq, 0);
@@ -395,7 +392,6 @@ static void _rtl92e_qos_activate(void *data)
for (i = 0; i < QOS_QUEUE_NUM; i++)
priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM, (u8 *)(&i));
-
success:
mutex_unlock(&priv->mutex);
}
@@ -455,7 +451,6 @@ static int _rtl92e_handle_beacon(struct net_device *dev,
schedule_delayed_work(&priv->update_beacon_wq, 0);
return 0;
-
}
static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv,
@@ -883,7 +878,6 @@ static void _rtl92e_init_priv_constant(struct net_device *dev)
pPSC->RegMaxLPSAwakeIntvl = 5;
}
-
static void _rtl92e_init_priv_variable(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -1201,7 +1195,6 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev)
} else {
return RESET_TYPE_NORESET;
}
-
}
static void _rtl92e_if_silent_reset(struct net_device *dev)
@@ -1407,7 +1400,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
ieee->LinkDetectInfo.NumTxOkInPeriod > 100)
bBusyTraffic = true;
-
if (ieee->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
ieee->LinkDetectInfo.NumTxOkInPeriod > 4000) {
bHigherBusyTraffic = true;
@@ -1456,7 +1448,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
else
priv->check_roaming_cnt = 0;
-
if (priv->check_roaming_cnt > 0) {
if (ieee->eRFPowerState == eRfOff)
netdev_info(dev, "%s(): RF is off\n", __func__);
@@ -1487,7 +1478,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
}
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
ieee->LinkDetectInfo.NumRecvDataInPeriod = 0;
-
}
spin_lock_irqsave(&priv->tx_lock, flags);
@@ -1541,7 +1531,6 @@ void rtl92e_tx_enable(struct net_device *dev)
rtllib_reset_queue(priv->rtllib);
}
-
static void _rtl92e_free_rx_ring(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -1936,13 +1925,11 @@ long rtl92e_translate_to_dbm(struct r8192_priv *priv, u8 signal_strength_index)
return signal_power;
}
-
void rtl92e_update_rx_statistics(struct r8192_priv *priv,
struct rtllib_rx_stats *pprevious_stats)
{
int weighting = 0;
-
if (priv->stats.recv_signal_power == 0)
priv->stats.recv_signal_power =
pprevious_stats->RecvSignalPower;
@@ -1985,8 +1972,6 @@ void rtl92e_copy_mpdu_stats(struct rtllib_rx_stats *psrc_stats,
ptarget_stats->bFirstMPDU = psrc_stats->bFirstMPDU;
}
-
-
static void _rtl92e_rx_normal(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -2086,7 +2071,6 @@ static void _rtl92e_rx_normal(struct net_device *dev)
priv->rx_idx[rx_queue_idx] = (priv->rx_idx[rx_queue_idx] + 1) %
priv->rxringcount;
}
-
}
static void _rtl92e_tx_resume(struct net_device *dev)
@@ -2151,7 +2135,6 @@ static int _rtl92e_open(struct net_device *dev)
ret = _rtl92e_try_up(dev);
mutex_unlock(&priv->wx_mutex);
return ret;
-
}
static int _rtl92e_try_up(struct net_device *dev)
@@ -2163,7 +2146,6 @@ static int _rtl92e_try_up(struct net_device *dev)
return _rtl92e_up(dev, false);
}
-
static int _rtl92e_close(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -2181,7 +2163,6 @@ static int _rtl92e_close(struct net_device *dev)
mutex_unlock(&priv->wx_mutex);
return ret;
-
}
static int _rtl92e_down(struct net_device *dev, bool shutdownrf)
@@ -2224,10 +2205,8 @@ static void _rtl92e_set_multicast(struct net_device *dev)
promisc = (dev->flags & IFF_PROMISC) ? 1 : 0;
priv->promisc = promisc;
-
}
-
static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -2376,8 +2355,6 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
return IRQ_HANDLED;
}
-
-
/****************************************************************************
* ---------------------------- PCI_STUFF---------------------------
****************************************************************************/
@@ -2452,7 +2429,6 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
goto err_rel_rtllib;
}
-
ioaddr = (unsigned long)ioremap(pmem_start, pmem_len);
if (ioaddr == (unsigned long)NULL) {
netdev_err(dev, "ioremap failed!");
--
2.37.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/4] staging: rtl8192e: Rename Tx... and RxCheckStuckHandler
2022-08-24 20:14 [PATCH 0/4] staging: rtl8192e: Coding Syle of rtl_core.c improved Philipp Hortmann
2022-08-24 20:14 ` [PATCH 1/4] staging: rtl8192e: Remove blank lines in rtl_core.c Philipp Hortmann
@ 2022-08-24 20:14 ` Philipp Hortmann
2022-08-24 20:14 ` [PATCH 3/4] staging: rtl8192e: Remove Unnecessary ftrace-like logging Philipp Hortmann
2022-08-24 20:14 ` [PATCH 4/4] staging: rtl8192e: Remove PHY_SetRFPowerState and rename StateToSet Philipp Hortmann
3 siblings, 0 replies; 5+ messages in thread
From: Philipp Hortmann @ 2022-08-24 20:14 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Variable name TxCheckStuckHandler and RxCheckStuckHandler is changed to
avoid CamelCase which is not accepted by checkpatch.pl
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 8 ++++----
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 5b3b215448bc..ff73b8cff5e8 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -43,8 +43,8 @@ static const struct rtl819x_ops rtl819xp_ops = {
.rx_enable = rtl92e_enable_rx,
.tx_enable = rtl92e_enable_tx,
.interrupt_recognized = rtl92e_ack_irq,
- .TxCheckStuckHandler = rtl92e_is_tx_stuck,
- .RxCheckStuckHandler = rtl92e_is_rx_stuck,
+ .tx_check_stuck_handler = rtl92e_is_tx_stuck,
+ .rx_check_stuck_handler = rtl92e_is_rx_stuck,
};
static struct pci_device_id rtl8192_pci_id_tbl[] = {
@@ -1143,7 +1143,7 @@ static enum reset_type _rtl92e_tx_check_stuck(struct net_device *dev)
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
if (bCheckFwTxCnt) {
- if (priv->ops->TxCheckStuckHandler(dev)) {
+ if (priv->ops->tx_check_stuck_handler(dev)) {
RT_TRACE(COMP_RESET,
"TxCheckStuck(): Fw indicates no Tx condition!\n");
return RESET_TYPE_SILENT;
@@ -1157,7 +1157,7 @@ static enum reset_type _rtl92e_rx_check_stuck(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- if (priv->ops->RxCheckStuckHandler(dev)) {
+ if (priv->ops->rx_check_stuck_handler(dev)) {
RT_TRACE(COMP_RESET, "RxStuck Condition\n");
return RESET_TYPE_SILENT;
}
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 698552a92100..8f254c34d5d3 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -299,8 +299,8 @@ struct rtl819x_ops {
void (*tx_enable)(struct net_device *dev);
void (*interrupt_recognized)(struct net_device *dev,
u32 *p_inta, u32 *p_intb);
- bool (*TxCheckStuckHandler)(struct net_device *dev);
- bool (*RxCheckStuckHandler)(struct net_device *dev);
+ bool (*tx_check_stuck_handler)(struct net_device *dev);
+ bool (*rx_check_stuck_handler)(struct net_device *dev);
};
struct r8192_priv {
--
2.37.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] staging: rtl8192e: Remove Unnecessary ftrace-like logging
2022-08-24 20:14 [PATCH 0/4] staging: rtl8192e: Coding Syle of rtl_core.c improved Philipp Hortmann
2022-08-24 20:14 ` [PATCH 1/4] staging: rtl8192e: Remove blank lines in rtl_core.c Philipp Hortmann
2022-08-24 20:14 ` [PATCH 2/4] staging: rtl8192e: Rename Tx... and RxCheckStuckHandler Philipp Hortmann
@ 2022-08-24 20:14 ` Philipp Hortmann
2022-08-24 20:14 ` [PATCH 4/4] staging: rtl8192e: Remove PHY_SetRFPowerState and rename StateToSet Philipp Hortmann
3 siblings, 0 replies; 5+ messages in thread
From: Philipp Hortmann @ 2022-08-24 20:14 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove "Unnecessary ftrace-like logging" as requested by checkpatch.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 130 ++-----------------
1 file changed, 9 insertions(+), 121 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index ff73b8cff5e8..8462dd9859e8 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -143,22 +143,13 @@ bool rtl92e_set_rf_state(struct net_device *dev,
u16 RFWaitCounter = 0;
unsigned long flag;
- RT_TRACE((COMP_PS | COMP_RF),
- "===>%s: StateToSet(%d)\n", __func__, StateToSet);
-
while (true) {
spin_lock_irqsave(&priv->rf_ps_lock, flag);
if (priv->RFChangeInProgress) {
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
- RT_TRACE((COMP_PS | COMP_RF),
- "%s: RF Change in progress! Wait to set..StateToSet(%d).\n",
- __func__, StateToSet);
while (priv->RFChangeInProgress) {
RFWaitCounter++;
- RT_TRACE((COMP_PS | COMP_RF),
- "%s: Wait 1 ms (%d times)...\n",
- __func__, RFWaitCounter);
mdelay(1);
if (RFWaitCounter > 100) {
@@ -191,12 +182,7 @@ bool rtl92e_set_rf_state(struct net_device *dev,
if (rtState == eRfOff &&
ChangeSource >= RF_CHANGE_BY_HW)
bConnectBySSID = true;
- } else {
- RT_TRACE((COMP_PS | COMP_RF),
- "%s - eRfon reject pMgntInfo->RfOffReason= 0x%x, ChangeSource=0x%X\n",
- __func__, priv->rtllib->RfOffReason, ChangeSource);
- }
-
+ }
break;
case eRfOff:
@@ -229,9 +215,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
}
if (bActionAllowed) {
- RT_TRACE((COMP_PS | COMP_RF),
- "%s: Action is allowed.... StateToSet(%d), RfOffReason(%#X)\n",
- __func__, StateToSet, priv->rtllib->RfOffReason);
PHY_SetRFPowerState(dev, StateToSet);
if (StateToSet == eRfOn) {
if (bConnectBySSID && priv->blinked_ingpio) {
@@ -240,17 +223,11 @@ bool rtl92e_set_rf_state(struct net_device *dev,
priv->blinked_ingpio = false;
}
}
- } else {
- RT_TRACE((COMP_PS | COMP_RF),
- "%s: Action is rejected.... StateToSet(%d), ChangeSource(%#X), RfOffReason(%#X)\n",
- __func__, StateToSet, ChangeSource, priv->rtllib->RfOffReason);
}
spin_lock_irqsave(&priv->rf_ps_lock, flag);
priv->RFChangeInProgress = false;
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
-
- RT_TRACE((COMP_PS | COMP_RF), "<===%s\n", __func__);
return bActionAllowed;
}
@@ -294,7 +271,6 @@ static void _rtl92e_set_chan(struct net_device *dev, short ch)
{
struct r8192_priv *priv = rtllib_priv(dev);
- RT_TRACE(COMP_CH, "=====>%s()====ch:%d\n", __func__, ch);
if (priv->chan_forced)
return;
@@ -314,9 +290,6 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap)
if (priv->dot11CurrentPreambleMode != PREAMBLE_SHORT) {
ShortPreamble = true;
priv->dot11CurrentPreambleMode = PREAMBLE_SHORT;
- RT_TRACE(COMP_DBG,
- "%s(): WLAN_CAPABILITY_SHORT_PREAMBLE\n",
- __func__);
priv->rtllib->SetHwRegHandler(dev, HW_VAR_ACK_PREAMBLE,
(unsigned char *)&ShortPreamble);
}
@@ -324,9 +297,6 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap)
if (priv->dot11CurrentPreambleMode != PREAMBLE_LONG) {
ShortPreamble = false;
priv->dot11CurrentPreambleMode = PREAMBLE_LONG;
- RT_TRACE(COMP_DBG,
- "%s(): WLAN_CAPABILITY_LONG_PREAMBLE\n",
- __func__);
priv->rtllib->SetHwRegHandler(dev, HW_VAR_ACK_PREAMBLE,
(unsigned char *)&ShortPreamble);
}
@@ -386,8 +356,6 @@ static void _rtl92e_qos_activate(void *data)
mutex_lock(&priv->mutex);
if (priv->rtllib->state != RTLLIB_LINKED)
goto success;
- RT_TRACE(COMP_QOS,
- "qos active process with associate response received\n");
for (i = 0; i < QOS_QUEUE_NUM; i++)
priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM, (u8 *)(&i));
@@ -422,18 +390,14 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv,
network->qos_data.param_count;
priv->rtllib->wmm_acm = network->qos_data.wmm_acm;
schedule_work(&priv->qos_activate);
- RT_TRACE(COMP_QOS,
- "QoS parameters change call qos_activate\n");
}
} else {
memcpy(&priv->rtllib->current_network.qos_data.parameters,
&def_qos_parameters, size);
- if ((network->qos_data.active == 1) && (active_network == 1)) {
+ if ((network->qos_data.active == 1) && (active_network == 1))
schedule_work(&priv->qos_activate);
- RT_TRACE(COMP_QOS,
- "QoS was disabled call qos_activate\n");
- }
+
network->qos_data.active = 0;
network->qos_data.supported = 0;
}
@@ -491,8 +455,6 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv,
spin_unlock_irqrestore(&priv->rtllib->lock, flags);
- RT_TRACE(COMP_QOS, "%s: network->flags = %d,%d\n", __func__,
- network->flags, priv->rtllib->current_network.qos_data.active);
if (set_qos_param == 1) {
rtl92e_dm_init_edca_turbo(priv->rtllib->dev);
schedule_work(&priv->qos_activate);
@@ -711,15 +673,9 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
if ((wireless_mode == WIRELESS_MODE_N_24G) ||
(wireless_mode == WIRELESS_MODE_N_5G)) {
priv->rtllib->pHTInfo->bEnableHT = 1;
- RT_TRACE(COMP_DBG, "%s(), wireless_mode:%x, bEnableHT = 1\n",
- __func__, wireless_mode);
} else {
priv->rtllib->pHTInfo->bEnableHT = 0;
- RT_TRACE(COMP_DBG, "%s(), wireless_mode:%x, bEnableHT = 0\n",
- __func__, wireless_mode);
}
-
- RT_TRACE(COMP_INIT, "Current Wireless Mode is %x\n", wireless_mode);
_rtl92e_refresh_support_rate(priv);
}
@@ -737,7 +693,6 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
priv->rtllib->ieee_up = 1;
priv->up_first_time = 0;
- RT_TRACE(COMP_INIT, "Bringing up iface");
priv->bfirst_init = true;
init_status = priv->ops->initialize_adapter(dev);
if (!init_status) {
@@ -746,7 +701,6 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
return -1;
}
- RT_TRACE(COMP_INIT, "start adapter finished\n");
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
priv->bfirst_init = false;
@@ -785,7 +739,6 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
priv->up = 0;
priv->rtllib->ieee_up = 0;
priv->bfirst_after_down = true;
- RT_TRACE(COMP_DOWN, "==========>%s()\n", __func__);
if (!netif_queue_stopped(dev))
netif_stop_queue(dev);
@@ -808,9 +761,6 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
spin_lock_irqsave(&priv->rf_ps_lock, flags);
break;
}
- RT_TRACE(COMP_DBG,
- "===>%s():RF is in progress, need to wait until rf change is done.\n",
- __func__);
mdelay(1);
RFInProgressTimeOut++;
spin_lock_irqsave(&priv->rf_ps_lock, flags);
@@ -824,7 +774,6 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
udelay(100);
memset(&priv->rtllib->current_network, 0,
offsetof(struct rtllib_network, list));
- RT_TRACE(COMP_DOWN, "<==========%s()\n", __func__);
return 0;
}
@@ -1026,7 +975,6 @@ static short _rtl92e_get_channel_map(struct net_device *dev)
"rtl819x_init:Error channel plan! Set to default.\n");
priv->ChannelPlan = COUNTRY_CODE_FCC;
}
- RT_TRACE(COMP_INIT, "Channel plan is %d\n", priv->ChannelPlan);
dot11d_init(priv->rtllib);
dot11d_channel_map(priv->ChannelPlan, priv->rtllib);
for (i = 1; i <= 11; i++)
@@ -1066,7 +1014,6 @@ static short _rtl92e_init(struct net_device *dev)
}
priv->irq = dev->irq;
- RT_TRACE(COMP_INIT, "IRQ %d\n", dev->irq);
if (_rtl92e_pci_initdescring(dev) != 0) {
netdev_err(dev, "Endopoints initialization failed");
@@ -1143,11 +1090,8 @@ static enum reset_type _rtl92e_tx_check_stuck(struct net_device *dev)
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
if (bCheckFwTxCnt) {
- if (priv->ops->tx_check_stuck_handler(dev)) {
- RT_TRACE(COMP_RESET,
- "TxCheckStuck(): Fw indicates no Tx condition!\n");
+ if (priv->ops->tx_check_stuck_handler(dev))
return RESET_TYPE_SILENT;
- }
}
return RESET_TYPE_NORESET;
@@ -1157,10 +1101,8 @@ static enum reset_type _rtl92e_rx_check_stuck(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
- if (priv->ops->rx_check_stuck_handler(dev)) {
- RT_TRACE(COMP_RESET, "RxStuck Condition\n");
+ if (priv->ops->rx_check_stuck_handler(dev))
return RESET_TYPE_SILENT;
- }
return RESET_TYPE_NORESET;
}
@@ -1206,9 +1148,6 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
unsigned long flag;
if (priv->ResetProgress == RESET_TYPE_NORESET) {
-
- RT_TRACE(COMP_RESET, "=========>Reset progress!!\n");
-
priv->ResetProgress = RESET_TYPE_SILENT;
spin_lock_irqsave(&priv->rf_ps_lock, flag);
@@ -1235,12 +1174,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
}
priv->up = 0;
- RT_TRACE(COMP_RESET, "%s():======>start to down the driver\n",
- __func__);
mdelay(1000);
- RT_TRACE(COMP_RESET,
- "%s():111111111111111111111111======>start to down the driver\n",
- __func__);
if (!netif_queue_stopped(dev))
netif_stop_queue(dev);
@@ -1268,16 +1202,8 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
rtl92e_dm_backup_state(dev);
mutex_unlock(&priv->wx_mutex);
- RT_TRACE(COMP_RESET,
- "%s():<==========down process is finished\n",
- __func__);
-
- RT_TRACE(COMP_RESET, "%s():<===========up process start\n",
- __func__);
reset_status = _rtl92e_up(dev, true);
- RT_TRACE(COMP_RESET,
- "%s():<===========up process is finished\n", __func__);
if (reset_status == -1) {
if (reset_times < 3) {
reset_times++;
@@ -1326,8 +1252,6 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
priv->bResetInProgress = false;
rtl92e_writeb(dev, UFWP, 1);
- RT_TRACE(COMP_RESET, "Reset finished!! ====>[%d]\n",
- priv->reset_count);
}
}
@@ -1388,8 +1312,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
if ((ieee->PowerSaveControl.ReturnPoint ==
IPS_CALLBACK_NONE) &&
(!ieee->bNetPromiscuousMode)) {
- RT_TRACE(COMP_PS,
- "====================>haha: rtl92e_ips_enter()\n");
rtl92e_ips_enter(dev);
}
}
@@ -1425,7 +1347,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
rtl92e_leisure_ps_leave(dev);
} else {
- RT_TRACE(COMP_LPS, "====>no link LPS leave\n");
rtl92e_leisure_ps_leave(dev);
}
@@ -1490,7 +1411,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
if (!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) {
priv->ResetProgress = RESET_TYPE_NORMAL;
- RT_TRACE(COMP_RESET, "%s(): NOMAL RESET\n", __func__);
return;
}
@@ -1500,7 +1420,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
priv->force_reset = false;
priv->bForcedSilentReset = false;
priv->bResetInProgress = false;
- RT_TRACE(COMP_TRACE, " <==RtUsbCheckForHangWorkItemCallback()\n");
}
static void _rtl92e_watchdog_timer_cb(struct timer_list *t)
@@ -2257,21 +2176,13 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
goto done;
}
- if (inta & IMR_TBDOK) {
- RT_TRACE(COMP_INTR, "beacon ok interrupt!\n");
+ if (inta & IMR_TBDOK)
priv->stats.txbeaconokint++;
- }
- if (inta & IMR_TBDER) {
- RT_TRACE(COMP_INTR, "beacon ok interrupt!\n");
+ if (inta & IMR_TBDER)
priv->stats.txbeaconerr++;
- }
-
- if (inta & IMR_BDOK)
- RT_TRACE(COMP_INTR, "beacon interrupt!\n");
if (inta & IMR_MGNTDOK) {
- RT_TRACE(COMP_INTR, "Manage ok interrupt!\n");
priv->stats.txmanageokint++;
_rtl92e_tx_isr(dev, MGNT_QUEUE);
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
@@ -2298,13 +2209,10 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
tasklet_schedule(&priv->irq_rx_tasklet);
}
- if (inta & IMR_BcnInt) {
- RT_TRACE(COMP_INTR, "prepare beacon for interrupt!\n");
+ if (inta & IMR_BcnInt)
tasklet_schedule(&priv->irq_prepare_beacon_tasklet);
- }
if (inta & IMR_RDU) {
- RT_TRACE(COMP_INTR, "rx descriptor unavailable!\n");
priv->stats.rxrdu++;
rtl92e_writel(dev, INTA_MASK,
rtl92e_readl(dev, INTA_MASK) & ~IMR_RDU);
@@ -2312,7 +2220,6 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
}
if (inta & IMR_RXFOVW) {
- RT_TRACE(COMP_INTR, "rx overflow !\n");
priv->stats.rxoverflow++;
tasklet_schedule(&priv->irq_rx_tasklet);
}
@@ -2321,21 +2228,18 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
priv->stats.txoverflow++;
if (inta & IMR_BKDOK) {
- RT_TRACE(COMP_INTR, "BK Tx OK interrupt!\n");
priv->stats.txbkokint++;
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
_rtl92e_tx_isr(dev, BK_QUEUE);
}
if (inta & IMR_BEDOK) {
- RT_TRACE(COMP_INTR, "BE TX OK interrupt!\n");
priv->stats.txbeokint++;
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
_rtl92e_tx_isr(dev, BE_QUEUE);
}
if (inta & IMR_VIDOK) {
- RT_TRACE(COMP_INTR, "VI TX OK interrupt!\n");
priv->stats.txviokint++;
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
_rtl92e_tx_isr(dev, VI_QUEUE);
@@ -2343,7 +2247,6 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
if (inta & IMR_VODOK) {
priv->stats.txvookint++;
- RT_TRACE(COMP_INTR, "Vo TX OK interrupt!\n");
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
_rtl92e_tx_isr(dev, VO_QUEUE);
}
@@ -2379,8 +2282,6 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
int err = -ENOMEM;
u8 revision_id;
- RT_TRACE(COMP_INIT, "Configuring chip resources");
-
if (pci_enable_device(pdev)) {
dev_err(&pdev->dev, "Failed to enable PCI device");
return -EIO;
@@ -2459,13 +2360,9 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
dev->type = ARPHRD_ETHER;
dev->watchdog_timeo = HZ * 3;
- if (dev_alloc_name(dev, ifname) < 0) {
- RT_TRACE(COMP_INIT,
- "Oops: devname already taken! Trying wlan%%d...\n");
+ if (dev_alloc_name(dev, ifname) < 0)
dev_alloc_name(dev, ifname);
- }
- RT_TRACE(COMP_INIT, "Driver probe completed1\n");
if (_rtl92e_init(dev) != 0) {
netdev_warn(dev, "Initialization failed");
goto err_free_irq;
@@ -2476,12 +2373,10 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
if (register_netdev(dev))
goto err_free_irq;
- RT_TRACE(COMP_INIT, "dev name: %s\n", dev->name);
if (priv->polling_timer_on == 0)
rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer);
- RT_TRACE(COMP_INIT, "Driver probe completed\n");
return 0;
err_free_irq:
@@ -2536,7 +2431,6 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev)
}
pci_disable_device(pdev);
- RT_TRACE(COMP_DOWN, "wlan driver removed\n");
}
bool rtl92e_enable_nic(struct net_device *dev)
@@ -2552,7 +2446,6 @@ bool rtl92e_enable_nic(struct net_device *dev)
return false;
}
- RT_TRACE(COMP_PS, "===========>%s()\n", __func__);
priv->bfirst_init = true;
init_status = priv->ops->initialize_adapter(dev);
if (!init_status) {
@@ -2560,13 +2453,11 @@ bool rtl92e_enable_nic(struct net_device *dev)
priv->bdisable_nic = false;
return false;
}
- RT_TRACE(COMP_INIT, "start adapter finished\n");
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
priv->bfirst_init = false;
rtl92e_irq_enable(dev);
priv->bdisable_nic = false;
- RT_TRACE(COMP_PS, "<===========%s()\n", __func__);
return init_status;
}
@@ -2575,7 +2466,6 @@ bool rtl92e_disable_nic(struct net_device *dev)
struct r8192_priv *priv = rtllib_priv(dev);
u8 tmp_state = 0;
- RT_TRACE(COMP_PS, "=========>%s()\n", __func__);
priv->bdisable_nic = true;
tmp_state = priv->rtllib->state;
rtllib_softmac_stop_protocol(priv->rtllib, 0, false);
@@ -2584,8 +2474,6 @@ bool rtl92e_disable_nic(struct net_device *dev)
rtl92e_irq_disable(dev);
priv->ops->stop_adapter(dev, false);
- RT_TRACE(COMP_PS, "<=========%s()\n", __func__);
-
return true;
}
--
2.37.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] staging: rtl8192e: Remove PHY_SetRFPowerState and rename StateToSet
2022-08-24 20:14 [PATCH 0/4] staging: rtl8192e: Coding Syle of rtl_core.c improved Philipp Hortmann
` (2 preceding siblings ...)
2022-08-24 20:14 ` [PATCH 3/4] staging: rtl8192e: Remove Unnecessary ftrace-like logging Philipp Hortmann
@ 2022-08-24 20:14 ` Philipp Hortmann
3 siblings, 0 replies; 5+ messages in thread
From: Philipp Hortmann @ 2022-08-24 20:14 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove macro that replaces PHY_SetRFPowerState with
rtl92e_set_rf_power_state and rename StateToSet to avoid CamelCase
which is not accepted by checkpatch.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 8 ++++----
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 +-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index 7c9148e033d8..7f2a24b72e52 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -83,7 +83,6 @@ void rtl92e_set_rf_off(struct net_device *dev);
bool rtl92e_set_rf_power_state(struct net_device *dev,
enum rt_rf_power_state eRFPowerState);
-#define PHY_SetRFPowerState rtl92e_set_rf_power_state
void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 8462dd9859e8..5ac4817909df 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -132,7 +132,7 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y)
* -----------------------------GENERAL FUNCTION-------------------------
****************************************************************************/
bool rtl92e_set_rf_state(struct net_device *dev,
- enum rt_rf_power_state StateToSet,
+ enum rt_rf_power_state state_to_set,
RT_RF_CHANGE_SOURCE ChangeSource)
{
struct r8192_priv *priv = rtllib_priv(dev);
@@ -168,7 +168,7 @@ bool rtl92e_set_rf_state(struct net_device *dev,
rtState = priv->rtllib->eRFPowerState;
- switch (StateToSet) {
+ switch (state_to_set) {
case eRfOn:
priv->rtllib->RfOffReason &= (~ChangeSource);
@@ -215,8 +215,8 @@ bool rtl92e_set_rf_state(struct net_device *dev,
}
if (bActionAllowed) {
- PHY_SetRFPowerState(dev, StateToSet);
- if (StateToSet == eRfOn) {
+ rtl92e_set_rf_power_state(dev, state_to_set);
+ if (state_to_set == eRfOn) {
if (bConnectBySSID && priv->blinked_ingpio) {
schedule_delayed_work(
&ieee->associate_procedure_wq, 0);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 8f254c34d5d3..1796c881a5fa 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -598,6 +598,6 @@ 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 StateToSet,
+ enum rt_rf_power_state state_to_set,
RT_RF_CHANGE_SOURCE ChangeSource);
#endif
--
2.37.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-08-24 20:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-24 20:14 [PATCH 0/4] staging: rtl8192e: Coding Syle of rtl_core.c improved Philipp Hortmann
2022-08-24 20:14 ` [PATCH 1/4] staging: rtl8192e: Remove blank lines in rtl_core.c Philipp Hortmann
2022-08-24 20:14 ` [PATCH 2/4] staging: rtl8192e: Rename Tx... and RxCheckStuckHandler Philipp Hortmann
2022-08-24 20:14 ` [PATCH 3/4] staging: rtl8192e: Remove Unnecessary ftrace-like logging Philipp Hortmann
2022-08-24 20:14 ` [PATCH 4/4] staging: rtl8192e: Remove PHY_SetRFPowerState and rename StateToSet Philipp Hortmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox