Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1673988

Re: [PATCH NET v3 2/2] net: hns: Use phy_driver to setup Phy loopback

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH NET v3 2/2] net: hns: Use phy_driver to setup Phy loopback
Date 2017-06-24 05:20 +0200
Message-ID <tVJM5-2rK-3@gated-at.bofh.it> (permalink)
References <tVsUW-hI-11@gated-at.bofh.it> <tVsUW-hI-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>  static int hns_nic_config_phy_loopback(struct phy_device *phy_dev, u8 en)
>  {
> -#define COPPER_CONTROL_REG 0
> -#define PHY_POWER_DOWN BIT(11)
> -#define PHY_LOOP_BACK BIT(14)
> -	u16 val = 0;
> +	int err;
>  
>  	if (phy_dev->is_c45) /* c45 branch adding for XGE PHY */
>  		return -ENOTSUPP;

You should take this out as well. You want the core to tell you if
loopback is supported or not. At some point, a c45 PHY could support
loopback.

> +	case MAC_LOOP_PHY_NONE:
>  		if ((phy_dev) && (!phy_dev->is_c45))
>  			ret |= hns_nic_config_phy_loopback(phy_dev, 0x0);

same here.

     Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH NET v3 0/2] Add loopback support in phy_driver and hns ethtool fix Lin Yun Sheng <linyunsheng@huawei.com> - 2017-06-23 11:20 +0200
  [PATCH NET v3 2/2] net: hns: Use phy_driver to setup Phy loopback Lin Yun Sheng <linyunsheng@huawei.com> - 2017-06-23 11:20 +0200
    Re: [PATCH NET v3 2/2] net: hns: Use phy_driver to setup Phy loopback Andrew Lunn <andrew@lunn.ch> - 2017-06-24 05:20 +0200
  [PATCH NET v3 1/2] net: phy: Add phy loopback support in net phy framework Lin Yun Sheng <linyunsheng@huawei.com> - 2017-06-23 11:20 +0200
    Re: [PATCH NET v3 1/2] net: phy: Add phy loopback support in net phy  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-24 05:20 +0200
      Re: [PATCH NET v3 1/2] net: phy: Add phy loopback support in net phy  framework Yunsheng Lin <linyunsheng@huawei.com> - 2017-06-24 05:50 +0200
        Re: [PATCH NET v3 1/2] net: phy: Add phy loopback support in net phy  framework Yunsheng Lin <linyunsheng@huawei.com> - 2017-06-24 08:20 +0200
          Re: [PATCH NET v3 1/2] net: phy: Add phy loopback support in net phy  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-24 16:00 +0200

csiph-web