]> git.baikalelectronics.ru Git - kernel.git/commit
net: cdc_ncm: record speed in status method
authorOliver Neukum <oneukum@suse.com>
Mon, 5 Apr 2021 23:13:43 +0000 (16:13 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Apr 2021 23:22:36 +0000 (16:22 -0700)
commit547e0f11ac618c21d777006f7fbe1755f4e2b858
tree28de11f4805aa4d617a8f68c828b4fc8ae9f4ef5
parente83e04296a14b1792023884587dfd1cfa9c89a3c
net: cdc_ncm: record speed in status method

Until very recently, the usbnet framework only had support functions
for devices which reported the link speed by explicitly querying the
PHY over a MDIO interface. However, the cdc_ncm devices send
notifications when the link state or link speeds change and do not
expose the PHY (or modem) directly.

Support funtions (e.g. usbnet_get_link_ksettings_internal()) to directly
query state recorded by the cdc_ncm driver were added in a previous patch.

So instead of cdc_ncm spewing the link speed into the dmesg buffer,
record the link speed encoded in these notifications and tell the
usbnet framework to use the new functions to get link speed/state.
Link speed/state is now available via ethtool.

This is especially useful given all current RTL8156 devices emit
a connection/speed status notification every 32ms and this would
fill the dmesg buffer. This implementation replaces the one
recently submitted in 97423f66b47c02e2e8dc46dd0647459aa76eba6c :
   "net: usb: cdc_ncm: don't spew notifications"

v2: rebased on upstream
v3: changed variable names
v4: rewrote commit message

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Tested-by: Roland Dreier <roland@kernel.org>
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_ncm.c