*****************************************************************************/
static const char version[] =
"de620.c: $Revision: 1.40 $, Bjorn Ekwall <bj0rn@blox.se>\n";
*****************************************************************************/
static const char version[] =
"de620.c: $Revision: 1.40 $, Bjorn Ekwall <bj0rn@blox.se>\n";
/* Put in the device structure. */
static int de620_open(struct net_device *);
static int de620_close(struct net_device *);
/* Put in the device structure. */
static int de620_open(struct net_device *);
static int de620_close(struct net_device *);
static void de620_set_multicast_list(struct net_device *);
static int de620_start_xmit(struct sk_buff *, struct net_device *);
/* Dispatch from interrupts. */
static void de620_set_multicast_list(struct net_device *);
static int de620_start_xmit(struct sk_buff *, struct net_device *);
/* Dispatch from interrupts. */
/**********************************************************
* *
* Convenience macros/functions for D-Link DE-620 adapter *
/**********************************************************
* *
* Convenience macros/functions for D-Link DE-620 adapter *
static void de620_timeout(struct net_device *dev)
{
printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, "network cable problem");
static void de620_timeout(struct net_device *dev)
{
printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, "network cable problem");
/* Read the status register (_not_ the status port) */
irq_status = de620_get_register(dev, R_STS);
/* Read the status register (_not_ the status port) */
irq_status = de620_get_register(dev, R_STS);
next_rx_page = header_buf.Rx_NextPage; /* at least a try... */
de620_send_command(dev, W_DUMMY);
de620_set_register(dev, W_NPRF, next_rx_page);
next_rx_page = header_buf.Rx_NextPage; /* at least a try... */
de620_send_command(dev, W_DUMMY);
de620_set_register(dev, W_NPRF, next_rx_page);
skb = dev_alloc_skb(size+2);
if (skb == NULL) { /* Yeah, but no place to put it... */
printk(KERN_WARNING "%s: Couldn't allocate a sk_buff of size %d.\n", dev->name, size);
skb = dev_alloc_skb(size+2);
if (skb == NULL) { /* Yeah, but no place to put it... */
printk(KERN_WARNING "%s: Couldn't allocate a sk_buff of size %d.\n", dev->name, size);
}
else { /* Yep! Go get it! */
skb_reserve(skb,2); /* Align */
}
else { /* Yep! Go get it! */
skb_reserve(skb,2); /* Align */
/* skb->data points to the start of sk_buff data area */
buffer = skb_put(skb,size);
/* copy the packet into the buffer */
/* skb->data points to the start of sk_buff data area */
buffer = skb_put(skb,size);
/* copy the packet into the buffer */
/******************************************************************************
*
* Only start-up code below
/******************************************************************************
*
* Only start-up code below
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
}
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
}
dev->open = de620_open;
dev->stop = de620_close;
dev->hard_start_xmit = de620_start_xmit;
dev->tx_timeout = de620_timeout;
dev->watchdog_timeo = HZ*2;
dev->set_multicast_list = de620_set_multicast_list;
dev->open = de620_open;
dev->stop = de620_close;
dev->hard_start_xmit = de620_start_xmit;
dev->tx_timeout = de620_timeout;
dev->watchdog_timeo = HZ*2;
dev->set_multicast_list = de620_set_multicast_list;
/******************************************************************************
*
* Loadable module skeleton
/******************************************************************************
*
* Loadable module skeleton