a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * forcedeth.h -- Driver for NVIDIA nForce media access controllers for iPXE
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (c) 2010 Andrei Faur <da3drus@gmail.com>
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * This program is free software; you can redistribute it and/or
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * modify it under the terms of the GNU General Public License as
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * published by the Free Software Foundation; either version 2 of the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * License, or any later version.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * This program is distributed in the hope that it will be useful, but
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * WITHOUT ANY WARRANTY; without even the implied warranty of
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * General Public License for more details.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * You should have received a copy of the GNU General Public License
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * along with this program; if not, write to the Free Software
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Portions of this code are taken from the Linux forcedeth driver that was
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * based on a cleanroom reimplementation which was based on reverse engineered
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * documentation written by Carl-Daniel Hailfinger and Andrew de Quincey:
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (C) 2003,4,5 Manfred Spraul
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (C) 2004 Andrew de Quincey (wol support)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * IRQ rate fixes, bigendian fixes, cleanups, verification)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (c) 2004,2005,2006,2007,2008,2009 NVIDIA Corporation
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * This header is a direct copy of #define lines and structs found in the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * above mentioned driver, modified where necessary to make them work for iPXE.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define RXTX_RING_SIZE ( ( RX_RING_SIZE ) + ( TX_RING_SIZE ) )
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define RX_BUF_SZ ( ( ETH_FRAME_LEN ) + ( NV_RX_HEADERS ) )
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/* PHY defines */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/* MSI/MSI-X defines */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/* Hardware access */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_NEED_TIMERIRQ 0x0000001 /* set the timer irq flag in the irq mask */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_NEED_LINKTIMER 0x0000002 /* poll link settings. Relies on the timer irq */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_LARGEDESC 0x0000004 /* device supports jumbo frames and needs packet format 2 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_HIGH_DMA 0x0000008 /* device supports 64bit dma */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_CHECKSUM 0x0000010 /* device supports tx and rx checksum offloads */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_VLAN 0x0000020 /* device supports vlan tagging and striping */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_MSI 0x0000040 /* device supports MSI */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_MSI_X 0x0000080 /* device supports MSI-X */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_POWER_CNTRL 0x0000100 /* device supports power savings */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_STATISTICS_V1 0x0000200 /* device supports hw statistics version 1 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_STATISTICS_V2 0x0000600 /* device supports hw statistics version 2 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_STATISTICS_V3 0x0000e00 /* device supports hw statistics version 3 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_TEST_EXTENDED 0x0001000 /* device supports extended diagnostic test */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_MGMT_UNIT 0x0002000 /* device supports management unit */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_CORRECT_MACADDR 0x0004000 /* device supports correct mac address order */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_COLLISION_FIX 0x0008000 /* device supports tx collision fix */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_PAUSEFRAME_TX_V1 0x0010000 /* device supports tx pause frames version 1 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_PAUSEFRAME_TX_V2 0x0020000 /* device supports tx pause frames version 2 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_PAUSEFRAME_TX_V3 0x0040000 /* device supports tx pause frames version 3 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_NEED_TX_LIMIT 0x0080000 /* device needs to limit tx */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_NEED_TX_LIMIT2 0x0180000 /* device needs to limit tx, expect for some revs */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_HAS_GEAR_MODE 0x0200000 /* device supports gear mode */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_NEED_PHY_INIT_FIX 0x0400000 /* device needs specific phy workaround */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_NEED_LOW_POWER_FIX 0x0800000 /* device needs special power up workaround */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define DEV_NEED_MSI_FIX 0x1000000 /* device needs msi workaround */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/* error and valid are the same for both */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NV_TX2_TSO_MAX_SIZE (1<<NV_TX2_TSO_MAX_SHIFT)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NV_RX_ERROR_MASK (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4|NV_RX_CRCERR|NV_RX_OVERFLOW|NV_RX_FRAMINGERR)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/* error and avail are the same for both */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NV_RX2_ERROR_MASK (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3|NV_RX2_ERROR4|NV_RX2_CRCERR|NV_RX2_OVERFLOW|NV_RX2_FRAMINGERR)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/* Miscellaneous hardware related defines */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/* various timeout delays: all in usec */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /* rx specific fields */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /* tx specific fields */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /* flow control */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NVREG_IRQ_TX_ALL (NVREG_IRQ_TX_ERR|NVREG_IRQ_TX_OK|NVREG_IRQ_TX_FORCED)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NVREG_IRQ_RX_ALL (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_RX_FORCED)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NVREG_IRQ_OTHER (NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RECOVER_ERROR)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * NVREG_POLL_DEFAULT is the interval length of the timer source on the nic
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * NVREG_POLL_DEFAULT=97 would result in an interval length of 1 ms
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NVREG_POLL_DEFAULT_THROUGHPUT 65535 /* backup tx cleanup if loop max reached */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NVREG_TX_DEFERRAL_RGMII_STRETCH_100 0x16300f
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#endif /* _FORCEDETH_H_ */