]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 Jun 2022 03:58:30 +0000 (20:58 -0700)
commit92eaffc53f48dd0f9870c74a40a6a68d02a82ec7
tree7ca12cffa0e45ed44c0e68de3abe4d67b1283b14
parent556fb8c49f2f75431de9969074e141b4214cec8f
net: dsa: mv88e6xxx: use BMSR_ANEGCOMPLETE bit for filling an_complete

Commit 3e8cac4b967d ("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: 3e8cac4b967d ("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>
drivers/net/dsa/mv88e6xxx/serdes.c