diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2011-11-16 21:58:00 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-17 03:13:41 -0500 |
commit | 19e30c14371f7afd38d1d35a693b96423a4db144 (patch) | |
tree | b1e30774ec0ff4e3f13ec5f8c2cf05b6c807a075 /drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | |
parent | c5b9b4e4b9076089fe7f9d4f5d1f2bba776646d2 (diff) | |
download | talos-obmc-linux-19e30c14371f7afd38d1d35a693b96423a4db144.tar.gz talos-obmc-linux-19e30c14371f7afd38d1d35a693b96423a4db144.zip |
stmmac: parameters auto-tuning through HW cap reg
New GMAC devices (newer than the databook 3.50a) have the
HW capability register that provides which features are actually
supported by the hardware.
On old devices many information have to be passed through the
platform, for example: enhanced descriptor structure,
TX COE etc. These are mandatory to properly configure the driver.
This remains still valid because the driver has to support old
Synopsys devices but now it's also able to override them using the
values from the HW capability register if supported.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index e8eff09bbbd7..0395f9eba801 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -430,6 +430,12 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) struct stmmac_priv *priv = netdev_priv(dev); u32 support = WAKE_MAGIC | WAKE_UCAST; + /* By default almost all GMAC devices support the WoL via + * magic frame but we can disable it if the HW capability + * register shows no support for pmt_magic_frame. */ + if ((priv->hw_cap_support) && (!priv->dma_cap.pmt_magic_frame)) + wol->wolopts &= ~WAKE_MAGIC; + if (!device_can_wakeup(priv->device)) return -EINVAL; |