/* Set the media capability of network adapter according to mii status register. It's necessary before auto-negotiate.  */
static void sis900_set_capability(struct net_device *net_dev, struct mii_phy *phy)
/* Set the media capability of network adapter according to mii status register. It's necessary before auto-negotiate.  */
static void sis900_set_capability(struct net_device *net_dev, struct mii_phy *phy)
{
	u16 cap;
	u16 status;
	status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
	status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
	cap = MII_NWAY_CSMA_CD |
		((phy->status & MII_STAT_CAN_TX_FDX)? MII_NWAY_TX_FDX:0) |
		((phy->status & MII_STAT_CAN_TX)    ? MII_NWAY_TX:0) |
		((phy->status & MII_STAT_CAN_T_FDX) ? MII_NWAY_T_FDX:0)|
		((phy->status & MII_STAT_CAN_T)     ? MII_NWAY_T:0);
	mdio_write(net_dev, phy->phy_addr, MII_ANADV, cap);
}