From: Ananthan <ananthanr.off@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Ananthan <ananthanr.off@gmail.com>
Subject: [PATCH] staging: rtl8723bs: replace magic number in InitBeaconParameters
Date: Sat, 11 Jul 2026 08:10:06 +0530 [thread overview]
Message-ID: <20260711024005.19900-2-ananthanr.off@gmail.com> (raw)
Per the bitfield comment in hal_com_reg.h, REG_TBTT_PROHIBIT packs
a "setup" time in bits 3:0 and a "hold" time in bits 19:8. The
rtw_write16() call here only writes the low 16 bits of that
register, covering the full setup field and the low byte of the
hold field.
Replace the magic number 0x6404 with two named constants
representing these fields.
No functional change.
Signed-off-by: Ananthan <ananthanr.off@gmail.com>
---
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index bcaf63b2893c..9609ae025736 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -11,6 +11,9 @@
#include <rtl8723b_hal.h>
#include "hal_com_h2c.h"
+#define TBTT_PROHIBIT_SETUP 0x04 /* bits 3:0: setup time, unit 32us */
+#define TBTT_PROHIBIT_HOLD_LOW 0x64 /* bits 15:8: low byte of 12-bit hold time, unit 32us */
+
static void _FWDownloadEnable(struct adapter *padapter, bool enable)
{
u8 tmp, count = 0;
@@ -861,8 +864,8 @@ void rtl8723b_InitBeaconParameters(struct adapter *padapter)
rtw_write16(padapter, REG_BCN_CTRL, val16);
- /* TODO: Remove these magic number */
- rtw_write16(padapter, REG_TBTT_PROHIBIT, 0x6404);/* ms */
+ rtw_write16(padapter, REG_TBTT_PROHIBIT,
+ (TBTT_PROHIBIT_HOLD_LOW << 8) | TBTT_PROHIBIT_SETUP);/* ms */
/* Firmware will control REG_DRVERLYINT when power saving is enable, */
/* so don't set this register on STA mode. */
if (!check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE))
--
2.43.0
next reply other threads:[~2026-07-11 2:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-11 2:40 Ananthan [this message]
2026-07-11 5:11 ` [PATCH] staging: rtl8723bs: replace magic number in InitBeaconParameters Greg Kroah-Hartman
2026-07-11 6:22 ` [PATCH v2] " Anantha Krishnan
2026-07-11 6:29 ` Greg Kroah-Hartman
2026-07-11 6:41 ` Dan Carpenter
2026-07-11 6:39 ` Anantha Krishnan
2026-07-11 6:42 ` Dan Carpenter
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=20260711024005.19900-2-ananthanr.off@gmail.com \
--to=ananthanr.off@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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