Lines Matching full:netdev
397 static int hns3_get_sset_count(struct net_device *netdev, int stringset) in hns3_get_sset_count() argument
399 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_sset_count()
461 static void hns3_get_strings(struct net_device *netdev, u32 stringset, u8 *data) in hns3_get_strings() argument
463 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_strings()
513 * @netdev: net device
517 static void hns3_get_stats(struct net_device *netdev, in hns3_get_stats() argument
520 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_stats()
523 if (hns3_nic_resetting(netdev)) { in hns3_get_stats()
524 netdev_err(netdev, "dev resetting, could not get stats\n"); in hns3_get_stats()
529 netdev_err(netdev, "could not get any statistics\n"); in hns3_get_stats()
533 h->ae_algo->ops->update_stats(h, &netdev->stats); in hns3_get_stats()
542 static void hns3_get_drvinfo(struct net_device *netdev, in hns3_get_drvinfo() argument
545 struct hns3_nic_priv *priv = netdev_priv(netdev); in hns3_get_drvinfo()
550 netdev_err(netdev, "could not get fw version!\n"); in hns3_get_drvinfo()
576 static u32 hns3_get_link(struct net_device *netdev) in hns3_get_link() argument
578 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_link()
586 static void hns3_get_ringparam(struct net_device *netdev, in hns3_get_ringparam() argument
589 struct hns3_nic_priv *priv = netdev_priv(netdev); in hns3_get_ringparam()
593 if (hns3_nic_resetting(netdev)) { in hns3_get_ringparam()
594 netdev_err(netdev, "dev resetting!"); in hns3_get_ringparam()
605 static void hns3_get_pauseparam(struct net_device *netdev, in hns3_get_pauseparam() argument
608 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_pauseparam()
615 static int hns3_set_pauseparam(struct net_device *netdev, in hns3_set_pauseparam() argument
618 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_set_pauseparam()
620 netif_dbg(h, drv, netdev, in hns3_set_pauseparam()
655 static int hns3_get_link_ksettings(struct net_device *netdev, in hns3_get_link_ksettings() argument
658 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_link_ksettings()
689 if (!netdev->phydev) in hns3_get_link_ksettings()
692 phy_ethtool_ksettings_get(netdev->phydev, cmd); in hns3_get_link_ksettings()
696 netdev_warn(netdev, "Unknown media type"); in hns3_get_link_ksettings()
703 link_stat = hns3_get_link(netdev); in hns3_get_link_ksettings()
712 static int hns3_check_ksettings_param(const struct net_device *netdev, in hns3_check_ksettings_param() argument
715 struct hnae3_handle *handle = hns3_get_handle(netdev); in hns3_check_ksettings_param()
742 netdev_err(netdev, in hns3_check_ksettings_param()
750 netdev_err(netdev, "unsupported speed\n"); in hns3_check_ksettings_param()
758 static int hns3_set_link_ksettings(struct net_device *netdev, in hns3_set_link_ksettings() argument
761 struct hnae3_handle *handle = hns3_get_handle(netdev); in hns3_set_link_ksettings()
770 netif_dbg(handle, drv, netdev, in hns3_set_link_ksettings()
772 netdev->phydev ? "phy" : "mac", in hns3_set_link_ksettings()
775 /* Only support ksettings_set for netdev with phy attached for now */ in hns3_set_link_ksettings()
776 if (netdev->phydev) { in hns3_set_link_ksettings()
781 return phy_ethtool_ksettings_set(netdev->phydev, cmd); in hns3_set_link_ksettings()
787 ret = hns3_check_ksettings_param(netdev, cmd); in hns3_set_link_ksettings()
801 netdev_info(netdev, in hns3_set_link_ksettings()
813 static u32 hns3_get_rss_key_size(struct net_device *netdev) in hns3_get_rss_key_size() argument
815 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_rss_key_size()
823 static u32 hns3_get_rss_indir_size(struct net_device *netdev) in hns3_get_rss_indir_size() argument
825 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_rss_indir_size()
833 static int hns3_get_rss(struct net_device *netdev, u32 *indir, u8 *key, in hns3_get_rss() argument
836 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_rss()
844 static int hns3_set_rss(struct net_device *netdev, const u32 *indir, in hns3_set_rss() argument
847 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_set_rss()
856 netdev_err(netdev, "hash func not supported\n"); in hns3_set_rss()
861 netdev_err(netdev, in hns3_set_rss()
869 static int hns3_get_rxnfc(struct net_device *netdev, in hns3_get_rxnfc() argument
873 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_rxnfc()
1021 static int hns3_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd) in hns3_set_rxnfc() argument
1023 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_set_rxnfc()
1043 static int hns3_nway_reset(struct net_device *netdev) in hns3_nway_reset() argument
1045 struct hnae3_handle *handle = hns3_get_handle(netdev); in hns3_nway_reset()
1047 struct phy_device *phy = netdev->phydev; in hns3_nway_reset()
1050 if (!netif_running(netdev)) in hns3_nway_reset()
1053 if (hns3_nic_resetting(netdev)) { in hns3_nway_reset()
1054 netdev_err(netdev, "dev resetting!"); in hns3_nway_reset()
1063 netdev_err(netdev, in hns3_nway_reset()
1068 netif_dbg(handle, drv, netdev, in hns3_nway_reset()
1077 static void hns3_get_channels(struct net_device *netdev, in hns3_get_channels() argument
1080 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_channels()
1086 static int hns3_get_coalesce_per_queue(struct net_device *netdev, u32 queue, in hns3_get_coalesce_per_queue() argument
1090 struct hns3_nic_priv *priv = netdev_priv(netdev); in hns3_get_coalesce_per_queue()
1094 if (hns3_nic_resetting(netdev)) in hns3_get_coalesce_per_queue()
1098 netdev_err(netdev, in hns3_get_coalesce_per_queue()
1121 static int hns3_get_coalesce(struct net_device *netdev, in hns3_get_coalesce() argument
1124 return hns3_get_coalesce_per_queue(netdev, 0, cmd); in hns3_get_coalesce()
1127 static int hns3_check_gl_coalesce_para(struct net_device *netdev, in hns3_check_gl_coalesce_para() argument
1133 netdev_err(netdev, in hns3_check_gl_coalesce_para()
1140 netdev_err(netdev, in hns3_check_gl_coalesce_para()
1148 netdev_info(netdev, in hns3_check_gl_coalesce_para()
1155 netdev_info(netdev, in hns3_check_gl_coalesce_para()
1163 static int hns3_check_rl_coalesce_para(struct net_device *netdev, in hns3_check_rl_coalesce_para() argument
1169 netdev_err(netdev, in hns3_check_rl_coalesce_para()
1175 netdev_err(netdev, in hns3_check_rl_coalesce_para()
1183 netdev_info(netdev, in hns3_check_rl_coalesce_para()
1191 static int hns3_check_coalesce_para(struct net_device *netdev, in hns3_check_coalesce_para() argument
1196 ret = hns3_check_gl_coalesce_para(netdev, cmd); in hns3_check_coalesce_para()
1198 netdev_err(netdev, in hns3_check_coalesce_para()
1203 ret = hns3_check_rl_coalesce_para(netdev, cmd); in hns3_check_coalesce_para()
1205 netdev_err(netdev, in hns3_check_coalesce_para()
1212 netdev_info(netdev, in hns3_check_coalesce_para()
1221 static void hns3_set_coalesce_per_queue(struct net_device *netdev, in hns3_set_coalesce_per_queue() argument
1226 struct hns3_nic_priv *priv = netdev_priv(netdev); in hns3_set_coalesce_per_queue()
1250 static int hns3_set_coalesce(struct net_device *netdev, in hns3_set_coalesce() argument
1253 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_set_coalesce()
1258 if (hns3_nic_resetting(netdev)) in hns3_set_coalesce()
1261 ret = hns3_check_coalesce_para(netdev, cmd); in hns3_set_coalesce()
1269 hns3_set_coalesce_per_queue(netdev, cmd, i); in hns3_set_coalesce()
1274 static int hns3_get_regs_len(struct net_device *netdev) in hns3_get_regs_len() argument
1276 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_regs_len()
1284 static void hns3_get_regs(struct net_device *netdev, in hns3_get_regs() argument
1287 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_regs()
1295 static int hns3_set_phys_id(struct net_device *netdev, in hns3_set_phys_id() argument
1298 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_set_phys_id()
1306 static u32 hns3_get_msglevel(struct net_device *netdev) in hns3_get_msglevel() argument
1308 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_get_msglevel()
1313 static void hns3_set_msglevel(struct net_device *netdev, u32 msg_level) in hns3_set_msglevel() argument
1315 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_set_msglevel()
1357 static int hns3_get_fecparam(struct net_device *netdev, in hns3_get_fecparam() argument
1360 struct hnae3_handle *handle = hns3_get_handle(netdev); in hns3_get_fecparam()
1380 static int hns3_set_fecparam(struct net_device *netdev, in hns3_set_fecparam() argument
1383 struct hnae3_handle *handle = hns3_get_handle(netdev); in hns3_set_fecparam()
1395 netif_dbg(handle, drv, netdev, "set fecparam: mode=%u\n", fec_mode); in hns3_set_fecparam()
1400 static int hns3_get_module_info(struct net_device *netdev, in hns3_get_module_info() argument
1405 struct hnae3_handle *handle = hns3_get_handle(netdev); in hns3_get_module_info()
1444 netdev_err(netdev, "Optical module unknown: %#x\n", in hns3_get_module_info()
1452 static int hns3_get_module_eeprom(struct net_device *netdev, in hns3_get_module_eeprom() argument
1455 struct hnae3_handle *handle = hns3_get_handle(netdev); in hns3_get_module_eeprom()
1538 void hns3_ethtool_set_ops(struct net_device *netdev) in hns3_ethtool_set_ops() argument
1540 struct hnae3_handle *h = hns3_get_handle(netdev); in hns3_ethtool_set_ops()
1543 netdev->ethtool_ops = &hns3vf_ethtool_ops; in hns3_ethtool_set_ops()
1545 netdev->ethtool_ops = &hns3_ethtool_ops; in hns3_ethtool_set_ops()