tg3: Convert code to use PHY_IS_FET
[safe/jmp/linux-2.6] / drivers / net / tg3.h
index 48f45c1..60b12ab 100644 (file)
 #define  TG3PCI_DEVICE_TIGON3_2                 0x1645 /* BCM5701 */
 #define  TG3PCI_DEVICE_TIGON3_3                 0x1646 /* BCM5702 */
 #define  TG3PCI_DEVICE_TIGON3_4                 0x1647 /* BCM5703 */
-#define TG3PCI_COMMAND                 0x00000004
-#define TG3PCI_STATUS                  0x00000006
-#define TG3PCI_CCREVID                 0x00000008
-#define TG3PCI_CACHELINESZ             0x0000000c
-#define TG3PCI_LATTIMER                        0x0000000d
-#define TG3PCI_HEADERTYPE              0x0000000e
-#define TG3PCI_BIST                    0x0000000f
-#define TG3PCI_BASE0_LOW               0x00000010
-#define TG3PCI_BASE0_HIGH              0x00000014
-/* 0x18 --> 0x2c unused */
-#define TG3PCI_SUBSYSVENID             0x0000002c
-#define TG3PCI_SUBSYSID                        0x0000002e
-#define TG3PCI_ROMADDR                 0x00000030
-#define TG3PCI_CAPLIST                 0x00000034
-/* 0x35 --> 0x3c unused */
-#define TG3PCI_IRQ_LINE                        0x0000003c
-#define TG3PCI_IRQ_PIN                 0x0000003d
-#define TG3PCI_MIN_GNT                 0x0000003e
-#define TG3PCI_MAX_LAT                 0x0000003f
-/* 0x40 --> 0x64 unused */
+#define  TG3PCI_DEVICE_TIGON3_5761S     0x1688
+#define  TG3PCI_DEVICE_TIGON3_5761SE    0x1689
+#define  TG3PCI_DEVICE_TIGON3_57780     0x1692
+#define  TG3PCI_DEVICE_TIGON3_57760     0x1690
+#define  TG3PCI_DEVICE_TIGON3_57790     0x1694
+#define  TG3PCI_DEVICE_TIGON3_57788     0x1691
+/* 0x04 --> 0x64 unused */
 #define TG3PCI_MSI_DATA                        0x00000064
 /* 0x66 --> 0x68 unused */
 #define TG3PCI_MISC_HOST_CTRL          0x00000068
 #define  CHIPREV_ID_5752_A1             0x6001
 #define  CHIPREV_ID_5714_A2             0x9002
 #define  CHIPREV_ID_5906_A1             0xc001
-#define  CHIPREV_ID_5784_A0             0x5784000
-#define  CHIPREV_ID_5784_A1             0x5784001
-#define  CHIPREV_ID_5761_A0             0x5761000
-#define  CHIPREV_ID_5761_A1             0x5761001
+#define  CHIPREV_ID_57780_A0            0x57780000
+#define  CHIPREV_ID_57780_A1            0x57780001
 #define  GET_ASIC_REV(CHIP_REV_ID)     ((CHIP_REV_ID) >> 12)
 #define   ASIC_REV_5700                         0x07
 #define   ASIC_REV_5701                         0x00
 #define   ASIC_REV_USE_PROD_ID_REG      0x0f
 #define   ASIC_REV_5784                         0x5784
 #define   ASIC_REV_5761                         0x5761
+#define   ASIC_REV_5785                         0x5785
+#define   ASIC_REV_57780                0x57780
 #define  GET_CHIP_REV(CHIP_REV_ID)     ((CHIP_REV_ID) >> 8)
 #define   CHIPREV_5700_AX               0x70
 #define   CHIPREV_5700_BX               0x71
 #define  DUAL_MAC_CTRL_ID               0x00000004
 #define TG3PCI_PRODID_ASICREV          0x000000bc
 #define  PROD_ID_ASIC_REV_MASK          0x0fffffff
-/* 0xc0 --> 0x100 unused */
+/* 0xc0 --> 0x110 unused */
 
