diff options
-rw-r--r-- | drivers/net/via-velocity.c | 9 | ||||
-rw-r--r-- | drivers/net/via-velocity.h | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 09cac704fdd7..0d6fec6b7d93 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -2923,6 +2923,7 @@ static u16 wol_calc_crc(int size, u8 *pattern, u8 *mask_pattern) | |||
2923 | static int velocity_set_wol(struct velocity_info *vptr) | 2923 | static int velocity_set_wol(struct velocity_info *vptr) |
2924 | { | 2924 | { |
2925 | struct mac_regs __iomem *regs = vptr->mac_regs; | 2925 | struct mac_regs __iomem *regs = vptr->mac_regs; |
2926 | enum speed_opt spd_dpx = vptr->options.spd_dpx; | ||
2926 | static u8 buf[256]; | 2927 | static u8 buf[256]; |
2927 | int i; | 2928 | int i; |
2928 | 2929 | ||
@@ -2968,6 +2969,12 @@ static int velocity_set_wol(struct velocity_info *vptr) | |||
2968 | 2969 | ||
2969 | writew(0x0FFF, ®s->WOLSRClr); | 2970 | writew(0x0FFF, ®s->WOLSRClr); |
2970 | 2971 | ||
2972 | if (spd_dpx == SPD_DPX_1000_FULL) | ||
2973 | goto mac_done; | ||
2974 | |||
2975 | if (spd_dpx != SPD_DPX_AUTO) | ||
2976 | goto advertise_done; | ||
2977 | |||
2971 | if (vptr->mii_status & VELOCITY_AUTONEG_ENABLE) { | 2978 | if (vptr->mii_status & VELOCITY_AUTONEG_ENABLE) { |
2972 | if (PHYID_GET_PHY_ID(vptr->phy_id) == PHYID_CICADA_CS8201) | 2979 | if (PHYID_GET_PHY_ID(vptr->phy_id) == PHYID_CICADA_CS8201) |
2973 | MII_REG_BITS_ON(AUXCR_MDPPS, MII_NCONFIG, vptr->mac_regs); | 2980 | MII_REG_BITS_ON(AUXCR_MDPPS, MII_NCONFIG, vptr->mac_regs); |
@@ -2978,6 +2985,7 @@ static int velocity_set_wol(struct velocity_info *vptr) | |||
2978 | if (vptr->mii_status & VELOCITY_SPEED_1000) | 2985 | if (vptr->mii_status & VELOCITY_SPEED_1000) |
2979 | MII_REG_BITS_ON(BMCR_ANRESTART, MII_BMCR, vptr->mac_regs); | 2986 | MII_REG_BITS_ON(BMCR_ANRESTART, MII_BMCR, vptr->mac_regs); |
2980 | 2987 | ||
2988 | advertise_done: | ||
2981 | BYTE_REG_BITS_ON(CHIPGCR_FCMODE, ®s->CHIPGCR); | 2989 | BYTE_REG_BITS_ON(CHIPGCR_FCMODE, ®s->CHIPGCR); |
2982 | 2990 | ||
2983 | { | 2991 | { |
@@ -2987,6 +2995,7 @@ static int velocity_set_wol(struct velocity_info *vptr) | |||
2987 | writeb(GCR, ®s->CHIPGCR); | 2995 | writeb(GCR, ®s->CHIPGCR); |
2988 | } | 2996 | } |
2989 | 2997 | ||
2998 | mac_done: | ||
2990 | BYTE_REG_BITS_OFF(ISR_PWEI, ®s->ISR); | 2999 | BYTE_REG_BITS_OFF(ISR_PWEI, ®s->ISR); |
2991 | /* Turn on SWPTAG just before entering power mode */ | 3000 | /* Turn on SWPTAG just before entering power mode */ |
2992 | BYTE_REG_BITS_ON(STICKHW_SWPTAG, ®s->STICKHW); | 3001 | BYTE_REG_BITS_ON(STICKHW_SWPTAG, ®s->STICKHW); |
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h index aa2e69b9ff61..d7227539484e 100644 --- a/drivers/net/via-velocity.h +++ b/drivers/net/via-velocity.h | |||
@@ -361,7 +361,7 @@ enum velocity_owner { | |||
361 | #define MAC_REG_CHIPGSR 0x9C | 361 | #define MAC_REG_CHIPGSR 0x9C |
362 | #define MAC_REG_TESTCFG 0x9D | 362 | #define MAC_REG_TESTCFG 0x9D |
363 | #define MAC_REG_DEBUG 0x9E | 363 | #define MAC_REG_DEBUG 0x9E |
364 | #define MAC_REG_CHIPGCR 0x9F | 364 | #define MAC_REG_CHIPGCR 0x9F /* Chip Operation and Diagnostic Control */ |
365 | #define MAC_REG_WOLCR0_SET 0xA0 | 365 | #define MAC_REG_WOLCR0_SET 0xA0 |
366 | #define MAC_REG_WOLCR1_SET 0xA1 | 366 | #define MAC_REG_WOLCR1_SET 0xA1 |
367 | #define MAC_REG_PWCFG_SET 0xA2 | 367 | #define MAC_REG_PWCFG_SET 0xA2 |
@@ -848,10 +848,10 @@ enum velocity_owner { | |||
848 | * Bits in CHIPGCR register | 848 | * Bits in CHIPGCR register |
849 | */ | 849 | */ |
850 | 850 | ||
851 | #define CHIPGCR_FCGMII 0x80 /* enable GMII mode */ | 851 | #define CHIPGCR_FCGMII 0x80 /* force GMII (else MII only) */ |
852 | #define CHIPGCR_FCFDX 0x40 | 852 | #define CHIPGCR_FCFDX 0x40 /* force full duplex */ |
853 | #define CHIPGCR_FCRESV 0x20 | 853 | #define CHIPGCR_FCRESV 0x20 |
854 | #define CHIPGCR_FCMODE 0x10 | 854 | #define CHIPGCR_FCMODE 0x10 /* enable MAC forced mode */ |
855 | #define CHIPGCR_LPSOPT 0x08 | 855 | #define CHIPGCR_LPSOPT 0x08 |
856 | #define CHIPGCR_TM1US 0x04 | 856 | #define CHIPGCR_TM1US 0x04 |
857 | #define CHIPGCR_TM0US 0x02 | 857 | #define CHIPGCR_TM0US 0x02 |