]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethtool: Add back transceiver type
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 20 Sep 2017 22:52:13 +0000 (15:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Sep 2017 22:20:40 +0000 (15:20 -0700)
commitafd587d8f3e79f7e0c6c012629d1e6cf8cbb62fd
tree516a7daded4877c0efea1d6926c9e2adc35876af
parent271462be7c67fcae00fcbfbba2d5e6b9c21352b1
net: ethtool: Add back transceiver type

Commit eda9ca094a26 ("net: ethtool: add new ETHTOOL_xLINKSETTINGS API")
deprecated the ethtool_cmd::transceiver field, which was fine in
premise, except that the PHY library was actually using it to report the
type of transceiver: internal or external.

Use the first word of the reserved field to put this __u8 transceiver
field back in. It is made read-only, and we don't expect the
ETHTOOL_xLINKSETTINGS API to be doing anything with this anyway, so this
is mostly for the legacy path where we do:

ethtool_get_settings()
-> dev->ethtool_ops->get_link_ksettings()
   -> convert_link_ksettings_to_legacy_settings()

to have no information loss compared to the legacy get_settings API.

Fixes: eda9ca094a26 ("net: ethtool: add new ETHTOOL_xLINKSETTINGS API")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/ethtool.h
net/core/ethtool.c