projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[netdrvr] irq handler minor cleanups in several drivers
[cascardo/linux.git]
/
drivers
/
net
/
declance.c
diff --git
a/drivers/net/declance.c
b/drivers/net/declance.c
index
95d854e
..
6b1e77c
100644
(file)
--- a/
drivers/net/declance.c
+++ b/
drivers/net/declance.c
@@
-258,8
+258,6
@@
struct lance_private {
int rx_new, tx_new;
int rx_old, tx_old;
int rx_new, tx_new;
int rx_old, tx_old;
- struct net_device_stats stats;
-
unsigned short busmaster_regval;
struct timer_list multicast_timer;
unsigned short busmaster_regval;
struct timer_list multicast_timer;
@@
-583,22
+581,22
@@
static int lance_rx(struct net_device *dev)
/* We got an incomplete frame? */
if ((bits & LE_R1_POK) != LE_R1_POK) {
/* We got an incomplete frame? */
if ((bits & LE_R1_POK) != LE_R1_POK) {
-
lp
->stats.rx_over_errors++;
-
lp
->stats.rx_errors++;
+
dev
->stats.rx_over_errors++;
+
dev
->stats.rx_errors++;
} else if (bits & LE_R1_ERR) {
/* Count only the end frame as a rx error,
* not the beginning
*/
if (bits & LE_R1_BUF)
} else if (bits & LE_R1_ERR) {
/* Count only the end frame as a rx error,
* not the beginning
*/
if (bits & LE_R1_BUF)
-
lp
->stats.rx_fifo_errors++;
+
dev
->stats.rx_fifo_errors++;
if (bits & LE_R1_CRC)
if (bits & LE_R1_CRC)
-
lp
->stats.rx_crc_errors++;
+
dev
->stats.rx_crc_errors++;
if (bits & LE_R1_OFL)
if (bits & LE_R1_OFL)
-
lp
->stats.rx_over_errors++;
+
dev
->stats.rx_over_errors++;
if (bits & LE_R1_FRA)
if (bits & LE_R1_FRA)
-
lp
->stats.rx_frame_errors++;
+
dev
->stats.rx_frame_errors++;
if (bits & LE_R1_EOP)
if (bits & LE_R1_EOP)
-
lp
->stats.rx_errors++;
+
dev
->stats.rx_errors++;
} else {
len = (*rds_ptr(rd, mblength, lp->type) & 0xfff) - 4;
skb = dev_alloc_skb(len + 2);
} else {
len = (*rds_ptr(rd, mblength, lp->type) & 0xfff) - 4;
skb = dev_alloc_skb(len + 2);
@@
-606,7
+604,7
@@
static int lance_rx(struct net_device *dev)
if (skb == 0) {
printk("%s: Memory squeeze, deferring packet.\n",
dev->name);
if (skb == 0) {
printk("%s: Memory squeeze, deferring packet.\n",
dev->name);
-
lp
->stats.rx_dropped++;
+
dev
->stats.rx_dropped++;
*rds_ptr(rd, mblength, lp->type) = 0;
*rds_ptr(rd, rmd1, lp->type) =
((lp->rx_buf_ptr_lnc[entry] >> 16) &
*rds_ptr(rd, mblength, lp->type) = 0;
*rds_ptr(rd, rmd1, lp->type) =
((lp->rx_buf_ptr_lnc[entry] >> 16) &
@@
-614,7
+612,7
@@
static int lance_rx(struct net_device *dev)
lp->rx_new = (entry + 1) & RX_RING_MOD_MASK;
return 0;
}
lp->rx_new = (entry + 1) & RX_RING_MOD_MASK;
return 0;
}
-
lp
->stats.rx_bytes += len;
+
dev
->stats.rx_bytes += len;
skb_reserve(skb, 2); /* 16 byte align */
skb_put(skb, len); /* make room */
skb_reserve(skb, 2); /* 16 byte align */
skb_put(skb, len); /* make room */
@@
-625,7
+623,7
@@
static int lance_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++;
}
/* Return the packet to the pool */
}
/* Return the packet to the pool */
@@
-660,14
+658,14
@@
static void lance_tx(struct net_device *dev)
if (*tds_ptr(td, tmd1, lp->type) & LE_T1_ERR) {
status = *tds_ptr(td, misc, lp->type);
if (*tds_ptr(td, tmd1, lp->type) & LE_T1_ERR) {
status = *tds_ptr(td, misc, lp->type);
-
lp
->stats.tx_errors++;
+
dev
->stats.tx_errors++;
if (status & LE_T3_RTY)
if (status & LE_T3_RTY)
-
lp
->stats.tx_aborted_errors++;
+
dev
->stats.tx_aborted_errors++;
if (status & LE_T3_LCOL)
if (status & LE_T3_LCOL)
-
lp
->stats.tx_window_errors++;
+
dev
->stats.tx_window_errors++;
if (status & LE_T3_CLOS) {
if (status & LE_T3_CLOS) {
-
lp
->stats.tx_carrier_errors++;
+
dev
->stats.tx_carrier_errors++;
printk("%s: Carrier Lost\n", dev->name);
/* Stop the lance */
writereg(&ll->rap, LE_CSR0);
printk("%s: Carrier Lost\n", dev->name);
/* Stop the lance */
writereg(&ll->rap, LE_CSR0);
@@
-681,7
+679,7
@@
static void lance_tx(struct net_device *dev)
* transmitter, restart the adapter.
*/
if (status & (LE_T3_BUF | LE_T3_UFL)) {
* transmitter, restart the adapter.
*/
if (status & (LE_T3_BUF | LE_T3_UFL)) {
-
lp
->stats.tx_fifo_errors++;
+
dev
->stats.tx_fifo_errors++;
printk("%s: Tx: ERR_BUF|ERR_UFL, restarting\n",
dev->name);
printk("%s: Tx: ERR_BUF|ERR_UFL, restarting\n",
dev->name);
@@
-702,13
+700,13
@@
static void lance_tx(struct net_device *dev)
/* One collision before packet was sent. */
if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EONE)
/* One collision before packet was sent. */
if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EONE)
-
lp
->stats.collisions++;
+
dev
->stats.collisions++;
/* More than one collision, be optimistic. */
if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EMORE)
/* More than one collision, be optimistic. */
if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EMORE)
-
lp
->stats.collisions += 2;
+
dev
->stats.collisions += 2;
-
lp
->stats.tx_packets++;
+
dev
->stats.tx_packets++;
}
j = (j + 1) & TX_RING_MOD_MASK;
}
}
j = (j + 1) & TX_RING_MOD_MASK;
}
@@
-721,15
+719,15
@@
out:
spin_unlock(&lp->lock);
}
spin_unlock(&lp->lock);
}
-static irqreturn_t lance_dma_merr_int(
const
int irq, void *dev_id)
+static irqreturn_t lance_dma_merr_int(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
{
struct net_device *dev = dev_id;
- printk("%s: DMA error\n", dev->name);
+ printk(
KERN_ERR
"%s: DMA error\n", dev->name);
return IRQ_HANDLED;
}
return IRQ_HANDLED;
}
-static irqreturn_t lance_interrupt(
const
int irq, void *dev_id)
+static irqreturn_t lance_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
struct lance_private *lp = netdev_priv(dev);
{
struct net_device *dev = dev_id;
struct lance_private *lp = netdev_priv(dev);
@@
-754,10
+752,10
@@
static irqreturn_t lance_interrupt(const int irq, void *dev_id)
lance_tx(dev);
if (csr0 & LE_C0_BABL)
lance_tx(dev);
if (csr0 & LE_C0_BABL)
-
lp
->stats.tx_errors++;
+
dev
->stats.tx_errors++;
if (csr0 & LE_C0_MISS)
if (csr0 & LE_C0_MISS)
-
lp
->stats.rx_errors++;
+
dev
->stats.rx_errors++;
if (csr0 & LE_C0_MERR) {
printk("%s: Memory error, status %04x\n", dev->name, csr0);
if (csr0 & LE_C0_MERR) {
printk("%s: Memory error, status %04x\n", dev->name, csr0);
@@
-912,7
+910,7
@@
static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
len = ETH_ZLEN;
}
len = ETH_ZLEN;
}
-
lp
->stats.tx_bytes += len;
+
dev
->stats.tx_bytes += len;
entry = lp->tx_new;
*lib_ptr(ib, btx_ring[entry].length, lp->type) = (-len);
entry = lp->tx_new;
*lib_ptr(ib, btx_ring[entry].length, lp->type) = (-len);
@@
-932,21
+930,12
@@
static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Kick the lance: transmit now */
writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD);
/* Kick the lance: transmit now */
writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD);
- spin_unlock_irq(&lp->lock);
-
dev->trans_start = jiffies;
dev_kfree_skb(skb);
return 0;
}
dev->trans_start = jiffies;
dev_kfree_skb(skb);
return 0;
}
-static struct net_device_stats *lance_get_stats(struct net_device *dev)
-{
- struct lance_private *lp = netdev_priv(dev);
-
- return &lp->stats;
-}
-
static void lance_load_multicast(struct net_device *dev)
{
struct lance_private *lp = netdev_priv(dev);
static void lance_load_multicast(struct net_device *dev)
{
struct lance_private *lp = netdev_priv(dev);
@@
-1038,6
+1027,7
@@
static int __init dec_lance_probe(struct device *bdev, const int type)
int i, ret;
unsigned long esar_base;
unsigned char *esar;
int i, ret;
unsigned long esar_base;
unsigned char *esar;
+ DECLARE_MAC_BUF(mac);
if (dec_lance_debug && version_printed++ == 0)
printk(version);
if (dec_lance_debug && version_printed++ == 0)
printk(version);
@@
-1225,28
+1215,26
@@
static int __init dec_lance_probe(struct device *bdev, const int type)
*/
switch (type) {
case ASIC_LANCE:
*/
switch (type) {
case ASIC_LANCE:
- printk("%s: IOASIC onboard LANCE
, addr =
", name);
+ printk("%s: IOASIC onboard LANCE", name);
break;
case PMAD_LANCE:
break;
case PMAD_LANCE:
- printk("%s: PMAD-AA
, addr =
", name);
+ printk("%s: PMAD-AA", name);
break;
case PMAX_LANCE:
break;
case PMAX_LANCE:
- printk("%s: PMAX onboard LANCE
, addr =
", name);
+ printk("%s: PMAX onboard LANCE", name);
break;
}
break;
}
- for (i = 0; i < 6; i++)
{
+ for (i = 0; i < 6; i++)
dev->dev_addr[i] = esar[i * 4];
dev->dev_addr[i] = esar[i * 4];
- printk("%2.2x%c", dev->dev_addr[i], i == 5 ? ',' : ':');
- }
- printk(" irq = %d\n", dev->irq);
+ printk(", addr = %s, irq = %d\n",
+ print_mac(mac, dev->dev_addr), dev->irq);
dev->open = &lance_open;
dev->stop = &lance_close;
dev->hard_start_xmit = &lance_start_xmit;
dev->tx_timeout = &lance_tx_timeout;
dev->watchdog_timeo = 5*HZ;
dev->open = &lance_open;
dev->stop = &lance_close;
dev->hard_start_xmit = &lance_start_xmit;
dev->tx_timeout = &lance_tx_timeout;
dev->watchdog_timeo = 5*HZ;
- dev->get_stats = &lance_get_stats;
dev->set_multicast_list = &lance_set_multicast;
/* lp->ll is the location of the registers for lance card */
dev->set_multicast_list = &lance_set_multicast;
/* lp->ll is the location of the registers for lance card */