Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135419
b: refs/heads/master
c: 3dd2051
h: refs/heads/master
i:
  135417: 5419a86
  135415: cbe1b0d
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 22, 2009
1 parent 88b2516 commit 5c15419
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 43 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: 9b31b6971f448796768860e3c9ee2d22f4511731
refs/heads/master: 3dd205165e076eacf09575f0c90031e7c52bc5e1
68 changes: 26 additions & 42 deletions trunk/drivers/net/pcmcia/axnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <linux/spinlock.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/crc32.h>
#include "../8390.h"

Expand Down Expand Up @@ -91,6 +92,10 @@ static void axnet_release(struct pcmcia_device *link);
static int axnet_open(struct net_device *dev);
static int axnet_close(struct net_device *dev);
static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int axnet_start_xmit(struct sk_buff *skb, struct net_device *dev);
static struct net_device_stats *get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static void axnet_tx_timeout(struct net_device *dev);
static const struct ethtool_ops netdev_ethtool_ops;
static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
static void ei_watchdog(u_long arg);
Expand All @@ -108,7 +113,6 @@ static void block_output(struct net_device *dev, int count,

static void axnet_detach(struct pcmcia_device *p_dev);

static void axdev_setup(struct net_device *dev);
static void AX88190_init(struct net_device *dev, int startp);
static int ax_open(struct net_device *dev);
static int ax_close(struct net_device *dev);
Expand All @@ -134,6 +138,19 @@ static inline axnet_dev_t *PRIV(struct net_device *dev)
return p;
}

static const struct net_device_ops axnet_netdev_ops = {
.ndo_open = axnet_open,
.ndo_stop = axnet_close,
.ndo_do_ioctl = axnet_ioctl,
.ndo_start_xmit = axnet_start_xmit,
.ndo_tx_timeout = axnet_tx_timeout,
.ndo_get_stats = get_stats,
.ndo_set_multicast_list = set_multicast_list,
.ndo_change_mtu = eth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
};

/*======================================================================
axnet_attach() creates an "instance" of the driver, allocating
Expand All @@ -146,15 +163,17 @@ static int axnet_probe(struct pcmcia_device *link)
{
axnet_dev_t *info;
struct net_device *dev;
struct ei_device *ei_local;

DEBUG(0, "axnet_attach()\n");

dev = alloc_netdev(sizeof(struct ei_device) + sizeof(axnet_dev_t),
"eth%d", axdev_setup);

dev = alloc_etherdev(sizeof(struct ei_device) + sizeof(axnet_dev_t));
if (!dev)
return -ENOMEM;

ei_local = netdev_priv(dev);
spin_lock_init(&ei_local->page_lock);

info = PRIV(dev);
info->p_dev = link;
link->priv = dev;
Expand All @@ -163,10 +182,10 @@ static int axnet_probe(struct pcmcia_device *link)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;

dev->open = &axnet_open;
dev->stop = &axnet_close;
dev->do_ioctl = &axnet_ioctl;
dev->netdev_ops = &axnet_netdev_ops;

SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
dev->watchdog_timeo = TX_TIMEOUT;

return axnet_config(link);
} /* axnet_attach */
Expand Down Expand Up @@ -905,14 +924,12 @@ int ei_debug = 1;
/* Index to functions. */
static void ei_tx_intr(struct net_device *dev);
static void ei_tx_err(struct net_device *dev);
static void axnet_tx_timeout(struct net_device *dev);
static void ei_receive(struct net_device *dev);
static void ei_rx_overrun(struct net_device *dev);

/* Routines generic to NS8390-based boards. */
static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
int start_page);
static void set_multicast_list(struct net_device *dev);
static void do_set_multicast_list(struct net_device *dev);

/*
Expand Down Expand Up @@ -954,15 +971,6 @@ static int ax_open(struct net_device *dev)
unsigned long flags;
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);

#ifdef HAVE_TX_TIMEOUT
/* The card I/O part of the driver (e.g. 3c503) can hook a Tx timeout
wrapper that does e.g. media check & then calls axnet_tx_timeout. */
if (dev->tx_timeout == NULL)
dev->tx_timeout = axnet_tx_timeout;
if (dev->watchdog_timeo <= 0)
dev->watchdog_timeo = TX_TIMEOUT;
#endif

/*
* Grab the page lock so we own the register set, then call
* the init function.
Expand Down Expand Up @@ -1701,30 +1709,6 @@ static void set_multicast_list(struct net_device *dev)
spin_unlock_irqrestore(&dev_lock(dev), flags);
}

/**
* axdev_setup - init rest of 8390 device struct
* @dev: network device structure to init
*
* Initialize the rest of the 8390 device structure. Do NOT __init
* this, as it is used by 8390 based modular drivers too.
*/

static void axdev_setup(struct net_device *dev)
{
struct ei_device *ei_local;
if (ei_debug > 1)
printk(version_8390);

ei_local = (struct ei_device *)netdev_priv(dev);
spin_lock_init(&ei_local->page_lock);

dev->hard_start_xmit = &axnet_start_xmit;
dev->get_stats = get_stats;
dev->set_multicast_list = &set_multicast_list;

ether_setup(dev);
}

/* This page of functions should be 8390 generic */
/* Follow National Semi's recommendations for initializing the "NIC". */

Expand Down

0 comments on commit 5c15419

Please sign in to comment.