[IPV4]: Remove three declarations of unimplemented methods and correct a typo in...
[safe/jmp/linux-2.6] / drivers / net / sky2.h
index 8df4643..ffe9b8a 100644 (file)
@@ -18,14 +18,6 @@ enum {
        PCI_CFG_REG_1   = 0x94,
 };
 
-enum {
-       PEX_DEV_CAP     = 0xe4,
-       PEX_DEV_CTRL    = 0xe8,
-       PEX_DEV_STA     = 0xea,
-       PEX_LNK_STAT    = 0xf2,
-       PEX_UNC_ERR_STAT= 0x104,
-};
-
 /* Yukon-2 */
 enum pci_dev_reg_1 {
        PCI_Y2_PIG_ENA   = 1<<31, /* Enable Plug-in-Go (YUKON-2) */
@@ -151,38 +143,6 @@ enum pci_cfg_reg1 {
                               PCI_STATUS_REC_TARGET_ABORT | \
                               PCI_STATUS_PARITY)
 
-enum pex_dev_ctrl {
-       PEX_DC_MAX_RRS_MSK      = 7<<12, /* Bit 14..12: Max. Read Request Size */
-       PEX_DC_EN_NO_SNOOP      = 1<<11,/* Enable No Snoop */
-       PEX_DC_EN_AUX_POW       = 1<<10,/* Enable AUX Power */
-       PEX_DC_EN_PHANTOM       = 1<<9, /* Enable Phantom Functions */
-       PEX_DC_EN_EXT_TAG       = 1<<8, /* Enable Extended Tag Field */
-       PEX_DC_MAX_PLS_MSK      = 7<<5, /* Bit  7.. 5:  Max. Payload Size Mask */
-       PEX_DC_EN_REL_ORD       = 1<<4, /* Enable Relaxed Ordering */
-       PEX_DC_EN_UNS_RQ_RP     = 1<<3, /* Enable Unsupported Request Reporting */
-       PEX_DC_EN_FAT_ER_RP     = 1<<2, /* Enable Fatal Error Reporting */
-       PEX_DC_EN_NFA_ER_RP     = 1<<1, /* Enable Non-Fatal Error Reporting */
-       PEX_DC_EN_COR_ER_RP     = 1<<0, /* Enable Correctable Error Reporting */
-};
-#define  PEX_DC_MAX_RD_RQ_SIZE(x) (((x)<<12) & PEX_DC_MAX_RRS_MSK)
-
-/* PEX_UNC_ERR_STAT     PEX Uncorrectable Errors Status Register (Yukon-2) */
-enum pex_err {
-       PEX_UNSUP_REQ   = 1<<20, /* Unsupported Request Error */
-
-       PEX_MALFOR_TLP  = 1<<18, /* Malformed TLP */
-
-       PEX_UNEXP_COMP  = 1<<16, /* Unexpected Completion */
-
-       PEX_COMP_TO     = 1<<14, /* Completion Timeout */
-       PEX_FLOW_CTRL_P = 1<<13, /* Flow Control Protocol Error */
-       PEX_POIS_TLP    = 1<<12, /* Poisoned TLP */
-
-       PEX_DATA_LINK_P = 1<<4, /* Data Link Protocol Error */
-       PEX_FATAL_ERRORS= (PEX_MALFOR_TLP | PEX_FLOW_CTRL_P | PEX_DATA_LINK_P),
-};
-
-
 enum csr_regs {
        B0_RAP          = 0x0000,
        B0_CTST         = 0x0004,
@@ -287,7 +247,8 @@ enum csr_regs {
        B3_PA_CTRL      = 0x01f0,
        B3_PA_TEST      = 0x01f2,
 
-       Y2_CFG_SPC      = 0x1c00,
+       Y2_CFG_SPC      = 0x1c00,       /* PCI config space region */
+       Y2_CFG_AER      = 0x1d00,       /* PCI Advanced Error Report region */
 };
 
 /*     B0_CTST                 16 bit  Control/Status register */
@@ -419,7 +380,6 @@ enum {
                          Y2_IS_PAR_RX2 | Y2_IS_TCP_TXS2| Y2_IS_TCP_TXA2,
 
        Y2_HWE_ALL_MASK = Y2_IS_TIST_OV | Y2_IS_MST_ERR | Y2_IS_IRQ_STAT |
-                         Y2_IS_PCI_EXP |
                          Y2_HWE_L1_MASK | Y2_HWE_L2_MASK,
 };
 
@@ -470,18 +430,24 @@ enum {
        CHIP_ID_YUKON_EX   = 0xb5, /* Chip ID for YUKON-2 Extreme */
        CHIP_ID_YUKON_EC   = 0xb6, /* Chip ID for YUKON-2 EC */
        CHIP_ID_YUKON_FE   = 0xb7, /* Chip ID for YUKON-2 FE */
-
+       CHIP_ID_YUKON_FE_P = 0xb8, /* Chip ID for YUKON-2 FE+ */
+};
+enum yukon_ec_rev {
        CHIP_REV_YU_EC_A1    = 0,  /* Chip Rev. for Yukon-EC A1/A0 */
        CHIP_REV_YU_EC_A2    = 1,  /* Chip Rev. for Yukon-EC A2 */
        CHIP_REV_YU_EC_A3    = 2,  /* Chip Rev. for Yukon-EC A3 */
-
+};
+enum yukon_ec_u_rev {
        CHIP_REV_YU_EC_U_A0  = 1,
        CHIP_REV_YU_EC_U_A1  = 2,
        CHIP_REV_YU_EC_U_B0  = 3,
-
+};
+enum yukon_fe_rev {
        CHIP_REV_YU_FE_A1    = 1,
        CHIP_REV_YU_FE_A2    = 2,
-
+};
+enum yukon_fe_p_rev {
+       CHIP_REV_YU_FE2_A0   = 0,
 };
 enum yukon_ex_rev {
        CHIP_REV_YU_EX_A0    = 1,
@@ -1668,7 +1634,7 @@ enum {
 
 /* Receive Frame Status Encoding */
 enum {
-       GMR_FS_LEN      = 0xffff<<16, /* Bit 31..16:    Rx Frame Length */
+       GMR_FS_LEN      = 0x7fff<<16, /* Bit 30..16:    Rx Frame Length */
        GMR_FS_VLAN     = 1<<13, /* VLAN Packet */
        GMR_FS_JABBER   = 1<<12, /* Jabber Packet */
        GMR_FS_UN_SIZE  = 1<<11, /* Undersize Packet */
@@ -1729,6 +1695,10 @@ enum {
        GMF_RX_CTRL_DEF = GMF_OPER_ON | GMF_RX_F_FL_ON,
 };
 
+/*     TX_GMF_EA               32 bit  Tx GMAC FIFO End Address */
+enum {
+       TX_DYN_WM_ENA   = 3,    /* Yukon-FE+ specific */
+};
 
 /*     TX_GMF_CTRL_T   32 bit  Tx GMAC FIFO Control/Test */
 enum {
@@ -1840,6 +1810,28 @@ enum {
 
 /*     GPHY_CTRL               32 bit  GPHY Control Reg (YUKON only) */
 enum {
+       GPC_TX_PAUSE    = 1<<30, /* Tx pause enabled (ro) */
+       GPC_RX_PAUSE    = 1<<29, /* Rx pause enabled (ro) */
+       GPC_SPEED       = 3<<27, /* PHY speed (ro) */
+       GPC_LINK        = 1<<26, /* Link up (ro) */
+       GPC_DUPLEX      = 1<<25, /* Duplex (ro) */
+       GPC_CLOCK       = 1<<24, /* 125Mhz clock stable (ro) */
+
+       GPC_PDOWN       = 1<<23, /* Internal regulator 2.5 power down */
+       GPC_TSTMODE     = 1<<22, /* Test mode */
+       GPC_REG18       = 1<<21, /* Reg18 Power down */
+       GPC_REG12SEL    = 3<<19, /* Reg12 power setting */
+       GPC_REG18SEL    = 3<<17, /* Reg18 power setting */
+       GPC_SPILOCK     = 1<<16, /* SPI lock (ASF) */
+
+       GPC_LEDMUX      = 3<<14, /* LED Mux */
+       GPC_INTPOL      = 1<<13, /* Interrupt polarity */
+       GPC_DETECT      = 1<<12, /* Energy detect */
+       GPC_1000HD      = 1<<11, /* Enable 1000Mbit HD */
+       GPC_SLAVE       = 1<<10, /* Slave mode */
+       GPC_PAUSE       = 1<<9, /* Pause enable */
+       GPC_LEDCTL      = 3<<6, /* GPHY Leds */
+
        GPC_RST_CLR     = 1<<1, /* Clear GPHY Reset */
        GPC_RST_SET     = 1<<0, /* Set   GPHY Reset */
 };
@@ -1998,14 +1990,15 @@ struct sky2_port {
        struct sky2_tx_le    *tx_le;
        u16                  tx_cons;           /* next le to check */
        u16                  tx_prod;           /* next le to use */
-       u32                  tx_addr64;
+       u16                  tx_next;           /* debug only */
+
        u16                  tx_pending;
        u16                  tx_last_mss;
        u32                  tx_tcpsum;
 
        struct rx_ring_info  *rx_ring ____cacheline_aligned_in_smp;
        struct sky2_rx_le    *rx_le;
-       u32                  rx_addr64;
+
        u16                  rx_next;           /* next re to check */
        u16                  rx_put;            /* next le index to use */
        u16                  rx_pending;
@@ -2016,6 +2009,14 @@ struct sky2_port {
        u16                  rx_tag;
        struct vlan_group    *vlgrp;
 #endif
+       struct {
+               unsigned long last;
+               u32     mac_rp;
+               u8      mac_lev;
+               u8      fifo_rp;
+               u8      fifo_lev;
+       } check;
+
 
        dma_addr_t           rx_le_map;
        dma_addr_t           tx_le_map;
@@ -2028,14 +2029,25 @@ struct sky2_port {
        enum flow_control    flow_mode;
        enum flow_control    flow_status;
 
-       struct net_device_stats net_stats;
-
+#ifdef CONFIG_SKY2_DEBUG
+       struct dentry        *debugfs;
+#endif
 };
 
 struct sky2_hw {
        void __iomem         *regs;
        struct pci_dev       *pdev;
+       struct napi_struct   napi;
        struct net_device    *dev[2];
+       unsigned long        flags;
+#define SKY2_HW_USE_MSI                0x00000001
+#define SKY2_HW_FIBRE_PHY      0x00000002
+#define SKY2_HW_GIGABIT                0x00000004
+#define SKY2_HW_NEWER_PHY      0x00000008
+#define SKY2_HW_FIFO_HANG_CHECK        0x00000010
+#define SKY2_HW_NEW_LE         0x00000020      /* new LSOv2 format */
+#define SKY2_HW_AUTO_TX_SUM    0x00000040      /* new IP decode for Tx */
+#define SKY2_HW_ADV_POWER_CTL  0x00000080      /* additional PHY power regs */
 
        u8                   chip_id;
        u8                   chip_rev;
@@ -2046,15 +2058,14 @@ struct sky2_hw {
        u32                  st_idx;
        dma_addr_t           st_dma;
 
-       struct timer_list    idle_timer;
+       struct timer_list    watchdog_timer;
        struct work_struct   restart_work;
-       int                  msi;
        wait_queue_head_t    msi_wait;
 };
 
 static inline int sky2_is_copper(const struct sky2_hw *hw)
 {
-       return !(hw->pmd_type == 'L' || hw->pmd_type == 'S' || hw->pmd_type == 'P');
+       return !(hw->flags & SKY2_HW_FIBRE_PHY);
 }
 
 /* Register accessor for memory mapped device */