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>
This commit is contained in:
committed by
Jeff Garzik
parent
c99210b50f
commit
ea76e63598
@@ -2040,6 +2040,15 @@ struct sky2_hw {
|
||||
void __iomem *regs;
|
||||
struct pci_dev *pdev;
|
||||
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_RAMBUFFER 0x00000010 /* chip has RAM FIFO */
|
||||
#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;
|
||||
@@ -2053,13 +2062,12 @@ struct sky2_hw {
|
||||
|
||||
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 */
|
||||
|
Reference in New Issue
Block a user