summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2024-06-27 18:33:46 +0300
committerJakub Kicinski <kuba@kernel.org>2024-06-29 04:53:17 +0300
commit3ebbd9f6de7ec6d538639ebb657246f629ace81e (patch)
treeca13c32db16b128af29892f398760c2677440d6a /include
parentc2dd2139e0cd0a567d68f0ca7215dcfe627e7afc (diff)
downloadlinux-3ebbd9f6de7ec6d538639ebb657246f629ace81e.tar.xz
net: move ethtool-related netdev state into its own struct
net_dev->ethtool is a pointer to new struct ethtool_netdev_state, which currently contains only the wol_enabled field. Suggested-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://patch.msgid.link/293a562278371de7534ed1eb17531838ca090633.1719502239.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ethtool.h8
-rw-r--r--include/linux/netdevice.h8
2 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c7f6f2bc9cac..374639e661d1 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -1004,6 +1004,14 @@ int ethtool_virtdev_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd,
u32 *dev_speed, u8 *dev_duplex);
+/**
+ * struct ethtool_netdev_state - per-netdevice state for ethtool features
+ * @wol_enabled: Wake-on-LAN is enabled
+ */
+struct ethtool_netdev_state {
+ unsigned wol_enabled:1;
+};
+
struct phy_device;
struct phy_tdr_config;
struct phy_plca_cfg;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1e3401093c13..3c719f0d5f5a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -80,6 +80,7 @@ struct xdp_buff;
struct xdp_frame;
struct xdp_metadata_ops;
struct xdp_md;
+struct ethtool_netdev_state;
typedef u32 xdp_features_t;
@@ -1986,8 +1987,6 @@ enum netdev_reg_state {
* switch driver and used to set the phys state of the
* switch port.
*
- * @wol_enabled: Wake-on-LAN is enabled
- *
* @threaded: napi threaded mode is enabled
*
* @module_fw_flash_in_progress: Module firmware flashing is in progress.
@@ -2001,6 +2000,7 @@ enum netdev_reg_state {
* @udp_tunnel_nic_info: static structure describing the UDP tunnel
* offload capabilities of the device
* @udp_tunnel_nic: UDP tunnel offload state
+ * @ethtool: ethtool related state
* @xdp_state: stores info on attached XDP BPF programs
*
* @nested_level: Used as a parameter of spin_lock_nested() of
@@ -2375,7 +2375,7 @@ struct net_device {
struct lock_class_key *qdisc_tx_busylock;
bool proto_down;
bool threaded;
- unsigned wol_enabled:1;
+
unsigned module_fw_flash_in_progress:1;
struct list_head net_notifier_list;
@@ -2386,6 +2386,8 @@ struct net_device {
const struct udp_tunnel_nic_info *udp_tunnel_nic_info;
struct udp_tunnel_nic *udp_tunnel_nic;
+ struct ethtool_netdev_state *ethtool;
+
/* protected by rtnl_lock */
struct bpf_xdp_entity xdp_state[__MAX_XDP_MODE];