-/* 0x100 --> 0x200 unused */
+#define TG3_CORR_ERR_STAT              0x00000110
+#define  TG3_CORR_ERR_STAT_CLEAR       0xffffffff
+/* 0x114 --> 0x200 unused */
 
 /* Mailbox registers */
 #define MAILBOX_INTERRUPT_0            0x00000200 /* 64-bit */
 #define  MAC_MODE_TDE_ENABLE            0x00200000
 #define  MAC_MODE_RDE_ENABLE            0x00400000
 #define  MAC_MODE_FHDE_ENABLE           0x00800000
+#define  MAC_MODE_KEEP_FRAME_IN_WOL     0x01000000
+#define  MAC_MODE_APE_RX_EN             0x08000000
+#define  MAC_MODE_APE_TX_EN             0x10000000
 #define MAC_STATUS                     0x00000404
 #define  MAC_STATUS_PCS_SYNCED          0x00000001
 #define  MAC_STATUS_SIGNAL_DET          0x00000002
 #define  MI_COM_DATA_MASK               0x0000ffff
 #define MAC_MI_STAT                    0x00000450
 #define  MAC_MI_STAT_LNKSTAT_ATTN_ENAB  0x00000001
+#define  MAC_MI_STAT_10MBPS_MODE        0x00000002
 #define MAC_MI_MODE                    0x00000454
 #define  MAC_MI_MODE_CLK_10MHZ          0x00000001
 #define  MAC_MI_MODE_SHORT_PREAMBLE     0x00000002
 #define MAC_SERDES_CFG                 0x00000590
 #define  MAC_SERDES_CFG_EDGE_SELECT     0x00001000
 #define MAC_SERDES_STAT                        0x00000594
-/* 0x598 --> 0x5b0 unused */
+/* 0x598 --> 0x5a0 unused */
+#define MAC_PHYCFG1                    0x000005a0
+#define  MAC_PHYCFG1_RGMII_INT          0x00000001
+#define  MAC_PHYCFG1_RXCLK_TO_MASK      0x00001ff0
+#define  MAC_PHYCFG1_RXCLK_TIMEOUT      0x00001000
+#define  MAC_PHYCFG1_TXCLK_TO_MASK      0x01ff0000
+#define  MAC_PHYCFG1_TXCLK_TIMEOUT      0x01000000
+#define  MAC_PHYCFG1_RGMII_EXT_RX_DEC   0x02000000
+#define  MAC_PHYCFG1_RGMII_SND_STAT_EN  0x04000000
+#define  MAC_PHYCFG1_TXC_DRV            0x20000000
+#define MAC_PHYCFG2                    0x000005a4
+#define  MAC_PHYCFG2_INBAND_ENABLE      0x00000001
+#define  MAC_PHYCFG2_EMODE_MASK_MASK    0x000001c0
+#define  MAC_PHYCFG2_EMODE_MASK_AC131   0x000000c0
+#define  MAC_PHYCFG2_EMODE_MASK_50610   0x00000100
+#define  MAC_PHYCFG2_EMODE_MASK_RT8211  0x00000000
+#define  MAC_PHYCFG2_EMODE_MASK_RT8201  0x000001c0
+#define  MAC_PHYCFG2_EMODE_COMP_MASK    0x00000e00
+#define  MAC_PHYCFG2_EMODE_COMP_AC131   0x00000600
+#define  MAC_PHYCFG2_EMODE_COMP_50610   0x00000400
+#define  MAC_PHYCFG2_EMODE_COMP_RT8211  0x00000800
+#define  MAC_PHYCFG2_EMODE_COMP_RT8201  0x00000000
+#define  MAC_PHYCFG2_FMODE_MASK_MASK    0x00007000
+#define  MAC_PHYCFG2_FMODE_MASK_AC131   0x00006000
+#define  MAC_PHYCFG2_FMODE_MASK_50610   0x00004000
+#define  MAC_PHYCFG2_FMODE_MASK_RT8211  0x00000000
+#define  MAC_PHYCFG2_FMODE_MASK_RT8201  0x00007000
+#define  MAC_PHYCFG2_FMODE_COMP_MASK    0x00038000
+#define  MAC_PHYCFG2_FMODE_COMP_AC131   0x00030000
+#define  MAC_PHYCFG2_FMODE_COMP_50610   0x00008000
+#define  MAC_PHYCFG2_FMODE_COMP_RT8211  0x00038000
+#define  MAC_PHYCFG2_FMODE_COMP_RT8201  0x00000000
+#define  MAC_PHYCFG2_GMODE_MASK_MASK    0x001c0000
+#define  MAC_PHYCFG2_GMODE_MASK_AC131   0x001c0000
+#define  MAC_PHYCFG2_GMODE_MASK_50610   0x00100000
+#define  MAC_PHYCFG2_GMODE_MASK_RT8211  0x00000000
+#define  MAC_PHYCFG2_GMODE_MASK_RT8201  0x001c0000
+#define  MAC_PHYCFG2_GMODE_COMP_MASK    0x00e00000
+#define  MAC_PHYCFG2_GMODE_COMP_AC131   0x00e00000
+#define  MAC_PHYCFG2_GMODE_COMP_50610   0x00000000
+#define  MAC_PHYCFG2_GMODE_COMP_RT8211  0x00200000
+#define  MAC_PHYCFG2_GMODE_COMP_RT8201  0x00000000
+#define  MAC_PHYCFG2_ACT_MASK_MASK      0x03000000
+#define  MAC_PHYCFG2_ACT_MASK_AC131     0x03000000
+#define  MAC_PHYCFG2_ACT_MASK_50610     0x01000000
+#define  MAC_PHYCFG2_ACT_MASK_RT8211    0x03000000
+#define  MAC_PHYCFG2_ACT_MASK_RT8201    0x01000000
+#define  MAC_PHYCFG2_ACT_COMP_MASK      0x0c000000
+#define  MAC_PHYCFG2_ACT_COMP_AC131     0x00000000
+#define  MAC_PHYCFG2_ACT_COMP_50610     0x00000000
+#define  MAC_PHYCFG2_ACT_COMP_RT8211    0x00000000
+#define  MAC_PHYCFG2_ACT_COMP_RT8201    0x08000000
+#define  MAC_PHYCFG2_QUAL_MASK_MASK     0x30000000
+#define  MAC_PHYCFG2_QUAL_MASK_AC131    0x30000000
+#define  MAC_PHYCFG2_QUAL_MASK_50610    0x30000000
+#define  MAC_PHYCFG2_QUAL_MASK_RT8211   0x30000000
+#define  MAC_PHYCFG2_QUAL_MASK_RT8201   0x30000000
+#define  MAC_PHYCFG2_QUAL_COMP_MASK     0xc0000000
+#define  MAC_PHYCFG2_QUAL_COMP_AC131    0x00000000
+#define  MAC_PHYCFG2_QUAL_COMP_50610    0x00000000
+#define  MAC_PHYCFG2_QUAL_COMP_RT8211   0x00000000
+#define  MAC_PHYCFG2_QUAL_COMP_RT8201   0x00000000
+#define MAC_PHYCFG2_50610_LED_MODES \
+       (MAC_PHYCFG2_EMODE_MASK_50610 | \
+        MAC_PHYCFG2_EMODE_COMP_50610 | \
+        MAC_PHYCFG2_FMODE_MASK_50610 | \
+        MAC_PHYCFG2_FMODE_COMP_50610 | \
+        MAC_PHYCFG2_GMODE_MASK_50610 | \
+        MAC_PHYCFG2_GMODE_COMP_50610 | \
+        MAC_PHYCFG2_ACT_MASK_50610 | \
+        MAC_PHYCFG2_ACT_COMP_50610 | \
+        MAC_PHYCFG2_QUAL_MASK_50610 | \
+        MAC_PHYCFG2_QUAL_COMP_50610)
+#define MAC_PHYCFG2_AC131_LED_MODES \
+       (MAC_PHYCFG2_EMODE_MASK_AC131 | \
+        MAC_PHYCFG2_EMODE_COMP_AC131 | \
+        MAC_PHYCFG2_FMODE_MASK_AC131 | \
+        MAC_PHYCFG2_FMODE_COMP_AC131 | \
+        MAC_PHYCFG2_GMODE_MASK_AC131 | \
+        MAC_PHYCFG2_GMODE_COMP_AC131 | \
+        MAC_PHYCFG2_ACT_MASK_AC131 | \
+        MAC_PHYCFG2_ACT_COMP_AC131 | \
+        MAC_PHYCFG2_QUAL_MASK_AC131 | \
+        MAC_PHYCFG2_QUAL_COMP_AC131)
+#define MAC_PHYCFG2_RTL8211C_LED_MODES \
+       (MAC_PHYCFG2_EMODE_MASK_RT8211 | \
+        MAC_PHYCFG2_EMODE_COMP_RT8211 | \
+        MAC_PHYCFG2_FMODE_MASK_RT8211 | \
+        MAC_PHYCFG2_FMODE_COMP_RT8211 | \
+        MAC_PHYCFG2_GMODE_MASK_RT8211 | \
+        MAC_PHYCFG2_GMODE_COMP_RT8211 | \
+        MAC_PHYCFG2_ACT_MASK_RT8211 | \
+        MAC_PHYCFG2_ACT_COMP_RT8211 | \
+        MAC_PHYCFG2_QUAL_MASK_RT8211 | \
+        MAC_PHYCFG2_QUAL_COMP_RT8211)
+#define MAC_PHYCFG2_RTL8201E_LED_MODES \
+       (MAC_PHYCFG2_EMODE_MASK_RT8201 | \
+        MAC_PHYCFG2_EMODE_COMP_RT8201 | \
+        MAC_PHYCFG2_FMODE_MASK_RT8201 | \
+        MAC_PHYCFG2_FMODE_COMP_RT8201 | \
+        MAC_PHYCFG2_GMODE_MASK_RT8201 | \
+        MAC_PHYCFG2_GMODE_COMP_RT8201 | \
+        MAC_PHYCFG2_ACT_MASK_RT8201 | \
+        MAC_PHYCFG2_ACT_COMP_RT8201 | \
+        MAC_PHYCFG2_QUAL_MASK_RT8201 | \
+        MAC_PHYCFG2_QUAL_COMP_RT8201)
+#define MAC_EXT_RGMII_MODE             0x000005a8
+#define  MAC_RGMII_MODE_TX_ENABLE       0x00000001
+#define  MAC_RGMII_MODE_TX_LOWPWR       0x00000002
+#define  MAC_RGMII_MODE_TX_RESET        0x00000004
+#define  MAC_RGMII_MODE_RX_INT_B        0x00000100
+#define  MAC_RGMII_MODE_RX_QUALITY      0x00000200
+#define  MAC_RGMII_MODE_RX_ACTIVITY     0x00000400
+#define  MAC_RGMII_MODE_RX_ENG_DET      0x00000800
+/* 0x5ac --> 0x5b0 unused */
 #define SERDES_RX_CTRL                 0x000005b0      /* 5780/5714 only */
 #define  SERDES_RX_SIG_DETECT           0x00000400
 #define SG_DIG_CTRL                    0x000005b0
 #define  RCVLPC_STATSCTRL_ENABLE        0x00000001
 #define  RCVLPC_STATSCTRL_FASTUPD       0x00000002
 #define RCVLPC_STATS_ENABLE            0x00002018
