From nobody Sat Apr 11 21:29:15 2026 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 40169C25B07 for ; Sat, 6 Aug 2022 11:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241762AbiHFLO1 (ORCPT ); Sat, 6 Aug 2022 07:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbiHFLOP (ORCPT ); Sat, 6 Aug 2022 07:14:15 -0400 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 161B811818 for ; Sat, 6 Aug 2022 04:14:15 -0700 (PDT) Received: from dslb-188-097-043-167.188.097.pools.vodafone-ip.de ([188.97.43.167] 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 1oKHkv-0001FX-T5; Sat, 06 Aug 2022 13:14:09 +0200 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 v2 4/5] staging: r8188eu: read aid from struct ieee80211_mgmt Date: Sat, 6 Aug 2022 13:13:51 +0200 Message-Id: <20220806111352.690650-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220806111352.690650-1-martin@kaiser.cx> References: <20220724153917.138848-1-martin@kaiser.cx> <20220806111352.690650-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 aid of the association response message from struct ieee80211_mgmt. This should be easier to understand and to review than calculating the offset manually. Remove the cast to int, aid is a u16. Keep the 0x3fff mask that is currently applied to the aid. Signed-off-by: Martin Kaiser --- v2: - rewrite the commit message drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 0a78b8bbb66a..10074355b82d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1353,8 +1353,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, str= uct recv_frame *precv_frame /* set slot time */ pmlmeinfo->slotTime =3D (pmlmeinfo->capability & BIT(10)) ? 9 : 20; =20 - /* AID */ - pmlmeinfo->aid =3D (int)(le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN= + 4)) & 0x3fff); + pmlmeinfo->aid =3D le16_to_cpu(mgmt->u.assoc_resp.aid) & 0x3fff; res =3D pmlmeinfo->aid; =20 /* following are moved to join event callback function */ --=20 2.30.2