d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/*
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * CDDL HEADER START
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw *
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * The contents of this file are subject to the terms of the
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Common Development and Distribution License (the "License").
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * You may not use this file except in compliance with the License.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw *
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * or http://www.opensolaris.org/os/licensing.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * See the License for the specific language governing permissions
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * and limitations under the License.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw *
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * When distributing Covered Code, include this CDDL HEADER in each
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * If applicable, add the following below this CDDL HEADER, with the
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * fields enclosed by brackets "[]" replaced with your own identifying
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * information: Portions Copyright [yyyy] [name of copyright owner]
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw *
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * CDDL HEADER END
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/*
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Copyright (C) 2003-2005 Chelsio Communications. All rights reserved.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#pragma ident "%Z%%M% %I% %E% SMI" /* ch_compat.h */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#ifndef CHELSIO_T1_COMPAT_H
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define CHELSIO_T1_COMPAT_H
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#ifndef ETH_ALEN
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ETH_ALEN 6
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#endif
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* MAC and PHY link speeds */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwenum { SPEED_10, SPEED_100, SPEED_1000, SPEED_10000 };
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* MAC and PHY link duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwenum { DUPLEX_HALF, DUPLEX_FULL };
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* Autonegotiation settings */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwenum { AUTONEG_DISABLE, AUTONEG_ENABLE };
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#ifndef MII_BMCR
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* Generic MII registers and register fields. */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define MII_BMCR 0x00 /* Basic mode control register */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define MII_BMSR 0x01 /* Basic mode status register */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define MII_PHYSID1 0x02 /* PHYS ID 1 */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define MII_PHYSID2 0x03 /* PHYS ID 2 */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define MII_ADVERTISE 0x04 /* Advertisement control reg */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define MII_LPA 0x05 /* Link partner ability reg */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* Basic mode control register. */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_RESV 0x007f /* Unused... */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_CTST 0x0080 /* Collision test */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_FULLDPLX 0x0100 /* Full duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMCR_RESET 0x8000 /* Reset the DP83840 */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* Basic mode status register. */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_JCD 0x0002 /* Jabber detected */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_LSTATUS 0x0004 /* Link status */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_RFAULT 0x0010 /* Remote fault detected */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_RESV 0x07c0 /* Unused... */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* Advertisement control register. */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_SLCT 0x001f /* Selector bits */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_RESV 0x1c00 /* Unused... */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#endif
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* MAC and PHY supported features */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_10baseT_Half (1 << 0)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_10baseT_Full (1 << 1)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_100baseT_Half (1 << 2)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_100baseT_Full (1 << 3)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_1000baseT_Half (1 << 4)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_1000baseT_Full (1 << 5)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_10000baseT_Full (1 << 6)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_Autoneg (1 << 7)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_TP (1 << 8)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_FIBRE (1 << 9)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_PAUSE (1 << 10)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define SUPPORTED_LOOPBACK (1 << 11)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* Features advertised by PHY */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_10baseT_Half (1 << 0)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_10baseT_Full (1 << 1)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_100baseT_Half (1 << 2)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_100baseT_Full (1 << 3)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_1000baseT_Half (1 << 4)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_1000baseT_Full (1 << 5)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_10000baseT_Full (1 << 6)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_Autoneg (1 << 7)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_PAUSE (1 << 10)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define ADVERTISED_ASYM_PAUSE (1 << 12)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* diagnostic message categories */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwenum { LINK = 1, INTR = 2, HW = 4 };
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* diagnostic message levels */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* enum { INFO, DEBUG }; */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#ifndef __devinit
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define __devinit
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#endif
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#ifndef CH_DEVICE
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwstruct pci_device_id {
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw unsigned short devid;
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw unsigned short ssid;
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw unsigned short board_info_index;
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw};
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define CH_DEVICE_COMMON(devid, ssid, idx) { devid, ssid, idx }
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define CH_DEVICE(devid, ssid, idx) CH_DEVICE_COMMON(devid, ssid, idx)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#endif
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#endif