]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: Add support for asking the PHY its abilities
authorAndrew Lunn <andrew@lunn.ch>
Sat, 9 Feb 2019 14:24:47 +0000 (15:24 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Feb 2019 17:32:04 +0000 (09:32 -0800)
commitda1d4bf69749afc999882c7f1e7a972c23c1b947
tree91e7fe76b8d68927e68c7284dffbc720114ec965
parentbf83fa182c836adfdd5ea5006d4630080480f9ef
net: phy: Add support for asking the PHY its abilities

Add support for runtime determination of what the PHY supports, by
adding a new function to the phy driver. The get_features call should
set the phydev->supported member with the features the PHY supports.
It is only called if phydrv->features is NULL.

This requires minor changes to pause. The PHY driver should not set
pause abilities, except for when it has odd cause capabilities, e.g.
pause cannot be disabled. With this change, phydev->supported already
contains the drivers abilities, including pause. So rather than
considering phydrv->features, look at the phydev->supported, and
enable pause if neither of the pause bits are already set.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: fixed small checkpatch complaint in one comment]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c
include/linux/phy.h