|
@@ -645,8 +645,7 @@ static int netdev_open(struct net_device *dev)
|
|
goto out_err;
|
|
goto out_err;
|
|
|
|
|
|
if (debug > 1)
|
|
if (debug > 1)
|
|
- printk(KERN_DEBUG "%s: w89c840_open() irq %d\n",
|
|
|
|
- dev->name, dev->irq);
|
|
|
|
|
|
+ netdev_dbg(dev, "w89c840_open() irq %d\n", dev->irq);
|
|
|
|
|
|
if((i=alloc_ringdesc(dev)))
|
|
if((i=alloc_ringdesc(dev)))
|
|
goto out_err;
|
|
goto out_err;
|
|
@@ -658,7 +657,7 @@ static int netdev_open(struct net_device *dev)
|
|
|
|
|
|
netif_start_queue(dev);
|
|
netif_start_queue(dev);
|
|
if (debug > 2)
|
|
if (debug > 2)
|
|
- printk(KERN_DEBUG "%s: Done netdev_open()\n", dev->name);
|
|
|
|
|
|
+ netdev_dbg(dev, "Done netdev_open()\n");
|
|
|
|
|
|
/* Set the timer to check for link beat. */
|
|
/* Set the timer to check for link beat. */
|
|
init_timer(&np->timer);
|
|
init_timer(&np->timer);
|
|
@@ -787,9 +786,9 @@ static void netdev_timer(unsigned long data)
|
|
void __iomem *ioaddr = np->base_addr;
|
|
void __iomem *ioaddr = np->base_addr;
|
|
|
|
|
|
if (debug > 2)
|
|
if (debug > 2)
|
|
- printk(KERN_DEBUG "%s: Media selection timer tick, status %08x config %08x\n",
|
|
|
|
- dev->name, ioread32(ioaddr + IntrStatus),
|
|
|
|
- ioread32(ioaddr + NetworkConfig));
|
|
|
|
|
|
+ netdev_dbg(dev, "Media selection timer tick, status %08x config %08x\n",
|
|
|
|
+ ioread32(ioaddr + IntrStatus),
|
|
|
|
+ ioread32(ioaddr + NetworkConfig));
|
|
spin_lock_irq(&np->lock);
|
|
spin_lock_irq(&np->lock);
|
|
update_csr6(dev, update_link(dev));
|
|
update_csr6(dev, update_link(dev));
|
|
spin_unlock_irq(&np->lock);
|
|
spin_unlock_irq(&np->lock);
|
|
@@ -1056,8 +1055,8 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
|
|
spin_unlock_irq(&np->lock);
|
|
spin_unlock_irq(&np->lock);
|
|
|
|
|
|
if (debug > 4) {
|
|
if (debug > 4) {
|
|
- printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n",
|
|
|
|
- dev->name, np->cur_tx, entry);
|
|
|
|
|
|
+ netdev_dbg(dev, "Transmit frame #%d queued in slot %d\n",
|
|
|
|
+ np->cur_tx, entry);
|
|
}
|
|
}
|
|
return NETDEV_TX_OK;
|
|
return NETDEV_TX_OK;
|
|
}
|
|
}
|
|
@@ -1074,8 +1073,8 @@ static void netdev_tx_done(struct net_device *dev)
|
|
if (tx_status & 0x8000) { /* There was an error, log it. */
|
|
if (tx_status & 0x8000) { /* There was an error, log it. */
|
|
#ifndef final_version
|
|
#ifndef final_version
|
|
if (debug > 1)
|
|
if (debug > 1)
|
|
- printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n",
|
|
|
|
- dev->name, tx_status);
|
|
|
|
|
|
+ netdev_dbg(dev, "Transmit error, Tx status %08x\n",
|
|
|
|
+ tx_status);
|
|
#endif
|
|
#endif
|
|
np->stats.tx_errors++;
|
|
np->stats.tx_errors++;
|
|
if (tx_status & 0x0104) np->stats.tx_aborted_errors++;
|
|
if (tx_status & 0x0104) np->stats.tx_aborted_errors++;
|
|
@@ -1087,8 +1086,8 @@ static void netdev_tx_done(struct net_device *dev)
|
|
} else {
|
|
} else {
|
|
#ifndef final_version
|
|
#ifndef final_version
|
|
if (debug > 3)
|
|
if (debug > 3)
|
|
- printk(KERN_DEBUG "%s: Transmit slot %d ok, Tx status %08x\n",
|
|
|
|
- dev->name, entry, tx_status);
|
|
|
|
|
|
+ netdev_dbg(dev, "Transmit slot %d ok, Tx status %08x\n",
|
|
|
|
+ entry, tx_status);
|
|
#endif
|
|
#endif
|
|
np->stats.tx_bytes += np->tx_skbuff[entry]->len;
|
|
np->stats.tx_bytes += np->tx_skbuff[entry]->len;
|
|
np->stats.collisions += (tx_status >> 3) & 15;
|
|
np->stats.collisions += (tx_status >> 3) & 15;
|
|
@@ -1131,8 +1130,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
|
|
iowrite32(intr_status & 0x001ffff, ioaddr + IntrStatus);
|
|
iowrite32(intr_status & 0x001ffff, ioaddr + IntrStatus);
|
|
|
|
|
|
if (debug > 4)
|
|
if (debug > 4)
|
|
- printk(KERN_DEBUG "%s: Interrupt, status %04x\n",
|
|
|
|
- dev->name, intr_status);
|
|
|
|
|
|
+ netdev_dbg(dev, "Interrupt, status %04x\n", intr_status);
|
|
|
|
|
|
if ((intr_status & (NormalIntr|AbnormalIntr)) == 0)
|
|
if ((intr_status & (NormalIntr|AbnormalIntr)) == 0)
|
|
break;
|
|
break;
|
|
@@ -1173,8 +1171,8 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
|
|
} while (1);
|
|
} while (1);
|
|
|
|
|
|
if (debug > 3)
|
|
if (debug > 3)
|
|
- printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x\n",
|
|
|
|
- dev->name, ioread32(ioaddr + IntrStatus));
|
|
|
|
|
|
+ netdev_dbg(dev, "exiting interrupt, status=%#4.4x\n",
|
|
|
|
+ ioread32(ioaddr + IntrStatus));
|
|
return IRQ_RETVAL(handled);
|
|
return IRQ_RETVAL(handled);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1187,8 +1185,8 @@ static int netdev_rx(struct net_device *dev)
|
|
int work_limit = np->dirty_rx + RX_RING_SIZE - np->cur_rx;
|
|
int work_limit = np->dirty_rx + RX_RING_SIZE - np->cur_rx;
|
|
|
|
|
|
if (debug > 4) {
|
|
if (debug > 4) {
|
|
- printk(KERN_DEBUG " In netdev_rx(), entry %d status %04x\n",
|
|
|
|
- entry, np->rx_ring[entry].status);
|
|
|
|
|
|
+ netdev_dbg(dev, " In netdev_rx(), entry %d status %04x\n",
|
|
|
|
+ entry, np->rx_ring[entry].status);
|
|
}
|
|
}
|
|
|
|
|
|
/* If EOP is set on the next entry, it's a new packet. Send it up. */
|
|
/* If EOP is set on the next entry, it's a new packet. Send it up. */
|
|
@@ -1197,8 +1195,8 @@ static int netdev_rx(struct net_device *dev)
|
|
s32 status = desc->status;
|
|
s32 status = desc->status;
|
|
|
|
|
|
if (debug > 4)
|
|
if (debug > 4)
|
|
- printk(KERN_DEBUG " netdev_rx() status was %08x\n",
|
|
|
|
- status);
|
|
|
|
|
|
+ netdev_dbg(dev, " netdev_rx() status was %08x\n",
|
|
|
|
+ status);
|
|
if (status < 0)
|
|
if (status < 0)
|
|
break;
|
|
break;
|
|
if ((status & 0x38008300) != 0x0300) {
|
|
if ((status & 0x38008300) != 0x0300) {
|
|
@@ -1213,8 +1211,8 @@ static int netdev_rx(struct net_device *dev)
|
|
} else if (status & 0x8000) {
|
|
} else if (status & 0x8000) {
|
|
/* There was a fatal error. */
|
|
/* There was a fatal error. */
|
|
if (debug > 2)
|
|
if (debug > 2)
|
|
- printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
|
|
|
|
- dev->name, status);
|
|
|
|
|
|
+ netdev_dbg(dev, "Receive error, Rx status %08x\n",
|
|
|
|
+ status);
|
|
np->stats.rx_errors++; /* end of a packet.*/
|
|
np->stats.rx_errors++; /* end of a packet.*/
|
|
if (status & 0x0890) np->stats.rx_length_errors++;
|
|
if (status & 0x0890) np->stats.rx_length_errors++;
|
|
if (status & 0x004C) np->stats.rx_frame_errors++;
|
|
if (status & 0x004C) np->stats.rx_frame_errors++;
|
|
@@ -1227,8 +1225,8 @@ static int netdev_rx(struct net_device *dev)
|
|
|
|
|
|
#ifndef final_version
|
|
#ifndef final_version
|
|
if (debug > 4)
|
|
if (debug > 4)
|
|
- printk(KERN_DEBUG " netdev_rx() normal Rx pkt length %d status %x\n",
|
|
|
|
- pkt_len, status);
|
|
|
|
|
|
+ netdev_dbg(dev, " netdev_rx() normal Rx pkt length %d status %x\n",
|
|
|
|
+ pkt_len, status);
|
|
#endif
|
|
#endif
|
|
/* Check if the packet is long enough to accept without copying
|
|
/* Check if the packet is long enough to accept without copying
|
|
to a minimally-sized skbuff. */
|
|
to a minimally-sized skbuff. */
|
|
@@ -1253,10 +1251,10 @@ static int netdev_rx(struct net_device *dev)
|
|
#ifndef final_version /* Remove after testing. */
|
|
#ifndef final_version /* Remove after testing. */
|
|
/* You will want this info for the initial debug. */
|
|
/* You will want this info for the initial debug. */
|
|
if (debug > 5)
|
|
if (debug > 5)
|
|
- printk(KERN_DEBUG " Rx data %pM %pM %02x%02x %pI4\n",
|
|
|
|
- &skb->data[0], &skb->data[6],
|
|
|
|
- skb->data[12], skb->data[13],
|
|
|
|
- &skb->data[14]);
|
|
|
|
|
|
+ netdev_dbg(dev, " Rx data %pM %pM %02x%02x %pI4\n",
|
|
|
|
+ &skb->data[0], &skb->data[6],
|
|
|
|
+ skb->data[12], skb->data[13],
|
|
|
|
+ &skb->data[14]);
|
|
#endif
|
|
#endif
|
|
skb->protocol = eth_type_trans(skb, dev);
|
|
skb->protocol = eth_type_trans(skb, dev);
|
|
netif_rx(skb);
|
|
netif_rx(skb);
|
|
@@ -1294,8 +1292,7 @@ static void netdev_error(struct net_device *dev, int intr_status)
|
|
void __iomem *ioaddr = np->base_addr;
|
|
void __iomem *ioaddr = np->base_addr;
|
|
|
|
|
|
if (debug > 2)
|
|
if (debug > 2)
|
|
- printk(KERN_DEBUG "%s: Abnormal event, %08x\n",
|
|
|
|
- dev->name, intr_status);
|
|
|
|
|
|
+ netdev_dbg(dev, "Abnormal event, %08x\n", intr_status);
|
|
if (intr_status == 0xffffffff)
|
|
if (intr_status == 0xffffffff)
|
|
return;
|
|
return;
|
|
spin_lock(&np->lock);
|
|
spin_lock(&np->lock);
|
|
@@ -1315,8 +1312,7 @@ static void netdev_error(struct net_device *dev, int intr_status)
|
|
new = 127; /* load full packet before starting */
|
|
new = 127; /* load full packet before starting */
|
|
new = (np->csr6 & ~(0x7F << 14)) | (new<<14);
|
|
new = (np->csr6 & ~(0x7F << 14)) | (new<<14);
|
|
#endif
|
|
#endif
|
|
- printk(KERN_DEBUG "%s: Tx underflow, new csr6 %08x\n",
|
|
|
|
- dev->name, new);
|
|
|
|
|
|
+ netdev_dbg(dev, "Tx underflow, new csr6 %08x\n", new);
|
|
update_csr6(dev, new);
|
|
update_csr6(dev, new);
|
|
}
|
|
}
|
|
if (intr_status & RxDied) { /* Missed a Rx frame. */
|
|
if (intr_status & RxDied) { /* Missed a Rx frame. */
|
|
@@ -1489,13 +1485,12 @@ static int netdev_close(struct net_device *dev)
|
|
netif_stop_queue(dev);
|
|
netif_stop_queue(dev);
|
|
|
|
|
|
if (debug > 1) {
|
|
if (debug > 1) {
|
|
- printk(KERN_DEBUG "%s: Shutting down ethercard, status was %08x Config %08x\n",
|
|
|
|
- dev->name, ioread32(ioaddr + IntrStatus),
|
|
|
|
- ioread32(ioaddr + NetworkConfig));
|
|
|
|
- printk(KERN_DEBUG "%s: Queue pointers were Tx %d / %d, Rx %d / %d\n",
|
|
|
|
- dev->name,
|
|
|
|
- np->cur_tx, np->dirty_tx,
|
|
|
|
- np->cur_rx, np->dirty_rx);
|
|
|
|
|
|
+ netdev_dbg(dev, "Shutting down ethercard, status was %08x Config %08x\n",
|
|
|
|
+ ioread32(ioaddr + IntrStatus),
|
|
|
|
+ ioread32(ioaddr + NetworkConfig));
|
|
|
|
+ netdev_dbg(dev, "Queue pointers were Tx %d / %d, Rx %d / %d\n",
|
|
|
|
+ np->cur_tx, np->dirty_tx,
|
|
|
|
+ np->cur_rx, np->dirty_rx);
|
|
}
|
|
}
|
|
|
|
|
|
/* Stop the chip's Tx and Rx processes. */
|
|
/* Stop the chip's Tx and Rx processes. */
|