Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135414
b: refs/heads/master
c: 23169a4
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 22, 2009
1 parent 0fffbea commit 721f45e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28b1801d5a367adaf3d02605c762a59781d99664
refs/heads/master: 23169a402d6a2d55992e6b7f6157ae04b636545a
34 changes: 24 additions & 10 deletions trunk/drivers/net/pcmcia/pcnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/log2.h>
#include <linux/etherdevice.h>
#include "../8390.h"

#include <pcmcia/cs_types.h>
Expand Down Expand Up @@ -233,6 +234,23 @@ static inline pcnet_dev_t *PRIV(struct net_device *dev)
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
Expand Down Expand Up @@ -260,9 +278,7 @@ static int pcnet_probe(struct pcmcia_device *link)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;

dev->open = &pcnet_open;
dev->stop = &pcnet_close;
dev->set_config = &set_config;
dev->netdev_ops = &pcnet_netdev_ops;

return pcnet_config(link);
} /* pcnet_attach */
Expand Down Expand Up @@ -640,18 +656,12 @@ static int pcnet_config(struct pcmcia_device *link)

SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);

if (info->flags & (IS_DL10019|IS_DL10022)) {
dev->do_ioctl = &ei_ioctl;
if (info->flags & (IS_DL10019|IS_DL10022))
mii_phy_probe(dev);
}

link->dev_node = &info->node;
SET_NETDEV_DEV(dev, &handle_to_dev(link));

#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = ei_poll;
#endif

if (register_netdev(dev) != 0) {
printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n");
link->dev_node = NULL;
Expand Down Expand Up @@ -1183,6 +1193,10 @@ static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
pcnet_dev_t *info = PRIV(dev);
u16 *data = (u16 *)&rq->ifr_ifru;
unsigned int mii_addr = dev->base_addr + DLINK_GPIO;

if (!(info->flags & (IS_DL10019|IS_DL10022)))
return -EINVAL;

switch (cmd) {
case SIOCGMIIPHY:
data[0] = info->phy_id;
Expand Down

0 comments on commit 721f45e

Please sign in to comment.