lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 19 Jan 2018 10:50:09 +0800
From:   "lipeng (Y)" <lipeng321@...wei.com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
        <salil.mehta@...wei.com>
Subject: Re: [PATCH net-next 3/5] net: hns3: add ethtool -p support for phy
 device



On 2018/1/18 22:25, Andrew Lunn wrote:
>> +static int hclge_set_led_status_phy(struct phy_device *phydev, int value)
>> +{
>> +	int ret, cur_page;
>> +
>> +	mutex_lock(&phydev->lock);
>> +
>> +	ret = phy_read(phydev, HCLGE_PHY_PAGE_REG);
>> +	if (ret < 0)
>> +		goto out;
>> +	else
>> +		cur_page = ret;
>> +
>> +	ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, HCLGE_PHY_PAGE_LED);
>> +	if (ret)
>> +		goto out;
>> +
>> +	ret = phy_write(phydev, HCLGE_LED_FC_REG, value);
>> +	if (ret)
>> +		goto out;
>> +
>> +	ret = phy_write(phydev, HCLGE_PHY_PAGE_REG, cur_page);
>> +
>> +out:
>> +	mutex_unlock(&phydev->lock);
>> +	return ret;
>> +}
> Sorry, but NACK.
>
> Please add an interface to phylib and the phy driver you are using to
> do this.
>
>>   #define HCLGE_PHY_PAGE_MDIX		0
>>   #define HCLGE_PHY_PAGE_COPPER		0
>> +#define HCLGE_PHY_PAGE_LED		3
>>   
>>   /* Page Selection Reg. */
>>   #define HCLGE_PHY_PAGE_REG		22
>> @@ -73,6 +74,15 @@
>>   /* Copper Specific Status Register */
>>   #define HCLGE_PHY_CSS_REG		17
>>   
>> +/* LED Function Control Register */
>> +#define HCLGE_LED_FC_REG		16
>> +
>> +/* LED Polarity Control Register */
>> +#define HCLGE_LED_PC_REG		17
>> +
>> +#define HCLGE_LED_FORCE_ON		9
>> +#define HCLGE_LED_FORCE_OFF		8
>> +
> By the looks of these defines, you assume you have a Marvell PHY.
> Please make this generic so anybody with a Marvell PHY can use it.
>
>         Andrew
Hi  Andrw,

As your suggestion, we need add  interface to  phylib and the phy driver.
We will consider your suggestion and push this patch after we fix your 
comments.

so we will remove this patch  in V2 patch-set.

Thanks
Peng Li

> .
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