These defines look generic but they are just a shift of the real mii defines.
Signed-off-by: Francois Romieu <[EMAIL PROTECTED]> diff -puN drivers/net/r8169.c~r8169-700 drivers/net/r8169.c --- a/drivers/net/r8169.c~r8169-700 2005-08-24 21:54:02.302251050 +0200 +++ b/drivers/net/r8169.c 2005-08-24 21:54:02.329246669 +0200 @@ -13,11 +13,11 @@ Ex: 'insmod r8169 media = 0x04' will force PHY to operate in 100Mpbs Half-duplex. SET_MEDIA can be: - _10_Half = 0x01 - _10_Full = 0x02 - _100_Half = 0x04 - _100_Full = 0x08 - _1000_Full = 0x10 + 10 Mbps half = 0x01 + 10 Mbps full = 0x02 + 100 Mbps half = 0x04 + 100 Mbps full = 0x08 + 1000 Mbps full = 0x10 2. Support TBI mode. ========================================================================= @@ -312,13 +312,6 @@ enum RTL8169_register_content { LinkStatus = 0x02, FullDup = 0x01, - /* _MediaType */ - _10_Half = 0x01, - _10_Full = 0x02, - _100_Half = 0x04, - _100_Full = 0x08, - _1000_Full = 0x10, - /* _TBICSRBit */ TBILinkOK = 0x02000000, @@ -554,22 +547,28 @@ static void rtl8169_check_link_status(st spin_unlock_irqrestore(&tp->lock, flags); } +/* + * This function supports an obsolete interface for link setting. + * Use of ethtool is preferred. + */ static void rtl8169_link_option(int idx, u8 *autoneg, u16 *speed, u8 *duplex) { +#define _OPT(SPEED) ((ADVERTISE_##SPEED) >> 5) struct { u16 speed; u8 duplex; u8 autoneg; u8 media; } link_settings[] = { - { SPEED_10, DUPLEX_HALF, AUTONEG_DISABLE, _10_Half }, - { SPEED_10, DUPLEX_FULL, AUTONEG_DISABLE, _10_Full }, - { SPEED_100, DUPLEX_HALF, AUTONEG_DISABLE, _100_Half }, - { SPEED_100, DUPLEX_FULL, AUTONEG_DISABLE, _100_Full }, - { SPEED_1000, DUPLEX_FULL, AUTONEG_DISABLE, _1000_Full }, + { SPEED_10, DUPLEX_HALF, AUTONEG_DISABLE, _OPT(10HALF) }, + { SPEED_10, DUPLEX_FULL, AUTONEG_DISABLE, _OPT(10FULL) }, + { SPEED_100, DUPLEX_HALF, AUTONEG_DISABLE, _OPT(100HALF) }, + { SPEED_100, DUPLEX_FULL, AUTONEG_DISABLE, _OPT(100FULL) }, + { SPEED_1000, DUPLEX_FULL, AUTONEG_DISABLE, _OPT(1000FULL) }, /* Make TBI happy */ - { SPEED_1000, DUPLEX_FULL, AUTONEG_ENABLE, 0xff } + { SPEED_1000, DUPLEX_FULL, AUTONEG_ENABLE, 0xff } }, *p; +#undef _OPT unsigned char option; option = ((idx < MAX_UNITS) && (idx >= 0)) ? media[idx] : 0xff; _ - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html