tc35815.c (07fa3fa2572f2dee85beb8137f90ccf33d7206af) | tc35815.c (3c1bcc8614db10803f1f57ef0295363917448cb2) |
---|---|
1/* 2 * tc35815.c: A TOSHIBA TC35815CF PCI 10/100Mbps ethernet driver for linux. 3 * 4 * Based on skelton.c by Donald Becker. 5 * 6 * This driver is a replacement of older and less maintained version. 7 * This is a header of the older version: 8 * -----<snip>----- --- 593 unchanged lines hidden (view full) --- 602 phy_read(phydev, MII_BMCR), 603 phy_read(phydev, MII_BMSR), 604 phy_read(phydev, MII_LPA)); 605 } 606} 607 608static int tc_mii_probe(struct net_device *dev) 609{ | 1/* 2 * tc35815.c: A TOSHIBA TC35815CF PCI 10/100Mbps ethernet driver for linux. 3 * 4 * Based on skelton.c by Donald Becker. 5 * 6 * This driver is a replacement of older and less maintained version. 7 * This is a header of the older version: 8 * -----<snip>----- --- 593 unchanged lines hidden (view full) --- 602 phy_read(phydev, MII_BMCR), 603 phy_read(phydev, MII_BMSR), 604 phy_read(phydev, MII_LPA)); 605 } 606} 607 608static int tc_mii_probe(struct net_device *dev) 609{ |
610 __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; |
|
610 struct tc35815_local *lp = netdev_priv(dev); 611 struct phy_device *phydev; | 611 struct tc35815_local *lp = netdev_priv(dev); 612 struct phy_device *phydev; |
612 u32 dropmask; | |
613 614 phydev = phy_find_first(lp->mii_bus); 615 if (!phydev) { 616 printk(KERN_ERR "%s: no PHY found\n", dev->name); 617 return -ENODEV; 618 } 619 620 /* attach the mac to the phy */ --- 4 unchanged lines hidden (view full) --- 625 printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); 626 return PTR_ERR(phydev); 627 } 628 629 phy_attached_info(phydev); 630 631 /* mask with MAC supported features */ 632 phy_set_max_speed(phydev, SPEED_100); | 613 614 phydev = phy_find_first(lp->mii_bus); 615 if (!phydev) { 616 printk(KERN_ERR "%s: no PHY found\n", dev->name); 617 return -ENODEV; 618 } 619 620 /* attach the mac to the phy */ --- 4 unchanged lines hidden (view full) --- 625 printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); 626 return PTR_ERR(phydev); 627 } 628 629 phy_attached_info(phydev); 630 631 /* mask with MAC supported features */ 632 phy_set_max_speed(phydev, SPEED_100); |
633 dropmask = 0; 634 if (options.speed == 10) 635 dropmask |= SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full; 636 else if (options.speed == 100) 637 dropmask |= SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full; 638 if (options.duplex == 1) 639 dropmask |= SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full; 640 else if (options.duplex == 2) 641 dropmask |= SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half; 642 phydev->supported &= ~dropmask; 643 phydev->advertising = phydev->supported; | 633 if (options.speed == 10) { 634 linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, mask); 635 linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, mask); 636 } else if (options.speed == 100) { 637 linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, mask); 638 linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, mask); 639 } 640 if (options.duplex == 1) { 641 linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, mask); 642 linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, mask); 643 } else if (options.duplex == 2) { 644 linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, mask); 645 linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, mask); 646 } 647 linkmode_and(phydev->supported, phydev->supported, mask); 648 linkmode_copy(phydev->advertising, phydev->supported); |
644 645 lp->link = 0; 646 lp->speed = 0; 647 lp->duplex = -1; 648 649 return 0; 650} 651 --- 1507 unchanged lines hidden --- | 649 650 lp->link = 0; 651 lp->speed = 0; 652 lp->duplex = -1; 653 654 return 0; 655} 656 --- 1507 unchanged lines hidden --- |