+#define  RCVLPC_STATSENAB_ASF_FIX       0x00000002
 #define  RCVLPC_STATSENAB_DACK_FIX      0x00040000
 #define  RCVLPC_STATSENAB_LNGBRST_RFIX  0x00400000
 #define RCVLPC_STATS_INCMASK           0x0000201c
 #define  RDMAC_MODE_MBUF_SBD_CRPT_ENAB  0x00002000
 #define  RDMAC_MODE_FIFO_SIZE_128       0x00020000
 #define  RDMAC_MODE_FIFO_LONG_BURST     0x00030000
+#define  RDMAC_MODE_IPV4_LSO_EN                 0x08000000
+#define  RDMAC_MODE_IPV6_LSO_EN                 0x10000000
 #define RDMAC_STATUS                   0x00004804
 #define  RDMAC_STATUS_TGTABORT          0x00000004
 #define  RDMAC_STATUS_MSTABORT          0x00000008
 #define  FLASH_5761VENDOR_ST_A_M45PE40  0x02000000
 #define  FLASH_5761VENDOR_ST_A_M45PE80  0x02000002
 #define  FLASH_5761VENDOR_ST_A_M45PE16  0x02000003
+#define  FLASH_57780VENDOR_ATMEL_AT45DB011D 0x00400000
+#define  FLASH_57780VENDOR_ATMEL_AT45DB011B 0x03400000
+#define  FLASH_57780VENDOR_ATMEL_AT45DB021D 0x00400002
+#define  FLASH_57780VENDOR_ATMEL_AT45DB021B 0x03400002
+#define  FLASH_57780VENDOR_ATMEL_AT45DB041D 0x00400001
+#define  FLASH_57780VENDOR_ATMEL_AT45DB041B 0x03400001
 #define  NVRAM_CFG1_5752PAGE_SIZE_MASK  0x70000000
 #define  FLASH_5752PAGE_SIZE_256        0x00000000
 #define  FLASH_5752PAGE_SIZE_512        0x10000000
 #define  FLASH_5752PAGE_SIZE_2K                 0x30000000
 #define  FLASH_5752PAGE_SIZE_4K                 0x40000000
 #define  FLASH_5752PAGE_SIZE_264        0x50000000
