afeimpl.h revision 96fb08b94cc33de779f46f36c30d77230f1a8c2f
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Solaris driver for ethernet cards based on the ADMtek Centaur
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2007 by Garrett D'Amore <garrett@damore.org>.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Redistribution and use in source and binary forms, with or without
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * modification, are permitted provided that the following conditions
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * 1. Redistributions of source code must retain the above copyright
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * notice, this list of conditions and the following disclaimer.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * 2. Redistributions in binary form must reproduce the above copyright
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * notice, this list of conditions and the following disclaimer in the
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * documentation and/or other materials provided with the distribution.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * 3. Neither the name of the author nor the names of any co-contributors
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * may be used to endorse or promote products derived from this software
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * without specific prior written permission.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * POSSIBILITY OF SUCH DAMAGE.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Use is subject to license terms.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#pragma ident "%Z%%M% %I% %E% SMI"
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Compile time tunables.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define AFE_RXRING 128 /* number of rcv buffers */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define AFE_TXRING 128 /* number of xmt buffers */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define AFE_TXRECLAIM 8 /* when to reclaim tx buffers (txavail) */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define AFE_TXRESCHED 120 /* when to resched (txavail) */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define AFE_LINKTIMER 5000 /* how often we check link state (in msec) */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define AFE_HEADROOM 34 /* headroom in packet (should be 2 modulo 4) */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Constants, do not change.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define AFE_BUFSZ (1664) /* big enough for a vlan frame */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Card models.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikartypedef enum {
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar char *card_cardname; /* Description of the card */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar afe_model_t card_model; /* Card specific flags */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Device instance structure, one per PCI card.
int afe_flags;
int afe_rxhead;
int afe_txreclaim;
int afe_txsend;
int afe_txavail;
int afe_phyaddr;
int afe_phyid;
int afe_phyinuse;
int afe_forcefiber;
unsigned afe_norcvbuf;
unsigned afe_errrcv;
unsigned afe_errxmt;
unsigned afe_missed;
unsigned afe_underflow;
unsigned afe_overflow;
unsigned afe_align_errors;
unsigned afe_fcs_errors;
unsigned afe_carrier_errors;
unsigned afe_collisions;
unsigned afe_ex_collisions;
unsigned afe_tx_late_collisions;
unsigned afe_defer_xmts;
unsigned afe_first_collisions;
unsigned afe_multi_collisions;
unsigned afe_sqe_errors;
unsigned afe_macxmt_errors;
unsigned afe_macrcv_errors;
unsigned afe_toolong_errors;
unsigned afe_runt;
unsigned afe_jabber;
struct afe_rxbuf {
struct afe_txbuf {
struct afe_desc {
unsigned desc_status;
unsigned desc_control;
unsigned desc_buffer1;
unsigned desc_buffer2;
* Register definitions located in afe.h exported header file.
#ifdef DEBUG