Automatic merge of /spare/repo/netdev-2.6 branch sis900

authored by and committed by Jeff Garzik 38778204 8cf0d9d0

+50 -3
+1
drivers/net/Kconfig
··· 1555 1555 tristate "SiS 900/7016 PCI Fast Ethernet Adapter support" 1556 1556 depends on NET_PCI && PCI 1557 1557 select CRC32 1558 + select MII 1558 1559 ---help--- 1559 1560 This is a driver for the Fast Ethernet PCI network cards based on 1560 1561 the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in
+49 -3
drivers/net/sis900.c
··· 162 162 struct mii_phy * mii; 163 163 struct mii_phy * first_mii; /* record the first mii structure */ 164 164 unsigned int cur_phy; 165 + struct mii_if_info mii_info; 165 166 166 167 struct timer_list timer; /* Link status detection timer. */ 167 168 u8 autong_complete; /* 1: auto-negotiate complete */ ··· 204 203 static int sis900_mii_probe (struct net_device * net_dev); 205 204 static void sis900_init_rxfilter (struct net_device * net_dev); 206 205 static u16 read_eeprom(long ioaddr, int location); 207 - static u16 mdio_read(struct net_device *net_dev, int phy_id, int location); 206 + static int mdio_read(struct net_device *net_dev, int phy_id, int location); 208 207 static void mdio_write(struct net_device *net_dev, int phy_id, int location, int val); 209 208 static void sis900_timer(unsigned long data); 210 209 static void sis900_check_mode (struct net_device *net_dev, struct mii_phy *mii_phy); ··· 479 478 sis_priv->msg_enable = sis900_debug; 480 479 else 481 480 sis_priv->msg_enable = SIS900_DEF_MSG; 482 - 481 + 482 + sis_priv->mii_info.dev = net_dev; 483 + sis_priv->mii_info.mdio_read = mdio_read; 484 + sis_priv->mii_info.mdio_write = mdio_write; 485 + sis_priv->mii_info.phy_id_mask = 0x1f; 486 + sis_priv->mii_info.reg_num_mask = 0x1f; 487 + 483 488 /* Get Mac address according to the chip revision */ 484 489 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &(sis_priv->chipset_rev)); 485 490 if(netif_msg_probe(sis_priv)) ··· 732 725 pci_name(sis_priv->pci_dev), sis_priv->cur_phy); 733 726 } 734 727 728 + sis_priv->mii_info.phy_id = sis_priv->cur_phy; 729 + 735 730 status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL); 736 731 status &= (~MII_CNTL_ISOLATE); 737 732 ··· 861 852 * Please see SiS7014 or ICS spec 862 853 */ 863 854 864 - static u16 mdio_read(struct net_device *net_dev, int phy_id, int location) 855 + static int mdio_read(struct net_device *net_dev, int phy_id, int location) 865 856 { 866 857 long mdio_addr = net_dev->base_addr + mear; 867 858 int mii_cmd = MIIread|(phy_id<<MIIpmdShift)|(location<<MIIregShift); ··· 1975 1966 sis_priv->msg_enable = value; 1976 1967 } 1977 1968 1969 + static u32 sis900_get_link(struct net_device *net_dev) 1970 + { 1971 + struct sis900_private *sis_priv = net_dev->priv; 1972 + return mii_link_ok(&sis_priv->mii_info); 1973 + } 1974 + 1975 + static int sis900_get_settings(struct net_device *net_dev, 1976 + struct ethtool_cmd *cmd) 1977 + { 1978 + struct sis900_private *sis_priv = net_dev->priv; 1979 + spin_lock_irq(&sis_priv->lock); 1980 + mii_ethtool_gset(&sis_priv->mii_info, cmd); 1981 + spin_unlock_irq(&sis_priv->lock); 1982 + return 0; 1983 + } 1984 + 1985 + static int sis900_set_settings(struct net_device *net_dev, 1986 + struct ethtool_cmd *cmd) 1987 + { 1988 + struct sis900_private *sis_priv = net_dev->priv; 1989 + int rt; 1990 + spin_lock_irq(&sis_priv->lock); 1991 + rt = mii_ethtool_sset(&sis_priv->mii_info, cmd); 1992 + spin_unlock_irq(&sis_priv->lock); 1993 + return rt; 1994 + } 1995 + 1996 + static int sis900_nway_reset(struct net_device *net_dev) 1997 + { 1998 + struct sis900_private *sis_priv = net_dev->priv; 1999 + return mii_nway_restart(&sis_priv->mii_info); 2000 + } 2001 + 1978 2002 static struct ethtool_ops sis900_ethtool_ops = { 1979 2003 .get_drvinfo = sis900_get_drvinfo, 1980 2004 .get_msglevel = sis900_get_msglevel, 1981 2005 .set_msglevel = sis900_set_msglevel, 2006 + .get_link = sis900_get_link, 2007 + .get_settings = sis900_get_settings, 2008 + .set_settings = sis900_set_settings, 2009 + .nway_reset = sis900_nway_reset, 1982 2010 }; 1983 2011 1984 2012 /**