net: dsa: mv88e6xxx: use BMSR_ANEGCOMPLETE bit for filling an_complete
authorMarek Behún <kabel@kernel.org>
Tue, 7 Jun 2022 11:28:42 +0000 (12:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:19 +0000 (18:36 +0200)
commit9b18f01a5120785d9b07d8ea889920b7fd943784
tree4b7e16caf06633e68bf8a48e41c0714d713020c1
parente31d9ba169860687dba19bdc8fccbfd34077f655
net: dsa: mv88e6xxx: use BMSR_ANEGCOMPLETE bit for filling an_complete

[ Upstream commit 47e96930d6e6106d5252e85b868d3c7e29296de0 ]

Commit ede359d8843a ("net: dsa: mv88e6xxx: Link in pcs_get_state() if AN
is bypassed") added the ability to link if AN was bypassed, and added
filling of state->an_complete field, but set it to true if AN was
enabled in BMCR, not when AN was reported complete in BMSR.

This was done because for some reason, when I wanted to use BMSR value
to infer an_complete, I was looking at BMSR_ANEGCAPABLE bit (which was
always 1), instead of BMSR_ANEGCOMPLETE bit.

Use BMSR_ANEGCOMPLETE for filling state->an_complete.

Fixes: ede359d8843a ("net: dsa: mv88e6xxx: Link in pcs_get_state() if AN is bypassed")
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/mv88e6xxx/serdes.c