# Re: \[PATCH net v2\] net: phy: phy\_ethtool\_ksettings\_set: Don't discard phy\_start\_aneg's return

- From: Heiner Kallweit \<hkallweit1@gmail.com\>
- Date: 2021-11-08 18:01:36 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/11/11215769
- Thread: https://ratatoskr.run/netdev/2021/11/11215670/t.md

```text
On 08.11.2021 18:57, Andrew Lunn wrote:
>> It is BCM53125. Currently, you can set "mdix auto|off|on" which does
>> not take any effect.  The chip will do what is its default depending
>> on copper autonegotiation.
>>
>> I am adding support for setting "mdix auto|off". I want the thing to error on "mdix on".
>> Where would I add that check?
> 
> /* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
>  * the driver is required to renegotiate link
>  */
> #define ETH_TP_MDI_INVALID	0x00 /* status: unknown; control: unsupported */
> #define ETH_TP_MDI		0x01 /* status: MDI;     control: force MDI */
> #define ETH_TP_MDI_X		0x02 /* status: MDI-X;   control: force MDI-X */
> #define ETH_TP_MDI_AUTO		0x03 /*                  control: auto-select */
> 
> So there are three valid settings. And you are saying you only want to
> implement two of them? If the hardware can do all three, you should
> implement all three.
> 

If we would like to support PHY's that don't support all MDI modes then
supposedly this would require to add ETHTOOL_LINK_MODE bits for the
MDI modes. Then we could use the generic mechanism to check the bits in
the "supported" bitmap.

> 	  Andrew
> 
> 

```