+#define  FLASH_5752PAGE_SIZE_528        0x60000000
 #define NVRAM_CFG2                     0x00007018
 #define NVRAM_CFG3                     0x0000701c
 #define NVRAM_SWARB                    0x00007020
 #define PCIE_TRANSACTION_CFG           0x00007c04
 #define PCIE_TRANS_CFG_1SHOT_MSI        0x20000000
 #define PCIE_TRANS_CFG_LOM              0x00000020
+/* 0x7c08 --> 0x7d28 unused */
 
 #define PCIE_PWR_MGMT_THRESH           0x00007d28
 #define PCIE_PWR_MGMT_L1_THRESH_MSK     0x0000ff00
+#define PCIE_PWR_MGMT_L1_THRESH_4MS     0x0000ff00
+#define PCIE_PWR_MGMT_EXT_ASPM_TMR_EN   0x01000000
+/* 0x7d2c --> 0x7d54 unused */
+
+#define TG3_PCIE_LNKCTL                        0x00007d54
+#define  TG3_PCIE_LNKCTL_L1_PLL_PD_EN   0x00000008
+#define  TG3_PCIE_LNKCTL_L1_PLL_PD_DIS  0x00000080
+/* 0x7d58 --> 0x7e70 unused */
+
+#define TG3_PCIE_EIDLE_DELAY           0x00007e70
+#define  TG3_PCIE_EIDLE_DELAY_MASK      0x0000001f
+#define  TG3_PCIE_EIDLE_DELAY_13_CLKS   0x0000000c
+/* 0x7e74 --> 0x8000 unused */
 
 
 /* OTP bit definitions */
 
 #define TG3_OTP_DEFAULT                        0x286c1640
 
+/* Hardware Selfboot NVRAM layout */
+#define TG3_NVM_HWSB_CFG1              0x00000004
+#define  TG3_NVM_HWSB_CFG1_MAJMSK      0xf8000000
+#define  TG3_NVM_HWSB_CFG1_MAJSFT      27
+#define  TG3_NVM_HWSB_CFG1_MINMSK      0x07c00000
+#define  TG3_NVM_HWSB_CFG1_MINSFT      22
 
 #define TG3_EEPROM_MAGIC               0x669955aa
 #define TG3_EEPROM_MAGIC_FW            0xa5000000
 #define TG3_NVM_DIRENT_SIZE            0xc
 #define TG3_NVM_DIRTYPE_SHIFT          24
 #define TG3_NVM_DIRTYPE_ASFINI         1
+#define TG3_NVM_PTREV_BCVER            0x94
+#define TG3_NVM_BCVER_MAJMSK           0x0000ff00
+#define TG3_NVM_BCVER_MAJSFT           8
+#define TG3_NVM_BCVER_MINMSK           0x000000ff
+
+#define TG3_EEPROM_SB_F1R0_EDH_OFF     0x10
+#define TG3_EEPROM_SB_F1R2_EDH_OFF     0x14
+#define TG3_EEPROM_SB_F1R2_MBA_OFF     0x10
+#define TG3_EEPROM_SB_F1R3_EDH_OFF     0x18
+#define TG3_EEPROM_SB_EDH_MAJ_MASK     0x00000700
+#define TG3_EEPROM_SB_EDH_MAJ_SHFT     8
+#define TG3_EEPROM_SB_EDH_MIN_MASK     0x000000ff
+#define TG3_EEPROM_SB_EDH_BLD_MASK     0x0000f800
+#define TG3_EEPROM_SB_EDH_BLD_SHFT     11
+
 
 /* 32K Window into NIC internal memory */
 #define NIC_SRAM_WIN_BASE              0x00008000
 
 #define NIC_SRAM_DATA_CFG_2            0x00000d38
 
+#define  NIC_SRAM_DATA_CFG_2_APD_EN     0x00000400
 #define  SHASTA_EXT_LED_MODE_MASK       0x00018000
 #define  SHASTA_EXT_LED_LEGACY          0x00000000
 #define  SHASTA_EXT_LED_SHARED          0x00008000
 #define NIC_SRAM_DATA_CFG_3            0x00000d3c
 #define  NIC_SRAM_ASPM_DEBOUNCE                 0x00000002
 
+#define NIC_SRAM_DATA_CFG_4            0x00000d60
+#define  NIC_SRAM_GMII_MODE             0x00000002
+#define  NIC_SRAM_RGMII_STD_IBND_DISABLE 0x00000004
+#define  NIC_SRAM_RGMII_EXT_IBND_RX_EN  0x00000008
+#define  NIC_SRAM_RGMII_EXT_IBND_TX_EN  0x00000010
+
 #define NIC_SRAM_RX_MINI_BUFFER_DESC   0x00001000
 
 #define NIC_SRAM_DMA_DESC_POOL_BASE    0x00002000
 
 #define MII_TG3_DSP_RW_PORT            0x15 /* DSP coefficient read/write port */
 
-#define MII_TG3_EPHY_PTEST             0x17 /* 5906 PHY register */
 #define MII_TG3_DSP_ADDRESS            0x17 /* DSP address register */
 
 #define MII_TG3_DSP_TAP1               0x0001
 
 #define MII_TG3_AUX_CTRL               0x18 /* auxilliary control register */
 
+#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010
+#define MII_TG3_AUXCTL_PCTL_SPR_ISOLATE        0x0020
+#define MII_TG3_AUXCTL_PCTL_VREG_11V   0x0180
+#define MII_TG3_AUXCTL_SHDWSEL_PWRCTL  0x0002
+
 #define MII_TG3_AUXCTL_MISC_WREN       0x8000
 #define MII_TG3_AUXCTL_MISC_FORCE_AMDIX        0x0200
 #define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000
 #define MII_TG3_ISTAT                  0x1a /* IRQ status register */
 #define MII_TG3_IMASK                  0x1b /* IRQ mask register */
 
-#define MII_TG3_MISC_SHDW              0x1c
-#define MII_TG3_MISC_SHDW_WREN         0x8000
-#define MII_TG3_MISC_SHDW_APD_SEL      0x2800
-
-#define MII_TG3_MISC_SHDW_APD_WKTM_84MS        0x0001
-
 /* ISTAT/IMASK event bits */
 #define MII_TG3_INT_LINKCHG            0x0002
 #define MII_TG3_INT_SPEEDCHG           0x0004
 
 #define MII_TG3_MISC_SHDW              0x1c
 #define MII_TG3_MISC_SHDW_WREN         0x8000
-#define MII_TG3_MISC_SHDW_SCR5_SEL     0x1400
+
+#define MII_TG3_MISC_SHDW_APD_WKTM_84MS        0x0001
+#define MII_TG3_MISC_SHDW_APD_ENABLE   0x0020
 #define MII_TG3_MISC_SHDW_APD_SEL      0x2800
 
 #define MII_TG3_MISC_SHDW_SCR5_C125OE  0x0001
 #define MII_TG3_MISC_SHDW_SCR5_SDTL    0x0004
 #define MII_TG3_MISC_SHDW_SCR5_DLPTLM  0x0008
 #define MII_TG3_MISC_SHDW_SCR5_LPED    0x0010
-
-#define MII_TG3_MISC_SHDW_APD_WKTM_84MS        0x0001
-#define MII_TG3_MISC_SHDW_APD_ENABLE   0x0020
-
-#define MII_TG3_EPHY_TEST              0x1f /* 5906 PHY register */
-#define MII_TG3_EPHY_SHADOW_EN         0x80
-
-#define MII_TG3_EPHYTST_MISCCTRL       0x10 /* 5906 EPHY misc ctrl shadow register */
-#define MII_TG3_EPHYTST_MISCCTRL_MDIX  0x4000
+#define MII_TG3_MISC_SHDW_SCR5_SEL     0x1400
 
 #define MII_TG3_TEST1                  0x1e
 #define MII_TG3_TEST1_TRIM_EN          0x0010
 #define MII_TG3_TEST1_CRC_EN           0x8000
 
+
+/* Fast Ethernet Tranceiver definitions */
+#define MII_TG3_FET_PTEST              0x17
+#define MII_TG3_FET_TEST               0x1f
+#define  MII_TG3_FET_SHADOW_EN         0x0080
+
+#define MII_TG3_FET_SHDW_MISCCTRL      0x10
+#define  MII_TG3_FET_SHDW_MISCCTRL_MDIX        0x4000
+
+#define MII_TG3_FET_SHDW_AUXSTAT2      0x1b
+#define  MII_TG3_FET_SHDW_AUXSTAT2_APD 0x0020
+
+
 /* APE registers.  Accessible through BAR1 */
 #define TG3_APE_EVENT                  0x000c
 #define  APE_EVENT_1                    0x00000001
 /* APE shared memory.  Accessible through BAR1 */
 #define TG3_APE_FW_STATUS              0x400c
 #define  APE_FW_STATUS_READY            0x00000100
+#define TG3_APE_FW_VERSION             0x4018
+#define  APE_FW_VERSION_MAJMSK          0xff000000
+#define  APE_FW_VERSION_MAJSFT          24
+#define  APE_FW_VERSION_MINMSK          0x00ff0000
+#define  APE_FW_VERSION_MINSFT          16
+#define  APE_FW_VERSION_REVMSK          0x0000ff00
+#define  APE_FW_VERSION_REVSFT          8
+#define  APE_FW_VERSION_BLDMSK          0x000000ff
 #define TG3_APE_HOST_SEG_SIG           0x4200
 #define  APE_HOST_SEG_SIG_MAGIC                 0x484f5354
 #define TG3_APE_HOST_SEG_LEN           0x4204
 #define  APE_EVENT_STATUS_EVENT_PENDING         0x80000000
 
 /* APE convenience enumerations. */
+#define TG3_APE_LOCK_GRC                1
 #define TG3_APE_LOCK_MEM                4
 
 #define TG3_EEPROM_SB_F1R2_MBA_OFF     0x10
