| To: | Andy Lutomirski <luto@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH r8169] ethtool support and sane speed selection/detection |
| From: | Felipe W Damasio <felipewd@xxxxxxxxxxxx> |
| Date: | Wed, 28 Apr 2004 09:42:27 -0300 |
| Cc: | linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx |
| In-reply-to: | <20040424050931.14C341D4F@luto.stanford.edu> |
| Newsgroups: | gmane.linux.kernel |
| References: | <20040424050931.14C341D4F@luto.stanford.edu> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 |
Hi Andy, Andy Lutomirski wrote:
Please look 8139cp's way of doind this. Using that interface is much cleaner and doesn't duplicate code.
+ cmd->supported = SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_100baseT_Half | + SUPPORTED_100baseT_Full | + SUPPORTED_1000baseT_Full | + SUPPORTED_Autoneg | + SUPPORTED_TP; + + cmd->autoneg = 1; + cmd->advertising = ADVERTISED_TP | ADVERTISED_Autoneg; + if (tp->phy_auto_nego_reg & PHY_Cap_10_Half) + cmd->advertising |= ADVERTISED_10baseT_Half; + if (tp->phy_auto_nego_reg & PHY_Cap_10_Full) + cmd->advertising |= ADVERTISED_10baseT_Full; + if (tp->phy_auto_nego_reg & PHY_Cap_100_Half) + cmd->advertising |= ADVERTISED_100baseT_Half; + if (tp->phy_auto_nego_reg & PHY_Cap_100_Full) + cmd->advertising |= ADVERTISED_100baseT_Full; + if (tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full) + cmd->advertising |= ADVERTISED_1000baseT_Full; + + if (status & _1000bpsF) cmd->speed = SPEED_1000; + else if (status & _100bps) cmd->speed = SPEED_100; + else if (status & _10bps) cmd->speed = SPEED_10; + + if (status & _1000bpsF || status & FullDup) + cmd->duplex = DUPLEX_FULL; + else + cmd->duplex = DUPLEX_HALF; + + return 0; +} You should use mii's interface on this. There's no need to duplicate code. Please use mii_ethtool_gset here. Also rtl8169_set_settings should use mii_ethtool_sset. If the card gets a LinkChg interrupt you should treat with mii_check_media at rtl8169_set_settings. Cheers, Felipe |
| Previous by Date: | spin_lock_bh() called in irq handler, Paul Mackerras |
|---|---|
| Next by Date: | Re: [PATCH r8169] ethtool support and sane speed selection/detection, Jeff Garzik |
| Previous by Thread: | Re: [PATCH r8169] ethtool support and sane speed selection/detection, Andy Lutomirski |
| Next by Thread: | Re: [PATCH r8169] ethtool support and sane speed selection/detection, Jeff Garzik |
| Indexes: | [Date] [Thread] [Top] [All Lists] |