sfc: Rename Falcon-specific board code and types
[safe/jmp/linux-2.6] / drivers / net / tg3.h
index 685d971..bab7940 100644 (file)
 #define  TG3PCI_DEVICE_TIGON3_57788     0x1691
 #define  TG3PCI_DEVICE_TIGON3_5785_G    0x1699 /* GPHY */
 #define  TG3PCI_DEVICE_TIGON3_5785_F    0x16a0 /* 10/100 only */
+#define  TG3PCI_DEVICE_TIGON3_5717C     0x1655
+#define  TG3PCI_DEVICE_TIGON3_5717S     0x1656
+#define  TG3PCI_DEVICE_TIGON3_5718C     0x1665
+#define  TG3PCI_DEVICE_TIGON3_5718S     0x1666
 /* 0x04 --> 0x64 unused */
 #define TG3PCI_MSI_DATA                        0x00000064
 /* 0x66 --> 0x68 unused */
 #define   ASIC_REV_5761                         0x5761
 #define   ASIC_REV_5785                         0x5785
 #define   ASIC_REV_57780                0x57780
+#define   ASIC_REV_5717                         0x5717
 #define  GET_CHIP_REV(CHIP_REV_ID)     ((CHIP_REV_ID) >> 8)
 #define   CHIPREV_5700_AX               0x70
 #define   CHIPREV_5700_BX               0x71
 #define TG3PCI_MEM_WIN_BASE_ADDR       0x0000007c
 #define TG3PCI_REG_DATA                        0x00000080
 #define TG3PCI_MEM_WIN_DATA            0x00000084
-#define TG3PCI_MODE_CTRL               0x00000088
-#define TG3PCI_MISC_CFG                        0x0000008c
 #define TG3PCI_MISC_LOCAL_CTRL         0x00000090
 /* 0x94 --> 0x98 unused */
 #define TG3PCI_STD_RING_PROD_IDX       0x00000098 /* 64-bit */
 #define TG3PCI_RCV_RET_RING_CON_IDX    0x000000a0 /* 64-bit */
-#define TG3PCI_SND_PROD_IDX            0x000000a8 /* 64-bit */
-/* 0xb0 --> 0xb8 unused */
+/* 0xa0 --> 0xb8 unused */
 #define TG3PCI_DUAL_MAC_CTRL           0x000000b8
 #define  DUAL_MAC_CTRL_CH_MASK          0x00000003
 #define  DUAL_MAC_CTRL_ID               0x00000004
 #define TG3PCI_PRODID_ASICREV          0x000000bc
 #define  PROD_ID_ASIC_REV_MASK          0x0fffffff
-/* 0xc0 --> 0x110 unused */
+/* 0xc0 --> 0xf4 unused */
+
+#define TG3PCI_GEN2_PRODID_ASICREV     0x000000f4
+/* 0xf8 --> 0x200 unused */
 
 #define TG3_CORR_ERR_STAT              0x00000110
 #define  TG3_CORR_ERR_STAT_CLEAR       0xffffffff
 #define  SG_DIG_PARTNER_FULL_DUPLEX     0x00020000 /* If !MRADV_CRC16_SELECT */
 #define  SG_DIG_PARTNER_NEXT_PAGE       0x00010000 /* If !MRADV_CRC16_SELECT */
 #define  SG_DIG_AUTONEG_STATE_MASK      0x00000ff0
+#define  SG_DIG_IS_SERDES               0x00000100
 #define  SG_DIG_COMMA_DETECTOR          0x00000008
 #define  SG_DIG_MAC_ACK_STATUS          0x00000004
 #define  SG_DIG_AUTONEG_COMPLETE        0x00000002
 #define RCVBDI_MINI_THRESH             0x00002c14
 #define RCVBDI_STD_THRESH              0x00002c18
 #define RCVBDI_JUMBO_THRESH            0x00002c1c
-/* 0x2c20 --> 0x3000 unused */
+/* 0x2c20 --> 0x2d00 unused */
+
+#define STD_REPLENISH_LWM              0x00002d00
+#define JMB_REPLENISH_LWM              0x00002d04
+/* 0x2d08 --> 0x3000 unused */
 
 /* Receive BD Completion Control Registers */
 #define RCVCC_MODE                     0x00003000
 #define TG3_CPMU_HST_ACC               0x0000361c
 #define  CPMU_HST_ACC_MACCLK_MASK       0x001f0000
 #define  CPMU_HST_ACC_MACCLK_6_25       0x00130000
-/* 0x3620 --> 0x3630 unused */
+/* 0x3620 --> 0x362c unused */
 
+#define TG3_CPMU_STATUS                        0x0000362c
+#define  TG3_CPMU_STATUS_PCIE_FUNC      0x20000000
 #define TG3_CPMU_CLCK_STAT             0x00003630
 #define  CPMU_CLCK_STAT_MAC_CLCK_MASK   0x001f0000
 #define  CPMU_CLCK_STAT_MAC_CLCK_62_5   0x00000000
 #define MSGINT_MODE                    0x00006000
 #define  MSGINT_MODE_RESET              0x00000001
 #define  MSGINT_MODE_ENABLE             0x00000002
+#define  MSGINT_MODE_ONE_SHOT_DISABLE   0x00000020
 #define  MSGINT_MODE_MULTIVEC_EN        0x00000080
 #define MSGINT_STATUS                  0x00006004
 #define MSGINT_FIFO                    0x00006008
 #define  FLASH_57780VENDOR_ATMEL_AT45DB021B 0x03400002
 #define  FLASH_57780VENDOR_ATMEL_AT45DB041D 0x00400001
 #define  FLASH_57780VENDOR_ATMEL_AT45DB041B 0x03400001
+#define  FLASH_5717VENDOR_ATMEL_EEPROM  0x02000001
+#define  FLASH_5717VENDOR_MICRO_EEPROM  0x02000003
+#define  FLASH_5717VENDOR_ATMEL_MDB011D         0x01000001
+#define  FLASH_5717VENDOR_ATMEL_MDB021D         0x01000003
+#define  FLASH_5717VENDOR_ST_M_M25PE10  0x02000000
+#define  FLASH_5717VENDOR_ST_M_M25PE20  0x02000002
+#define  FLASH_5717VENDOR_ST_M_M45PE10  0x00000001
+#define  FLASH_5717VENDOR_ST_M_M45PE20  0x00000003
+#define  FLASH_5717VENDOR_ATMEL_ADB011B         0x01400000
+#define  FLASH_5717VENDOR_ATMEL_ADB021B         0x01400002
+#define  FLASH_5717VENDOR_ATMEL_ADB011D         0x01400001
+#define  FLASH_5717VENDOR_ATMEL_ADB021D         0x01400003
+#define  FLASH_5717VENDOR_ST_A_M25PE10  0x02400000
+#define  FLASH_5717VENDOR_ST_A_M25PE20  0x02400002
+#define  FLASH_5717VENDOR_ST_A_M45PE10  0x02400001
+#define  FLASH_5717VENDOR_ST_A_M45PE20  0x02400003
+#define  FLASH_5717VENDOR_ATMEL_45USPT  0x03400000
+#define  FLASH_5717VENDOR_ST_25USPT     0x03400002
+#define  FLASH_5717VENDOR_ST_45USPT     0x03400001
 #define  NVRAM_CFG1_5752PAGE_SIZE_MASK  0x70000000
 #define  FLASH_5752PAGE_SIZE_256        0x00000000
 #define  FLASH_5752PAGE_SIZE_512        0x10000000
@@ -2124,6 +2156,7 @@ struct tg3_tx_buffer_desc {
 #define TXD_FLAG_IP_CSUM               0x0002
 #define TXD_FLAG_END                   0x0004
 #define TXD_FLAG_IP_FRAG               0x0008
+#define TXD_FLAG_JMB_PKT               0x0008
 #define TXD_FLAG_IP_FRAG_END           0x0010
 #define TXD_FLAG_VLAN                  0x0040
 #define TXD_FLAG_COAL_NOW              0x0080
@@ -2379,7 +2412,6 @@ struct ring_info {
 
 struct tx_ring_info {
        struct sk_buff                  *skb;
-       u32                             prev_vlan_tag;
 };
 
 struct tg3_config_info {
@@ -2520,7 +2552,7 @@ struct tg3_rx_prodring_set {
        dma_addr_t                      rx_jmb_mapping;
 };
 
-#define TG3_IRQ_MAX_VECS 1
+#define TG3_IRQ_MAX_VECS 5
 
 struct tg3_napi {
        struct napi_struct              napi    ____cacheline_aligned;
@@ -2716,7 +2748,6 @@ struct tg3 {
 #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
@@ -2773,6 +2804,8 @@ struct tg3 {
        struct mii_bus                  *mdio_bus;
        int                             mdio_irq[PHY_MAX_ADDR];
 
+       u8                              phy_addr;
+
        /* PHY info */
        u32                             phy_id;
 #define PHY_ID_MASK                    0xfffffff0