From patchwork Tue Oct 15 09:09:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Furong Xu <0x1207@gmail.com> X-Patchwork-Id: 13835963 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C7A61DE2A9; Tue, 15 Oct 2024 09:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728983412; cv=none; b=ZrmkAXHtPJRiTsFzXHaCwX3doAJxwXfIvY9PgNj63BlaAXueDYm04s3PZyR8GfTq2qQB6GXnl7rEiG1PxQ7MEUI/OG92VSgqsimlAqJ5yBIdvKinBLZuPrEvSK2WZeNWFmkCtYKA7tnSkqZi+qEeIH6yZ5fZk8sKzqeeRRk/+Zs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728983412; c=relaxed/simple; bh=ilBybk8ERyLhCaAO5qqAT3Qyj0+TzcvuH3QdQoDJAEQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HQyPyXPa7++3BXtcuvH0Aa8xO7bOFhEPNjNuL4M43stXb6aQdWUekvi0Kkb6RO5q+qOd/b00/Fb8R2FlxFzMM/wgpYHBxeADORuzNsejUaVGwvO6gKaZ/1jcjXt2CjNtzf1SsJcxmwHAMmBqaOj/h6kxsFCtW6gmjF2wmUxvdaQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aFLDSgWf; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aFLDSgWf" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-20c714cd9c8so39809735ad.0; Tue, 15 Oct 2024 02:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728983409; x=1729588209; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w9AYwbn4eXyLAVKgloTmHLzZBFaB+et4kmtIlrq0lDo=; b=aFLDSgWfe9hROPF60EUf6D7MG99tIdoIjrv1Nt/Ueq1NUNfKjqEca16wYSBimf50LS AR3FuAqfOuN4mVtEJQ3KlVenwZ6tBkGp5jUkUSTFwTVqI9H0YNq6AOsBrgFmSApTj38u vNNes7oJySPAgBzf6duKycksEjvpv7b+AK1BlV04rP8siGYtjkO6ouvXcSxpe0MJr2N3 svT3b/ZT5+c3gGuShDJmThNhYWbdLzlAEeCMT65SEkXrYJeQuBCD4aLYEQSzs2P11JFA GKtz+dSYKCz2J+hevjNUDy8rKY0cZ4zbSeIrQqsxtvsYlrTPUL4Qx4eYQbHo9JfhNWSX AQdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728983409; x=1729588209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w9AYwbn4eXyLAVKgloTmHLzZBFaB+et4kmtIlrq0lDo=; b=i4qT3NOTHrliRPHUHKtd+ksEBWXpZlE0wMNtz3++tNpKe9cS/cvMm9WhS1AI1quWoD KYJOn7uTFFXMLY4mHFx/DOI/itqQWELDUJ2y4KtRf5W+ckCa9kKVuW4vPBL/QnzQUwKG ONetF3orkliQVkrKfJSqWAS7suYNdHtJzIpZ+QjyohS8B7EH/+QKQFa10CtzCK15Sx4G nE4xS7Ray4p56A5Gtalbz+by3o27a6maOsLm54s91+rA6si35f+gsAAvY4bgj6aXvgv6 hMlmcl3GWA+fg7TthDAOoZiV+HafjCXe3269rZsbMpUfmseio2sK2Xi3PcWPHOEwLqm8 ajOQ== X-Forwarded-Encrypted: i=1; AJvYcCWbpt79ku0K7gFzFpKobEwQ6UC9X8F3PYMrfXWj5zqerkZjugGHZQu7C21XwdJhs1b0nHLK03PnxFyv7TU=@vger.kernel.org X-Gm-Message-State: AOJu0YxF8c61tAeUPTy4e2BfTRQ+CdHCGfh7HHsfEgfdYGdgTX6GOm99 gnNC7x70k1O+93mDgchvsOR5kttrWs0IAWM/ifZAnA4yiAGebYzsqi1ntg== X-Google-Smtp-Source: AGHT+IFD0kBS+t2LBFgfwcGjcXIxjOpgkvhMDhP1tNyRVn7WGg3sqZ3o/93O7uQlVVIUBEU/20HGag== X-Received: by 2002:a17:902:dacf:b0:20c:b090:c87 with SMTP id d9443c01a7336-20cbb1a9856mr139278615ad.29.1728983408492; Tue, 15 Oct 2024 02:10:08 -0700 (PDT) Received: from localhost.localdomain ([129.146.253.192]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-20d17ec8f35sm7905095ad.0.2024.10.15.02.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 02:10:08 -0700 (PDT) From: Furong Xu <0x1207@gmail.com> To: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Vladimir Oltean , Andrew Lunn , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , xfr@outlook.com, Furong Xu <0x1207@gmail.com> Subject: [PATCH net-next v1 2/5] net: stmmac: Introduce stmmac_fpe_ops for gmac4 and xgmac Date: Tue, 15 Oct 2024 17:09:23 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org By moving FPE function callbacks from stmmac_ops to stmmac_fpe_ops, FPE implementation becomes a separate module completely, like the EST implementation. Signed-off-by: Furong Xu <0x1207@gmail.com> Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/common.h | 1 + .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 13 ----- .../ethernet/stmicro/stmmac/dwxgmac2_core.c | 3 -- drivers/net/ethernet/stmicro/stmmac/hwif.c | 7 +++ drivers/net/ethernet/stmicro/stmmac/hwif.h | 54 ++++++++++--------- .../net/ethernet/stmicro/stmmac/stmmac_fpe.c | 44 ++++++++++----- .../net/ethernet/stmicro/stmmac/stmmac_fpe.h | 16 ------ 7 files changed, 69 insertions(+), 69 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index 684489156dce..a6e6ef687f36 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h @@ -592,6 +592,7 @@ struct mac_device_info { const struct stmmac_tc_ops *tc; const struct stmmac_mmc_ops *mmc; const struct stmmac_est_ops *est; + const struct stmmac_fpe_ops *fpe; struct dw_xpcs *xpcs; struct phylink_pcs *phylink_pcs; struct mii_regs mii; /* MII register Addresses */ diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 4d217926820a..1c45b7c1660f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -16,7 +16,6 @@ #include #include #include "stmmac.h" -#include "stmmac_fpe.h" #include "stmmac_pcs.h" #include "dwmac4.h" #include "dwmac5.h" @@ -1262,12 +1261,6 @@ const struct stmmac_ops dwmac410_ops = { .set_arp_offload = dwmac4_set_arp_offload, .config_l3_filter = dwmac4_config_l3_filter, .config_l4_filter = dwmac4_config_l4_filter, - .fpe_configure = dwmac5_fpe_configure, - .fpe_send_mpacket = dwmac5_fpe_send_mpacket, - .fpe_irq_status = dwmac5_fpe_irq_status, - .fpe_get_add_frag_size = dwmac5_fpe_get_add_frag_size, - .fpe_set_add_frag_size = dwmac5_fpe_set_add_frag_size, - .fpe_map_preemption_class = dwmac5_fpe_map_preemption_class, .add_hw_vlan_rx_fltr = dwmac4_add_hw_vlan_rx_fltr, .del_hw_vlan_rx_fltr = dwmac4_del_hw_vlan_rx_fltr, .restore_hw_vlan_rx_fltr = dwmac4_restore_hw_vlan_rx_fltr, @@ -1317,12 +1310,6 @@ const struct stmmac_ops dwmac510_ops = { .set_arp_offload = dwmac4_set_arp_offload, .config_l3_filter = dwmac4_config_l3_filter, .config_l4_filter = dwmac4_config_l4_filter, - .fpe_configure = dwmac5_fpe_configure, - .fpe_send_mpacket = dwmac5_fpe_send_mpacket, - .fpe_irq_status = dwmac5_fpe_irq_status, - .fpe_get_add_frag_size = dwmac5_fpe_get_add_frag_size, - .fpe_set_add_frag_size = dwmac5_fpe_set_add_frag_size, - .fpe_map_preemption_class = dwmac5_fpe_map_preemption_class, .add_hw_vlan_rx_fltr = dwmac4_add_hw_vlan_rx_fltr, .del_hw_vlan_rx_fltr = dwmac4_del_hw_vlan_rx_fltr, .restore_hw_vlan_rx_fltr = dwmac4_restore_hw_vlan_rx_fltr, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index 111ba5a524ed..ce2cbae15973 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -8,7 +8,6 @@ #include #include #include "stmmac.h" -#include "stmmac_fpe.h" #include "stmmac_ptp.h" #include "dwxlgmac2.h" #include "dwxgmac2.h" @@ -1545,7 +1544,6 @@ const struct stmmac_ops dwxgmac210_ops = { .config_l3_filter = dwxgmac2_config_l3_filter, .config_l4_filter = dwxgmac2_config_l4_filter, .set_arp_offload = dwxgmac2_set_arp_offload, - .fpe_configure = dwxgmac3_fpe_configure, }; static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode, @@ -1602,7 +1600,6 @@ const struct stmmac_ops dwxlgmac2_ops = { .config_l3_filter = dwxgmac2_config_l3_filter, .config_l4_filter = dwxgmac2_config_l4_filter, .set_arp_offload = dwxgmac2_set_arp_offload, - .fpe_configure = dwxgmac3_fpe_configure, }; int dwxgmac2_setup(struct stmmac_priv *priv) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c index 88cce28b2f98..5969963d132b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c @@ -116,6 +116,7 @@ static const struct stmmac_hwif_entry { const void *tc; const void *mmc; const void *est; + const void *fpe; int (*setup)(struct stmmac_priv *priv); int (*quirks)(struct stmmac_priv *priv); } stmmac_hw[] = { @@ -194,6 +195,7 @@ static const struct stmmac_hwif_entry { .tc = &dwmac510_tc_ops, .mmc = &dwmac_mmc_ops, .est = &dwmac510_est_ops, + .fpe = &dwmac5_fpe_ops, .setup = dwmac4_setup, .quirks = NULL, }, { @@ -214,6 +216,7 @@ static const struct stmmac_hwif_entry { .tc = &dwmac510_tc_ops, .mmc = &dwmac_mmc_ops, .est = &dwmac510_est_ops, + .fpe = &dwmac5_fpe_ops, .setup = dwmac4_setup, .quirks = NULL, }, { @@ -234,6 +237,7 @@ static const struct stmmac_hwif_entry { .tc = &dwmac510_tc_ops, .mmc = &dwmac_mmc_ops, .est = &dwmac510_est_ops, + .fpe = &dwmac5_fpe_ops, .setup = dwmac4_setup, .quirks = NULL, }, { @@ -255,6 +259,7 @@ static const struct stmmac_hwif_entry { .tc = &dwxgmac_tc_ops, .mmc = &dwxgmac_mmc_ops, .est = &dwmac510_est_ops, + .fpe = &dwxgmac_fpe_ops, .setup = dwxgmac2_setup, .quirks = NULL, }, { @@ -276,6 +281,7 @@ static const struct stmmac_hwif_entry { .tc = &dwxgmac_tc_ops, .mmc = &dwxgmac_mmc_ops, .est = &dwmac510_est_ops, + .fpe = &dwxgmac_fpe_ops, .setup = dwxlgmac2_setup, .quirks = stmmac_dwxlgmac_quirks, }, @@ -351,6 +357,7 @@ int stmmac_hwif_init(struct stmmac_priv *priv) mac->tc = mac->tc ? : entry->tc; mac->mmc = mac->mmc ? : entry->mmc; mac->est = mac->est ? : entry->est; + mac->fpe = mac->fpe ? : entry->fpe; priv->hw = mac; priv->ptpaddr = priv->ioaddr + entry->regs.ptp_off; diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index d5a9f01ecac5..2f069657d9d5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -420,18 +420,6 @@ struct stmmac_ops { bool en, bool udp, bool sa, bool inv, u32 match); void (*set_arp_offload)(struct mac_device_info *hw, bool en, u32 addr); - void (*fpe_configure)(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, - u32 num_txq, u32 num_rxq, - bool tx_enable, bool pmac_enable); - void (*fpe_send_mpacket)(void __iomem *ioaddr, - struct stmmac_fpe_cfg *cfg, - enum stmmac_mpacket_type type); - int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device *dev); - int (*fpe_get_add_frag_size)(const void __iomem *ioaddr); - void (*fpe_set_add_frag_size)(void __iomem *ioaddr, u32 add_frag_size); - int (*fpe_map_preemption_class)(struct net_device *ndev, - struct netlink_ext_ack *extack, - u32 pclass); }; #define stmmac_core_init(__priv, __args...) \ @@ -530,18 +518,6 @@ struct stmmac_ops { stmmac_do_callback(__priv, mac, config_l4_filter, __args) #define stmmac_set_arp_offload(__priv, __args...) \ stmmac_do_void_callback(__priv, mac, set_arp_offload, __args) -#define stmmac_fpe_configure(__priv, __args...) \ - stmmac_do_void_callback(__priv, mac, fpe_configure, __args) -#define stmmac_fpe_send_mpacket(__priv, __args...) \ - stmmac_do_void_callback(__priv, mac, fpe_send_mpacket, __args) -#define stmmac_fpe_irq_status(__priv, __args...) \ - stmmac_do_callback(__priv, mac, fpe_irq_status, __args) -#define stmmac_fpe_get_add_frag_size(__priv, __args...) \ - stmmac_do_callback(__priv, mac, fpe_get_add_frag_size, __args) -#define stmmac_fpe_set_add_frag_size(__priv, __args...) \ - stmmac_do_void_callback(__priv, mac, fpe_set_add_frag_size, __args) -#define stmmac_fpe_map_preemption_class(__priv, __args...) \ - stmmac_do_void_callback(__priv, mac, fpe_map_preemption_class, __args) /* PTP and HW Timer helpers */ struct stmmac_hwtimestamp { @@ -677,6 +653,34 @@ struct stmmac_est_ops { #define stmmac_est_irq_status(__priv, __args...) \ stmmac_do_void_callback(__priv, est, irq_status, __args) +struct stmmac_fpe_ops { + void (*fpe_configure)(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, + bool tx_enable, bool pmac_enable); + void (*fpe_send_mpacket)(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, + enum stmmac_mpacket_type type); + int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device *dev); + int (*fpe_get_add_frag_size)(const void __iomem *ioaddr); + void (*fpe_set_add_frag_size)(void __iomem *ioaddr, u32 add_frag_size); + int (*fpe_map_preemption_class)(struct net_device *ndev, + struct netlink_ext_ack *extack, + u32 pclass); +}; + +#define stmmac_fpe_configure(__priv, __args...) \ + stmmac_do_void_callback(__priv, fpe, fpe_configure, __args) +#define stmmac_fpe_send_mpacket(__priv, __args...) \ + stmmac_do_void_callback(__priv, fpe, fpe_send_mpacket, __args) +#define stmmac_fpe_irq_status(__priv, __args...) \ + stmmac_do_callback(__priv, fpe, fpe_irq_status, __args) +#define stmmac_fpe_get_add_frag_size(__priv, __args...) \ + stmmac_do_callback(__priv, fpe, fpe_get_add_frag_size, __args) +#define stmmac_fpe_set_add_frag_size(__priv, __args...) \ + stmmac_do_void_callback(__priv, fpe, fpe_set_add_frag_size, __args) +#define stmmac_fpe_map_preemption_class(__priv, __args...) \ + stmmac_do_void_callback(__priv, fpe, fpe_map_preemption_class, __args) + struct stmmac_regs_off { u32 ptp_off; u32 mmc_off; @@ -702,6 +706,8 @@ extern const struct stmmac_desc_ops dwxgmac210_desc_ops; extern const struct stmmac_mmc_ops dwmac_mmc_ops; extern const struct stmmac_mmc_ops dwxgmac_mmc_ops; extern const struct stmmac_est_ops dwmac510_est_ops; +extern const struct stmmac_fpe_ops dwmac5_fpe_ops; +extern const struct stmmac_fpe_ops dwxgmac_fpe_ops; #define GMAC_VERSION 0x00000020 /* GMAC CORE Version */ #define GMAC4_VERSION 0x00000110 /* GMAC4+ CORE Version */ diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c index 3187eaea7503..c01eb7243d56 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c @@ -160,9 +160,10 @@ void stmmac_fpe_apply(struct stmmac_priv *priv) } } -void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, - u32 num_txq, u32 num_rxq, - bool tx_enable, bool pmac_enable) +static void dwmac5_fpe_configure(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, + bool tx_enable, bool pmac_enable) { u32 value; @@ -193,7 +194,7 @@ void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, writel(value, ioaddr + GMAC_INT_EN); } -int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev) +static int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev) { u32 value; int status; @@ -228,8 +229,9 @@ int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev) return status; } -void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, - enum stmmac_mpacket_type type) +static void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, + enum stmmac_mpacket_type type) { u32 value = cfg->fpe_csr; @@ -241,12 +243,13 @@ void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, writel(value, ioaddr + MAC_FPE_CTRL_STS); } -int dwmac5_fpe_get_add_frag_size(const void __iomem *ioaddr) +static int dwmac5_fpe_get_add_frag_size(const void __iomem *ioaddr) { return FIELD_GET(DWMAC5_ADD_FRAG_SZ, readl(ioaddr + MTL_FPE_CTRL_STS)); } -void dwmac5_fpe_set_add_frag_size(void __iomem *ioaddr, u32 add_frag_size) +static void dwmac5_fpe_set_add_frag_size(void __iomem *ioaddr, + u32 add_frag_size) { u32 value; @@ -258,8 +261,9 @@ void dwmac5_fpe_set_add_frag_size(void __iomem *ioaddr, u32 add_frag_size) #define ALG_ERR_MSG "TX algorithm SP is not suitable for one-to-many mapping" #define WEIGHT_ERR_MSG "TXQ weight %u differs across other TXQs in TC: [%u]" -int dwmac5_fpe_map_preemption_class(struct net_device *ndev, - struct netlink_ext_ack *extack, u32 pclass) +static int dwmac5_fpe_map_preemption_class(struct net_device *ndev, + struct netlink_ext_ack *extack, + u32 pclass) { u32 val, offset, count, queue_weight, preemptible_txqs = 0; struct stmmac_priv *priv = netdev_priv(ndev); @@ -310,9 +314,10 @@ int dwmac5_fpe_map_preemption_class(struct net_device *ndev, return 0; } -void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, - u32 num_txq, u32 num_rxq, - bool tx_enable, bool pmac_enable) +static void dwxgmac3_fpe_configure(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, + bool tx_enable, bool pmac_enable) { u32 value; @@ -334,3 +339,16 @@ void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, value |= XGMAC_EFPE; writel(value, ioaddr + XGMAC_FPE_CTRL_STS); } + +const struct stmmac_fpe_ops dwmac5_fpe_ops = { + .fpe_configure = dwmac5_fpe_configure, + .fpe_send_mpacket = dwmac5_fpe_send_mpacket, + .fpe_irq_status = dwmac5_fpe_irq_status, + .fpe_get_add_frag_size = dwmac5_fpe_get_add_frag_size, + .fpe_set_add_frag_size = dwmac5_fpe_set_add_frag_size, + .fpe_map_preemption_class = dwmac5_fpe_map_preemption_class, +}; + +const struct stmmac_fpe_ops dwxgmac_fpe_ops = { + .fpe_configure = dwxgmac3_fpe_configure, +}; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.h index d4d46a07d6a7..a113b5c57de9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.h @@ -36,19 +36,3 @@ void stmmac_fpe_link_state_handle(struct stmmac_priv *priv, bool is_up); void stmmac_fpe_event_status(struct stmmac_priv *priv, int status); void stmmac_fpe_init(struct stmmac_priv *priv); void stmmac_fpe_apply(struct stmmac_priv *priv); - -void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, - u32 num_txq, u32 num_rxq, - bool tx_enable, bool pmac_enable); -void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, - struct stmmac_fpe_cfg *cfg, - enum stmmac_mpacket_type type); -int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev); -int dwmac5_fpe_get_add_frag_size(const void __iomem *ioaddr); -void dwmac5_fpe_set_add_frag_size(void __iomem *ioaddr, u32 add_frag_size); -int dwmac5_fpe_map_preemption_class(struct net_device *ndev, - struct netlink_ext_ack *extack, u32 pclass); - -void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, - u32 num_txq, u32 num_rxq, - bool tx_enable, bool pmac_enable);