git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dl2k: BMSR fixes
[safe/jmp/linux-2.6]
/
drivers
/
net
/
eepro.c
diff --git
a/drivers/net/eepro.c
b/drivers/net/eepro.c
index
09ff9b9
..
83bda6c
100644
(file)
--- a/
drivers/net/eepro.c
+++ b/
drivers/net/eepro.c
@@
-192,7
+192,6
@@
static unsigned int net_debug = NET_DEBUG;
/* Information that need to be kept for each board. */
struct eepro_local {
/* Information that need to be kept for each board. */
struct eepro_local {
- struct net_device_stats stats;
unsigned rx_start;
unsigned tx_start; /* start of the transmit chain */
int tx_last; /* pointer to last packet in the transmit chain */
unsigned rx_start;
unsigned tx_start; /* start of the transmit chain */
int tx_last; /* pointer to last packet in the transmit chain */
@@
-311,11
+310,10
@@
struct eepro_local {
static int eepro_probe1(struct net_device *dev, int autoprobe);
static int eepro_open(struct net_device *dev);
static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev);
static int eepro_probe1(struct net_device *dev, int autoprobe);
static int eepro_open(struct net_device *dev);
static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev);
-static irqreturn_t eepro_interrupt(int irq, void *dev_id
, struct pt_regs *regs
);
+static irqreturn_t eepro_interrupt(int irq, void *dev_id);
static void eepro_rx(struct net_device *dev);
static void eepro_transmit_interrupt(struct net_device *dev);
static int eepro_close(struct net_device *dev);
static void eepro_rx(struct net_device *dev);
static void eepro_transmit_interrupt(struct net_device *dev);
static int eepro_close(struct net_device *dev);
-static struct net_device_stats *eepro_get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static void eepro_tx_timeout (struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static void eepro_tx_timeout (struct net_device *dev);
@@
-514,7
+512,7
@@
buffer (transmit-buffer = 32K - receive-buffer).
/* a complete sel reset */
#define eepro_complete_selreset(ioaddr) { \
/* a complete sel reset */
#define eepro_complete_selreset(ioaddr) { \
-
lp
->stats.tx_errors++;\
+
dev
->stats.tx_errors++;\
eepro_sel_reset(ioaddr);\
lp->tx_end = \
lp->xmt_lower_limit;\
eepro_sel_reset(ioaddr);\
lp->tx_end = \
lp->xmt_lower_limit;\
@@
-537,8
+535,6
@@
static int __init do_eepro_probe(struct net_device *dev)
int base_addr = dev->base_addr;
int irq = dev->irq;
int base_addr = dev->base_addr;
int irq = dev->irq;
- SET_MODULE_OWNER(dev);
-
#ifdef PnPWakeup
/* XXXX for multiple cards should this only be run once? */
#ifdef PnPWakeup
/* XXXX for multiple cards should this only be run once? */
@@
-594,8
+590,6
@@
struct net_device * __init eepro_probe(int unit)
if (!dev)
return ERR_PTR(-ENODEV);
if (!dev)
return ERR_PTR(-ENODEV);
- SET_MODULE_OWNER(dev);
-
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
@@
-696,6
+690,7
@@
static void __init eepro_print_info (struct net_device *dev)
struct eepro_local * lp = netdev_priv(dev);
int i;
const char * ifmap[] = {"AUI", "10Base2", "10BaseT"};
struct eepro_local * lp = netdev_priv(dev);
int i;
const char * ifmap[] = {"AUI", "10Base2", "10BaseT"};
+ DECLARE_MAC_BUF(mac);
i = inb(dev->base_addr + ID_REG);
printk(KERN_DEBUG " id: %#x ",i);
i = inb(dev->base_addr + ID_REG);
printk(KERN_DEBUG " id: %#x ",i);
@@
-717,10
+712,10
@@
static void __init eepro_print_info (struct net_device *dev)
case LAN595:
printk("%s: Intel 82595-based lan card at %#x,",
dev->name, (unsigned)dev->base_addr);
case LAN595:
printk("%s: Intel 82595-based lan card at %#x,",
dev->name, (unsigned)dev->base_addr);
+ break;
}
}
- for (i=0; i < 6; i++)
- printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
+ printk(" %s", print_mac(mac, dev->dev_addr));
if (net_debug > 3)
printk(KERN_DEBUG ", %dK RCV buffer",
if (net_debug > 3)
printk(KERN_DEBUG ", %dK RCV buffer",
@@
-860,7
+855,6
@@
static int __init eepro_probe1(struct net_device *dev, int autoprobe)
dev->open = eepro_open;
dev->stop = eepro_close;
dev->hard_start_xmit = eepro_send_packet;
dev->open = eepro_open;
dev->stop = eepro_close;
dev->hard_start_xmit = eepro_send_packet;
- dev->get_stats = eepro_get_stats;
dev->set_multicast_list = &set_multicast_list;
dev->tx_timeout = eepro_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
dev->set_multicast_list = &set_multicast_list;
dev->tx_timeout = eepro_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
@@
-994,16
+988,6
@@
static int eepro_open(struct net_device *dev)
return -EAGAIN;
}
return -EAGAIN;
}
-#ifdef irq2dev_map
- if (((irq2dev_map[dev->irq] != 0)
- || (irq2dev_map[dev->irq] = dev) == 0) &&
- (irq2dev_map[dev->irq]!=dev)) {
- /* printk("%s: IRQ map wrong\n", dev->name); */
- free_irq(dev->irq, dev);
- return -EAGAIN;
- }
-#endif
-
/* Initialize the 82595. */
eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
/* Initialize the 82595. */
eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
@@
-1136,7
+1120,7
@@
static void eepro_tx_timeout (struct net_device *dev)
printk (KERN_ERR "%s: transmit timed out, %s?\n", dev->name,
"network cable problem");
/* This is not a duplicate. One message for the console,
printk (KERN_ERR "%s: transmit timed out, %s?\n", dev->name,
"network cable problem");
/* This is not a duplicate. One message for the console,
- one for the
the
log file */
+ one for the log file */
printk (KERN_DEBUG "%s: transmit timed out, %s?\n", dev->name,
"network cable problem");
eepro_complete_selreset(ioaddr);
printk (KERN_DEBUG "%s: transmit timed out, %s?\n", dev->name,
"network cable problem");
eepro_complete_selreset(ioaddr);
@@
-1168,9
+1152,9
@@
static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
if (hardware_send_packet(dev, buf, length))
/* we won't wake queue here because we're out of space */
if (hardware_send_packet(dev, buf, length))
/* we won't wake queue here because we're out of space */
-
lp
->stats.tx_dropped++;
+
dev
->stats.tx_dropped++;
else {
else {
-
lp
->stats.tx_bytes+=skb->len;
+
dev
->stats.tx_bytes+=skb->len;
dev->trans_start = jiffies;
netif_wake_queue(dev);
}
dev->trans_start = jiffies;
netif_wake_queue(dev);
}
@@
-1180,7
+1164,7
@@
static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb (skb);
/* You might need to clean up and record Tx statistics here. */
dev_kfree_skb (skb);
/* You might need to clean up and record Tx statistics here. */
- /*
lp
->stats.tx_aborted_errors++; */
+ /*
dev
->stats.tx_aborted_errors++; */
if (net_debug > 5)
printk(KERN_DEBUG "%s: exiting eepro_send_packet routine.\n", dev->name);
if (net_debug > 5)
printk(KERN_DEBUG "%s: exiting eepro_send_packet routine.\n", dev->name);
@@
-1196,19
+1180,13
@@
static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
Handle the network interface interrupts. */
static irqreturn_t
Handle the network interface interrupts. */
static irqreturn_t
-eepro_interrupt(int irq, void *dev_id
, struct pt_regs * regs
)
+eepro_interrupt(int irq, void *dev_id)
{
{
- struct net_device *dev = (struct net_device *)dev_id;
- /* (struct net_device *)(irq2dev_map[irq]);*/
+ struct net_device *dev = dev_id;
struct eepro_local *lp;
int ioaddr, status, boguscount = 20;
int handled = 0;
struct eepro_local *lp;
int ioaddr, status, boguscount = 20;
int handled = 0;
- if (dev == NULL) {
- printk (KERN_ERR "eepro_interrupt(): irq %d for unknown device.\\n", irq);
- return IRQ_NONE;
- }
-
lp = netdev_priv(dev);
spin_lock(&lp->lock);
lp = netdev_priv(dev);
spin_lock(&lp->lock);
@@
-1288,25
+1266,11
@@
static int eepro_close(struct net_device *dev)
/* release the interrupt */
free_irq(dev->irq, dev);
/* release the interrupt */
free_irq(dev->irq, dev);
-#ifdef irq2dev_map
- irq2dev_map[dev->irq] = 0;
-#endif
-
/* Update the statistics here. What statistics? */
return 0;
}
/* Update the statistics here. What statistics? */
return 0;
}
-/* Get the current statistics. This may be called with the card open or
- closed. */
-static struct net_device_stats *
-eepro_get_stats(struct net_device *dev)
-{
- struct eepro_local *lp = netdev_priv(dev);
-
- return &lp->stats;
-}
-
/* Set or clear the multicast filter for this adaptor.
*/
static void
/* Set or clear the multicast filter for this adaptor.
*/
static void
@@
-1599,19
+1563,18
@@
eepro_rx(struct net_device *dev)
/* Malloc up new buffer. */
struct sk_buff *skb;
/* Malloc up new buffer. */
struct sk_buff *skb;
-
lp
->stats.rx_bytes+=rcv_size;
+
dev
->stats.rx_bytes+=rcv_size;
rcv_size &= 0x3fff;
skb = dev_alloc_skb(rcv_size+5);
if (skb == NULL) {
printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
rcv_size &= 0x3fff;
skb = dev_alloc_skb(rcv_size+5);
if (skb == NULL) {
printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
-
lp
->stats.rx_dropped++;
+
dev
->stats.rx_dropped++;
rcv_car = lp->rx_start + RCV_HEADER + rcv_size;
lp->rx_start = rcv_next_frame;
outw(rcv_next_frame, ioaddr + HOST_ADDRESS_REG);
break;
}
rcv_car = lp->rx_start + RCV_HEADER + rcv_size;
lp->rx_start = rcv_next_frame;
outw(rcv_next_frame, ioaddr + HOST_ADDRESS_REG);
break;
}
- skb->dev = dev;
skb_reserve(skb,2);
if (lp->version == LAN595)
skb_reserve(skb,2);
if (lp->version == LAN595)
@@
-1627,28
+1590,28
@@
eepro_rx(struct net_device *dev)
skb->protocol = eth_type_trans(skb,dev);
netif_rx(skb);
dev->last_rx = jiffies;
skb->protocol = eth_type_trans(skb,dev);
netif_rx(skb);
dev->last_rx = jiffies;
-
lp
->stats.rx_packets++;
+
dev
->stats.rx_packets++;
}
else { /* Not sure will ever reach here,
I set the 595 to discard bad received frames */
}
else { /* Not sure will ever reach here,
I set the 595 to discard bad received frames */
-
lp
->stats.rx_errors++;
+
dev
->stats.rx_errors++;
if (rcv_status & 0x0100)
if (rcv_status & 0x0100)
-
lp
->stats.rx_over_errors++;
+
dev
->stats.rx_over_errors++;
else if (rcv_status & 0x0400)
else if (rcv_status & 0x0400)
-
lp
->stats.rx_frame_errors++;
+
dev
->stats.rx_frame_errors++;
else if (rcv_status & 0x0800)
else if (rcv_status & 0x0800)
-
lp
->stats.rx_crc_errors++;
+
dev
->stats.rx_crc_errors++;
printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n",
dev->name, rcv_event, rcv_status, rcv_next_frame, rcv_size);
}
if (rcv_status & 0x1000)
printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n",
dev->name, rcv_event, rcv_status, rcv_next_frame, rcv_size);
}
if (rcv_status & 0x1000)
-
lp
->stats.rx_length_errors++;
+
dev
->stats.rx_length_errors++;
rcv_car = lp->rx_start + RCV_HEADER + rcv_size;
lp->rx_start = rcv_next_frame;
rcv_car = lp->rx_start + RCV_HEADER + rcv_size;
lp->rx_start = rcv_next_frame;
@@
-1691,11
+1654,11
@@
eepro_transmit_interrupt(struct net_device *dev)
netif_wake_queue (dev);
if (xmt_status & TX_OK)
netif_wake_queue (dev);
if (xmt_status & TX_OK)
-
lp
->stats.tx_packets++;
+
dev
->stats.tx_packets++;
else {
else {
-
lp
->stats.tx_errors++;
+
dev
->stats.tx_errors++;
if (xmt_status & 0x0400) {
if (xmt_status & 0x0400) {
-
lp
->stats.tx_carrier_errors++;
+
dev
->stats.tx_carrier_errors++;
printk(KERN_DEBUG "%s: carrier error\n",
dev->name);
printk(KERN_DEBUG "%s: XMT status = %#x\n",
printk(KERN_DEBUG "%s: carrier error\n",
dev->name);
printk(KERN_DEBUG "%s: XMT status = %#x\n",
@@
-1709,11
+1672,11
@@
eepro_transmit_interrupt(struct net_device *dev)
}
}
if (xmt_status & 0x000f) {
}
}
if (xmt_status & 0x000f) {
-
lp
->stats.collisions += (xmt_status & 0x000f);
+
dev
->stats.collisions += (xmt_status & 0x000f);
}
if ((xmt_status & 0x0040) == 0x0) {
}
if ((xmt_status & 0x0040) == 0x0) {
-
lp
->stats.tx_heartbeat_errors++;
+
dev
->stats.tx_heartbeat_errors++;
}
}
}
}
}
}
@@
-1847,7
+1810,7
@@
int __init init_module(void)
return n_eepro ? 0 : -ENODEV;
}
return n_eepro ? 0 : -ENODEV;
}
-void
+void
__exit
cleanup_module(void)
{
int i;
cleanup_module(void)
{
int i;