Commit 2ab1d925 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: add generic ndo_do_ioctl handler phy_do_ioctl

A number of network drivers has the same glue code to use phy_mii_ioctl
as ndo_do_ioctl handler. So let's add such a generic ndo_do_ioctl
handler to phylib.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4262c38d
...@@ -432,6 +432,21 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd) ...@@ -432,6 +432,21 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
} }
EXPORT_SYMBOL(phy_mii_ioctl); EXPORT_SYMBOL(phy_mii_ioctl);
/**
* phy_do_ioctl - generic ndo_do_ioctl implementation
* @dev: the net_device struct
* @ifr: &struct ifreq for socket ioctl's
* @cmd: ioctl cmd to execute
*/
int phy_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
if (!netif_running(dev) || !dev->phydev)
return -ENODEV;
return phy_mii_ioctl(dev->phydev, ifr, cmd);
}
EXPORT_SYMBOL(phy_do_ioctl);
void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies) void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies)
{ {
mod_delayed_work(system_power_efficient_wq, &phydev->state_queue, mod_delayed_work(system_power_efficient_wq, &phydev->state_queue,
......
...@@ -1242,6 +1242,7 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev, ...@@ -1242,6 +1242,7 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev,
int phy_ethtool_ksettings_set(struct phy_device *phydev, int phy_ethtool_ksettings_set(struct phy_device *phydev,
const struct ethtool_link_ksettings *cmd); const struct ethtool_link_ksettings *cmd);
int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
int phy_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
void phy_request_interrupt(struct phy_device *phydev); void phy_request_interrupt(struct phy_device *phydev);
void phy_free_interrupt(struct phy_device *phydev); void phy_free_interrupt(struct phy_device *phydev);
void phy_print_status(struct phy_device *phydev); void phy_print_status(struct phy_device *phydev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment