ethtool: provide link settings with LINKINFO_GET request
Implement LINKINFO_GET netlink request to get basic link settings provided by ETHTOOL_GLINKSETTINGS and ETHTOOL_GSET ioctl commands. This request provides settings not directly related to autonegotiation and link mode selection: physical port, phy MDIO address, MDI(-X) status, MDI(-X) control and transceiver. LINKINFO_GET request can be used with NLM_F_DUMP (without device identification) to request the information for all devices in current network namespace providing the data. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
71921690f9
commit
459e0b81b3
@@ -15,6 +15,7 @@
|
||||
enum {
|
||||
ETHTOOL_MSG_USER_NONE,
|
||||
ETHTOOL_MSG_STRSET_GET,
|
||||
ETHTOOL_MSG_LINKINFO_GET,
|
||||
|
||||
/* add new constants above here */
|
||||
__ETHTOOL_MSG_USER_CNT,
|
||||
@@ -25,6 +26,7 @@ enum {
|
||||
enum {
|
||||
ETHTOOL_MSG_KERNEL_NONE,
|
||||
ETHTOOL_MSG_STRSET_GET_REPLY,
|
||||
ETHTOOL_MSG_LINKINFO_GET_REPLY,
|
||||
|
||||
/* add new constants above here */
|
||||
__ETHTOOL_MSG_KERNEL_CNT,
|
||||
@@ -141,6 +143,22 @@ enum {
|
||||
ETHTOOL_A_STRSET_MAX = __ETHTOOL_A_STRSET_CNT - 1
|
||||
};
|
||||
|
||||
/* LINKINFO */
|
||||
|
||||
enum {
|
||||
ETHTOOL_A_LINKINFO_UNSPEC,
|
||||
ETHTOOL_A_LINKINFO_HEADER, /* nest - _A_HEADER_* */
|
||||
ETHTOOL_A_LINKINFO_PORT, /* u8 */
|
||||
ETHTOOL_A_LINKINFO_PHYADDR, /* u8 */
|
||||
ETHTOOL_A_LINKINFO_TP_MDIX, /* u8 */
|
||||
ETHTOOL_A_LINKINFO_TP_MDIX_CTRL, /* u8 */
|
||||
ETHTOOL_A_LINKINFO_TRANSCEIVER, /* u8 */
|
||||
|
||||
/* add new constants above here */
|
||||
__ETHTOOL_A_LINKINFO_CNT,
|
||||
ETHTOOL_A_LINKINFO_MAX = __ETHTOOL_A_LINKINFO_CNT - 1
|
||||
};
|
||||
|
||||
/* generic netlink info */
|
||||
#define ETHTOOL_GENL_NAME "ethtool"
|
||||
#define ETHTOOL_GENL_VERSION 1
|
||||
|
Reference in New Issue
Block a user