net: macb: fix macb_get/set_wol() when moving to phylink
authorNicolas Ferre <nicolas.ferre@microchip.com>
Fri, 10 Jul 2020 12:46:43 +0000 (14:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2020 06:13:25 +0000 (08:13 +0200)
commit8438f279296006fa838f4fe1f4082bf68ce7b73e
treeddf4b648c8ab55c2d7b7329f1a6a9fbe375a1bf9
parentb2d36146a095a0be8b06849a4bb27df6bcbe002c
net: macb: fix macb_get/set_wol() when moving to phylink

[ Upstream commit 253fe09435045ab9346a8e364299d971185ae031 ]

Keep previous function goals and integrate phylink actions to them.

phylink_ethtool_get_wol() is not enough to figure out if Ethernet driver
supports Wake-on-Lan.
Initialization of "supported" and "wolopts" members is done in phylink
function, no need to keep them in calling function.

phylink_ethtool_set_wol() return value is considered and determines
if the MAC has to handle WoL or not. The case where the PHY doesn't
implement WoL leads to the MAC configuring it to provide this feature.

Fixes: 7897b071ac3b ("net: macb: convert to phylink")
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: Harini Katakam <harini.katakam@xilinx.com>
Cc: Antoine Tenart <antoine.tenart@bootlin.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/cadence/macb_main.c