OpenCloudOS-Kernel/drivers/net/phy
Giuseppe CAVALLARO a59a4d1921 phy: add the EEE support and the way to access to the MMD registers.
This patch adds the support for the Energy-Efficient Ethernet (EEE)
to the Physical Abstraction Layer.
To support the EEE we have to access to the MMD registers 3.20 and
7.60/61. So two new functions have been added to read/write the MMD
registers (clause 45).

An Ethernet driver (I tested the stmmac) can invoke the phy_init_eee to properly
check if the EEE is supported by the PHYs and it can also set the clock
stop enable bit in the 3.0 register.
The phy_get_eee_err can be used for reporting the number of time where
the PHY failed to complete its normal wake sequence.

In the end, this patch also adds the EEE ethtool support implementing:
 o phy_ethtool_set_eee
 o phy_ethtool_get_eee

v1: initial patch
v2: fixed some errors especially on naming convention
v3: renamed again the mmd read/write functions thank to Ben's feedback
v4: moved file to phy.c and added the ethtool support.
v5: fixed phy_adv_to_eee, phy_eee_to_supported, phy_eee_to_adv return
    values according to ethtool API (thanks to Ben's feedback).
    Renamed some macros to avoid too long names.
v6: fixed kernel-doc comments to be properly parsed.
    Fixed the phy_init_eee function: we need to check which link mode
    was autonegotiated and then the corresponding bits in 7.60 and 7.61
    registers.
v7: reviewed the way to get the negotiated settings.
v8: fixed a problem in the phy_init_eee return value erroneously added
    when included the phy_read_status call.
v9: do not remove the MDIO_AN_EEE_ADV_100TX and MDIO_AN_EEE_ADV_1000T
    and fixed the eee_{cap,lp,adv} declaration as "int" instead of u16.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-01 03:34:50 -07:00
..
Kconfig netdev/phy: Add driver for Broadcom BCM87XX 10G Ethernet PHYs 2012-06-27 21:23:25 -07:00
Makefile netdev/phy: Add driver for Broadcom BCM87XX 10G Ethernet PHYs 2012-06-27 21:23:25 -07:00
amd.c phy: add am79c874 PHY support 2012-03-19 18:02:05 -04:00
bcm63xx.c net:phy:bcm63xx: remove unnecessary code 2012-04-03 19:02:00 -04:00
bcm87xx.c netdev/phy: Add driver for Broadcom BCM87XX 10G Ethernet PHYs 2012-06-27 21:23:25 -07:00
broadcom.c drivers/net: Remove boolean comparisons to true/false 2012-02-13 00:47:40 -05:00
cicada.c net/phy: fix many "defined but unused" warnings 2010-10-05 00:34:29 -07:00
davicom.c net:phy:davicom: remove unnecessary code 2012-04-03 19:02:00 -04:00
dp83640.c phy: Use pr_<level> 2012-06-11 16:58:24 -07:00
dp83640_reg.h ptp: Added a clock driver for the National Semiconductor PHYTER. 2011-05-23 13:10:23 -07:00
et1011c.c net/phy: fix many "defined but unused" warnings 2010-10-05 00:34:29 -07:00
fixed.c phy: Use pr_<level> 2012-06-11 16:58:24 -07:00
icplus.c net: icplus: fix interrupt mask 2012-06-04 12:02:40 -04:00
lxt.c net/phy: fix many "defined but unused" warnings 2010-10-05 00:34:29 -07:00
marvell.c net:phy:marvell: remove unnecessary code 2012-04-03 19:02:00 -04:00
mdio-bitbang.c mdio-gpio: Add reset functionality to mdio-gpio driver(v2). 2011-11-15 16:56:17 -05:00
mdio-gpio.c irq_domain/x86: Convert x86 (embedded) to use common irq_domain 2012-02-23 14:37:47 -07:00
mdio-mux-gpio.c netdev/of/phy: Add MDIO bus multiplexer driven by GPIO lines. 2012-05-07 22:58:09 -04:00
mdio-mux.c netdev/of/phy: Add MDIO bus multiplexer support. 2012-05-07 22:58:09 -04:00
mdio-octeon.c mdio-octeon: use an unique MDIO bus name. 2012-01-10 16:35:02 -08:00
mdio_bus.c netdev/phy/of: Add more methods for binding PHY devices to drivers. 2012-06-27 21:23:25 -07:00
micrel.c phy/micrel: change phy_id_mask for KSZ9021 and KS8001 2012-06-19 00:31:36 -07:00
national.c phy: Use pr_<level> 2012-06-11 16:58:24 -07:00
phy.c phy: add the EEE support and the way to access to the MMD registers. 2012-07-01 03:34:50 -07:00
phy_device.c phy: Fix warning in get_phy_device(). 2012-06-27 21:28:14 -07:00
qsemi.c net/phy: fix many "defined but unused" warnings 2010-10-05 00:34:29 -07:00
realtek.c drivers/net: Add module.h to drivers who were implicitly using it 2011-10-31 19:31:07 -04:00
smsc.c net: phy: smsc: Move SMSC PHY constants to <linux/smscphy.h> 2012-01-03 20:23:18 -05:00
spi_ks8995.c phy: Use pr_<level> 2012-06-11 16:58:24 -07:00
ste10Xp.c net/phy: fix many "defined but unused" warnings 2010-10-05 00:34:29 -07:00
vitesse.c phylib: Modify Vitesse RGMII skew settings 2011-10-19 15:59:45 -04:00