aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/via-rhine.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/via-rhine.c')
-rw-r--r--drivers/net/via-rhine.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 241871589283..a9b2150909d6 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -1085,6 +1085,25 @@ static void rhine_check_media(struct net_device *dev, unsigned int init_media)
1085 else 1085 else
1086 iowrite8(ioread8(ioaddr + ChipCmd1) & ~Cmd1FDuplex, 1086 iowrite8(ioread8(ioaddr + ChipCmd1) & ~Cmd1FDuplex,
1087 ioaddr + ChipCmd1); 1087 ioaddr + ChipCmd1);
1088 if (debug > 1)
1089 printk(KERN_INFO "%s: force_media %d, carrier %d\n", dev->name,
1090 rp->mii_if.force_media, netif_carrier_ok(dev));
1091}
1092
1093/* Called after status of force_media possibly changed */
1094void rhine_set_carrier(struct mii_if_info *mii)
1095{
1096 if (mii->force_media) {
1097 /* autoneg is off: Link is always assumed to be up */
1098 if (!netif_carrier_ok(mii->dev))
1099 netif_carrier_on(mii->dev);
1100 }
1101 else /* Let MMI library update carrier status */
1102 rhine_check_media(mii->dev, 0);
1103 if (debug > 1)
1104 printk(KERN_INFO "%s: force_media %d, carrier %d\n",
1105 mii->dev->name, mii->force_media,
1106 netif_carrier_ok(mii->dev));
1088} 1107}
1089 1108
1090static void rhine_check_media_task(struct net_device *dev) 1109static void rhine_check_media_task(struct net_device *dev)
@@ -1782,6 +1801,7 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1782 spin_lock_irq(&rp->lock); 1801 spin_lock_irq(&rp->lock);
1783 rc = mii_ethtool_sset(&rp->mii_if, cmd); 1802 rc = mii_ethtool_sset(&rp->mii_if, cmd);
1784 spin_unlock_irq(&rp->lock); 1803 spin_unlock_irq(&rp->lock);
1804 rhine_set_carrier(&rp->mii_if);
1785 1805
1786 return rc; 1806 return rc;
1787} 1807}
@@ -1869,6 +1889,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1869 spin_lock_irq(&rp->lock); 1889 spin_lock_irq(&rp->lock);
1870 rc = generic_mii_ioctl(&rp->mii_if, if_mii(rq), cmd, NULL); 1890 rc = generic_mii_ioctl(&rp->mii_if, if_mii(rq), cmd, NULL);
1871 spin_unlock_irq(&rp->lock); 1891 spin_unlock_irq(&rp->lock);
1892 rhine_set_carrier(&rp->mii_if);
1872 1893
1873 return rc; 1894 return rc;
1874} 1895}