From: Pavel Skripkin <paskripkin@gmail.com>
To: Martin Kaiser <martin@kaiser.cx>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] staging: r8188eu: turbo scan is always off for r8188eu
Date: Mon, 3 Jan 2022 00:44:12 +0300 [thread overview]
Message-ID: <6d33d346-b797-aeb3-8b1b-64332e05fb87@gmail.com> (raw)
In-Reply-To: <20220102175932.89127-6-martin@kaiser.cx>
On 1/2/22 20:59, Martin Kaiser wrote:
> Turbo scan is always disabled. Remove the TurboScanOff variable and
> related checks.
>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 21 +++++++------------
> 1 file changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c
> index 0b982cc7c86f..6e0231099986 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c
> @@ -87,28 +87,21 @@ rtl8188e_PHY_RF6052SetCckTxPower(
> struct hal_data_8188e *pHalData = &Adapter->haldata;
> struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
> u32 TxAGC[2] = {0, 0}, tmpval = 0, pwrtrac_value;
> - bool TurboScanOff = false;
> u8 idx1, idx2;
> u8 *ptr;
> u8 direction;
> - /* FOR CE ,must disable turbo scan */
> - TurboScanOff = true;
>
> if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
> TxAGC[RF_PATH_A] = 0x3f3f3f3f;
> TxAGC[RF_PATH_B] = 0x3f3f3f3f;
>
> - TurboScanOff = true;/* disable turbo scan */
> -
> - if (TurboScanOff) {
> - for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
> - TxAGC[idx1] =
> - pPowerlevel[idx1] | (pPowerlevel[idx1] << 8) |
> - (pPowerlevel[idx1] << 16) | (pPowerlevel[idx1] << 24);
> - /* 2010/10/18 MH For external PA module. We need to limit power index to be less than 0x20. */
> - if (TxAGC[idx1] > 0x20 && pHalData->ExternalPA)
> - TxAGC[idx1] = 0x20;
> - }
> + for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
> + TxAGC[idx1] =
> + pPowerlevel[idx1] | (pPowerlevel[idx1] << 8) |
> + (pPowerlevel[idx1] << 16) | (pPowerlevel[idx1] << 24);
> + /* 2010/10/18 MH For external PA module. We need to limit power index to be less than 0x20. */
> + if (TxAGC[idx1] > 0x20 && pHalData->ExternalPA)
> + TxAGC[idx1] = 0x20;
> }
> } else {
> for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
Hi Martin,
thanks for your clean up work!
It's a bit unrelated to the patch, but I found it while reviewing this.
It's in the same function rtl8188e_PHY_RF6052SetCckTxPower():
89: u32 TxAGC[2] = {0, 0};
...
92 u8 *ptr;
...
129 for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
130 ptr = (u8 *)(&TxAGC[idx1]);
131 for (idx2 = 0; idx2 < 4; idx2++) {
132 if (*ptr > RF6052_MAX_TX_PWR)
133 *ptr = RF6052_MAX_TX_PWR;
134 ptr++;
135 }
136 }
What is going on here? Code just checks and writes to random place on
stack outside TxAGC array? I might be missing something, but it looks
wrong...
Just wanted to share, since I believe your knowledge about this driver
is much deeper than mine :)
thanks
With regards,
Pavel Skripkin
next prev parent reply other threads:[~2022-01-02 21:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-02 17:59 [PATCH 0/5] staging: r8188eu: some trivial cleanups Martin Kaiser
2022-01-02 17:59 ` [PATCH 1/5] staging: r8188eu: remove unused power management defines Martin Kaiser
2022-01-02 17:59 ` [PATCH 2/5] staging: r8188eu: internal autosuspend is always false Martin Kaiser
2022-01-02 17:59 ` [PATCH 3/5] staging: r8188eu: fix_rate is set but not used Martin Kaiser
2022-01-02 17:59 ` [PATCH 4/5] staging: r8188eu: cmd_issued_cnt " Martin Kaiser
2022-01-02 17:59 ` [PATCH 5/5] staging: r8188eu: turbo scan is always off for r8188eu Martin Kaiser
2022-01-02 21:44 ` Pavel Skripkin [this message]
2022-01-04 20:51 ` Martin Kaiser
2022-01-04 20:52 ` Pavel Skripkin
2022-01-02 18:41 ` [PATCH 0/5] staging: r8188eu: some trivial cleanups Michael Straube
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6d33d346-b797-aeb3-8b1b-64332e05fb87@gmail.com \
--to=paskripkin@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=martin@kaiser.cx \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome