#ifndef _SYS_HME_H
#define _SYS_HME_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#define IPG1 8
#define IPG2 4
#define HME_2P0_REVID 0xa0
#define HME_2P1_REVID 0x20
#define HME_2P1_REVID_OBP 0x21
#define HME_1C0_REVID 0xc0
#define HME_2C0_REVID 0xc1
#define HME_REV_VERS_MASK 0x0f
typedef struct {
ddi_dma_handle_t dmah;
ddi_acc_handle_t acch;
caddr_t kaddr;
uint32_t paddr;
} hmebuf_t;
struct hme {
mac_handle_t hme_mh;
mii_handle_t hme_mii;
dev_info_t *dip;
int instance;
ulong_t pagesize;
int hme_mifpoll_enable;
int hme_frame_enable;
int hme_lance_mode_enable;
int hme_rxcv_enable;
uint32_t hme_lance_mode;
uint32_t hme_ipg0;
uint32_t hme_ipg1;
uint32_t hme_ipg2;
uint_t hme_burstsizes;
uint32_t hme_config;
int hme_phy_failure;
int hme_64bit_xfer;
int hme_phyad;
int hme_nlasttries;
int hme_cheerio_mode;
struct ether_addr hme_factaddr;
struct ether_addr hme_ouraddr;
uint32_t hme_addrflags;
uint32_t hme_flags;
boolean_t hme_wantw;
boolean_t hme_started;
uint8_t hme_devno;
uint16_t hme_ladrf[4];
uint32_t hme_ladrf_refcnt[64];
boolean_t hme_promisc;
uint32_t hme_multi;
struct hme_global *hme_globregp;
struct hme_etx *hme_etxregp;
struct hme_erx *hme_erxregp;
struct hme_bmac *hme_bmacregp;
struct hme_mif *hme_mifregp;
unsigned char *hme_romp;
kmutex_t hme_xmitlock;
kmutex_t hme_intrlock;
ddi_iblock_cookie_t hme_cookie;
struct hme_rmd *hme_rmdp;
struct hme_tmd *hme_tmdp;
ddi_dma_handle_t hme_rmd_dmah;
ddi_acc_handle_t hme_rmd_acch;
caddr_t hme_rmd_kaddr;
uint32_t hme_rmd_paddr;
ddi_dma_handle_t hme_tmd_dmah;
ddi_acc_handle_t hme_tmd_acch;
caddr_t hme_tmd_kaddr;
uint32_t hme_tmd_paddr;
uint64_t hme_rxindex;
uint64_t hme_txindex;
uint64_t hme_txreclaim;
hmebuf_t *hme_tbuf;
hmebuf_t *hme_rbuf;
ddi_device_acc_attr_t hme_dev_attr;
ddi_acc_handle_t hme_globregh;
ddi_acc_handle_t hme_etxregh;
ddi_acc_handle_t hme_erxregh;
ddi_acc_handle_t hme_bmacregh;
ddi_acc_handle_t hme_mifregh;
ddi_acc_handle_t hme_romh;
ddi_acc_handle_t pci_config_handle;
ddi_dma_handle_t hme_iopbhandle;
ulong_t hme_iopbkbase;
uint32_t hme_iopbiobase;
kstat_t *hme_ksp;
kstat_t *hme_intrstats;
uint64_t hme_ipackets;
uint64_t hme_rbytes;
uint64_t hme_ierrors;
uint64_t hme_opackets;
uint64_t hme_obytes;
uint64_t hme_oerrors;
uint64_t hme_multircv;
uint64_t hme_multixmt;
uint64_t hme_brdcstrcv;
uint64_t hme_brdcstxmt;
uint64_t hme_oflo;
uint64_t hme_uflo;
uint64_t hme_norcvbuf;
uint64_t hme_noxmtbuf;
uint64_t hme_duplex;
uint64_t hme_align_errors;
uint64_t hme_coll;
uint64_t hme_fcs_errors;
uint64_t hme_defer_xmts;
uint64_t hme_sqe_errors;
uint64_t hme_excol;
uint64_t hme_fstcol;
uint64_t hme_tlcol;
uint64_t hme_toolong_errors;
uint64_t hme_runt;
uint64_t hme_carrier_errors;
uint64_t hme_jab;
uint32_t hme_cvc;
uint32_t hme_lenerr;
uint32_t hme_buff;
uint32_t hme_missed;
uint32_t hme_nocanput;
uint32_t hme_allocbfail;
uint32_t hme_babl;
uint32_t hme_tmder;
uint32_t hme_txlaterr;
uint32_t hme_rxlaterr;
uint32_t hme_slvparerr;
uint32_t hme_txparerr;
uint32_t hme_rxparerr;
uint32_t hme_slverrack;
uint32_t hme_txerrack;
uint32_t hme_rxerrack;
uint32_t hme_txtagerr;
uint32_t hme_rxtagerr;
uint32_t hme_eoperr;
uint32_t hme_notmds;
uint32_t hme_notbufs;
uint32_t hme_norbufs;
uint32_t hme_starts;
uint32_t hme_txhung;
time_t hme_msg_time;
uint32_t inits;
uint32_t phyfail;
uint32_t asic_rev;
};
#define HMERUNNING 0x01
#define HMESUSPENDED 0x08
#define HMEINITIALIZED 0x10
#define HME_FACTADDR_PRESENT 0x01
#define HME_FACTADDR_USE 0x02
struct hmekstat {
struct kstat_named hk_cvc;
struct kstat_named hk_lenerr;
struct kstat_named hk_buff;
struct kstat_named hk_missed;
struct kstat_named hk_nocanput;
struct kstat_named hk_allocbfail;
struct kstat_named hk_babl;
struct kstat_named hk_tmder;
struct kstat_named hk_txlaterr;
struct kstat_named hk_rxlaterr;
struct kstat_named hk_slvparerr;
struct kstat_named hk_txparerr;
struct kstat_named hk_rxparerr;
struct kstat_named hk_slverrack;
struct kstat_named hk_txerrack;
struct kstat_named hk_rxerrack;
struct kstat_named hk_txtagerr;
struct kstat_named hk_rxtagerr;
struct kstat_named hk_eoperr;
struct kstat_named hk_notmds;
struct kstat_named hk_notbufs;
struct kstat_named hk_norbufs;
struct kstat_named hk_inits;
struct kstat_named hk_phyfail;
struct kstat_named hk_asic_rev;
};
#define HMEDRAINTIME (400000)
#define ROUNDUP(a, n) (((a) + ((n) - 1)) & ~((n) - 1))
#define ROUNDUP2(a, n) (uchar_t *)((((uintptr_t)(a)) + ((n) - 1)) & ~((n) - 1))
#define HMEBURSTSIZE (64)
#define HMEBURSTMASK (HMEBURSTSIZE - 1)
#define HMEBUFSIZE (1728)
#define HMEHEADROOM (34)
#define HME_FSTBYTE_OFFSET 2
#endif
#ifdef __cplusplus
}
#endif
#endif