net: phy: Pass mdix ethtool setting through to phy driver
authorDavid Thomson <david.thomson@alliedtelesis.co.nz>
Fri, 10 Jul 2015 01:56:54 +0000 (13:56 +1200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Jul 2015 06:17:32 +0000 (23:17 -0700)
Pass the mdix setting from ethtool down to the phy driver, to allow
driver specific implementations of manually setting the polarity.

Signed-off-by: David Thomson <david.thomson@alliedtelesis.co.nz>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c
include/linux/phy.h

index b2197b506acbe86f3540d5ae1d8334129c2bbe57..47693a9ebd3aee303f63935cbcb1e39e0f893f67 100644 (file)
@@ -353,6 +353,8 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd)
 
        phydev->duplex = cmd->duplex;
 
+       phydev->mdix = cmd->eth_tp_mdix_ctrl;
+
        /* Restart the PHY */
        phy_start_aneg(phydev);
 
index a26c3f84b8ddc6c15e2abbecf47a588419534b11..e5fb1d4159619f7ecad0fca5515e627fd7016e06 100644 (file)
@@ -424,6 +424,8 @@ struct phy_device {
 
        struct net_device *attached_dev;
 
+       u8 mdix;
+
        void (*adjust_link)(struct net_device *dev);
 };
 #define to_phy_device(d) container_of(d, struct phy_device, dev)