* time, actually reset it.
*/
error = -ENODEV;
- if (ARCRESET(0) && ARCRESET(1))
+ if (lp->hw.reset(dev, 0) && lp->hw.reset(dev, 1))
goto out_module_put;
newmtu = choose_mtu();
arc_printk(D_NORMAL, dev, "WARNING! Station address FF may confuse DOS networking programs!\n");
arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
- if (ASTATUS() & RESETflag) {
+ if (lp->hw.status(dev) & RESETflag) {
arc_printk(D_DEBUG, dev, "%s: %d: %s\n",
__FILE__, __LINE__, __func__);
- ACOMMAND(CFLAGScmd | RESETclear);
+ lp->hw.command(dev, CFLAGScmd | RESETclear);
}
arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
/* make sure we're ready to receive IRQ's. */
- AINTMASK(0);
+ lp->hw.intmask(dev, 0);
udelay(1); /* give it time to set the mask before
* we reset it again. (may not even be
* necessary)
*/
arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
lp->intmask = NORXflag | RECONflag;
- AINTMASK(lp->intmask);
+ lp->hw.intmask(dev, lp->intmask);
arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
netif_start_queue(dev);
netif_stop_queue(dev);
/* flush TX and disable RX */
- AINTMASK(0);
- ACOMMAND(NOTXcmd); /* stop transmit */
- ACOMMAND(NORXcmd); /* disable receive */
+ lp->hw.intmask(dev, 0);
+ lp->hw.command(dev, NOTXcmd); /* stop transmit */
+ lp->hw.command(dev, NORXcmd); /* disable receive */
mdelay(1);
/* shut down the card */
arc_printk(D_DURING, dev,
"transmit requested (status=%Xh, txbufs=%d/%d, len=%d, protocol %x)\n",
- ASTATUS(), lp->cur_tx, lp->next_tx, skb->len, skb->protocol);
+ lp->hw.status(dev), lp->cur_tx, lp->next_tx, skb->len, skb->protocol);
pkt = (struct archdr *)skb->data;
soft = &pkt->soft.rfc1201;
netif_stop_queue(dev);
spin_lock_irqsave(&lp->lock, flags);
- AINTMASK(0);
+ lp->hw.intmask(dev, 0);
if (lp->next_tx == -1)
txbuf = get_arcbuf(dev);
else
}
arc_printk(D_DEBUG, dev, "%s: %d: %s, status: %x\n",
- __FILE__, __LINE__, __func__, ASTATUS());
+ __FILE__, __LINE__, __func__, lp->hw.status(dev));
/* make sure we didn't ignore a TX IRQ while we were in here */
- AINTMASK(0);
+ lp->hw.intmask(dev, 0);
arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
lp->intmask |= TXFREEflag | EXCNAKflag;
- AINTMASK(lp->intmask);
+ lp->hw.intmask(dev, lp->intmask);
arc_printk(D_DEBUG, dev, "%s: %d: %s, status: %x\n",
- __FILE__, __LINE__, __func__, ASTATUS());
+ __FILE__, __LINE__, __func__, lp->hw.status(dev));
spin_unlock_irqrestore(&lp->lock, flags);
if (freeskb)
struct arcnet_local *lp = netdev_priv(dev);
arc_printk(D_DURING, dev, "go_tx: status=%Xh, intmask=%Xh, next_tx=%d, cur_tx=%d\n",
- ASTATUS(), lp->intmask, lp->next_tx, lp->cur_tx);
+ lp->hw.status(dev), lp->intmask, lp->next_tx, lp->cur_tx);
if (lp->cur_tx != -1 || lp->next_tx == -1)
return 0;
lp->next_tx = -1;
/* start sending */
- ACOMMAND(TXcmd | (lp->cur_tx << 3));
+ lp->hw.command(dev, TXcmd | (lp->cur_tx << 3));
dev->stats.tx_packets++;
lp->lasttrans_dest = lp->lastload_dest;
{
unsigned long flags;
struct arcnet_local *lp = netdev_priv(dev);
- int status = ASTATUS();
+ int status = lp->hw.status(dev);
char *msg;
spin_lock_irqsave(&lp->lock, flags);
msg = "";
dev->stats.tx_aborted_errors++;
lp->timed_out = 1;
- ACOMMAND(NOTXcmd | (lp->cur_tx << 3));
+ lp->hw.command(dev, NOTXcmd | (lp->cur_tx << 3));
}
dev->stats.tx_errors++;
/* make sure we didn't miss a TX or a EXC NAK IRQ */
- AINTMASK(0);
+ lp->hw.intmask(dev, 0);
lp->intmask |= TXFREEflag | EXCNAKflag;
- AINTMASK(lp->intmask);
+ lp->hw.intmask(dev, lp->intmask);
spin_unlock_irqrestore(&lp->lock, flags);
* clear it right away (but nothing else).
*/
if (!netif_running(dev)) {
- if (ASTATUS() & RESETflag)
- ACOMMAND(CFLAGScmd | RESETclear);
- AINTMASK(0);
+ if (lp->hw.status(dev) & RESETflag)
+ lp->hw.command(dev, CFLAGScmd | RESETclear);
+ lp->hw.intmask(dev, 0);
spin_unlock(&lp->lock);
return retval;
}
arc_printk(D_DURING, dev, "in arcnet_inthandler (status=%Xh, intmask=%Xh)\n",
- ASTATUS(), lp->intmask);
+ lp->hw.status(dev), lp->intmask);
boguscount = 5;
do {
- status = ASTATUS();
+ status = lp->hw.status(dev);
diagstatus = (status >> 8) & 0xFF;
arc_printk(D_DEBUG, dev, "%s: %d: %s: status=%x\n",
if (lp->cur_rx != -1) {
arc_printk(D_DURING, dev, "enabling receive to buffer #%d\n",
lp->cur_rx);
- ACOMMAND(RXcmd | (lp->cur_rx << 3) | RXbcasts);
+ lp->hw.command(dev, RXcmd | (lp->cur_rx << 3) | RXbcasts);
}
didsomething++;
}
arc_printk(D_DURING, dev, "EXCNAK IRQ (diagstat=%Xh)\n",
diagstatus);
- ACOMMAND(NOTXcmd); /* disable transmit */
+ lp->hw.command(dev, NOTXcmd); /* disable transmit */
lp->excnak_pending = 1;
- ACOMMAND(EXCNAKclear);
+ lp->hw.command(dev, EXCNAKclear);
lp->intmask &= ~(EXCNAKflag);
didsomething++;
}
didsomething++;
}
if (status & lp->intmask & RECONflag) {
- ACOMMAND(CFLAGScmd | CONFIGclear);
+ lp->hw.command(dev, CFLAGScmd | CONFIGclear);
dev->stats.tx_carrier_errors++;
arc_printk(D_RECON, dev, "Network reconfiguration detected (status=%Xh)\n",
} while (--boguscount && didsomething);
arc_printk(D_DURING, dev, "arcnet_interrupt complete (status=%Xh, count=%d)\n",
- ASTATUS(), boguscount);
+ lp->hw.status(dev), boguscount);
arc_printk(D_DURING, dev, "\n");
- AINTMASK(0);
+ lp->hw.intmask(dev, 0);
udelay(1);
- AINTMASK(lp->intmask);
+ lp->hw.intmask(dev, lp->intmask);
spin_unlock(&lp->lock);
return retval;