[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65fa6691-eafb-d8ba-c7f9-28f7cf19396b@denx.de>
Date: Fri, 4 Jan 2019 03:19:01 +0100
From: Marek Vasut <marex@...x.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
Nisar Sayed <Nisar.Sayed@...rochip.com>,
Woojung Huh <Woojung.Huh@...rochip.com>,
Florian Fainelli <f.fainelli@...il.com>,
linux-usb@...r.kernel.org
Subject: Re: [PATCH 10/19] usbnet: smsc95xx: Replace smsc95xx_mdio_read() with
phy_read()
On 1/3/19 2:39 PM, Andrew Lunn wrote:
>> 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.
Fine, this can be done in a subsequent patch though, right ? I'd like to
keep the changes small, so if something breaks, it could be bisected easily.
--
Best regards,
Marek Vasut
Powered by blists - more mailing lists