#include <dev/mii/miivar.h>
#define INTERFACE_NAME_LEN 32
struct dp8390_softc {
struct device sc_dev;
void *sc_ih;
int sc_flags;
struct arpcom sc_arpcom;
struct mii_data sc_mii;
#define sc_media sc_mii.mii_media
bus_space_tag_t sc_regt;
bus_space_handle_t sc_regh;
bus_space_tag_t sc_buft;
bus_space_handle_t sc_bufh;
bus_size_t sc_reg_map[16];
int is790;
u_int8_t cr_proto;
u_int8_t rcr_proto;
u_int8_t dcr_reg;
int mem_start;
int mem_end;
int mem_size;
int mem_ring;
u_short txb_cnt;
u_short txb_inuse;
u_short txb_new;
u_short txb_next_tx;
u_short txb_len[8];
u_short tx_page_start;
u_short rec_page_start;
u_short rec_page_stop;
u_short next_packet;
int sc_enabled;
int (*test_mem)(struct dp8390_softc *);
void (*init_card)(struct dp8390_softc *);
void (*stop_card)(struct dp8390_softc *);
void (*read_hdr)(struct dp8390_softc *,
int, struct dp8390_ring *);
void (*recv_int)(struct dp8390_softc *);
int (*ring_copy)(struct dp8390_softc *,
int, caddr_t, u_short);
int (*write_mbuf)(struct dp8390_softc *, struct mbuf *, int);
int (*sc_enable)(struct dp8390_softc *);
void (*sc_disable)(struct dp8390_softc *);
void (*sc_media_init)(struct dp8390_softc *);
void (*sc_media_fini)(struct dp8390_softc *);
int (*sc_mediachange)(struct dp8390_softc *);
void (*sc_mediastatus)(struct dp8390_softc *,
struct ifmediareq *);
};
#define DP8390_VENDOR_UNKNOWN 0xff
#define DP8390_VENDOR_WD_SMC 0x00
#define DP8390_VENDOR_3COM 0x01
#define DP8390_VENDOR_NOVELL 0x02
#define DP8390_VENDOR_APPLE 0x10
#define DP8390_VENDOR_INTERLAN 0x11
#define DP8390_VENDOR_DAYNA 0x12
#define DP8390_VENDOR_ASANTE 0x13
#define DP8390_VENDOR_FARALLON 0x14
#define DP8390_VENDOR_FOCUS 0x15
#define DP8390_VENDOR_KINETICS 0x16
#define DP8390_VENDOR_CABLETRON 0x17
#define DP8390_DISABLE_TRANSCEIVER 0x0001
#define DP8390_FORCE_8BIT_MODE 0x0002
#define DP8390_FORCE_16BIT_MODE 0x0004
#define DP8390_NO_MULTI_BUFFERING 0x0008
#define DP8390_FORCE_PIO 0x0010
#define DP8390_DO_AX88190_WORKAROUND 0x0020
#define DP8390_ATTACHED 0x0040
#define DP8390_NO_REMOTE_DMA_COMPLETE 0x0080
#define NIC_GET(t, h, reg) bus_space_read_1(t, h, \
((sc)->sc_reg_map[reg]))
#define NIC_PUT(t, h, reg, val) bus_space_write_1(t, h, \
((sc)->sc_reg_map[reg]), (val))
#define NIC_BARRIER(t, h) bus_space_barrier(t, h, 0, 0x10, \
BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE)
int dp8390_config(struct dp8390_softc *);
int dp8390_intr(void *);
int dp8390_ioctl(struct ifnet *, u_long, caddr_t);
void dp8390_start(struct ifnet *);
void dp8390_watchdog(struct ifnet *);
void dp8390_reset(struct dp8390_softc *);
void dp8390_init(struct dp8390_softc *);
void dp8390_stop(struct dp8390_softc *);
int dp8390_enable(struct dp8390_softc *);
void dp8390_disable(struct dp8390_softc *);
int dp8390_mediachange(struct ifnet *);
void dp8390_mediastatus(struct ifnet *, struct ifmediareq *);
void dp8390_media_init(struct dp8390_softc *);
int dp8390_detach(struct dp8390_softc *, int);
void dp8390_rint(struct dp8390_softc *);
void dp8390_getmcaf(struct arpcom *, u_int8_t *);
struct mbuf *dp8390_get(struct dp8390_softc *, int, u_short);