Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp754957pxb; Thu, 30 Sep 2021 17:00:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC3bI4etIN2Ypn9B9rb4K+N/BDZvI2NN46z2P6vbYKCZ+RDuBLtN/N/hwQTuERD155WYAK X-Received: by 2002:a17:90a:5d11:: with SMTP id s17mr173145pji.230.1633046403605; Thu, 30 Sep 2021 17:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633046403; cv=none; d=google.com; s=arc-20160816; b=n+0Pm98mh1gNr5UlaeS5WwkMjTYs/HPU7Ds0IlsQ+fKniSL5DIKdANUhRG0GRBdg4E nET0knoxnWLkaRAQBkHNTeKS+hn9EtItNIVuniMkclQJQt+xwICM6wBk/AGoe0xEUjOj O462qcm5L0HpMHBBmhROlXVU44plQ/kohqQNiVx5WoibSDqzE/piWYgj/+pY3uSoQ89z oOzLAdK3rJRoHK0TBXCKhICvfyuOqYCqs878t2aEB3qNmFXH/SVfIUM8fMOQPdXIivXs z7are4ZYPU7RZ84RNdwaF3GCGI4hy5Dk0FOpOR8ZPgrKA+WojWn9w+K6NIJOn44q4Zit sIww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=KOgQ6QuY+EInS5PxxSUkAYnduHygdpt7xFFRCeSYh5E=; b=H7F+euRAktXiMigwKBHFujb3zPh+2KZqmxzKnRTlqCai4bT04rPT4aayJ78IGDrMFp KJ+Vh8165DOxDopg5yJm3/PxKy203tbrEYOGW886uBQR6BORT+oPtqTHx4xE4Uxbfpu1 ArHhtE+lY1+loe2+C3JadcBMzHwVD1soqgz/tqV0xGFPCdWXsT2fJPH5E3b6Qz7E944+ S/FKRvyLUDpQJcwhXJhI0zDjwC5yzSe7vzATjSuzN9bF2WV8J6LxL7ygkr3Mvm2XZdmm OYKPNg1gDrIO3RFq9gK311TyqC+eIDnRuiy40/K7l/Aa3dEmXDjj1hGeSk9x8wXqqEW2 w+CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c84si5458452pfb.156.2021.09.30.16.59.52; Thu, 30 Sep 2021 17:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350905AbhJAAAU (ORCPT + 78 others); Thu, 30 Sep 2021 20:00:20 -0400 Received: from mailgw01.mediatek.com ([216.200.240.184]:59473 "EHLO mailgw01.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350800AbhJAAAS (ORCPT ); Thu, 30 Sep 2021 20:00:18 -0400 X-UUID: 3378a53a251e48259c54e677e306a858-20210930 X-UUID: 3378a53a251e48259c54e677e306a858-20210930 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1570592269; Thu, 30 Sep 2021 16:58:28 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Sep 2021 16:48:37 -0700 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 1 Oct 2021 07:48:37 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 08/16] mt76: mt7921: make all event parser reusable between mt7921s and mt7921e Date: Fri, 1 Oct 2021 07:47:55 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang The longer event such as the event for mcu_get_nic_capability would hold the data in paged fragment skb for the SDIO device so we turn the skb to be linearized skb before accessing it to reuse the same event parser betweem mt7921s and mt7921e. Tested-by: Deren Wu Acked-by: Lorenzo Bianconi Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index 95f7866b3d57..94d6c3935fb2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -455,7 +455,12 @@ mt7921_mcu_rx_unsolicited_event(struct mt7921_dev *dev, struct sk_buff *skb) void mt7921_mcu_rx_event(struct mt7921_dev *dev, struct sk_buff *skb) { - struct mt7921_mcu_rxd *rxd = (struct mt7921_mcu_rxd *)skb->data; + struct mt7921_mcu_rxd *rxd; + + if (skb_linearize(skb)) + return; + + rxd = (struct mt7921_mcu_rxd *)skb->data; if (rxd->eid == 0x6) { mt76_mcu_rx_event(&dev->mt76, skb); -- 2.25.1