sky2: fix LED management

Fix problems in LED management, so ethtool -p works correctly on Yukon-EC
and other chips. The driver was incorrectly setting the PHY LED overide bits.
Moral: read the spec sheet, not the vendor driver.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Stephen Hemminger
2008-02-22 16:00:33 -08:00
committed by Jeff Garzik
parent f11cf25ef3
commit a84d0a3d69
2 changed files with 75 additions and 73 deletions

View File

@@ -1318,18 +1318,21 @@ enum {
BLINK_670MS = 4,/* 670 ms */
};
/**** PHY_MARV_LED_OVER 16 bit r/w LED control */
enum {
PHY_M_LED_MO_DUP = 3<<10,/* Bit 11..10: Duplex */
PHY_M_LED_MO_10 = 3<<8, /* Bit 9.. 8: Link 10 */
PHY_M_LED_MO_100 = 3<<6, /* Bit 7.. 6: Link 100 */
PHY_M_LED_MO_1000 = 3<<4, /* Bit 5.. 4: Link 1000 */
PHY_M_LED_MO_RX = 3<<2, /* Bit 3.. 2: Rx */
PHY_M_LED_MO_TX = 3<<0, /* Bit 1.. 0: Tx */
/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/
#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */
PHY_M_LED_ALL = PHY_M_LED_MO_DUP | PHY_M_LED_MO_10
| PHY_M_LED_MO_100 | PHY_M_LED_MO_1000
| PHY_M_LED_MO_RX,
#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */
#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */
#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */
#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */
#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */
#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */
enum led_mode {
MO_LED_NORM = 0,
MO_LED_BLINK = 1,
MO_LED_OFF = 2,
MO_LED_ON = 3,
};
/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/