2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * CDDL HEADER START
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * The contents of this file are subject to the terms of the
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Common Development and Distribution License (the "License").
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * You may not use this file except in compliance with the License.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * See the License for the specific language governing permissions
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * and limitations under the License.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * When distributing Covered Code, include this CDDL HEADER in each
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * If applicable, add the following below this CDDL HEADER, with the
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * fields enclosed by brackets "[]" replaced with your own identifying
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * information: Portions Copyright [yyyy] [name of copyright owner]
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * CDDL HEADER END
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Use is subject to license terms.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Number of descriptor entries for each ring. The no. of descriptors is bound
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * to 4K per ring (256 entries a 16 bytes).
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * The number of TX interrupts to "schedule" on the ring.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * The the periodic check interval of 2 seconds, in nano seconds
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * The number of TX checks that must pass without progress before we decide
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * to reset the adapter.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * All possible interrupts with the unwanted commented.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR0_STATSMAX | */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR0_RX_EARLY | */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR1_TIMER1 | */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR1_PHYEVENT | */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR1_TDERR | */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR1_SSRCI | */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR1_UINTR_SET| */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR1_UINTR_CLR| */ \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders /* VR_ICR1_PWEI */)
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Our definitions of RX and TX errors.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_ISR_ERR_BITS (VR_ISR_TX_ERR_BITS | \
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_MAX_PKTSZ (ETHERMAX + ETHERFCSL + VLAN_TAGSZ + VR_SLOPSZ)
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * PCI identification for the Rhine's.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Feature bits for the different cards.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_RX_PAUSE_CAP (1 << 0) /* can receive pauses */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_TX_PAUSE_CAP (1 << 1) /* can transmit pauses */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_MRDLNMULTIPLE (1 << 2) /* can read mult cache lines */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_TXCHKSUM (1 << 3) /* can do TX TCP checksum */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_RXCHKSUM (1 << 4) /* can do RX TCP checksum */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_CAMSUPPORT (1 << 5) /* has a CAM filter */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_VLANTAGGING (1 << 6) /* can do VLAN tagging */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_FEATURE_MIBCOUNTER (1 << 7) /* has a MIB counter */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Bug bits for the different cards.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_BUG_TXALIGN (1 << 0) /* needs aligned TX */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_BUG_NEEDMODE10T (1 << 1) /* chip needs mode10t secret */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_BUG_NEEDMIION (1 << 2) /* chip needs miion secret */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_BUG_NEEDMODE2PCEROPT (1 << 3) /* chip needs pceropt */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_BUG_NO_TXQUEUEING (1 << 4) /* chip cannot queue tx */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_BUG_NO_MEMIO (1 << 5) /* chip cannot memory space */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#define VR_BUG_MIIPOLLSTOP (1 << 6) /* special to stop polling */
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Clear bit b in register r.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Set bit b in register r.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Set bits b in register r to value v.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders VR_PUT8(acc, r, (VR_GET8(acc, r) & ~(b)) | (v))
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders VR_PUT16(acc, r, (VR_GET16(acc, r) & ~(b)) | (v))
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders VR_PUT32(acc, r, (VR_GET32(acc, r) & ~(b)) | (v))
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * The descriptor as used by the MAC.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * A structure describing an DMA object.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * A descriptor as used by the host.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Pause variations.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Type of medium attachement unit.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * A structure defining the various types of cards and their habits.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * A structure describing the card.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Operational parameters.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef enum {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Access attributes for the card.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Instance state structure.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulderstypedef struct {
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders * Function prototypes.
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Muldersint vr_mac_getstat(void *arg, uint_t stat, uint64_t *val);
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Muldersint vr_mac_set_promisc(void *vrp, boolean_t promiscflag);
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Muldersint vr_mac_set_multicast(void *vrp, boolean_t add,
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Muldersmblk_t *vr_mac_tx_enqueue_list(void *p, mblk_t *mp);
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Muldersint vr_mac_getprop(void *arg, const char *pr_name,
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Muldersint vr_mac_setprop(void *arg, const char *pr_name,
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyervoid vr_mac_propinfo(void *arg, const char *pr_name,
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer mac_prop_id_t pr_num, mac_prop_info_handle_t prh);
2ca5b6595b95478e6568b0e77c6c83c8a870867aJoost Mulders#endif /* _VR_H */