EXPORT_SYMBOL(arcnet_dump_skb);
#endif
-
/*
* Dump the contents of an ARCnet buffer
*/
#endif
-
/*
* Unregister a protocol driver from the arc_proto_map. Protocol drivers
* are responsible for registering themselves, but the unregister routine
}
}
-
/*
* Add a buffer to the queue. Only the interrupt handler is allowed to do
* this, unless interrupts are disabled.
}
}
-
/*
* Get a buffer from the queue. If this returns -1, there are no buffers
* available.
}
}
-
BUGLVL(D_DURING) {
BUGMSG(D_DURING, "get_arcbuf: got #%d; buffer queue is now: ", buf);
for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5)
return buf;
}
-
static int choose_mtu(void)
{
int count, mtu = 65535;
arcdev_setup);
if (dev) {
struct arcnet_local *lp = netdev_priv(dev);
+
spin_lock_init(&lp->lock);
}
BUGMSG2(D_PROTO, "\n");
}
-
BUGMSG(D_INIT, "arcnet_open: resetting card.\n");
/* try to put the card in a defined state - if it fails the first
ACOMMAND(CFLAGScmd | RESETclear);
}
-
BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
/* make sure we're ready to receive IRQ's. */
AINTMASK(0);
return error;
}
-
/* The inverse routine to arcnet_open - shuts down the card. */
int arcnet_close(struct net_device *dev)
{
return 0;
}
-
static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned len)
BUGMSG(D_NORMAL, "arcnet_header: Yikes! skb->len(%d) != len(%d)!\n",
skb->len, len);
-
/* Type is host order - ? */
if (type == ETH_P_ARCNET) {
proto = arc_raw_proto;
return retval; /* no need to try again */
}
-
/*
* Actually start transmitting a packet that was loaded into a buffer
* by prepare_tx. This should _only_ be called by the interrupt handler.
return 1;
}
-
/* Called by the kernel when transmit times out */
void arcnet_timeout(struct net_device *dev)
{
netif_wake_queue(dev);
}
-
/*
* The typical workload of the driver: Handle the network interface
* interrupts. Establish which device needs attention, and call the correct
didsomething++;
}
-
/* a transmit finished, and we're interested in it. */
if ((status & lp->intmask & TXFREEflag) || lp->timed_out) {
lp->intmask &= ~(TXFREEflag | EXCNAKflag);
if (lp->outgoing.proto &&
lp->outgoing.proto->ack_tx) {
int ackstatus;
+
if (status & TXACKflag)
ackstatus = 2;
else if (lp->excnak_pending)
/* continue a split packet, if any */
if (lp->outgoing.proto && lp->outgoing.proto->continue_tx) {
int txbuf = get_arcbuf(dev);
+
if (txbuf != -1) {
if (lp->outgoing.proto->continue_tx(dev, txbuf)) {
/* that was the last segment */
ASTATUS(), boguscount);
BUGMSG(D_DURING, "\n");
-
AINTMASK(0);
udelay(1);
AINTMASK(lp->intmask);
return retval;
}
-
/*
* This is a generic packet receiver that calls arcnet??_rx depending on the
* protocol ID found.
arc_proto_map[soft->proto]->rx(dev, bufnum, &pkt, length);
}
-
static void null_rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length)
{
pkthdr->soft.rfc1201.proto, pkthdr->hard.source);
}
-
static int null_build_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, uint8_t daddr)
{
return 0;
}
-
/* the "do nothing" prepare_tx function warns that there's nothing to do. */
static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
int length, int bufnum)