net: ethernet: stmmac: Add config option for stmmac ethtool

Add this config option to reduce memory usage, if it was not necessary.

./ksize.sh drivers/net/ethernet/stmicro/

before size: 121861 Bytes
after  size: 109539 Bytes
save   size: 12322 Bytes

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I828130d961846a955b998d63afffbabcc9dd5925
This commit is contained in:
David Wu
2021-09-18 16:37:51 +08:00
committed by Tao Huang
parent a42414454f
commit 541323a247
3 changed files with 15 additions and 1 deletions

View File

@@ -25,6 +25,12 @@ config STMMAC_SELFTESTS
feature if you are facing problems with your HW and submit the test
results to the netdev Mailing List.
config STMMAC_ETHTOOL
bool "Ethtool feature for STMMAC"
default STMMAC_ETH
help
This selects the ethtool function, default is Y.
config STMMAC_PLATFORM
tristate "STMMAC Platform bus support"
depends on STMMAC_ETH

View File

@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_STMMAC_ETH) += stmmac.o
stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \
stmmac-objs:= stmmac_main.o stmmac_mdio.o ring_mode.o \
chain_mode.o dwmac_lib.o dwmac1000_core.o dwmac1000_dma.o \
dwmac100_core.o dwmac100_dma.o enh_desc.o norm_desc.o \
mmc_core.o stmmac_hwtstamp.o stmmac_ptp.o dwmac4_descs.o \
@@ -9,6 +9,7 @@ stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \
$(stmmac-y)
stmmac-$(CONFIG_STMMAC_SELFTESTS) += stmmac_selftests.o
stmmac-$(CONFIG_STMMAC_ETHTOOL) += stmmac_ethtool.o
# Ordering matters. Generic driver must be last.
obj-$(CONFIG_STMMAC_PLATFORM) += stmmac-platform.o

View File

@@ -256,7 +256,14 @@ enum stmmac_state {
int stmmac_mdio_unregister(struct net_device *ndev);
int stmmac_mdio_register(struct net_device *ndev);
int stmmac_mdio_reset(struct mii_bus *mii);
#ifdef CONFIG_STMMAC_ETHTOOL
void stmmac_set_ethtool_ops(struct net_device *netdev);
#else
static inline void stmmac_set_ethtool_ops(struct net_device *netdev)
{
}
#endif
void stmmac_ptp_register(struct stmmac_priv *priv);
void stmmac_ptp_unregister(struct stmmac_priv *priv);