aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-09-19 18:36:44 -0400
committerJeff Garzik <jeff@garzik.org>2007-09-20 15:23:00 -0400
commitea76e63598eb312e5d33a782275be91038fc6df2 (patch)
tree6d7ba4add8344afdc1046f248fce352e6d342444 /drivers/net/sky2.h
parentc99210b50fe741026d86fdcb5f3f5a0c00c503cc (diff)
sky2: reorganize chip revision features
This patch should cause no functional changes in driver behaviour. There are (too) many revisions of the Yukon 2 chip now. Instead of adding more conditionals based on chip revision; rerganize into a set of feature flags so adding new versions is less problematic. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sky2.h')
-rw-r--r--drivers/net/sky2.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 3baae48f8042..af303496f9e2 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -2040,6 +2040,15 @@ struct sky2_hw {
2040 void __iomem *regs; 2040 void __iomem *regs;
2041 struct pci_dev *pdev; 2041 struct pci_dev *pdev;
2042 struct net_device *dev[2]; 2042 struct net_device *dev[2];
2043 unsigned long flags;
2044#define SKY2_HW_USE_MSI 0x00000001
2045#define SKY2_HW_FIBRE_PHY 0x00000002
2046#define SKY2_HW_GIGABIT 0x00000004
2047#define SKY2_HW_NEWER_PHY 0x00000008
2048#define SKY2_HW_RAMBUFFER 0x00000010 /* chip has RAM FIFO */
2049#define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */
2050#define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */
2051#define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */
2043 2052
2044 u8 chip_id; 2053 u8 chip_id;
2045 u8 chip_rev; 2054 u8 chip_rev;
@@ -2053,13 +2062,12 @@ struct sky2_hw {
2053 2062
2054 struct timer_list watchdog_timer; 2063 struct timer_list watchdog_timer;
2055 struct work_struct restart_work; 2064 struct work_struct restart_work;
2056 int msi;
2057 wait_queue_head_t msi_wait; 2065 wait_queue_head_t msi_wait;
2058}; 2066};
2059 2067
2060static inline int sky2_is_copper(const struct sky2_hw *hw) 2068static inline int sky2_is_copper(const struct sky2_hw *hw)
2061{ 2069{
2062 return !(hw->pmd_type == 'L' || hw->pmd_type == 'S' || hw->pmd_type == 'P'); 2070 return !(hw->flags & SKY2_HW_FIBRE_PHY);
2063} 2071}
2064 2072
2065/* Register accessor for memory mapped device */ 2073/* Register accessor for memory mapped device */