patch-2.4.23 linux-2.4.23/drivers/net/dmfe.c
Next file: linux-2.4.23/drivers/net/dummy.c
Previous file: linux-2.4.23/drivers/net/bonding/bonding.h
Back to the patch index
Back to the overall index
- Lines: 86
- Date:
2003-11-28 10:26:20.000000000 -0800
- Orig file:
linux-2.4.22/drivers/net/dmfe.c
- Orig date:
2003-06-13 07:51:34.000000000 -0700
diff -urN linux-2.4.22/drivers/net/dmfe.c linux-2.4.23/drivers/net/dmfe.c
@@ -299,7 +299,7 @@
static int dmfe_stop(struct DEVICE *);
static struct net_device_stats * dmfe_get_stats(struct DEVICE *);
static void dmfe_set_filter_mode(struct DEVICE *);
-static int dmfe_do_ioctl(struct DEVICE *, struct ifreq *, int);
+static struct ethtool_ops netdev_ethtool_ops;
static u16 read_srom_word(long ,int);
static void dmfe_interrupt(int , void *, struct pt_regs *);
static void dmfe_descriptor_init(struct dmfe_board_info *, unsigned long);
@@ -419,7 +419,7 @@
dev->stop = &dmfe_stop;
dev->get_stats = &dmfe_get_stats;
dev->set_multicast_list = &dmfe_set_filter_mode;
- dev->do_ioctl = &dmfe_do_ioctl;
+ dev->ethtool_ops = &netdev_ethtool_ops;
spin_lock_init(&db->lock);
pci_read_config_dword(pdev, 0x50, &pci_pmr);
@@ -1002,54 +1002,23 @@
}
-/*
- * Process the ethtool ioctl command
- */
-
-static int dmfe_ethtool_ioctl(struct net_device *dev, void *useraddr)
-{
- struct dmfe_board_info *db = dev->priv;
- struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
- u32 ethcmd;
-
- if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd)))
- return -EFAULT;
-
- switch (ethcmd) {
- case ETHTOOL_GDRVINFO:
- strcpy(info.driver, DRV_NAME);
- strcpy(info.version, DRV_VERSION);
- if (db->pdev)
- strcpy(info.bus_info, db->pdev->slot_name);
- else
- sprintf(info.bus_info, "EISA 0x%lx %d",
- dev->base_addr, dev->irq);
- if (copy_to_user(useraddr, &info, sizeof(info)))
- return -EFAULT;
- return 0;
- }
-
- return -EOPNOTSUPP;
-}
-
-
-/*
- * Process the upper socket ioctl command
- */
-
-static int dmfe_do_ioctl(struct DEVICE *dev, struct ifreq *ifr, int cmd)
+static void netdev_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *info)
{
- int retval = -EOPNOTSUPP;
- DMFE_DBUG(0, "dmfe_do_ioctl()", 0);
-
- switch(cmd) {
- case SIOCETHTOOL:
- return dmfe_ethtool_ioctl(dev, (void*)ifr->ifr_data);
- }
+ struct dmfe_board_info *np = dev->priv;
- return retval;
+ strcpy(info->driver, DRV_NAME);
+ strcpy(info->version, DRV_VERSION);
+ if (np->pdev)
+ strcpy(info->bus_info, pci_name(np->pdev));
+ else
+ sprintf(info->bus_info, "EISA 0x%lx %d",
+ dev->base_addr, dev->irq);
}
+static struct ethtool_ops netdev_ethtool_ops = {
+ .get_drvinfo = netdev_get_drvinfo,
+};
/*
* A periodic timer routine
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)