Merge branch 'mii_bmcr_encode_fixed'
authorDavid S. Miller <davem@davemloft.net>
Sun, 19 Jun 2022 09:38:27 +0000 (10:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Jun 2022 09:38:27 +0000 (10:38 +0100)
Russell King says:

====================
net: introduce mii_bmcr_encode_fixed()

While converting the mv88e6xxx driver to phylink pcs, it has been
noticed that we've started to have repeated cases where we convert a
speed and duplex to a BMCR value.

Rather than open coding this in multiple locations, let's provide a
helper for this - in linux/mii.h. This helper not only takes care of
the standard 10, 100 and 1000Mbps encodings, but also includes
2500Mbps (which is the same as 1000Mbps) for those users who require
that encoding as well. Unknown speeds will be encoded to 10Mbps, and
non-full duplexes will be encoded as half duplex.

This series converts the existing users to the new helper, and the
mv88e6xxx conversion will add further users in the 6352 and 639x PCS
code.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

Trivial merge