Commit 23169a40 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

pcnet: convert driver to net_device_ops

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 28b1801d
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/log2.h> #include <linux/log2.h>
#include <linux/etherdevice.h>
#include "../8390.h" #include "../8390.h"
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
...@@ -233,6 +234,23 @@ static inline pcnet_dev_t *PRIV(struct net_device *dev) ...@@ -233,6 +234,23 @@ static inline pcnet_dev_t *PRIV(struct net_device *dev)
return (pcnet_dev_t *)(p + sizeof(struct ei_device)); return (pcnet_dev_t *)(p + sizeof(struct ei_device));
} }
static const struct net_device_ops pcnet_netdev_ops = {
.ndo_open = pcnet_open,
.ndo_stop = pcnet_close,
.ndo_set_config = set_config,
.ndo_start_xmit = ei_start_xmit,
.ndo_get_stats = ei_get_stats,
.ndo_do_ioctl = ei_ioctl,
.ndo_set_multicast_list = ei_set_multicast_list,
.ndo_tx_timeout = ei_tx_timeout,
.ndo_change_mtu = eth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ei_poll,
#endif
};
/*====================================================================== /*======================================================================
pcnet_attach() creates an "instance" of the driver, allocating pcnet_attach() creates an "instance" of the driver, allocating
...@@ -260,9 +278,7 @@ static int pcnet_probe(struct pcmcia_device *link) ...@@ -260,9 +278,7 @@ static int pcnet_probe(struct pcmcia_device *link)
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
dev->open = &pcnet_open; dev->netdev_ops = &pcnet_netdev_ops;
dev->stop = &pcnet_close;
dev->set_config = &set_config;
return pcnet_config(link); return pcnet_config(link);
} /* pcnet_attach */ } /* pcnet_attach */
...@@ -640,18 +656,12 @@ static int pcnet_config(struct pcmcia_device *link) ...@@ -640,18 +656,12 @@ static int pcnet_config(struct pcmcia_device *link)
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
if (info->flags & (IS_DL10019|IS_DL10022)) { if (info->flags & (IS_DL10019|IS_DL10022))
dev->do_ioctl = &ei_ioctl;
mii_phy_probe(dev); mii_phy_probe(dev);
}
link->dev_node = &info->node; link->dev_node = &info->node;
SET_NETDEV_DEV(dev, &handle_to_dev(link)); SET_NETDEV_DEV(dev, &handle_to_dev(link));
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = ei_poll;
#endif
if (register_netdev(dev) != 0) { if (register_netdev(dev) != 0) {
printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n");
link->dev_node = NULL; link->dev_node = NULL;
...@@ -1183,6 +1193,10 @@ static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -1183,6 +1193,10 @@ static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
pcnet_dev_t *info = PRIV(dev); pcnet_dev_t *info = PRIV(dev);
u16 *data = (u16 *)&rq->ifr_ifru; u16 *data = (u16 *)&rq->ifr_ifru;
unsigned int mii_addr = dev->base_addr + DLINK_GPIO; unsigned int mii_addr = dev->base_addr + DLINK_GPIO;
if (!(info->flags & (IS_DL10019|IS_DL10022)))
return -EINVAL;
switch (cmd) { switch (cmd) {
case SIOCGMIIPHY: case SIOCGMIIPHY:
data[0] = info->phy_id; data[0] = info->phy_id;
......
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