/* * 7990.h -- LANCE ethernet IC generic routines. * This is an attempt to separate out the bits of various ethernet * drivers that are common because they all use the AMD 7990 LANCE * (Local Area Network Controller for Ethernet) chip. * * Copyright (C) 05/1998 Peter Maydell * * Most of this stuff was obtained by looking at other LANCE drivers, * in particular a2065.[ch]. The AMD C-LANCE datasheet was also helpful. */ #ifndef _7990_H #define _7990_H /* The lance only has two register locations. We communicate mostly via memory. */ #define LANCE_RDP 0 /* Register Data Port */ #define LANCE_RAP 2 /* Register Address Port */ /* Transmit/receive ring definitions. * We allow the specific drivers to override these defaults if they want to. * NB: according to lance.c, increasing the number of buffers is a waste * of space and reduces the chance that an upper layer will be able to * reorder queued Tx packets based on priority. [Clearly there is a minimum * limit too: too small and we drop rx packets and can't tx at full speed.] * 4+4 seems to be the usual setting; the atarilance driver uses 3 and 5. */ /* Blast! This won't work. The problem is that we can't specify a default * setting because that would cause the lance_init_block struct to be * too long (and overflow the RAM on shared-memory cards like the HP LANCE. */ #ifndef LANCE_LOG_TX_BUFFERS #define LANCE_LOG_TX_BUFFERS 1 #define LANCE_LOG_RX_BUFFERS 3 #endif #define TX_RING_SIZE (1<tx_old<=lp->tx_new)?\ lp->tx_old+lp->tx_ring_mod_mask-lp->tx_new:\ lp->tx_old - lp->tx_new-1) /* The LANCE only uses 24 bit addresses. This does the obvious thing. */ #define LANCE_ADDR(x) ((int)(x) & ~0xff000000) /* Now the prototypes we export */ extern int lance_open(struct net_device *dev); extern int lance_close (struct net_device *dev); extern int lance_start_xmit (struct sk_buff *skb, struct net_device *dev); extern void lance_set_multicast (struct net_device *dev); extern void lance_tx_timeout(struct net_device *dev); #ifdef CONFIG_NET_POLL_CONTROLLER extern void lance_poll(struct net_device *dev); #endif #endif /* ndef _7990_H */