diff options
| author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-07-27 17:21:36 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-07-29 19:47:43 -0400 |
| commit | bd695a5f0ccf7b38982c426d86055ff3591c9b5b (patch) | |
| tree | 08e9da3531f5c72c0b82f0151913e571e564550b | |
| parent | 2add511e58dc822a4573dd35280750fb3a21a2db (diff) | |
net: mvpp2: implement ioctl() operation for PHY ioctls
This commit implements the ->ndo_do_ioctl() operation so that the
PHY-related ioctl() calls can work from userspace, which allows
applications like mii-tool or mii-diag to do their job.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/ethernet/marvell/mvpp2.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index 3cae3d2abe7e..ece83f101526 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c | |||
| @@ -5714,6 +5714,21 @@ mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) | |||
| 5714 | return stats; | 5714 | return stats; |
| 5715 | } | 5715 | } |
| 5716 | 5716 | ||
| 5717 | static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | ||
| 5718 | { | ||
| 5719 | struct mvpp2_port *port = netdev_priv(dev); | ||
| 5720 | int ret; | ||
| 5721 | |||
| 5722 | if (!port->phy_dev) | ||
| 5723 | return -ENOTSUPP; | ||
| 5724 | |||
| 5725 | ret = phy_mii_ioctl(port->phy_dev, ifr, cmd); | ||
| 5726 | if (!ret) | ||
| 5727 | mvpp2_link_event(dev); | ||
| 5728 | |||
| 5729 | return ret; | ||
| 5730 | } | ||
| 5731 | |||
| 5717 | /* Ethtool methods */ | 5732 | /* Ethtool methods */ |
| 5718 | 5733 | ||
| 5719 | /* Get settings (phy address, speed) for ethtools */ | 5734 | /* Get settings (phy address, speed) for ethtools */ |
| @@ -5868,6 +5883,7 @@ static const struct net_device_ops mvpp2_netdev_ops = { | |||
| 5868 | .ndo_set_mac_address = mvpp2_set_mac_address, | 5883 | .ndo_set_mac_address = mvpp2_set_mac_address, |
| 5869 | .ndo_change_mtu = mvpp2_change_mtu, | 5884 | .ndo_change_mtu = mvpp2_change_mtu, |
| 5870 | .ndo_get_stats64 = mvpp2_get_stats64, | 5885 | .ndo_get_stats64 = mvpp2_get_stats64, |
| 5886 | .ndo_do_ioctl = mvpp2_ioctl, | ||
| 5871 | }; | 5887 | }; |
| 5872 | 5888 | ||
| 5873 | static const struct ethtool_ops mvpp2_eth_tool_ops = { | 5889 | static const struct ethtool_ops mvpp2_eth_tool_ops = { |
