Commit 285cc15c authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

ethtool: adjust struct ethtool_keee to kernel needs

This patch changes the following in struct ethtool_keee
- remove member cmd, it's not needed on kernel side
- remove reserved fields
- switch the semantically boolean members to type bool

We don't have to change any user of the boolean members due to the
implicit casting from/to bool. A small change is needed where a
pointer to bool members is used, in addition remove few now unneeded
double negations.
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0b3100bc
...@@ -223,15 +223,13 @@ __ethtool_get_link_ksettings(struct net_device *dev, ...@@ -223,15 +223,13 @@ __ethtool_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *link_ksettings); struct ethtool_link_ksettings *link_ksettings);
struct ethtool_keee { struct ethtool_keee {
u32 cmd;
u32 supported; u32 supported;
u32 advertised; u32 advertised;
u32 lp_advertised; u32 lp_advertised;
u32 eee_active;
u32 eee_enabled;
u32 tx_lpi_enabled;
u32 tx_lpi_timer; u32 tx_lpi_timer;
u32 reserved[2]; bool tx_lpi_enabled;
bool eee_active;
bool eee_enabled;
}; };
struct kernel_ethtool_coalesce { struct kernel_ethtool_coalesce {
......
...@@ -98,10 +98,10 @@ static int eee_fill_reply(struct sk_buff *skb, ...@@ -98,10 +98,10 @@ static int eee_fill_reply(struct sk_buff *skb,
if (ret < 0) if (ret < 0)
return ret; return ret;
if (nla_put_u8(skb, ETHTOOL_A_EEE_ACTIVE, !!eee->eee_active) || if (nla_put_u8(skb, ETHTOOL_A_EEE_ACTIVE, eee->eee_active) ||
nla_put_u8(skb, ETHTOOL_A_EEE_ENABLED, !!eee->eee_enabled) || nla_put_u8(skb, ETHTOOL_A_EEE_ENABLED, eee->eee_enabled) ||
nla_put_u8(skb, ETHTOOL_A_EEE_TX_LPI_ENABLED, nla_put_u8(skb, ETHTOOL_A_EEE_TX_LPI_ENABLED,
!!eee->tx_lpi_enabled) || eee->tx_lpi_enabled) ||
nla_put_u32(skb, ETHTOOL_A_EEE_TX_LPI_TIMER, eee->tx_lpi_timer)) nla_put_u32(skb, ETHTOOL_A_EEE_TX_LPI_TIMER, eee->tx_lpi_timer))
return -EMSGSIZE; return -EMSGSIZE;
...@@ -145,9 +145,9 @@ ethnl_set_eee(struct ethnl_req_info *req_info, struct genl_info *info) ...@@ -145,9 +145,9 @@ ethnl_set_eee(struct ethnl_req_info *req_info, struct genl_info *info)
link_mode_names, info->extack, &mod); link_mode_names, info->extack, &mod);
if (ret < 0) if (ret < 0)
return ret; return ret;
ethnl_update_bool32(&eee.eee_enabled, tb[ETHTOOL_A_EEE_ENABLED], &mod); ethnl_update_bool(&eee.eee_enabled, tb[ETHTOOL_A_EEE_ENABLED], &mod);
ethnl_update_bool32(&eee.tx_lpi_enabled, ethnl_update_bool(&eee.tx_lpi_enabled, tb[ETHTOOL_A_EEE_TX_LPI_ENABLED],
tb[ETHTOOL_A_EEE_TX_LPI_ENABLED], &mod); &mod);
ethnl_update_u32(&eee.tx_lpi_timer, tb[ETHTOOL_A_EEE_TX_LPI_TIMER], ethnl_update_u32(&eee.tx_lpi_timer, tb[ETHTOOL_A_EEE_TX_LPI_TIMER],
&mod); &mod);
if (!mod) if (!mod)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment