Commit af42c0ff authored by Jeff Garzik's avatar Jeff Garzik

[netdrvr ne2k-pci] ethtool_ops support

parent 53e82261
......@@ -174,7 +174,7 @@ static void ne2k_pci_block_input(struct net_device *dev, int count,
struct sk_buff *skb, int ring_offset);
static void ne2k_pci_block_output(struct net_device *dev, const int count,
const unsigned char *buf, const int start_page);
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static struct ethtool_ops ne2k_pci_ethtool_ops;
......@@ -355,7 +355,7 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
ei_status.priv = (unsigned long) pdev;
dev->open = &ne2k_pci_open;
dev->stop = &ne2k_pci_close;
dev->do_ioctl = &netdev_ioctl;
dev->ethtool_ops = &ne2k_pci_ethtool_ops;
NS8390_init(dev, 0);
i = register_netdev(dev);
......@@ -583,40 +583,22 @@ static void ne2k_pci_block_output(struct net_device *dev, int count,
return;
}
static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
static void ne2k_pci_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct ei_device *ei = dev->priv;
struct pci_dev *pci_dev = (struct pci_dev *) ei->priv;
u32 ethcmd;
if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
return -EFAULT;
switch (ethcmd) {
case ETHTOOL_GDRVINFO: {
struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO};
strcpy(info.driver, DRV_NAME);
strcpy(info.version, DRV_VERSION);
strcpy(info.bus_info, pci_name(pci_dev));
if (copy_to_user(useraddr, &info, sizeof(info)))
return -EFAULT;
return 0;
}
}
return -EOPNOTSUPP;
strcpy(info->driver, DRV_NAME);
strcpy(info->version, DRV_VERSION);
strcpy(info->bus_info, pci_name(pci_dev));
}
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
switch(cmd) {
case SIOCETHTOOL:
return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
default:
return -EOPNOTSUPP;
}
}
static struct ethtool_ops ne2k_pci_ethtool_ops = {
.get_drvinfo = ne2k_pci_get_drvinfo,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
};
static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
{
......
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