Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1492818rwb; Tue, 29 Nov 2022 14:30:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf4OwrpC+MmOojljvLbdViNaF6FfZaAkIwpyka/ruFjVNZ8z6hBOj51tEJsRfoZ7xos11zcM X-Received: by 2002:a17:907:75c7:b0:7c0:8371:97a9 with SMTP id jl7-20020a17090775c700b007c0837197a9mr5440545ejc.583.1669761048226; Tue, 29 Nov 2022 14:30:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669761048; cv=none; d=google.com; s=arc-20160816; b=Z1/J/sUe6HDN8uKQDwFXcTUG2hDWWmys/sup8sgzhBFf0olyMpvD2O87ePasXjJIgm s0+8wrO4RpXk2ClD1wPk/gATFGy2dIg8G6MQwDnf6W/kNbeHsT4sR26gcHNgnE1cwKWJ k5MccmGpAPRUgDVJ3YNB52o6hfVjF3lWYu54eIe14bBSDnuk7ZmtCHW7SZ3ZEi0DJf2c kVx2UeDBawC8hxXNHKOMR68wUeMyWQ7X+uQdCmYjduT68FjkcmnHEUOAn7PFC1zoMSMg AQz1pH0doYlQ2/vjFlsM8BFvwwa4JZ7zVSFY47uDQZSJQNhHXuWXfCbUSNPUFrbWfIZj Y3GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lNeTLQb2dpzxBJbemZXySm0yXayZjnijU2hhhaUXrxk=; b=oluf1/DO42+aQnR/9C7Cp/Q4YQpX4NsjFu07yC8zHyaurnai51VtzCT/Wg/aiYuHdC u9j/zBUrrrrnM9wNiukiXM3Kw1ZYzZVU3YbtVA4BaetlAzx3lmi8h7jid/5nUjpVg+c9 G4syUdMk48WLdHroNYjDvBIPMpEBmOarKe1TSS61HqM8MwY5Np6aAwZ8okC+DL+5Sg0v B0zNRKIM9i2cBoI1YX+/ZhzjLjPZbbYfteExFVNorRo5HdKVSFOCT4IemJJ9T2gwJueo 2xDOeF8+jAWShxGiEdQoK2hLNE8GPFdEifMnli2vlf6Sf9hKsmFsI7JGNcZ4Jv4tlLwq EKZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a1709064fc500b0078d148daf4bsi14833459ejw.409.2022.11.29.14.30.27; Tue, 29 Nov 2022 14:30:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236567AbiK2Uw0 (ORCPT + 84 others); Tue, 29 Nov 2022 15:52:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236607AbiK2UwV (ORCPT ); Tue, 29 Nov 2022 15:52:21 -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 5925A1B788 for ; Tue, 29 Nov 2022 12:52:20 -0800 (PST) Received: from dslb-188-104-061-001.188.104.pools.vodafone-ip.de ([188.104.61.1] 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 1p07aQ-0001pO-3E; Tue, 29 Nov 2022 21:52:14 +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 2/5] staging: r8188eu: read reason code from ieee80211_mgmt Date: Tue, 29 Nov 2022 21:51:49 +0100 Message-Id: <20221129205152.128172-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221129205152.128172-1-martin@kaiser.cx> References: <20221129205152.128172-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the struct ieee80211_mgmt to read the reason code instead of parsing the message manually. Remove the pframe pointer, it's no longer used. Signed-off-by: Martin Kaiser --- 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 b2b2cb57ed04..fe58d4e3e260 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1432,7 +1432,6 @@ static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; - u8 *pframe = precv_frame->rx_data; struct wifidirect_info *pwdinfo = &padapter->wdinfo; if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) @@ -1443,7 +1442,7 @@ static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) _set_timer(&pwdinfo->reset_ch_sitesurvey, 10); } - reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); + reason = le16_to_cpu(mgmt->u.disassoc.reason_code); if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { struct sta_info *psta; -- 2.30.2