Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2279095rdb; Thu, 21 Sep 2023 13:53:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXcEV1Uo0jTYxqg77j/em6qa0VDtCOZEAd7Jw5Fi/NpDrhzYu8LNt6V77CtSJUAPChYInf X-Received: by 2002:a25:da8a:0:b0:d81:4ebc:242e with SMTP id n132-20020a25da8a000000b00d814ebc242emr6393105ybf.45.1695329604693; Thu, 21 Sep 2023 13:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695329604; cv=none; d=google.com; s=arc-20160816; b=tysaxLd7nMxa0IM/sllBI2uEUIV2xyB74QbkMQS4xZauqp7WxEwtFO9T0X2JMd6RE3 1y3piLyS/atvlYwr3MYBtIiiDZeixWs8E2VRZimjGEWjGaVYlD97uR0w5rS8Cc9bzljD +xOMcUqjayl60nB4Ep19Y6dPfDoWOX5VfBtz9pqSUS7ckV5WCxWvEpPheSVy2qD2Nair k2uSacTWM4DmqWsOvGlxSP21rWCjDRPRrH4AlqnvtWxf/S6UMiQyePqFo/iZuoRnz6cJ DEe9h951wkrD2gEccWGwYLQDjxnRK+LnPEKjSKdBFPb/F1tbJYTlp8pt9NNaBwp99A7U vpIA== 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 :message-id:date:subject:to:from:dkim-signature; bh=H4oZQOsqSRYHINWYGOgZgDL1uvm2SVUKaVUh+Us9cMU=; fh=qW0phhq3fb3oiohK/Mu9j1KY1zyRNiiioKFc5anvatM=; b=M5bDgIMCyTJ/Viz+JRjG/WAJ18m3IYA9o4aGaH+qKf6aFXImQHeT/ul5RP05FThQ1f u6oS5+B+lkP0PdAsilgcpsBwiyo94XPFnc+kURTiDBAyDmwDNGCLejsEgOE+nKmG8nk4 E79jH7fSZeN5azU/9k7zPvtU8VvgdhItiAhOy4SrtSTlvkpbRu7OU0JWu8KPgupwOYW6 o5nUxyf4KGq1cYOXmr4Bl0Yni2eRuvx5+eJ1MAUlmmAs6xj6W+j3X4VAEZdRHM29ZtXs 1RLhFq/TpggAS4cRY3teRNVxCJQmW2zsYOvNMvCLIbh/zntyZeeUIE5bN5fQ24znWwtE t1nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=d3Evum5F; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y8-20020a63ce08000000b00578af1e2f3csi2244467pgf.426.2023.09.21.13.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 13:53:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=d3Evum5F; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B1387801C01E; Thu, 21 Sep 2023 13:11:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbjIUULf (ORCPT + 56 others); Thu, 21 Sep 2023 16:11:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230315AbjIUULX (ORCPT ); Thu, 21 Sep 2023 16:11:23 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED687B94D for ; Thu, 21 Sep 2023 12:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=H4oZQOsqSRYHINWYGOgZgDL1uvm2SVUKaVUh+Us9cMU=; b=d3Evum5Fjr6rK2gO+byn1WhNLt GhItIUEOcniUyYs2hq3zzaMpOVtNRMAffq2u/zuvTBq5klCPjiRxmSqPd3xuJ5HYrlBbW0X5naAO9 /ytGoiRBoCZ/mJogZuXpbUH5QW5XET+d1IpHoY/y98PllU8NM9lyX00ujWUJi5yDWvk8=; Received: from p54ae986d.dip0.t-ipconnect.de ([84.174.152.109] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjEbm-005Auc-DH for linux-wireless@vger.kernel.org; Thu, 21 Sep 2023 10:00:22 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH] wifi: mt76: mt7915 add tc offloading support Date: Thu, 21 Sep 2023 10:00:21 +0200 Message-ID: <20230921080021.18016-1-nbd@nbd.name> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:11:35 -0700 (PDT) This is used for offloading flows from WLAN to Ethernet, or from WLAN to WLAN Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 3 +++ drivers/net/wireless/mediatek/mt76/mt7915/main.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index f4d77eba7191..81478289f17e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -344,6 +344,9 @@ mt7915_init_wiphy(struct mt7915_phy *phy) hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; hw->netdev_features = NETIF_F_RXCSUM; + if (mtk_wed_device_active(&mdev->mmio.wed)) + hw->netdev_features |= NETIF_F_HW_TC; + hw->radiotap_timestamp.units_pos = IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US; diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index d527ab28d4ef..a3fd54cc1911 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -1653,6 +1653,20 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw, return 0; } + +static int +mt7915_net_setup_tc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct net_device *netdev, enum tc_setup_type type, + void *type_data) +{ + struct mt7915_dev *dev = mt7915_hw_dev(hw); + struct mtk_wed_device *wed = &dev->mt76.mmio.wed; + + if (!mtk_wed_device_active(wed)) + return -EOPNOTSUPP; + + return mtk_wed_device_setup_tc(wed, netdev, type, type_data); +} #endif const struct ieee80211_ops mt7915_ops = { @@ -1707,5 +1721,6 @@ const struct ieee80211_ops mt7915_ops = { .set_radar_background = mt7915_set_radar_background, #ifdef CONFIG_NET_MEDIATEK_SOC_WED .net_fill_forward_path = mt7915_net_fill_forward_path, + .net_setup_tc = mt7915_net_setup_tc, #endif }; -- 2.41.0