Commit 852ea22a authored by Ralf Baechle's avatar Ralf Baechle Committed by Jeff Garzik

[PATCH] IOC3 fixes

 - Using the right register clearly improves chances of getting the MII
   code and thus the driver working at all.
 - On startup check the media type before setting up duplex or we might
   spend the first 1.2s with a wrong duplex setting.
 - Get rid of whitespace lines.
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 6be382ea
...@@ -499,7 +499,7 @@ static int ioc3_mdio_read(struct net_device *dev, int phy, int reg) ...@@ -499,7 +499,7 @@ static int ioc3_mdio_read(struct net_device *dev, int phy, int reg)
ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG); ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG);
while (ioc3_r_micr() & MICR_BUSY); while (ioc3_r_micr() & MICR_BUSY);
return ioc3_r_micr() & MIDR_DATA_MASK; return ioc3_r_midr_r() & MIDR_DATA_MASK;
} }
static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data) static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data)
...@@ -1291,7 +1291,6 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1291,7 +1291,6 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->features = NETIF_F_IP_CSUM; dev->features = NETIF_F_IP_CSUM;
#endif #endif
ioc3_setup_duplex(ip);
sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1);
sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2); sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2);
...@@ -1300,6 +1299,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1300,6 +1299,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_stop; goto out_stop;
mii_check_media(&ip->mii, 1, 1); mii_check_media(&ip->mii, 1, 1);
ioc3_setup_duplex(ip);
vendor = (sw_physid1 << 12) | (sw_physid2 >> 4); vendor = (sw_physid1 << 12) | (sw_physid2 >> 4);
model = (sw_physid2 >> 4) & 0x3f; model = (sw_physid2 >> 4) & 0x3f;
...@@ -1524,7 +1524,7 @@ static void ioc3_get_drvinfo (struct net_device *dev, ...@@ -1524,7 +1524,7 @@ static void ioc3_get_drvinfo (struct net_device *dev,
struct ethtool_drvinfo *info) struct ethtool_drvinfo *info)
{ {
struct ioc3_private *ip = netdev_priv(dev); struct ioc3_private *ip = netdev_priv(dev);
strcpy (info->driver, IOC3_NAME); strcpy (info->driver, IOC3_NAME);
strcpy (info->version, IOC3_VERSION); strcpy (info->version, IOC3_VERSION);
strcpy (info->bus_info, pci_name(ip->pdev)); strcpy (info->bus_info, pci_name(ip->pdev));
...@@ -1550,7 +1550,7 @@ static int ioc3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -1550,7 +1550,7 @@ static int ioc3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
spin_lock_irq(&ip->ioc3_lock); spin_lock_irq(&ip->ioc3_lock);
rc = mii_ethtool_sset(&ip->mii, cmd); rc = mii_ethtool_sset(&ip->mii, cmd);
spin_unlock_irq(&ip->ioc3_lock); spin_unlock_irq(&ip->ioc3_lock);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment