Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85611
b: refs/heads/master
c: c991d16
h: refs/heads/master
i:
  85609: 6f71ab7
  85607: 028ee6f
v: v3
  • Loading branch information
Ben Dooks authored and Jeff Garzik committed Feb 11, 2008
1 parent c0b2f20 commit 38a4de0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 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: 41c340f0f89ce44be4956c146436c335dba47142
refs/heads/master: c991d168cb649d416c5a773a50d0754299f31366
28 changes: 22 additions & 6 deletions trunk/drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ dm9000_open(struct net_device *dev)
board_info_t *db = (board_info_t *) dev->priv;
unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK;

dev_dbg(db->dev, "entering %s\n", __func__);
if (netif_msg_ifup(db))
dev_dbg(db->dev, "enabling %s\n", dev->name);

/* If there is no IRQ type specified, default to something that
* may work, and tell the user that this is a problem */
Expand Down Expand Up @@ -855,7 +856,8 @@ dm9000_stop(struct net_device *ndev)
{
board_info_t *db = (board_info_t *) ndev->priv;

dm9000_dbg(db, 1, "entering %s\n", __func__);
if (netif_msg_ifdown(db))
dev_dbg(db->dev, "shutting down %s\n", ndev->name);

netif_stop_queue(ndev);
netif_carrier_off(ndev);
Expand Down Expand Up @@ -883,6 +885,9 @@ dm9000_tx_done(struct net_device *dev, board_info_t * db)
db->tx_pkt_cnt--;
dev->stats.tx_packets++;

if (netif_msg_tx_done(db))
dev_dbg(db->dev, "tx done, NSR %02x\n", tx_status);

/* Queue packet check & send */
if (db->tx_pkt_cnt > 0) {
iow(db, DM9000_TXPLL, db->queue_pkt_len & 0xff);
Expand Down Expand Up @@ -918,6 +923,9 @@ dm9000_interrupt(int irq, void *dev_id)
int_status = ior(db, DM9000_ISR); /* Got ISR */
iow(db, DM9000_ISR, int_status); /* Clear ISR status */

if (netif_msg_intr(db))
dev_dbg(db->dev, "interrupt status %02x\n", int_status);

/* Received the coming packet */
if (int_status & ISR_PRS)
dm9000_rx(dev);
Expand Down Expand Up @@ -982,10 +990,15 @@ dm9000_rx(struct net_device *dev)

RxLen = le16_to_cpu(rxhdr.RxLen);

if (netif_msg_rx_status(db))
dev_dbg(db->dev, "RX: status %02x, length %04x\n",
rxhdr.RxStatus, RxLen);

/* Packet Status check */
if (RxLen < 0x40) {
GoodPacket = false;
dev_dbg(db->dev, "Bad Packet received (runt)\n");
if (netif_msg_rx_err(db))
dev_dbg(db->dev, "RX: Bad Packet (runt)\n");
}

if (RxLen > DM9000_PKT_MAX) {
Expand All @@ -995,15 +1008,18 @@ dm9000_rx(struct net_device *dev)
if (rxhdr.RxStatus & 0xbf) {
GoodPacket = false;
if (rxhdr.RxStatus & 0x01) {
dev_dbg(db->dev, "fifo error\n");
if (netif_msg_rx_err(db))
dev_dbg(db->dev, "fifo error\n");
dev->stats.rx_fifo_errors++;
}
if (rxhdr.RxStatus & 0x02) {
dev_dbg(db->dev, "crc error\n");
if (netif_msg_rx_err(db))
dev_dbg(db->dev, "crc error\n");
dev->stats.rx_crc_errors++;
}
if (rxhdr.RxStatus & 0x80) {
dev_dbg(db->dev, "length error\n");
if (netif_msg_rx_err(db))
dev_dbg(db->dev, "length error\n");
dev->stats.rx_length_errors++;
}
}
Expand Down

0 comments on commit 38a4de0

Please sign in to comment.