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: 94474 Bytes
after  size: 82879 Bytes
save   size: 11595 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 0aa9fa02c4
commit 345c4d0af3
3 changed files with 16 additions and 1 deletions

View File

@@ -12,6 +12,12 @@ config STMMAC_ETH
if STMMAC_ETH
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 \
@@ -8,6 +8,8 @@ stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \
stmmac_tc.o dwxgmac2_core.o dwxgmac2_dma.o dwxgmac2_descs.o \
$(stmmac-y)
stmmac-$(CONFIG_STMMAC_ETHTOOL) += stmmac_ethtool.o
# Ordering matters. Generic driver must be last.
obj-$(CONFIG_STMMAC_PLATFORM) += stmmac-platform.o
obj-$(CONFIG_DWMAC_ANARION) += dwmac-anarion.o

View File

@@ -217,7 +217,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);