@@ -2171,7 +2344,6 @@ struct ring_info {
 
 struct tx_ring_info {
        struct sk_buff                  *skb;
-       DECLARE_PCI_UNMAP_ADDR(mapping)
        u32                             prev_vlan_tag;
 };
 
@@ -2186,8 +2358,6 @@ struct tg3_link_config {
        u8                              duplex;
        u8                              autoneg;
        u8                              flowctrl;
-#define TG3_FLOW_CTRL_TX               0x01
-#define TG3_FLOW_CTRL_RX               0x02
 
        /* Describes what we actually have. */
        u8                              active_flowctrl;
@@ -2359,6 +2529,7 @@ struct tg3 {
        struct tg3_hw_status            *hw_status;
        dma_addr_t                      status_mapping;
        u32                             last_tag;
+       u32                             last_irq_tag;
 
        u32                             msg_enable;
 
@@ -2406,7 +2577,10 @@ struct tg3 {
        struct tg3_ethtool_stats        estats;
        struct tg3_ethtool_stats        estats_prev;
 
+       union {
        unsigned long                   phy_crc_errors;
+       unsigned long                   last_event_jiffies;
+       };
 
        u32                             rx_offset;
        u32                             tg3_flags;
@@ -2479,12 +2653,20 @@ struct tg3 {
        u32                             tg3_flags3;
 #define TG3_FLG3_NO_NVRAM_ADDR_TRANS   0x00000001
 #define TG3_FLG3_ENABLE_APE            0x00000002
-#define TG3_FLG3_5761_5784_AX_FIXES    0x00000004
 #define TG3_FLG3_5701_DMA_BUG          0x00000008
 #define TG3_FLG3_USE_PHYLIB            0x00000010
 #define TG3_FLG3_MDIOBUS_INITED                0x00000020
 #define TG3_FLG3_MDIOBUS_PAUSED                0x00000040
 #define TG3_FLG3_PHY_CONNECTED         0x00000080
+#define TG3_FLG3_RGMII_STD_IBND_DISABLE        0x00000100
+#define TG3_FLG3_RGMII_EXT_IBND_RX_EN  0x00000200
+#define TG3_FLG3_RGMII_EXT_IBND_TX_EN  0x00000400
+#define TG3_FLG3_CLKREQ_BUG            0x00000800
+#define TG3_FLG3_PHY_ENABLE_APD                0x00001000
+#define TG3_FLG3_5755_PLUS             0x00002000
+#define TG3_FLG3_NO_NVRAM              0x00004000
+#define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
+#define TG3_FLG3_PHY_IS_FET            0x00010000
 
        struct timer_list               timer;
        u16                             timer_counter;
@@ -2516,16 +2698,18 @@ struct tg3 {
 
        /* PCI block */
        u32                             pci_chip_rev_id;
+       u16                             pci_cmd;
        u8                              pci_cacheline_sz;
        u8                              pci_lat_timer;
-       u8                              pci_hdr_type;
-       u8                              pci_bist;
 
        int                             pm_cap;
        int                             msi_cap;
+       union {
        int                             pcix_cap;
+       int                             pcie_cap;
+       };
 
-       struct mii_bus                  mdio_bus;
+       struct mii_bus                  *mdio_bus;
        int                             mdio_irq[PHY_MAX_ADDR];
 
        /* PHY info */
@@ -2555,10 +2739,18 @@ struct tg3 {
 #define PHY_REV_BCM5401_B2             0x3
 #define PHY_REV_BCM5401_C0             0x6
 #define PHY_REV_BCM5411_X0             0x1 /* Found on Netgear GA302T */
+#define TG3_PHY_ID_BCM50610            0x143bd60
+#define TG3_PHY_ID_BCMAC131            0x143bc70
+#define TG3_PHY_ID_RTL8211C            0x001cc910
+#define TG3_PHY_ID_RTL8201E            0x00008200
+#define TG3_PHY_ID_BCM57780            0x03625d90
+#define TG3_PHY_OUI_MASK               0xfffffc00
+#define TG3_PHY_OUI_1                  0x00206000
+#define TG3_PHY_OUI_2                  0x0143bc00
+#define TG3_PHY_OUI_3                  0x03625c00
 
        u32                             led_ctrl;
        u32                             phy_otp;
-       u16                             pci_cmd;
 
        char                            board_part_number[24];
 #define TG3_VER_SIZE 32
@@ -2620,6 +2812,11 @@ struct tg3 {
 #define SST_25VF0X0_PAGE_SIZE          4098
 
        struct ethtool_coalesce         coal;
+
+       /* firmware info */
+       const char                      *fw_needed;
+       const struct firmware           *fw;
+       u32                             fw_len; /* includes BSS */
 };
 
 #endif /* !(_T3_H) */