Commit 207a4316 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Jeff Garzik

[netdrvr 3c59x] ethtool_ops support

parent 37430918
...@@ -900,6 +900,7 @@ static void set_rx_mode(struct net_device *dev); ...@@ -900,6 +900,7 @@ static void set_rx_mode(struct net_device *dev);
static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static void vortex_tx_timeout(struct net_device *dev); static void vortex_tx_timeout(struct net_device *dev);
static void acpi_set_WOL(struct net_device *dev); static void acpi_set_WOL(struct net_device *dev);
static struct ethtool_ops vortex_ethtool_ops;
/* This driver uses 'options' to pass the media type, full-duplex flag, etc. */ /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */
/* Option count limit only -- unlimited interfaces are supported. */ /* Option count limit only -- unlimited interfaces are supported. */
...@@ -1445,6 +1446,7 @@ static int __devinit vortex_probe1(struct device *gendev, ...@@ -1445,6 +1446,7 @@ static int __devinit vortex_probe1(struct device *gendev,
dev->stop = vortex_close; dev->stop = vortex_close;
dev->get_stats = vortex_get_stats; dev->get_stats = vortex_get_stats;
dev->do_ioctl = vortex_ioctl; dev->do_ioctl = vortex_ioctl;
dev->ethtool_ops = &vortex_ethtool_ops;
dev->set_multicast_list = set_rx_mode; dev->set_multicast_list = set_rx_mode;
dev->tx_timeout = vortex_tx_timeout; dev->tx_timeout = vortex_tx_timeout;
dev->watchdog_timeo = (watchdog * HZ) / 1000; dev->watchdog_timeo = (watchdog * HZ) / 1000;
...@@ -2816,38 +2818,28 @@ static void update_stats(long ioaddr, struct net_device *dev) ...@@ -2816,38 +2818,28 @@ static void update_stats(long ioaddr, struct net_device *dev)
} }
static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr) static void vortex_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{ {
struct vortex_private *vp = dev->priv; struct vortex_private *vp = dev->priv;
u32 ethcmd;
strcpy(info->driver, DRV_NAME);
if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd))) strcpy(info->version, DRV_VERSION);
return -EFAULT; if (VORTEX_PCI(vp)) {
strcpy(info->bus_info, pci_name(VORTEX_PCI(vp)));
switch (ethcmd) { } else {
case ETHTOOL_GDRVINFO: {
struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO};
strcpy(info.driver, DRV_NAME);
strcpy(info.version, DRV_VERSION);
if (VORTEX_PCI(vp))
strcpy(info.bus_info, pci_name(VORTEX_PCI(vp)));
else {
if (VORTEX_EISA(vp)) if (VORTEX_EISA(vp))
sprintf (info.bus_info, vp->gendev->bus_id); sprintf(info->bus_info, vp->gendev->bus_id);
else else
sprintf(info.bus_info, "EISA 0x%lx %d", sprintf(info->bus_info, "EISA 0x%lx %d",
dev->base_addr, dev->irq); dev->base_addr, dev->irq);
} }
if (copy_to_user(useraddr, &info, sizeof(info)))
return -EFAULT;
return 0;
}
}
return -EOPNOTSUPP;
} }
static struct ethtool_ops vortex_ethtool_ops = {
.get_drvinfo = vortex_get_drvinfo,
};
static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
struct vortex_private *vp = (struct vortex_private *)dev->priv; struct vortex_private *vp = (struct vortex_private *)dev->priv;
...@@ -2857,9 +2849,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2857,9 +2849,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
int retval; int retval;
switch(cmd) { switch(cmd) {
case SIOCETHTOOL:
return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
case SIOCGMIIPHY: /* Get address of MII PHY in use. */ case SIOCGMIIPHY: /* Get address of MII PHY in use. */
data->phy_id = phy; data->phy_id = phy;
......
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