struct rx_ringbuf {
volatile int in_index; /* queue index head */
int out_index; /* queue index tail */
int elem_size; /* size of each element */
int num_elem; /* number of elements */
char *buf_start; /* start of buffer pool */
};
struct rx_elem {
DWORD size; /* size copied to this element */
BYTE data[ETH_MAX+10]; /* add some margin. data[0] should be */
}; /* dword aligned */
extern BYTE *get_rxbuf (int len) LOCKED_FUNC;
extern int peek_rxbuf (BYTE **buf);
extern int release_rxbuf (BYTE *buf);
#else
#define LOCKED_VAR
#define LOCKED_FUNC
struct device {
const char *name;
const char *long_name;
DWORD base_addr; /* device I/O address */
int irq; /* device IRQ number */
int dma; /* DMA channel */
DWORD mem_start; /* shared mem start */
DWORD mem_end; /* shared mem end */
DWORD rmem_start; /* shmem "recv" start */
DWORD rmem_end; /* shared "recv" end */
struct device *next; /* next device in list */
/* interface service routines */
int (*probe)(struct device *dev);
int (*open) (struct device *dev);
void (*close)(struct device *dev);
int (*xmit) (struct device *dev, const void *buf, int len);
void *(*get_stats)(struct device *dev);
void (*set_multicast_list)(struct device *dev);
/* driver-to-pcap receive buffer routines */
int (*copy_rx_buf) (BYTE *buf, int max); /* rx-copy (pktdrvr only) */
BYTE *(*get_rx_buf) (int len); /* rx-buf fetch/enqueue */
int (*peek_rx_buf) (BYTE **buf); /* rx-non-copy at queue */
int (*release_rx_buf) (BYTE *buf); /* release after peek */
WORD flags; /* Low-level status flags. */
void *priv; /* private data */
};
/*
* Network device statistics
*/
typedef struct net_device_stats {
DWORD rx_packets; /* total packets received */
DWORD tx_packets; /* total packets transmitted */
DWORD rx_bytes; /* total bytes received */
DWORD tx_bytes; /* total bytes transmitted */
DWORD rx_errors; /* bad packets received */
DWORD tx_errors; /* packet transmit problems */
DWORD rx_dropped; /* no space in Rx buffers */
DWORD tx_dropped; /* no space available for Tx */
DWORD multicast; /* multicast packets received */