Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2887750pxb; Tue, 12 Oct 2021 15:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3b/igKv+Ze6j0EHneFk1DTaB3CHycdYABggtqRDlCfRgKsZ5fK2ppCCcoQpvc0HrgUhCb X-Received: by 2002:a17:90b:1d0a:: with SMTP id on10mr9189215pjb.218.1634079184145; Tue, 12 Oct 2021 15:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634079184; cv=none; d=google.com; s=arc-20160816; b=055McMgkvTBzPRG9ZjIYOucW3rYf3FpdvtHSnWTJk+3rL6DM1XjLL/7iwwf5O/tgyH lcdY0Ov+xy4ow+5gGKswfisnRgLcbhSVYCDHRsrhoxrDHY+LFIMJQEtFyV64VgK/IOpu adnyGnDekpCA24B3ZAL4ZPnKe/718DplgVOhXMImcC46Hl0v74oZ05W9p4q/eyzExReY ZK4VOdfdiKGRhzsgCHDOhkOm98PtAsOoGQeAQTu4MLBbePToJOzaXcXW8LL8fSkOoSpN YT93TwDmSWkoanNQq16UP5yRfQ6A/DJN1AiP687LLBocehwucxrHFjr3wBex2FDNXb01 YEDA== 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=PpoagddNQVQlebIMwwSzqytfwtJUqFRg2cGZA1/drv015uTXzlD1f1WPd1ZzlIDPmt qYD/kFu97056kvPkHkA7NILEkVCzSiZ7gs3kAahNWQAcxUTZJjKo9OwfWnlX146NCJnB rnmHEdUNfvhkMt4GVtfMEk8vyEc9vQ78L2w2TWcxBsczY1DW1lqQKfUFJ9W3AHBHFE3k VeZuWSDil3XT7oN5UQ/EoutxFv19aMHboIxAN7taY98CZ7GL0I8noULAQVJG+YpXdK2k wcBcP95KVpaj65OqoeW/o4tIshhiWuuQgVbEAhDK8Cmqbqb68kiW8sm04RSXn+p3ychK xg7g== 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 r138si19144149pfc.109.2021.10.12.15.52.53; Tue, 12 Oct 2021 15:53:04 -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 S235737AbhJLWyv (ORCPT + 63 others); Tue, 12 Oct 2021 18:54:51 -0400 Received: from mailgw01.mediatek.com ([216.200.240.184]:36863 "EHLO mailgw01.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234280AbhJLWyu (ORCPT ); Tue, 12 Oct 2021 18:54:50 -0400 X-UUID: ab5806838e1346a3a9698afff32403c1-20211012 X-UUID: ab5806838e1346a3a9698afff32403c1-20211012 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 513222422; Tue, 12 Oct 2021 15:52:41 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 12 Oct 2021 15:52:39 -0700 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 13 Oct 2021 06:52:39 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 08/16] mt76: mt7921: make all event parser reusable between mt7921s and mt7921e Date: Wed, 13 Oct 2021 06:52:01 +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