static void mace_reset(struct net_device *dev) { struct mace_data *mp = netdev_priv(dev); volatile struct mace *mb = mp->mace; int i; /* soft-reset the chip */ i = 200; while (--i) { mb->biucc = SWRST; if (mb->biucc & SWRST) { udelay(10); continue; } break; } if (!i) { printk(KERN_ERR "macmace: cannot reset chip!\n"); return; } mb->maccc = 0; /* turn off tx, rx */ mb->imr = 0xFF; /* disable all intrs for now */ i = mb->ir; mb->biucc = XMTSP_64; mb->utr = RTRD; mb->fifocc = XMTFW_8 | RCVFW_64 | XMTFWU | RCVFWU; mb->xmtfc = AUTO_PAD_XMIT; /* auto-pad short frames */ mb->rcvfc = 0; /* load up the hardware address */ __mace_set_address(dev, dev->dev_addr); /* clear the multicast filter */ if (mp->chipid == BROKEN_ADDRCHG_REV) mb->iac = LOGADDR; else { mb->iac = ADDRCHG | LOGADDR; while ((mb->iac & ADDRCHG) != 0) ; } for (i = 0; i < 8; ++i) mb->ladrf = 0; /* done changing address */ if (mp->chipid != BROKEN_ADDRCHG_REV) mb->iac = 0; mb->plscc = PORTSEL_AUI; }
static void mace_reset(struct net_device *dev) { struct mace_data *mp = netdev_priv(dev); volatile struct mace *mb = mp->mace; int i; i = 200; while (--i) { mb->biucc = SWRST; if (mb->biucc & SWRST) { udelay(10); continue; } break; } if (!i) { printk(KERN_ERR "macmace: cannot reset chip!\n"); return; } mb->maccc = 0; mb->imr = 0xFF; i = mb->ir; mb->biucc = XMTSP_64; mb->utr = RTRD; mb->fifocc = XMTFW_8 | RCVFW_64 | XMTFWU | RCVFWU; mb->xmtfc = AUTO_PAD_XMIT; mb->rcvfc = 0; __mace_set_address(dev, dev->dev_addr); if (mp->chipid == BROKEN_ADDRCHG_REV) mb->iac = LOGADDR; else { mb->iac = ADDRCHG | LOGADDR; while ((mb->iac & ADDRCHG) != 0) ; } for (i = 0; i < 8; ++i) mb->ladrf = 0; if (mp->chipid != BROKEN_ADDRCHG_REV) mb->iac = 0; mb->plscc = PORTSEL_AUI; }
static int mace_set_address(struct net_device *dev, void *addr) { struct mace_data *mp = netdev_priv(dev); volatile struct mace *mb = mp->mace; unsigned long flags; u8 maccc; local_irq_save(flags); maccc = mb->maccc; __mace_set_address(dev, addr); mb->maccc = maccc; local_irq_restore(flags); return 0; }