From patchwork Tue Nov 29 20:51:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 27504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp567331wrr; Tue, 29 Nov 2022 13:06:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5NpEN3bZqkUEm6HniBqftqGdVTn5GyfHAbUYq6wqw952i4nn1CPL8DzXhswjwHGCXbJvic X-Received: by 2002:a17:906:d211:b0:79d:f5f2:6f55 with SMTP id w17-20020a170906d21100b0079df5f26f55mr31321744ejz.531.1669755985264; Tue, 29 Nov 2022 13:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669755985; cv=none; d=google.com; s=arc-20160816; b=LYMOM64q86POKNns3cXdDCUnqX9ocY5S+u5DkN+SAgs8hfJorWJ7lZhR06PJi04WpJ idkkoVzWBFBNYRhG/18o5HrvN+UO/b5UOu2uP7ySAHHNqhhmzQDSdeGrJwB5pDYUbEIE owS5iWv1RZmFGRLGqCop1rELqpFRxbPdxujf83Le2z9YwXNGzn6Wtja3vdlPg7r+dQH/ FGE6aZHTwDzdQFX7yZgJhWGLsDNuLVmAoh7Kp2zh6OHpTPNdpgHa5z9C5gvfrDWULPnk at0IEoWGteaOyLWUonGNm7zeGEQb5POOPoTHnDcoQ/4MPUQ+Pq9+YsquvlqCe1eqNHOd a0Sw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a056402354a00b00469c73c9605si14232604edd.269.2022.11.29.13.05.58; Tue, 29 Nov 2022 13:06:25 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750866052014379929?= X-GMAIL-MSGID: =?utf-8?q?1750866052014379929?= 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;