* [PATCH] rtl8723bs: improve readability in cmd filter and traffic watchdog
@ 2026-04-18 23:24 Vakii
2026-04-19 5:34 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Vakii @ 2026-04-18 23:24 UTC (permalink / raw)
To: linux-staging
[-- Attachment #1.1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #1.2: Type: text/html, Size: 26 bytes --]
[-- Attachment #2: 0001-rtl8723bs-improve-readability-in-cmd-filter-and-traf.patch --]
[-- Type: text/x-patch, Size: 2956 bytes --]
From ab0da1c2ba7446be7f5d0a0ba88a2b1503f39f4d Mon Sep 17 00:00:00 2001
From: knez <206253445+knezoWTF@users.noreply.github.com>
Date: Sun, 19 Apr 2026 00:56:32 +0200
Subject: [PATCH] rtl8723bs: improve readability in cmd filter and traffic
watchdog
- Rename bAllow to allow_pre_init_cmd
- Convert traffic flags to bool where appropriate
- Improve comments for traffic detection logic
No functional change.
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index abb84f8aecbe..e0c57652e0f5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -298,12 +298,13 @@ void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
{
- u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
+ /* set to true to allow enqueuing cmd when hw_init_completed is false */
+ bool allow_pre_init_cmd = false;
if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
- bAllow = true;
+ allow_pre_init_cmd = true;
- if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
+ if ((!pcmdpriv->padapter->hw_init_completed && !allow_pre_init_cmd) ||
!atomic_read(&pcmdpriv->cmdthd_running)) /* com_thread not running */
return _FAIL;
@@ -1127,12 +1128,16 @@ static void collect_traffic_statistics(struct adapter *padapter)
u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
{
- u8 bEnterPS = false;
+ bool bEnterPS = false;
u16 BusyThresholdHigh = 25;
u16 BusyThresholdLow = 10;
u16 BusyThreshold = BusyThresholdHigh;
- u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false;
- u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false;
+ u8 bBusyTraffic = false;
+ u8 bTxBusyTraffic = false;
+ u8 bRxBusyTraffic = false;
+ u8 bHigherBusyTraffic = false;
+ u8 bHigherBusyRxTraffic = false;
+ u8 bHigherBusyTxTraffic = false;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
collect_traffic_statistics(padapter);
@@ -1156,7 +1161,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
bTxBusyTraffic = true;
}
- /* Higher Tx/Rx data. */
+ /* Detect high Tx/Rx traffic load. */
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
bHigherBusyTraffic = true;
@@ -1191,7 +1196,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
bEnterPS = true;
}
- /* LeisurePS only work in infra mode. */
+ /* LeisurePS based on traffic state (infra mode only) */
if (bEnterPS) {
if (!from_timer)
LPS_Enter(padapter, "TRAFFIC_IDLE");
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtl8723bs: improve readability in cmd filter and traffic watchdog
2026-04-18 23:24 [PATCH] rtl8723bs: improve readability in cmd filter and traffic watchdog Vakii
@ 2026-04-19 5:34 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-04-19 5:34 UTC (permalink / raw)
To: Vakii; +Cc: linux-staging
On Sun, Apr 19, 2026 at 01:24:07AM +0200, Vakii wrote:
>
> From ab0da1c2ba7446be7f5d0a0ba88a2b1503f39f4d Mon Sep 17 00:00:00 2001
> From: knez <206253445+knezoWTF@users.noreply.github.com>
> Date: Sun, 19 Apr 2026 00:56:32 +0200
> Subject: [PATCH] rtl8723bs: improve readability in cmd filter and traffic
> watchdog
>
> - Rename bAllow to allow_pre_init_cmd
> - Convert traffic flags to bool where appropriate
> - Improve comments for traffic detection logic
>
> No functional change.
> ---
> drivers/staging/rtl8723bs/core/rtw_cmd.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index abb84f8aecbe..e0c57652e0f5 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -298,12 +298,13 @@ void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
> int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
> int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
> {
> - u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
> + /* set to true to allow enqueuing cmd when hw_init_completed is false */
> + bool allow_pre_init_cmd = false;
>
> if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
> - bAllow = true;
> + allow_pre_init_cmd = true;
>
> - if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
> + if ((!pcmdpriv->padapter->hw_init_completed && !allow_pre_init_cmd) ||
> !atomic_read(&pcmdpriv->cmdthd_running)) /* com_thread not running */
> return _FAIL;
>
> @@ -1127,12 +1128,16 @@ static void collect_traffic_statistics(struct adapter *padapter)
>
> u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
> {
> - u8 bEnterPS = false;
> + bool bEnterPS = false;
> u16 BusyThresholdHigh = 25;
> u16 BusyThresholdLow = 10;
> u16 BusyThreshold = BusyThresholdHigh;
> - u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false;
> - u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false;
> + u8 bBusyTraffic = false;
> + u8 bTxBusyTraffic = false;
> + u8 bRxBusyTraffic = false;
> + u8 bHigherBusyTraffic = false;
> + u8 bHigherBusyRxTraffic = false;
> + u8 bHigherBusyTxTraffic = false;
> struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>
> collect_traffic_statistics(padapter);
> @@ -1156,7 +1161,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
> bTxBusyTraffic = true;
> }
>
> - /* Higher Tx/Rx data. */
> + /* Detect high Tx/Rx traffic load. */
> if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
> pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
> bHigherBusyTraffic = true;
> @@ -1191,7 +1196,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
> bEnterPS = true;
> }
>
> - /* LeisurePS only work in infra mode. */
> + /* LeisurePS based on traffic state (infra mode only) */
> if (bEnterPS) {
> if (!from_timer)
> LPS_Enter(padapter, "TRAFFIC_IDLE");
> --
> 2.47.3
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- Your patch was attached, please place it inline so that it can be
applied directly from the email message itself.
- Your patch does not have a Signed-off-by: line. Please read the
kernel file, Documentation/process/submitting-patches.rst and resend
it after adding that line. Note, the line needs to be in the body of
the email, before the patch, not at the bottom of the patch or in the
email signature.
- Your patch did many different things all at once, making it difficult
to review. All Linux kernel patches need to only do one thing at a
time. If you need to do multiple things (such as clean up all coding
style issues in a file/driver), do it in a sequence of patches, each
one doing only one thing. This will make it easier to review the
patches to ensure that they are correct, and to help alleviate any
merge issues that larger patches can cause.
- It looks like you did not use your "real" name for the patch on either
the Signed-off-by: line, or the From: line (both of which have to
match). Please read the kernel file,
Documentation/process/submitting-patches.rst for how to do this
correctly.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] rtl8723bs: improve readability in cmd filter and traffic watchdog
@ 2026-04-19 11:01 Vasilije Knezevic
0 siblings, 0 replies; 3+ messages in thread
From: Vasilije Knezevic @ 2026-04-19 11:01 UTC (permalink / raw)
To: linux-staging; +Cc: Vasilije Knezevic
- Rename bAllow to allow_pre_init_cmd
- Convert traffic flags to bool where appropriate
- Improve comments for traffic detection logic
No functional change.
Signed-off-by: Vasilije Knezevic <vasilijeknezevic.dev@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index abb84f8aecbe..e0c57652e0f5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -298,12 +298,13 @@ void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
{
- u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
+ /* set to true to allow enqueuing cmd when hw_init_completed is false */
+ bool allow_pre_init_cmd = false;
if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
- bAllow = true;
+ allow_pre_init_cmd = true;
- if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
+ if ((!pcmdpriv->padapter->hw_init_completed && !allow_pre_init_cmd) ||
!atomic_read(&pcmdpriv->cmdthd_running)) /* com_thread not running */
return _FAIL;
@@ -1127,12 +1128,16 @@ static void collect_traffic_statistics(struct adapter *padapter)
u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
{
- u8 bEnterPS = false;
+ bool bEnterPS = false;
u16 BusyThresholdHigh = 25;
u16 BusyThresholdLow = 10;
u16 BusyThreshold = BusyThresholdHigh;
- u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false;
- u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false;
+ u8 bBusyTraffic = false;
+ u8 bTxBusyTraffic = false;
+ u8 bRxBusyTraffic = false;
+ u8 bHigherBusyTraffic = false;
+ u8 bHigherBusyRxTraffic = false;
+ u8 bHigherBusyTxTraffic = false;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
collect_traffic_statistics(padapter);
@@ -1156,7 +1161,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
bTxBusyTraffic = true;
}
- /* Higher Tx/Rx data. */
+ /* Detect high Tx/Rx traffic load. */
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
bHigherBusyTraffic = true;
@@ -1191,7 +1196,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
bEnterPS = true;
}
- /* LeisurePS only work in infra mode. */
+ /* LeisurePS based on traffic state (infra mode only) */
if (bEnterPS) {
if (!from_timer)
LPS_Enter(padapter, "TRAFFIC_IDLE");
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-19 11:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-18 23:24 [PATCH] rtl8723bs: improve readability in cmd filter and traffic watchdog Vakii
2026-04-19 5:34 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2026-04-19 11:01 Vasilije Knezevic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox