mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
1dd3f212af
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>
37 lines
917 B
C
37 lines
917 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#ifndef _LINUX_ETHTOOL_NETLINK_H_
|
|
#define _LINUX_ETHTOOL_NETLINK_H_
|
|
|
|
#include <uapi/linux/ethtool_netlink.h>
|
|
#include <linux/ethtool.h>
|
|
#include <linux/netdevice.h>
|
|
|
|
#define __ETHTOOL_LINK_MODE_MASK_NWORDS \
|
|
DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
|
|
|
|
enum ethtool_multicast_groups {
|
|
ETHNL_MCGRP_MONITOR,
|
|
};
|
|
|
|
struct phy_device;
|
|
|
|
#if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
|
|
int ethnl_cable_test_alloc(struct phy_device *phydev);
|
|
void ethnl_cable_test_free(struct phy_device *phydev);
|
|
void ethnl_cable_test_finished(struct phy_device *phydev);
|
|
#else
|
|
static inline int ethnl_cable_test_alloc(struct phy_device *phydev)
|
|
{
|
|
return -ENOTSUPP;
|
|
}
|
|
|
|
static inline void ethnl_cable_test_free(struct phy_device *phydev)
|
|
{
|
|
}
|
|
|
|
static inline void ethnl_cable_test_finished(struct phy_device *phydev)
|
|
{
|
|
}
|
|
#endif /* IS_ENABLED(ETHTOOL_NETLINK) */
|
|
#endif /* _LINUX_ETHTOOL_NETLINK_H_ */
|