e1000: Fix mii-tool access to setting speed and duplex
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 9 Mar 2006 01:24:12 +0000 (17:24 -0800)
committerroot <root@jk-desktop.jf.intel.com>
Thu, 9 Mar 2006 01:24:12 +0000 (17:24 -0800)
Paul Rolland reported that e1000 was having a hard time using mii-tool to set speed and duplex.  This patch fixes the issue on both newer hardware as well as fixing the code issue that originally caused the problem.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/e1000/e1000_main.c

index 9adaf5fa9d48fca0a28a58a6f94342ad4b356c13..5f7e5c8082016855c01a5548a2b1f5232616f474 100644 (file)
@@ -4171,7 +4171,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
                        spin_unlock_irqrestore(&adapter->stats_lock, flags);
                        return -EIO;
                }
-               if (adapter->hw.phy_type == e1000_phy_m88) {
+               if (adapter->hw.phy_type == e1000_media_type_copper) {
                        switch (data->reg_num) {
                        case PHY_CTRL:
                                if (mii_reg & MII_CR_POWER_DOWN)
@@ -4187,8 +4187,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
                                        else
                                                spddplx = SPEED_10;
                                        spddplx += (mii_reg & 0x100)
-                                                  ? FULL_DUPLEX :
-                                                  HALF_DUPLEX;
+                                                  ? DUPLEX_FULL :
+                                                  DUPLEX_HALF;
                                        retval = e1000_set_spd_dplx(adapter,
                                                                    spddplx);
                                        if (retval) {