From: Francois Romieu Date: Fri, 11 Mar 2011 19:30:24 +0000 (+0100) Subject: r8169: rtl8169_set_speed_xmii cleanup. X-Git-Tag: v3.0-rc1~377^2~123^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=826e6cbdadfa51495c7189641df2514cc48e23da;p=platform%2Fkernel%2Flinux-3.10.git r8169: rtl8169_set_speed_xmii cleanup. Shorten chipset version test. No functional change. Careful readers will notice that the 'supports_gmii' flag is deduced from the device PCI id. Though less specific than the chipset related RTL_GIGA_MAC_VER_XY, it is good enough to detect a GMII deprieved 810x. Some features push for a device specific configuration (improved jumbo frame support for instance). 'supports_gmii' will follow this path if / when the device PCI id test stops working. Signed-off-by: Francois Romieu Cc: Realtek linux nic maintainers --- diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 976bb31..182c794 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -1258,16 +1258,7 @@ static int rtl8169_set_speed_xmii(struct net_device *dev, giga_ctrl &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF); /* The 8100e/8101e/8102e do Fast Ethernet only. */ - if (tp->mac_version != RTL_GIGA_MAC_VER_07 && - tp->mac_version != RTL_GIGA_MAC_VER_08 && - tp->mac_version != RTL_GIGA_MAC_VER_09 && - tp->mac_version != RTL_GIGA_MAC_VER_10 && - tp->mac_version != RTL_GIGA_MAC_VER_13 && - tp->mac_version != RTL_GIGA_MAC_VER_14 && - tp->mac_version != RTL_GIGA_MAC_VER_15 && - tp->mac_version != RTL_GIGA_MAC_VER_16 && - tp->mac_version != RTL_GIGA_MAC_VER_29 && - tp->mac_version != RTL_GIGA_MAC_VER_30) { + if (tp->mii.supports_gmii) { if (adv & ADVERTISED_1000baseT_Half) giga_ctrl |= ADVERTISE_1000HALF; if (adv & ADVERTISED_1000baseT_Full)