X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fdm9000.c;h=0b0f1c407a7e87568c3f1f6f807208fe64ab4f46;hb=057b61afca098d3ad3d9e8d15914bc9f9315e425;hp=5ad2ec537684a5eda8ca1bcad93db619d4fa322c;hpb=f8dd0ecbb74d4b220b105d77c0633945ebb5453e;p=linux-2.6 diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 5ad2ec5376..0b0f1c407a 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c @@ -54,9 +54,6 @@ #define writesb outsb #define writesw outsw #define writesl outsl -#define DEFAULT_TRIGGER IRQF_TRIGGER_HIGH -#else -#define DEFAULT_TRIGGER (0) #endif /* @@ -343,6 +340,8 @@ static int dm9000_wait_eeprom(board_info_t *db) if ((status & EPCR_ERRE) == 0) break; + msleep(1); + if (timeout-- < 0) { dev_dbg(db->dev, "timeout waiting EEPROM\n"); break; @@ -889,19 +888,22 @@ dm9000_rx(struct net_device *dev) dev_dbg(db->dev, "RST: RX Len:%x\n", RxLen); } - if (rxhdr.RxStatus & 0xbf) { + /* rxhdr.RxStatus is identical to RSR register. */ + if (rxhdr.RxStatus & (RSR_FOE | RSR_CE | RSR_AE | + RSR_PLE | RSR_RWTO | + RSR_LCS | RSR_RF)) { GoodPacket = false; - if (rxhdr.RxStatus & 0x01) { + if (rxhdr.RxStatus & RSR_FOE) { if (netif_msg_rx_err(db)) dev_dbg(db->dev, "fifo error\n"); dev->stats.rx_fifo_errors++; } - if (rxhdr.RxStatus & 0x02) { + if (rxhdr.RxStatus & RSR_CE) { if (netif_msg_rx_err(db)) dev_dbg(db->dev, "crc error\n"); dev->stats.rx_crc_errors++; } - if (rxhdr.RxStatus & 0x80) { + if (rxhdr.RxStatus & RSR_RF) { if (netif_msg_rx_err(db)) dev_dbg(db->dev, "length error\n"); dev->stats.rx_length_errors++; @@ -1012,11 +1014,9 @@ dm9000_open(struct net_device *dev) /* If there is no IRQ type specified, default to something that * may work, and tell the user that this is a problem */ - if (irqflags == IRQF_TRIGGER_NONE) { + if (irqflags == IRQF_TRIGGER_NONE) dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n"); - irqflags = DEFAULT_TRIGGER; - } - + irqflags |= IRQF_SHARED; if (request_irq(dev->irq, &dm9000_interrupt, irqflags, dev->name, dev)) @@ -1070,7 +1070,7 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) /* Fill the phyxcer register into REG_0C */ iow(db, DM9000_EPAR, DM9000_PHY | reg); - iow(db, DM9000_EPCR, 0xc); /* Issue phyxcer read command */ + iow(db, DM9000_EPCR, EPCR_ERPRR | EPCR_EPOS); /* Issue phyxcer read command */ writeb(reg_save, db->io_addr); spin_unlock_irqrestore(&db->lock,flags); @@ -1121,7 +1121,7 @@ dm9000_phy_write(struct net_device *dev, iow(db, DM9000_EPDRL, value); iow(db, DM9000_EPDRH, value >> 8); - iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */ + iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW); /* Issue phyxcer write command */ writeb(reg_save, db->io_addr); spin_unlock_irqrestore(&db->lock, flags);