From nobody Fri Sep 19 08:39:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5542C4321E for ; Sat, 26 Nov 2022 16:01:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiKZQBt (ORCPT ); Sat, 26 Nov 2022 11:01:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbiKZQBl (ORCPT ); Sat, 26 Nov 2022 11:01:41 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11593193E2 for ; Sat, 26 Nov 2022 08:01:41 -0800 (PST) Received: from dslb-188-096-151-149.188.096.pools.vodafone-ip.de ([188.96.151.149] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1oyxcV-0000Ub-Jx; Sat, 26 Nov 2022 17:01:35 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 02/10] staging: r8188eu: read timestamp from ieee80211_mgmt Date: Sat, 26 Nov 2022 17:01:21 +0100 Message-Id: <20221126160129.178697-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126160129.178697-1-martin@kaiser.cx> References: <20221126160129.178697-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Read the 64-bit timestamp from struct ieee80211_mgmt instead of parsing the beacon message ourselves. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 80342b53a129..66e3a90da3a3 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -389,21 +389,6 @@ static u32 p2p_listen_state_process(struct adapter *pa= dapter, unsigned char *da) return _SUCCESS; } =20 -static void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe) -{ - u8 *pIE; - __le32 *pbuf; - - pIE =3D pframe + sizeof(struct ieee80211_hdr_3addr); - pbuf =3D (__le32 *)pIE; - - pmlmeext->TSFValue =3D le32_to_cpu(*(pbuf + 1)); - - pmlmeext->TSFValue =3D pmlmeext->TSFValue << 32; - - pmlmeext->TSFValue |=3D le32_to_cpu(*pbuf); -} - static void correct_TSF(struct adapter *padapter) { u8 reg; @@ -592,8 +577,7 @@ static void OnBeacon(struct adapter *padapter, struct r= ecv_frame *precv_frame) /* check the vendor of the assoc AP */ pmlmeinfo->assoc_AP_vendor =3D check_assoc_AP(pframe + sizeof(struct ie= ee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr)); =20 - /* update TSF Value */ - update_TSF(pmlmeext, pframe); + pmlmeext->TSFValue =3D le64_to_cpu(mgmt->u.beacon.timestamp); =20 /* start auth */ start_clnt_auth(padapter); @@ -635,8 +619,7 @@ static void OnBeacon(struct adapter *padapter, struct r= ecv_frame *precv_frame) return; } =20 - /* update TSF Value */ - update_TSF(pmlmeext, pframe); + pmlmeext->TSFValue =3D le64_to_cpu(mgmt->u.beacon.timestamp); =20 /* report sta add event */ report_add_sta_event(padapter, GetAddr2Ptr(pframe), cam_idx); --=20 2.30.2