net: ethtool: Add infrastructure for reporting cable test results

Provide infrastructure for PHY drivers to report the cable test
results.  A netlink skb is associated to the phydev. Helpers will be
added which can add results to this skb. Once the test has finished
the results are sent to user space.

When netlink ethtool is not part of the kernel configuration stubs are
provided. It is also impossible to trigger a cable test, so the error
code returned by the alloc function is of no consequence.

v2:
Include the status complete in the netlink notification message

v4:
Replace -EINVAL with -EMSGSIZE

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Andrew Lunn 2020-05-10 21:12:36 +02:00 committed by Jakub Kicinski
parent 0df960f14e
commit 1dd3f212af
4 changed files with 100 additions and 2 deletions

View file

@ -523,6 +523,11 @@ struct phy_device {
/* For use by PHYs inside the same package that need a shared state. */
struct phy_package_shared *shared;
/* Reporting cable test results */
struct sk_buff *skb;
void *ehdr;
struct nlattr *nest;
/* Interrupt and Polling infrastructure */
struct delayed_work state_queue;