From: luka.gejak@linux.dev
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Luka Gejak <luka.gejak@linux.dev>
Subject: [PATCH 17/21] staging: rtl8723bs: core: fix line lengths in rtw_cmd.c
Date: Tue, 24 Feb 2026 14:27:44 +0100 [thread overview]
Message-ID: <20260224132748.12336-18-luka.gejak@linux.dev> (raw)
In-Reply-To: <20260224132748.12336-1-luka.gejak@linux.dev>
From: Luka Gejak <luka.gejak@linux.dev>
Break long lines exceeding 100 characters to comply with kernel coding
style.
Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 147 +++++++++++++----------
1 file changed, 81 insertions(+), 66 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index b2e7f479f72b..b2e34a6842fc 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -183,7 +183,7 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
return -ENOMEM;
}
- pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
+ pcmdpriv->rsp_buf = PTR_ALIGN(pcmdpriv->rsp_allocated_buf, 4);
pcmdpriv->cmd_issued_cnt = 0;
pcmdpriv->cmd_done_cnt = 0;
@@ -392,7 +392,7 @@ int rtw_cmd_thread(void *context)
while (1) {
if (wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp)) {
netdev_dbg(padapter->pnetdev,
- FUNC_ADPT_FMT " wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp) return != 0, break\n",
+ FUNC_ADPT_FMT " cmd_queue_comp interrupted\n",
FUNC_ADPT_ARG(padapter));
break;
}
@@ -726,31 +726,33 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], (256 - 1));
psecnetwork->ie_length = 0;
- /* Added by Albert 2009/02/18 */
- /* If the driver wants to use the bssid to create the connection. */
- /* If not, we have to copy the connecting AP's MAC address to it so that */
- /* the driver just has the bssid information for PMKIDList searching. */
+ /* If not using bssid, copy connecting AP's MAC for PMKIDList searching. */
if (!pmlmepriv->assoc_by_bssid)
- memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.mac_address[0], ETH_ALEN);
+ memcpy(pmlmepriv->assoc_bssid, pnetwork->network.mac_address, ETH_ALEN);
- psecnetwork->ie_length = rtw_restruct_sec_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length);
-
- pqospriv->qos_option = 0;
-
- if (pregistrypriv->wmm_enable) {
- tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length, psecnetwork->ie_length);
-
- if (psecnetwork->ie_length != tmp_len) {
- psecnetwork->ie_length = tmp_len;
- pqospriv->qos_option = 1; /* There is WMM IE in this corresp. beacon */
- } else {
- pqospriv->qos_option = 0;/* There is no WMM IE in this corresp. beacon */
+ {
+ u8 *src_ie = pnetwork->network.ies;
+ u8 *dst_ie = psecnetwork->ies;
+ int src_len = pnetwork->network.ie_length;
+
+ psecnetwork->ie_length = rtw_restruct_sec_ie(padapter, src_ie,
+ dst_ie, src_len);
+
+ pqospriv->qos_option = 0;
+ if (pregistrypriv->wmm_enable) {
+ tmp_len = rtw_restruct_wmm_ie(padapter, src_ie, dst_ie,
+ src_len, psecnetwork->ie_length);
+ if (psecnetwork->ie_length != tmp_len) {
+ psecnetwork->ie_length = tmp_len;
+ pqospriv->qos_option = 1;
+ }
}
- }
- phtpriv->ht_option = false;
- ptmp = rtw_get_ie(&pnetwork->network.ies[12], WLAN_EID_HT_CAPABILITY, &tmp_len, pnetwork->network.ie_length - 12);
+ phtpriv->ht_option = false;
+ ptmp = rtw_get_ie(&src_ie[12], WLAN_EID_HT_CAPABILITY,
+ &tmp_len, src_len - 12);
+ }
if (pregistrypriv->ht_enable && ptmp && tmp_len > 0) {
/* Added by Albert 2010/06/23 */
/* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
@@ -787,7 +789,8 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
return res;
}
-u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue) /* for sta_mode */
+/* for sta_mode */
+u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue)
{
struct cmd_obj *cmdobj = NULL;
struct disconnect_parm *param = NULL;
@@ -823,10 +826,12 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
return res;
}
-u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrastructure networktype, bool enqueue)
+u8 rtw_setopmode_cmd(struct adapter *padapter,
+ enum ndis_802_11_network_infrastructure networktype,
+ bool enqueue)
{
- struct cmd_obj *ph2c;
- struct setopmode_parm *psetop;
+ struct cmd_obj *ph2c;
+ struct setopmode_parm *psetop;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS;
@@ -879,10 +884,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
else
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
- if (unicast_key)
+ if (unicast_key) {
memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
- else
- memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
+ } else {
+ u8 keyid = psecuritypriv->dot118021XGrpKeyid;
+ u8 *grpkey = psecuritypriv->dot118021XGrpKey[keyid].skey;
+
+ memcpy(&psetstakey_para->key, grpkey, 16);
+ }
/* jeff: set this because at least sw key is ready */
padapter->securitypriv.busetkipkey = true;
@@ -1104,25 +1113,26 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter)
static void collect_traffic_statistics(struct adapter *padapter)
{
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
-
- /* Tx */
- pdvobjpriv->traffic_stat.tx_bytes = padapter->xmitpriv.tx_bytes;
- pdvobjpriv->traffic_stat.tx_pkts = padapter->xmitpriv.tx_pkts;
- pdvobjpriv->traffic_stat.tx_drop = padapter->xmitpriv.tx_drop;
-
- /* Rx */
- pdvobjpriv->traffic_stat.rx_bytes = padapter->recvpriv.rx_bytes;
- pdvobjpriv->traffic_stat.rx_pkts = padapter->recvpriv.rx_pkts;
- pdvobjpriv->traffic_stat.rx_drop = padapter->recvpriv.rx_drop;
-
- /* Calculate throughput in last interval */
- pdvobjpriv->traffic_stat.cur_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes - pdvobjpriv->traffic_stat.last_tx_bytes;
- pdvobjpriv->traffic_stat.cur_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes - pdvobjpriv->traffic_stat.last_rx_bytes;
- pdvobjpriv->traffic_stat.last_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes;
- pdvobjpriv->traffic_stat.last_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes;
-
- pdvobjpriv->traffic_stat.cur_tx_tp = (u32)(pdvobjpriv->traffic_stat.cur_tx_bytes * 8 / 2 / 1024 / 1024);
- pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes * 8 / 2 / 1024 / 1024);
+ struct rtw_traffic_statistics *stats = &pdvobjpriv->traffic_stat;
+
+ /* Tx */
+ stats->tx_bytes = padapter->xmitpriv.tx_bytes;
+ stats->tx_pkts = padapter->xmitpriv.tx_pkts;
+ stats->tx_drop = padapter->xmitpriv.tx_drop;
+
+ /* Rx */
+ stats->rx_bytes = padapter->recvpriv.rx_bytes;
+ stats->rx_pkts = padapter->recvpriv.rx_pkts;
+ stats->rx_drop = padapter->recvpriv.rx_drop;
+
+ /* Calculate throughput in last interval */
+ stats->cur_tx_bytes = stats->tx_bytes - stats->last_tx_bytes;
+ stats->cur_rx_bytes = stats->rx_bytes - stats->last_rx_bytes;
+ stats->last_tx_bytes = stats->tx_bytes;
+ stats->last_rx_bytes = stats->rx_bytes;
+
+ stats->cur_tx_tp = (u32)(stats->cur_tx_bytes * 8 / 2 / 1024 / 1024);
+ stats->cur_rx_tp = (u32)(stats->cur_rx_bytes * 8 / 2 / 1024 / 1024);
}
u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
@@ -1168,27 +1178,31 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
}
/* check traffic for powersaving. */
- if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
- (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) {
- bEnterPS = false;
+ {
+ struct rt_link_detect_t *ldi = &pmlmepriv->LinkDetectInfo;
+ u32 rx_tx_sum = ldi->NumRxUnicastOkInPeriod + ldi->NumTxOkInPeriod;
- if (bBusyTraffic) {
- if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount <= 4)
- pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 4;
+ if ((rx_tx_sum > 8) || (ldi->NumRxUnicastOkInPeriod > 2)) {
+ bEnterPS = false;
- pmlmepriv->LinkDetectInfo.TrafficTransitionCount++;
+ if (bBusyTraffic) {
+ if (ldi->TrafficTransitionCount <= 4)
+ ldi->TrafficTransitionCount = 4;
- if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount > 30/*TrafficTransitionLevel*/)
- pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 30;
- }
- } else {
- if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount >= 2)
- pmlmepriv->LinkDetectInfo.TrafficTransitionCount -= 2;
- else
- pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 0;
+ ldi->TrafficTransitionCount++;
+
+ if (ldi->TrafficTransitionCount > 30)
+ ldi->TrafficTransitionCount = 30;
+ }
+ } else {
+ if (ldi->TrafficTransitionCount >= 2)
+ ldi->TrafficTransitionCount -= 2;
+ else
+ ldi->TrafficTransitionCount = 0;
- if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount == 0)
- bEnterPS = true;
+ if (ldi->TrafficTransitionCount == 0)
+ bEnterPS = true;
+ }
}
/* LeisurePS only work in infra mode. */
@@ -1734,7 +1748,8 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
pdrvextra_cmd = (struct drvextra_cmd_parm *)pbuf;
switch (pdrvextra_cmd->ec_id) {
- case DYNAMIC_CHK_WK_CID:/* only primary padapter go to this cmd, but execute dynamic_chk_wk_hdl() for two interfaces */
+ /* only primary padapter goes to this cmd, but execute for two interfaces */
+ case DYNAMIC_CHK_WK_CID:
dynamic_chk_wk_hdl(padapter);
break;
case POWER_SAVING_CTRL_WK_CID:
--
2.53.0
next prev parent reply other threads:[~2026-02-24 13:28 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 13:27 [PATCH 00/21] staging: rtl8723bs: various cleanups luka.gejak
2026-02-24 13:27 ` [PATCH 01/21] staging: rtl8723bs: remove unused rtl8192c function declarations luka.gejak
2026-02-24 13:27 ` [PATCH 02/21] staging: rtl8723bs: remove unused RECV_BLK defines luka.gejak
2026-02-24 13:27 ` [PATCH 03/21] staging: rtl8723bs: remove unused MAX_PATH_NUM defines luka.gejak
2026-02-24 13:27 ` [PATCH 04/21] staging: rtl8723bs: convert PSTA_INFO_T to struct sta_info * luka.gejak
2026-02-24 13:27 ` [PATCH 05/21] staging: rtl8723bs: remove NDIS type aliases luka.gejak
2026-02-24 13:27 ` [PATCH 06/21] staging: rtl8723bs: remove redundant MAC_ARG macro luka.gejak
2026-02-24 13:27 ` [PATCH 07/21] staging: rtl8723bs: core: fix line lengths in rtw_wlan_util.c luka.gejak
2026-02-25 6:53 ` Dan Carpenter
2026-02-24 13:27 ` [PATCH 08/21] staging: rtl8723bs: core: fix line lengths in rtw_recv.c luka.gejak
2026-02-25 6:53 ` Dan Carpenter
2026-02-24 13:27 ` [PATCH 09/21] staging: rtl8723bs: hal: fix line lengths in HalPhyRf_8723B.c luka.gejak
2026-02-25 6:57 ` Dan Carpenter
2026-02-24 13:27 ` [PATCH 10/21] staging: rtl8723bs: os_dep: fix line lengths in ioctl_cfg80211.c luka.gejak
2026-02-25 6:58 ` Dan Carpenter
2026-02-25 14:56 ` Greg Kroah-Hartman
2026-02-25 15:08 ` Luka Gejak
2026-02-25 15:14 ` Greg Kroah-Hartman
2026-02-25 15:17 ` Luka Gejak
2026-02-25 15:48 ` Greg Kroah-Hartman
2026-02-24 13:27 ` [PATCH 11/21] staging: rtl8723bs: hal: fix line lengths in rtl8723b_cmd.c luka.gejak
2026-02-25 6:58 ` Dan Carpenter
2026-02-24 13:27 ` [PATCH 12/21] staging: rtl8723bs: hal: fix line lengths in rtl8723b_hal_init.c luka.gejak
2026-02-25 7:00 ` Dan Carpenter
2026-02-25 9:19 ` Luka Gejak
2026-02-24 13:27 ` [PATCH 13/21] staging: rtl8723bs: hal: fix line lengths in rtl8723b_phycfg.c luka.gejak
2026-02-24 13:27 ` [PATCH 14/21] staging: rtl8723bs: core: fix various line length overflows luka.gejak
2026-02-24 13:27 ` [PATCH 15/21] staging: rtl8723bs: hal: " luka.gejak
2026-02-24 13:27 ` [PATCH 16/21] staging: rtl8723bs: os_dep: " luka.gejak
2026-02-24 13:27 ` luka.gejak [this message]
2026-02-24 13:27 ` [PATCH 18/21] staging: rtl8723bs: core: fix line lengths in rtw_mlme_ext.c luka.gejak
2026-02-24 13:27 ` [PATCH 19/21] staging: rtl8723bs: core: fix line lengths in rtw_mlme.c luka.gejak
2026-02-24 13:27 ` [PATCH 20/21] staging: rtl8723bs: core: fix line lengths in rtw_xmit.c luka.gejak
2026-02-24 13:27 ` [PATCH 21/21] staging: rtl8723bs: core: fix various line length overflows luka.gejak
2026-02-24 18:15 ` [PATCH 00/21] staging: rtl8723bs: various cleanups Greg Kroah-Hartman
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=20260224132748.12336-18-luka.gejak@linux.dev \
--to=luka.gejak@linux.dev \
--cc=dan.carpenter@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.