From nobody Tue Nov 26 13:45:36 2024 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.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 1701B187843; Fri, 18 Oct 2024 06:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729233598; cv=none; b=s20nT6QbnnzX5CXmnx7ShWVnGI0z50bN27zoPhOur14ZHabqdZ8JGpZVWquoObN85v57QnEiANtBxGL2k38LRai+4nj1DmADqq8IsS6oIheQ8V9RPKcO8eYnp/euc6UZZ7dj6sk0Pvg1cGGdwhnnhorHSIUXlSCstCo72QMTEEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729233598; c=relaxed/simple; bh=rNHGGAT3NqTIZMNGD0wZWE7rMN60c4Zlpl3L+BbL8QI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hBeQijoefHY2B/djnokz7JPrqn5lLTNPxTu0gUWPO8C/08yYuU3MJ0ZoAzCiZEaa18MiSqf3vGs7rCn3cbnF2DOiI6Wk+mixwSX5fIClasx3i2+EC+mYrLly2OctUhd7VN+JqlRbE9/qmTqjBEIGh2Sa5lgqAKhUOdd6xRrs4Dw= 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=TvVRwe2F; arc=none smtp.client-ip=209.85.215.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="TvVRwe2F" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7d4fa972cbeso1468827a12.2; Thu, 17 Oct 2024 23:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729233596; x=1729838396; 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=8MDQrB0ee+wSOWj7i9m+771wGRY+ZQ0e7kYg3aj0vKk=; b=TvVRwe2Flq2QIcPEKAUjy+FY2fXF16QPsofr5/4nywPUuj+t/wUrRdQU+77Y4F81ty 5a01AEjjTDdPWJm5501L7t++uf+VX2w88swPB5FWKkY8srdEqs61uZ70If9p2mW+Hh4t vagWRBN/2IqCuCUPrCCnIs208o3CZ75CvwOl+/RLqN0V3aAsLHT7JwkToTSKTvwpbZXh uUO/HVG2K27AsOIS3yrYNT9bhCwQxVxGX0iM1TpvhE4BmrjQIHP7ixv8f+3dxzl3OTnn tJEXYi9JJqVX1xJbyKv7ndvuamv/hYkXXz56O3KBdqdz3JQIJY+t+iuck522hiQfHcSP /z7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729233596; x=1729838396; 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=8MDQrB0ee+wSOWj7i9m+771wGRY+ZQ0e7kYg3aj0vKk=; b=pKHXuCIQwN+3Xb81tzG7KKSEE3OlWnlIsFGf5Q/1ACoznn73GSV+LLodyh8T3OPd8j 3gSM9C0uH6QqW4p1tO43HXQF5DU6Glg0sn7lB02Ok2Vy+oodBxydVhv82l1gNX0yVUP+ dVrfZLMtYgdPU2J5QSj/5Y6EnbFugaJ2ohBezHcdelqIfWJbsKzo/qxIq79DaknsG4it 6BCUlN9tZG3Zt/vgK9SGp/3B/LB5nxrxK+G6oI+rzxsG1jmjLkRkMxSm/F/PXaS1lMhQ zhtCtMD1fCKQGau4yk9yQh3K9BSIKCs8Soc2bQl3y7VryMHLEgKSJYHV3KYLjOLQN+JW Y56A== X-Forwarded-Encrypted: i=1; AJvYcCV4O4+AuWF00+kfV9SvLcM9Jj5BDs+yAGzG868AFTB2/6LClriYvqBKuqIxXDA/cU6K1pV7/MisowRVAKo=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3yZlGB0Jk3caSbLV30khavxT7AFB9YxobWB7PKQkkCHWYQwGs MAs0oNyiPl1+xP+Mowrmb8pQWupv57lQr7+wQ46/DxQU6DaXIUBeXr8NdA== X-Google-Smtp-Source: AGHT+IH7e7Tstx3JC/hZC8zRo4Gy5IHjcfofmbIDYA7Vom0jF+5TKlj1gforv/o2ShkVdUS3rAlMpA== X-Received: by 2002:a05:6a21:4781:b0:1d9:2408:aa4c with SMTP id adf61e73a8af0-1d92c508de1mr2365500637.23.1729233595766; Thu, 17 Oct 2024 23:39:55 -0700 (PDT) Received: from localhost.localdomain ([129.146.253.192]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-20e5a74766fsm6285455ad.73.2024.10.17.23.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 23:39:55 -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 , Simon Horman , Serge Semin , 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 v2 2/8] net: stmmac: Introduce stmmac_fpe_ops for gmac4 and xgmac Date: Fri, 18 Oct 2024 14:39:08 +0800 Message-Id: <210809290a8ca34159d193ade2a0e68649e1509a.1729233020.git.0x1207@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/eth= ernet/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/ne= t/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 =3D { .set_arp_offload =3D dwmac4_set_arp_offload, .config_l3_filter =3D dwmac4_config_l3_filter, .config_l4_filter =3D dwmac4_config_l4_filter, - .fpe_configure =3D dwmac5_fpe_configure, - .fpe_send_mpacket =3D dwmac5_fpe_send_mpacket, - .fpe_irq_status =3D dwmac5_fpe_irq_status, - .fpe_get_add_frag_size =3D dwmac5_fpe_get_add_frag_size, - .fpe_set_add_frag_size =3D dwmac5_fpe_set_add_frag_size, - .fpe_map_preemption_class =3D dwmac5_fpe_map_preemption_class, .add_hw_vlan_rx_fltr =3D dwmac4_add_hw_vlan_rx_fltr, .del_hw_vlan_rx_fltr =3D dwmac4_del_hw_vlan_rx_fltr, .restore_hw_vlan_rx_fltr =3D dwmac4_restore_hw_vlan_rx_fltr, @@ -1317,12 +1310,6 @@ const struct stmmac_ops dwmac510_ops =3D { .set_arp_offload =3D dwmac4_set_arp_offload, .config_l3_filter =3D dwmac4_config_l3_filter, .config_l4_filter =3D dwmac4_config_l4_filter, - .fpe_configure =3D dwmac5_fpe_configure, - .fpe_send_mpacket =3D dwmac5_fpe_send_mpacket, - .fpe_irq_status =3D dwmac5_fpe_irq_status, - .fpe_get_add_frag_size =3D dwmac5_fpe_get_add_frag_size, - .fpe_set_add_frag_size =3D dwmac5_fpe_set_add_frag_size, - .fpe_map_preemption_class =3D dwmac5_fpe_map_preemption_class, .add_hw_vlan_rx_fltr =3D dwmac4_add_hw_vlan_rx_fltr, .del_hw_vlan_rx_fltr =3D dwmac4_del_hw_vlan_rx_fltr, .restore_hw_vlan_rx_fltr =3D 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 =3D { .config_l3_filter =3D dwxgmac2_config_l3_filter, .config_l4_filter =3D dwxgmac2_config_l4_filter, .set_arp_offload =3D dwxgmac2_set_arp_offload, - .fpe_configure =3D dwxgmac3_fpe_configure, }; =20 static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode, @@ -1602,7 +1600,6 @@ const struct stmmac_ops dwxlgmac2_ops =3D { .config_l3_filter =3D dwxgmac2_config_l3_filter, .config_l4_filter =3D dwxgmac2_config_l4_filter, .set_arp_offload =3D dwxgmac2_set_arp_offload, - .fpe_configure =3D dwxgmac3_fpe_configure, }; =20 int dwxgmac2_setup(struct stmmac_priv *priv) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ether= net/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[] =3D { @@ -194,6 +195,7 @@ static const struct stmmac_hwif_entry { .tc =3D &dwmac510_tc_ops, .mmc =3D &dwmac_mmc_ops, .est =3D &dwmac510_est_ops, + .fpe =3D &dwmac5_fpe_ops, .setup =3D dwmac4_setup, .quirks =3D NULL, }, { @@ -214,6 +216,7 @@ static const struct stmmac_hwif_entry { .tc =3D &dwmac510_tc_ops, .mmc =3D &dwmac_mmc_ops, .est =3D &dwmac510_est_ops, + .fpe =3D &dwmac5_fpe_ops, .setup =3D dwmac4_setup, .quirks =3D NULL, }, { @@ -234,6 +237,7 @@ static const struct stmmac_hwif_entry { .tc =3D &dwmac510_tc_ops, .mmc =3D &dwmac_mmc_ops, .est =3D &dwmac510_est_ops, + .fpe =3D &dwmac5_fpe_ops, .setup =3D dwmac4_setup, .quirks =3D NULL, }, { @@ -255,6 +259,7 @@ static const struct stmmac_hwif_entry { .tc =3D &dwxgmac_tc_ops, .mmc =3D &dwxgmac_mmc_ops, .est =3D &dwmac510_est_ops, + .fpe =3D &dwxgmac_fpe_ops, .setup =3D dwxgmac2_setup, .quirks =3D NULL, }, { @@ -276,6 +281,7 @@ static const struct stmmac_hwif_entry { .tc =3D &dwxgmac_tc_ops, .mmc =3D &dwxgmac_mmc_ops, .est =3D &dwmac510_est_ops, + .fpe =3D &dwxgmac_fpe_ops, .setup =3D dwxlgmac2_setup, .quirks =3D stmmac_dwxlgmac_quirks, }, @@ -351,6 +357,7 @@ int stmmac_hwif_init(struct stmmac_priv *priv) mac->tc =3D mac->tc ? : entry->tc; mac->mmc =3D mac->mmc ? : entry->mmc; mac->est =3D mac->est ? : entry->est; + mac->fpe =3D mac->fpe ? : entry->fpe; =20 priv->hw =3D mac; priv->ptpaddr =3D priv->ioaddr + entry->regs.ptp_off; diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ether= net/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); }; =20 #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) =20 /* 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) =20 +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; =20 #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) } } =20 -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; =20 @@ -193,7 +194,7 @@ void dwmac5_fpe_configure(void __iomem *ioaddr, struct = stmmac_fpe_cfg *cfg, writel(value, ioaddr + GMAC_INT_EN); } =20 -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; } =20 -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 =3D cfg->fpe_csr; =20 @@ -241,12 +243,13 @@ void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, st= ruct stmmac_fpe_cfg *cfg, writel(value, ioaddr + MAC_FPE_CTRL_STS); } =20 -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)); } =20 -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; =20 @@ -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 mappi= ng" #define WEIGHT_ERR_MSG "TXQ weight %u differs across other TXQs in TC: [%u= ]" =20 -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 =3D 0; struct stmmac_priv *priv =3D netdev_priv(ndev); @@ -310,9 +314,10 @@ int dwmac5_fpe_map_preemption_class(struct net_device = *ndev, return 0; } =20 -void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *c= fg, - 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; =20 @@ -334,3 +339,16 @@ void dwxgmac3_fpe_configure(void __iomem *ioaddr, stru= ct stmmac_fpe_cfg *cfg, value |=3D XGMAC_EFPE; writel(value, ioaddr + XGMAC_FPE_CTRL_STS); } + +const struct stmmac_fpe_ops dwmac5_fpe_ops =3D { + .fpe_configure =3D dwmac5_fpe_configure, + .fpe_send_mpacket =3D dwmac5_fpe_send_mpacket, + .fpe_irq_status =3D dwmac5_fpe_irq_status, + .fpe_get_add_frag_size =3D dwmac5_fpe_get_add_frag_size, + .fpe_set_add_frag_size =3D dwmac5_fpe_set_add_frag_size, + .fpe_map_preemption_class =3D dwmac5_fpe_map_preemption_class, +}; + +const struct stmmac_fpe_ops dwxgmac_fpe_ops =3D { + .fpe_configure =3D 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 *pr= iv, 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 *c= fg, - u32 num_txq, u32 num_rxq, - bool tx_enable, bool pmac_enable); --=20 2.34.1