From patchwork Sat Oct 15 15:24:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2958 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684246wrs; Sat, 15 Oct 2022 08:27:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5p1zwIipgAfbVeduaAHUOm9HrJfApnt6TZiW9uBLkZYyFfHpsR74MZdGPiCB6O55PJ/IJW X-Received: by 2002:a65:554b:0:b0:46a:f646:6374 with SMTP id t11-20020a65554b000000b0046af6466374mr3054876pgr.356.1665847639862; Sat, 15 Oct 2022 08:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847639; cv=none; d=google.com; s=arc-20160816; b=nuPR00f4kktMS56EsSe/o70oARF6eFC6ILzoT5cYiTsBORBCfbPd6mq+WQbYNbv02L gAPZK8cc49vkXEvEi44qEIL1BVxeGMFXmp+HxcXuzpUOOGYjFvZc0ydDCCFyOqg8CXkV jtU86ZaR13spB247H+iwM2ahAfoHzLMQmsIu/3YdI9Fhd3uB8E9n1/W07EZYBF0kCBK8 FUxuP2XJOQrCbrbSIxnEPqn2A78oy6o64SPX+qfAnhJtEai1+03eBFOG9bcTntyJEHjR dTgYTqzI60xiktGqF8NdVwzg/WA44YTj67s5b2UfGH1bm1q8pDfba9Ft/R/xm7y4yuT9 CsUw== 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=+O9tsDWkpMlvziEol7v6+/ak83cH1zkQGI5zBJ6WhZc=; b=x/lbZoe2zedmfcvlI8cp4xkAGn6+78rE+Esfq8eIwOx7nqPFex9eW2b9/DH6EF3Sc8 0V5IrzFgY6ME6ueiC3f9G+Uch8BzKeXt/yrfKe0AglZAcye/0cQLJ5R/OYqJa9R1l6KM VRAHbGwNxnZvIEeQ9RhuZKGp1C0a0YVssqNrpqhVebCCweIN0CQW6cy8j908wr1h9k93 KxzUmz3f0pk0uyn+skSs/ESnZe7kpA6Hc3HwgrID1Z7FB88fl9fA2GQsLJW1k+0LZm4U H3ll5+VWVx1tNUAz2JsN/AojXAtpVhHGOLKx8iTW7f5yZ5zskBa0kDbrIIweh3CIVjKI s8QQ== 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 k69-20020a633d48000000b0046b2f9a5040si3554469pga.545.2022.10.15.08.27.07; Sat, 15 Oct 2022 08:27:19 -0700 (PDT) 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 S229827AbiJOPZK (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiJOPZF (ORCPT ); Sat, 15 Oct 2022 11:25:05 -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 22B4815A04 for ; Sat, 15 Oct 2022 08:24:56 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1u-000722-Rn; Sat, 15 Oct 2022 17:24:50 +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 2/9] staging: r8188eu: get reason code from mgmt struct Date: Sat, 15 Oct 2022 17:24:33 +0200 Message-Id: <20221015152440.232281-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-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?1746767854648387546?= X-GMAIL-MSGID: =?utf-8?q?1746767854648387546?= Read the deauth reson code from the newly added mgmt structure instead of calculating the offset ourselves. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 0c4b3b99150d..5c59fc91ecae 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1473,7 +1473,7 @@ unsigned int OnDeAuth(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;