From nobody Sun Feb 8 14:10:10 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A770346E7E for ; Fri, 6 Feb 2026 07:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770364529; cv=none; b=rX//HldrxrR3j+jwKo3gaEMN3ekYmJiaD/iVa0KhzFEYFoxZ5ss5eQY8sXRmY0nc1C219i0ikIIOlwMX1zSANd0zFbCLf5H9lEImwDJZl4n/msMvoAntxHyiCDibHX7xYMcNUGQvMu3V6YlZAPVSW2nGSCq8pjcSHDUagGU9p54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770364529; c=relaxed/simple; bh=RZDaxRseW8NLtF3AqOo4q119tWImR2umqmOQEHxzEvw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lmLA9dBEQaqgu9gMzhJ3+WkROhg+W/2dJVH4dbhLS6Aggkr+ZoC12FL2AJp/SbGvD3iZS1Hccp4rUAHgJtGzz2mkOl/Tlbb/zwMnk1C+6q7I8gFBT5z7Ile8YGKHCNmHXhFo9JV+O1/TwNSrFNAsaQcnUonT1+TR+wPsobsJjh8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iY35qif6; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iY35qif6" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-43284ed32a0so1114244f8f.3 for ; Thu, 05 Feb 2026 23:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770364528; x=1770969328; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zQ+Eis57/vHR1vw6pHuCr0O2ZIvIK8HRZ4Efzrz373A=; b=iY35qif6aPL4w6slTLXfw2eNYsXsMzkIISAOXx8MmDL7AfUG10cq19z4GNndvwXSk0 9wMQ/BlTKmw1FazhjYyR+8aH0229JZduom80Rb5gOuTzXcTz4Tf4uzHZmvmJrP++pHzf oXGIq4tWLS+gJP1egoiQ0fX9IPKaWAhHm5q2CLZmt7hsE8cOhUtH17x3rlYc7fOCCJqL qmWCSUj1KKks6j4JnfrcsCZwLMbsc8kohOgZmMzXYT6KY47dWhSSDhXSNXfW5VY3uPck nMQbVznJIHIgDDu/QJz2NDxRnvKsskedhw+JVnmwFz2MM17xAHEu3BwReHkAW5Z0EKLF Z3EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770364528; x=1770969328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zQ+Eis57/vHR1vw6pHuCr0O2ZIvIK8HRZ4Efzrz373A=; b=rQYYLRbkvE9w6CUHME48q2Il/KNmXcuXNf7fV7WxLh0tKdni26LoYhQcVnF0zIuhkn NUoxE8hSdAkKtqBZyl2eIbPCBTZpyNgiL48TUR4TgMbnr6UkV+AdrVILQgC9giXKToPU 70AhOQT0qyAFQKirPodMsQMQWq8oKsDgCUlU1QkS1zC0v1Sjr7JTY+uomsLRsaffVu1x PjG5+GYpGMnM8N3nV9hj0Hi4Wbik1Eiw7gPCIHILrQj+r0LwL3kKTnZneliXdm414kl9 Jj/DCszXzJqyUF3kWsWiHi2Ohfi9ZIQQI0e3KuKZIRQupWgRg2epj6Ry2gDeHJiYH13Y +GGg== X-Forwarded-Encrypted: i=1; AJvYcCUdHQij0KBedVFj2gOCh+pNEOpJKh+onA+XFRbwdlUn9Sbftc/S5rVukPFcpm9+3yQX9TKxHvySpNABgds=@vger.kernel.org X-Gm-Message-State: AOJu0YxqFulDeEmCNRPyqE3Z183LjxtKbZ/KbmmMeq73hUU8aHZeg9mc TjVTAiCaTE1XhutTr4oDWKCO0JUjgxxS8U4lzdrl6NuG6zwwcAlymyEItfyAGQE= X-Gm-Gg: AZuq6aKqit25yzwTgpaX2OlgTBbOVqO8mVbhCRB+JLY3l04Vc0SF44cZz2zyjIzBnGg RqsFOKv5Etu4/TlvPgmpBHBYFCl/3HbGvA8g6CQBvFn0s/ARKVCvBTgx4QLfQCGtsDeVrEUTqcX Oenhspa3kpIW2W7G+AyGwoZrugQ5HkC/T+StATM1Yo/9XLIcRjbtsWxeIDYFhOAmqyO3ciI25z0 /9pJa+57MbTPBLVMbHB9owHUZ9rhkKVDgIMxHDl7TRLgnSv/bdcjtSZAWx29ciBS1efrHxzpFcE UdC5s4oFWZxCg7NVXO4M8ta1Q2fgFwQyJyRSBKRTc37MEfYFr/NwH2SxGSWU6/4uRUFiQUOXZpy hOTJyzKSm2LzS8/h9ho+Jq3cipPtQM31YWWUn+h0PoqaUKwuIgsZquFA1Vx6gcVL6cs4ZDMeErL i7kRbMz1L72q9BrL7qlFSpEIRfyTybTH0qMSejeIhgL7I7fWWGoVPz5CFOY839BGU= X-Received: by 2002:a5d:5f48:0:b0:435:91b8:e01b with SMTP id ffacd0b85a97d-4362938d530mr3055057f8f.45.1770364527665; Thu, 05 Feb 2026 23:55:27 -0800 (PST) Received: from LGPC ([31.223.131.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296bd3b8sm3836039f8f.11.2026.02.05.23.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 23:55:26 -0800 (PST) From: lukagejak5@gmail.com X-Google-Original-From: luka.gejak@linux.dev To: Greg Kroah-Hartman Cc: Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH v2 22/26] staging: rtl8723bs: core: fix line lengths in rtw_cmd.c Date: Fri, 6 Feb 2026 08:54:35 +0100 Message-ID: <20260206075439.103287-23-luka.gejak@linux.dev> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260206075439.103287-1-luka.gejak@linux.dev> References: <20260206075439.103287-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Luka Gejak Break long lines exceeding 100 characters to comply with kernel coding style. Signed-off-by: Luka Gejak --- 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/rtl= 8723bs/core/rtw_cmd.c index 27da987d881f..39c22db2e824 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -185,7 +185,7 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) return -ENOMEM; } =20 - pcmdpriv->rsp_buf =3D pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdp= riv->rsp_allocated_buf) & 3); + pcmdpriv->rsp_buf =3D PTR_ALIGN(pcmdpriv->rsp_allocated_buf, 4); =20 pcmdpriv->cmd_issued_cnt =3D 0; pcmdpriv->cmd_done_cnt =3D 0; @@ -394,7 +394,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_qu= eue_comp) return !=3D 0, break\n", + FUNC_ADPT_FMT " cmd_queue_comp interrupted\n", FUNC_ADPT_ARG(padapter)); break; } @@ -728,31 +728,33 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct = wlan_network *pnetwork) memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], (256 = - 1)); =20 psecnetwork->ie_length =3D 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 tha= t */ - /* the driver just has the bssid information for PMKIDList searching. */ =20 + /* 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], ET= H_ALEN); + memcpy(pmlmepriv->assoc_bssid, pnetwork->network.mac_address, ETH_ALEN); =20 - psecnetwork->ie_length =3D rtw_restruct_sec_ie(padapter, &pnetwork->netwo= rk.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length); - - pqospriv->qos_option =3D 0; - - if (pregistrypriv->wmm_enable) { - tmp_len =3D rtw_restruct_wmm_ie(padapter, &pnetwork->network.ies[0], &ps= ecnetwork->ies[0], pnetwork->network.ie_length, psecnetwork->ie_length); - - if (psecnetwork->ie_length !=3D tmp_len) { - psecnetwork->ie_length =3D tmp_len; - pqospriv->qos_option =3D 1; /* There is WMM IE in this corresp. beacon = */ - } else { - pqospriv->qos_option =3D 0;/* There is no WMM IE in this corresp. beaco= n */ + { + u8 *src_ie =3D pnetwork->network.ies; + u8 *dst_ie =3D psecnetwork->ies; + int src_len =3D pnetwork->network.ie_length; + + psecnetwork->ie_length =3D rtw_restruct_sec_ie(padapter, src_ie, + dst_ie, src_len); + + pqospriv->qos_option =3D 0; + if (pregistrypriv->wmm_enable) { + tmp_len =3D rtw_restruct_wmm_ie(padapter, src_ie, dst_ie, + src_len, psecnetwork->ie_length); + if (psecnetwork->ie_length !=3D tmp_len) { + psecnetwork->ie_length =3D tmp_len; + pqospriv->qos_option =3D 1; + } } - } =20 - phtpriv->ht_option =3D false; - ptmp =3D rtw_get_ie(&pnetwork->network.ies[12], WLAN_EID_HT_CAPABILITY, &= tmp_len, pnetwork->network.ie_length - 12); + phtpriv->ht_option =3D false; + ptmp =3D 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 avo= id some IOT issue. */ @@ -789,7 +791,8 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wl= an_network *pnetwork) return res; } =20 -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 =3D NULL; struct disconnect_parm *param =3D NULL; @@ -825,10 +828,12 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 dea= uth_timeout_ms, bool enqueu return res; } =20 -u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_i= nfrastructure 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; =20 struct cmd_priv *pcmdpriv =3D &padapter->cmdpriv; u8 res =3D _SUCCESS; @@ -882,10 +887,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct= sta_info *sta, u8 unicast_ else GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false); =20 - if (unicast_key) + if (unicast_key) { memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16); - else - memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecurity= priv->dot118021XGrpKeyid].skey, 16); + } else { + u8 keyid =3D psecuritypriv->dot118021XGrpKeyid; + u8 *grpkey =3D psecuritypriv->dot118021XGrpKey[keyid].skey; + + memcpy(&psetstakey_para->key, grpkey, 16); + } =20 /* jeff: set this because at least sw key is ready */ padapter->securitypriv.busetkipkey =3D true; @@ -1107,25 +1116,26 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter) static void collect_traffic_statistics(struct adapter *padapter) { struct dvobj_priv *pdvobjpriv =3D adapter_to_dvobj(padapter); - - /* Tx */ - pdvobjpriv->traffic_stat.tx_bytes =3D padapter->xmitpriv.tx_bytes; - pdvobjpriv->traffic_stat.tx_pkts =3D padapter->xmitpriv.tx_pkts; - pdvobjpriv->traffic_stat.tx_drop =3D padapter->xmitpriv.tx_drop; - - /* Rx */ - pdvobjpriv->traffic_stat.rx_bytes =3D padapter->recvpriv.rx_bytes; - pdvobjpriv->traffic_stat.rx_pkts =3D padapter->recvpriv.rx_pkts; - pdvobjpriv->traffic_stat.rx_drop =3D padapter->recvpriv.rx_drop; - - /* Calculate throughput in last interval */ - pdvobjpriv->traffic_stat.cur_tx_bytes =3D pdvobjpriv->traffic_stat.tx_byt= es - pdvobjpriv->traffic_stat.last_tx_bytes; - pdvobjpriv->traffic_stat.cur_rx_bytes =3D pdvobjpriv->traffic_stat.rx_byt= es - pdvobjpriv->traffic_stat.last_rx_bytes; - pdvobjpriv->traffic_stat.last_tx_bytes =3D pdvobjpriv->traffic_stat.tx_by= tes; - pdvobjpriv->traffic_stat.last_rx_bytes =3D pdvobjpriv->traffic_stat.rx_by= tes; - - pdvobjpriv->traffic_stat.cur_tx_tp =3D (u32)(pdvobjpriv->traffic_stat.cur= _tx_bytes * 8 / 2 / 1024 / 1024); - pdvobjpriv->traffic_stat.cur_rx_tp =3D (u32)(pdvobjpriv->traffic_stat.cur= _rx_bytes * 8 / 2 / 1024 / 1024); + struct rtw_traffic_statistics *stats =3D &pdvobjpriv->traffic_stat; + + /* Tx */ + stats->tx_bytes =3D padapter->xmitpriv.tx_bytes; + stats->tx_pkts =3D padapter->xmitpriv.tx_pkts; + stats->tx_drop =3D padapter->xmitpriv.tx_drop; + + /* Rx */ + stats->rx_bytes =3D padapter->recvpriv.rx_bytes; + stats->rx_pkts =3D padapter->recvpriv.rx_pkts; + stats->rx_drop =3D padapter->recvpriv.rx_drop; + + /* Calculate throughput in last interval */ + stats->cur_tx_bytes =3D stats->tx_bytes - stats->last_tx_bytes; + stats->cur_rx_bytes =3D stats->rx_bytes - stats->last_rx_bytes; + stats->last_tx_bytes =3D stats->tx_bytes; + stats->last_rx_bytes =3D stats->rx_bytes; + + stats->cur_tx_tp =3D (u32)(stats->cur_tx_bytes * 8 / 2 / 1024 / 1024); + stats->cur_rx_tp =3D (u32)(stats->cur_rx_bytes * 8 / 2 / 1024 / 1024); } =20 u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) @@ -1171,27 +1181,31 @@ u8 traffic_status_watchdog(struct adapter *padapter= , u8 from_timer) } =20 /* check traffic for powersaving. */ - if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->Link= DetectInfo.NumTxOkInPeriod) > 8) || - (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) { - bEnterPS =3D false; + { + struct rt_link_detect_t *ldi =3D &pmlmepriv->LinkDetectInfo; + u32 rx_tx_sum =3D ldi->NumRxUnicastOkInPeriod + ldi->NumTxOkInPeriod; =20 - if (bBusyTraffic) { - if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount <=3D 4) - pmlmepriv->LinkDetectInfo.TrafficTransitionCount =3D 4; + if ((rx_tx_sum > 8) || (ldi->NumRxUnicastOkInPeriod > 2)) { + bEnterPS =3D false; =20 - pmlmepriv->LinkDetectInfo.TrafficTransitionCount++; + if (bBusyTraffic) { + if (ldi->TrafficTransitionCount <=3D 4) + ldi->TrafficTransitionCount =3D 4; =20 - if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount > 30/*TrafficTran= sitionLevel*/) - pmlmepriv->LinkDetectInfo.TrafficTransitionCount =3D 30; - } - } else { - if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount >=3D 2) - pmlmepriv->LinkDetectInfo.TrafficTransitionCount -=3D 2; - else - pmlmepriv->LinkDetectInfo.TrafficTransitionCount =3D 0; + ldi->TrafficTransitionCount++; + + if (ldi->TrafficTransitionCount > 30) + ldi->TrafficTransitionCount =3D 30; + } + } else { + if (ldi->TrafficTransitionCount >=3D 2) + ldi->TrafficTransitionCount -=3D 2; + else + ldi->TrafficTransitionCount =3D 0; =20 - if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount =3D=3D 0) - bEnterPS =3D true; + if (ldi->TrafficTransitionCount =3D=3D 0) + bEnterPS =3D true; + } } =20 /* LeisurePS only work in infra mode. */ @@ -1737,7 +1751,8 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, uns= igned char *pbuf) pdrvextra_cmd =3D (struct drvextra_cmd_parm *)pbuf; =20 switch (pdrvextra_cmd->ec_id) { - case DYNAMIC_CHK_WK_CID:/* only primary padapter go to this cmd, but exe= cute 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: --=20 2.52.0