Re: [PATCH 10/19] usbnet: smsc95xx: Replace smsc95xx_mdio_read() with phy_read()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  static int get_mdix_status(struct net_device *net)
>  {
>  	struct usbnet *dev = netdev_priv(net);
> +	struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
>  	u32 val;
>  	int buf;
>  
> -	buf = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, SPECIAL_CTRL_STS);
> +	buf = phy_read(pdata->phydev, SPECIAL_CTRL_STS);
>  	if (buf & SPECIAL_CTRL_STS_OVRRD_AMDIX_) {
>  		if (buf & SPECIAL_CTRL_STS_AMDIX_ENABLE_)
>  			return ETH_TP_MDI_AUTO;
> @@ -793,7 +794,7 @@ static void set_mdix_status(struct net_device *net, __u8 mdix_ctrl)
>  	    (pdata->chip_id == ID_REV_CHIP_ID_89530_) ||
>  	    (pdata->chip_id == ID_REV_CHIP_ID_9730_)) {
>  		/* Extend Manual AutoMDIX timer for 9500A/9500Ai */
> -		buf = smsc95xx_mdio_read(dev->net, dev->mii.phy_id,
> +		buf = phy_read(pdata->phydev,
>  					 PHY_EDPD_CONFIG);
>  		buf |= PHY_EDPD_CONFIG_EXT_CROSSOVER_;
>  		smsc95xx_mdio_write(dev->net, dev->mii.phy_id,
> @@ -801,7 +802,7 @@ static void set_mdix_status(struct net_device *net, __u8 mdix_ctrl)
>  	}
>  
>  	if (mdix_ctrl == ETH_TP_MDI) {
> -		buf = smsc95xx_mdio_read(dev->net, dev->mii.phy_id,
> +		buf = phy_read(pdata->phydev,
>  					 SPECIAL_CTRL_STS);
>  		buf |= SPECIAL_CTRL_STS_OVRRD_AMDIX_;
>  		buf &= ~(SPECIAL_CTRL_STS_AMDIX_ENABLE_ |
> @@ -809,7 +810,7 @@ static void set_mdix_status(struct net_device *net, __u8 mdix_ctrl)
>  		smsc95xx_mdio_write(dev->net, dev->mii.phy_id,
>  				    SPECIAL_CTRL_STS, buf);
>  	} else if (mdix_ctrl == ETH_TP_MDI_X) {
> -		buf = smsc95xx_mdio_read(dev->net, dev->mii.phy_id,
> +		buf = phy_read(pdata->phydev,
>  					 SPECIAL_CTRL_STS);
>  		buf |= SPECIAL_CTRL_STS_OVRRD_AMDIX_;
>  		buf &= ~(SPECIAL_CTRL_STS_AMDIX_ENABLE_ |
> @@ -818,7 +819,7 @@ static void set_mdix_status(struct net_device *net, __u8 mdix_ctrl)
>  		smsc95xx_mdio_write(dev->net, dev->mii.phy_id,
>  				    SPECIAL_CTRL_STS, buf);
>  	} else if (mdix_ctrl == ETH_TP_MDI_AUTO) {
> -		buf = smsc95xx_mdio_read(dev->net, dev->mii.phy_id,
> +		buf = phy_read(pdata->phydev,
>  					 SPECIAL_CTRL_STS);
>  		buf &= ~SPECIAL_CTRL_STS_OVRRD_AMDIX_;
>  		buf &= ~(SPECIAL_CTRL_STS_AMDIX_ENABLE_ |
> @@ -968,6 +969,7 @@ static void smsc95xx_adjust_link(struct net_device *netdev)
 
All this crossover code should be moved into the PHY driver.

    Andrew



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux