net: aquantia: atlantic: use new api ethtool_{get|set}_link_ksettings
Subsystems (3)
PATCH v2 1/1 net: aquantia: atlantic: use new api ethtool_{get|set}_link_ksettings
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings.
As I don't have the hardware, I'd be very pleased if someone may test this patch.
---
Changelog:
v2:
- add support and advertise for TP
.../net/ethernet/aquantia/atlantic/aq_ethtool.c | 23 +++++---- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 51 +++++++++++++------- drivers/net/ethernet/aquantia/atlantic/aq_nic.h | 6 ++- 3 files changed, 49 insertions(+), 31 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +12 -11
@@ -35,24 +35,25 @@ static u32 aq_ethtool_get_link(struct net_device *ndev)return ethtool_op_get_link (ndev); } -static int aq_ethtool_get_settings (struct net_device *ndev, -struct ethtool_cmd *cmd) +static int aq_ethtool_get_link_ksettings (struct net_device *ndev, +struct ethtool_link_ksettings *cmd) {struct aq_nic_s *aq_nic =netdev_priv (ndev); -aq_nic_get_link_settings (aq_nic, cmd); -ethtool_cmd_speed_set (cmd,netif_carrier_ok (ndev) ? -aq_nic_get_link_speed (aq_nic) :0U ); +aq_nic_get_link_ksettings (aq_nic, cmd); + cmd->base.speed =netif_carrier_ok (ndev) ? +aq_nic_get_link_speed (aq_nic) :0U ;return 0 ; } -static int aq_ethtool_set_settings (struct net_device *ndev, -struct ethtool_cmd *cmd) +static int +aq_ethtool_set_link_ksettings (struct net_device *ndev, +const struct ethtool_link_ksettings *cmd) {struct aq_nic_s *aq_nic =netdev_priv (ndev); -return aq_nic_set_link_settings (aq_nic, cmd); +return aq_nic_set_link_ksettings (aq_nic, cmd); }/* there "5U" is number of queue[#] stats lines (InPackets+...+InErrors) */
@@ -248,8 +249,6 @@ static int aq_ethtool_get_rxnfc(struct net_device *ndev, .get_link = aq_ethtool_get_link, .get_regs_len = aq_ethtool_get_regs_len, .get_regs = aq_ethtool_get_regs, - .get_settings = aq_ethtool_get_settings, - .set_settings = aq_ethtool_set_settings, .get_drvinfo = aq_ethtool_get_drvinfo, .get_strings = aq_ethtool_get_strings, .get_rxfh_indir_size = aq_ethtool_get_rss_indir_size,
@@ -257,5 +256,7 @@ static int aq_ethtool_get_rxnfc(struct net_device *ndev, .get_rxfh = aq_ethtool_get_rss, .get_rxnfc = aq_ethtool_get_rxnfc, .get_sset_count = aq_ethtool_get_sset_count, - .get_ethtool_stats = aq_ethtool_stats + .get_ethtool_stats = aq_ethtool_stats, + .get_link_ksettings = aq_ethtool_get_link_ksettings, + .set_link_ksettings = aq_ethtool_set_link_ksettings, };
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +33 -18
83 lines not on this page · raw message
drivers/net/ethernet/aquantia/atlantic/aq_nic.h +4 -2
@@ -99,8 +99,10 @@ void aq_nic_set_tx_ring(struct aq_nic_s *self, unsigned int idx,int aq_nic_set_packet_filter (struct aq_nic_s *self,unsigned int flags);int aq_nic_set_multicast_list (struct aq_nic_s *self,struct net_device *ndev);unsigned int aq_nic_get_link_speed (struct aq_nic_s *self); -void aq_nic_get_link_settings (struct aq_nic_s *self,struct ethtool_cmd *cmd); -int aq_nic_set_link_settings (struct aq_nic_s *self,struct ethtool_cmd *cmd); +void aq_nic_get_link_ksettings (struct aq_nic_s *self, +struct ethtool_link_ksettings *cmd); +int aq_nic_set_link_ksettings (struct aq_nic_s *self, +const struct ethtool_link_ksettings *cmd);struct aq_nic_cfg_s *aq_nic_get_cfg (struct aq_nic_s *self);u32 aq_nic_get_fw_version (struct aq_nic_s *self);int aq_nic_change_pm_state (struct aq_nic_s *self,pm_message_t *pm_msg);
Signature · 1 line
1.7.4.4
Quoted 6 lines
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings.
As I don't have the hardware, I'd be very pleased if someone may test this patch.
Quoted 1 line
Signed-off-by Philippe Reynes <[email protected]> Tested-by: Pavel
Belous <[email protected]>
From: Philippe Reynes <[email protected]>
Date: Mon, 30 Jan 2017 23:04:42 +0100
Quoted 11 lines
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings.
As I don't have the hardware, I'd be very pleased if someone may test this patch.
Signed-off-by Philippe Reynes <[email protected]>---
Changelog:
v2:
- add support and advertise for TP
Applied, thanks.