Lines Matching refs:netdev
217 nfp_net_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) in nfp_net_get_drvinfo() argument
220 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_drvinfo()
232 nfp_net_nway_reset(struct net_device *netdev) in nfp_net_nway_reset() argument
238 port = nfp_port_from_netdev(netdev); in nfp_net_nway_reset()
243 if (!netif_running(netdev)) in nfp_net_nway_reset()
248 netdev_info(netdev, "Link down failed: %d\n", err); in nfp_net_nway_reset()
254 netdev_info(netdev, "Link up failed: %d\n", err); in nfp_net_nway_reset()
258 netdev_info(netdev, "Link reset succeeded\n"); in nfp_net_nway_reset()
263 nfp_app_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) in nfp_app_get_drvinfo() argument
265 struct nfp_app *app = nfp_app_from_netdev(netdev); in nfp_app_get_drvinfo()
304 nfp_net_get_link_ksettings(struct net_device *netdev, in nfp_net_get_link_ksettings() argument
319 port = nfp_port_from_netdev(netdev); in nfp_net_get_link_ksettings()
334 if (!netif_carrier_ok(netdev)) in nfp_net_get_link_ksettings()
345 if (!nfp_netdev_is_nfp_net(netdev)) in nfp_net_get_link_ksettings()
347 nn = netdev_priv(netdev); in nfp_net_get_link_ksettings()
363 nfp_net_set_link_ksettings(struct net_device *netdev, in nfp_net_set_link_ksettings() argument
372 port = nfp_port_from_netdev(netdev); in nfp_net_set_link_ksettings()
377 if (netif_running(netdev)) { in nfp_net_set_link_ksettings()
378 …netdev_warn(netdev, "Changing settings not allowed on an active interface. It may cause the port t… in nfp_net_set_link_ksettings()
387 netdev_warn(netdev, "Autoneg is not supported.\n"); in nfp_net_set_link_ksettings()
400 netdev_err(netdev, "Speed changing is not allowed when working on autoneg mode.\n"); in nfp_net_set_link_ksettings()
423 static void nfp_net_get_ringparam(struct net_device *netdev, in nfp_net_get_ringparam() argument
428 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_ringparam()
451 static int nfp_net_set_ringparam(struct net_device *netdev, in nfp_net_set_ringparam() argument
457 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_set_ringparam()
483 static int nfp_test_link(struct net_device *netdev) in nfp_test_link() argument
485 if (!netif_carrier_ok(netdev) || !(netdev->flags & IFF_UP)) in nfp_test_link()
491 static int nfp_test_nsp(struct net_device *netdev) in nfp_test_nsp() argument
493 struct nfp_app *app = nfp_app_from_netdev(netdev); in nfp_test_nsp()
501 netdev_info(netdev, "NSP Test: failed to access the NSP: %d\n", err); in nfp_test_nsp()
518 netdev_info(netdev, "NSP Test: reading bsp version failed %d\n", err); in nfp_test_nsp()
527 static int nfp_test_fw(struct net_device *netdev) in nfp_test_fw() argument
529 struct nfp_net *nn = netdev_priv(netdev); in nfp_test_fw()
534 netdev_info(netdev, "FW Test: update failed %d\n", err); in nfp_test_fw()
539 static int nfp_test_reg(struct net_device *netdev) in nfp_test_reg() argument
541 struct nfp_app *app = nfp_app_from_netdev(netdev); in nfp_test_reg()
549 netdev_info(netdev, "REG Test: NFP model detection failed %d\n", err); in nfp_test_reg()
556 static bool link_test_supported(struct net_device *netdev) in link_test_supported() argument
561 static bool nsp_test_supported(struct net_device *netdev) in nsp_test_supported() argument
563 if (nfp_app_from_netdev(netdev)) in nsp_test_supported()
569 static bool fw_test_supported(struct net_device *netdev) in fw_test_supported() argument
571 if (nfp_netdev_is_nfp_net(netdev)) in fw_test_supported()
577 static bool reg_test_supported(struct net_device *netdev) in reg_test_supported() argument
579 if (nfp_app_from_netdev(netdev)) in reg_test_supported()
598 static void nfp_get_self_test_strings(struct net_device *netdev, u8 *data) in nfp_get_self_test_strings() argument
603 if (nfp_self_test[i].is_supported(netdev)) in nfp_get_self_test_strings()
607 static int nfp_get_self_test_count(struct net_device *netdev) in nfp_get_self_test_count() argument
612 if (nfp_self_test[i].is_supported(netdev)) in nfp_get_self_test_count()
618 static void nfp_net_self_test(struct net_device *netdev, struct ethtool_test *eth_test, in nfp_net_self_test() argument
623 netdev_info(netdev, "Start self test\n"); in nfp_net_self_test()
626 if (nfp_self_test[i].is_supported(netdev)) { in nfp_net_self_test()
627 ret = nfp_self_test[i].func(netdev); in nfp_net_self_test()
634 netdev_info(netdev, "Test end\n"); in nfp_net_self_test()
637 static unsigned int nfp_vnic_get_sw_stats_count(struct net_device *netdev) in nfp_vnic_get_sw_stats_count() argument
639 struct nfp_net *nn = netdev_priv(netdev); in nfp_vnic_get_sw_stats_count()
645 static u8 *nfp_vnic_get_sw_stats_strings(struct net_device *netdev, u8 *data) in nfp_vnic_get_sw_stats_strings() argument
647 struct nfp_net *nn = netdev_priv(netdev); in nfp_vnic_get_sw_stats_strings()
678 static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data) in nfp_vnic_get_sw_stats() argument
681 struct nfp_net *nn = netdev_priv(netdev); in nfp_vnic_get_sw_stats()
842 static unsigned int nfp_mac_get_stats_count(struct net_device *netdev) in nfp_mac_get_stats_count() argument
846 port = nfp_port_from_netdev(netdev); in nfp_mac_get_stats_count()
853 static u8 *nfp_mac_get_stats_strings(struct net_device *netdev, u8 *data) in nfp_mac_get_stats_strings() argument
858 port = nfp_port_from_netdev(netdev); in nfp_mac_get_stats_strings()
868 static u64 *nfp_mac_get_stats(struct net_device *netdev, u64 *data) in nfp_mac_get_stats() argument
873 port = nfp_port_from_netdev(netdev); in nfp_mac_get_stats()
883 static void nfp_net_get_strings(struct net_device *netdev, in nfp_net_get_strings() argument
886 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_strings()
890 data = nfp_vnic_get_sw_stats_strings(netdev, data); in nfp_net_get_strings()
897 data = nfp_mac_get_stats_strings(netdev, data); in nfp_net_get_strings()
901 nfp_get_self_test_strings(netdev, data); in nfp_net_get_strings()
907 nfp_net_get_stats(struct net_device *netdev, struct ethtool_stats *stats, in nfp_net_get_stats() argument
910 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_stats()
912 data = nfp_vnic_get_sw_stats(netdev, data); in nfp_net_get_stats()
918 data = nfp_mac_get_stats(netdev, data); in nfp_net_get_stats()
922 static int nfp_net_get_sset_count(struct net_device *netdev, int sset) in nfp_net_get_sset_count() argument
924 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_sset_count()
929 cnt = nfp_vnic_get_sw_stats_count(netdev); in nfp_net_get_sset_count()
934 cnt += nfp_mac_get_stats_count(netdev); in nfp_net_get_sset_count()
938 return nfp_get_self_test_count(netdev); in nfp_net_get_sset_count()
944 static void nfp_port_get_strings(struct net_device *netdev, in nfp_port_get_strings() argument
947 struct nfp_port *port = nfp_port_from_netdev(netdev); in nfp_port_get_strings()
954 data = nfp_mac_get_stats_strings(netdev, data); in nfp_port_get_strings()
958 nfp_get_self_test_strings(netdev, data); in nfp_port_get_strings()
964 nfp_port_get_stats(struct net_device *netdev, struct ethtool_stats *stats, in nfp_port_get_stats() argument
967 struct nfp_port *port = nfp_port_from_netdev(netdev); in nfp_port_get_stats()
972 data = nfp_mac_get_stats(netdev, data); in nfp_port_get_stats()
976 static int nfp_port_get_sset_count(struct net_device *netdev, int sset) in nfp_port_get_sset_count() argument
978 struct nfp_port *port = nfp_port_from_netdev(netdev); in nfp_port_get_sset_count()
986 count = nfp_mac_get_stats_count(netdev); in nfp_port_get_sset_count()
990 return nfp_get_self_test_count(netdev); in nfp_port_get_sset_count()
1030 nfp_port_get_fecparam(struct net_device *netdev, in nfp_port_get_fecparam() argument
1039 port = nfp_port_from_netdev(netdev); in nfp_port_get_fecparam()
1054 nfp_port_set_fecparam(struct net_device *netdev, in nfp_port_set_fecparam() argument
1061 port = nfp_port_from_netdev(netdev); in nfp_port_set_fecparam()
1121 static int nfp_net_get_rxnfc(struct net_device *netdev, in nfp_net_get_rxnfc() argument
1124 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_rxnfc()
1189 static int nfp_net_set_rxnfc(struct net_device *netdev, in nfp_net_set_rxnfc() argument
1192 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_set_rxnfc()
1202 static u32 nfp_net_get_rxfh_indir_size(struct net_device *netdev) in nfp_net_get_rxfh_indir_size() argument
1204 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_rxfh_indir_size()
1212 static u32 nfp_net_get_rxfh_key_size(struct net_device *netdev) in nfp_net_get_rxfh_key_size() argument
1214 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_rxfh_key_size()
1222 static int nfp_net_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, in nfp_net_get_rxfh() argument
1225 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_rxfh()
1245 static int nfp_net_set_rxfh(struct net_device *netdev, in nfp_net_set_rxfh() argument
1249 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_set_rxfh()
1275 static int nfp_net_get_regs_len(struct net_device *netdev) in nfp_net_get_regs_len() argument
1280 static void nfp_net_get_regs(struct net_device *netdev, in nfp_net_get_regs() argument
1283 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_regs()
1293 static int nfp_net_get_coalesce(struct net_device *netdev, in nfp_net_get_coalesce() argument
1298 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_coalesce()
1360 static int nfp_app_set_dump(struct net_device *netdev, struct ethtool_dump *val) in nfp_app_set_dump() argument
1362 struct nfp_app *app = nfp_app_from_netdev(netdev); in nfp_app_set_dump()
1388 nfp_app_get_dump_flag(struct net_device *netdev, struct ethtool_dump *dump) in nfp_app_get_dump_flag() argument
1390 struct nfp_app *app = nfp_app_from_netdev(netdev); in nfp_app_get_dump_flag()
1405 nfp_app_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump, in nfp_app_get_dump_data() argument
1408 struct nfp_app *app = nfp_app_from_netdev(netdev); in nfp_app_get_dump_data()
1424 nfp_port_get_module_info(struct net_device *netdev, in nfp_port_get_module_info() argument
1434 port = nfp_port_from_netdev(netdev); in nfp_port_get_module_info()
1447 netdev_err(netdev, "Failed to access the NSP: %d\n", err); in nfp_port_get_module_info()
1452 netdev_info(netdev, "reading module EEPROM not supported. Please update flash\n"); in nfp_port_get_module_info()
1494 netdev_err(netdev, "Unsupported module 0x%x detected\n", in nfp_port_get_module_info()
1505 nfp_port_get_module_eeprom(struct net_device *netdev, in nfp_port_get_module_eeprom() argument
1513 port = nfp_port_from_netdev(netdev); in nfp_port_get_module_eeprom()
1521 netdev_err(netdev, "Failed to access the NSP: %d\n", err); in nfp_port_get_module_eeprom()
1526 netdev_info(netdev, "reading module EEPROM not supported. Please update flash\n"); in nfp_port_get_module_eeprom()
1536 netdev_warn(netdev, in nfp_port_get_module_eeprom()
1541 netdev_err(netdev, in nfp_port_get_module_eeprom()
1552 static int nfp_net_set_coalesce(struct net_device *netdev, in nfp_net_set_coalesce() argument
1557 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_set_coalesce()
1611 static void nfp_net_get_channels(struct net_device *netdev, in nfp_net_get_channels() argument
1614 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_channels()
1649 static int nfp_net_set_channels(struct net_device *netdev, in nfp_net_set_channels() argument
1652 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_set_channels()
1670 static void nfp_port_get_pauseparam(struct net_device *netdev, in nfp_port_get_pauseparam() argument
1676 port = nfp_port_from_netdev(netdev); in nfp_port_get_pauseparam()
1687 static int nfp_net_set_phys_id(struct net_device *netdev, in nfp_net_set_phys_id() argument
1694 port = nfp_port_from_netdev(netdev); in nfp_net_set_phys_id()
1722 nfp_net_get_eeprom_len(struct net_device *netdev) in nfp_net_get_eeprom_len() argument
1727 port = nfp_port_from_netdev(netdev); in nfp_net_get_eeprom_len()
1736 nfp_net_get_nsp_hwindex(struct net_device *netdev, in nfp_net_get_nsp_hwindex() argument
1745 port = nfp_port_from_netdev(netdev); in nfp_net_get_nsp_hwindex()
1753 netdev_err(netdev, "Failed to access the NSP: %d\n", err); in nfp_net_get_nsp_hwindex()
1758 netdev_err(netdev, "NSP doesn't support PF MAC generation\n"); in nfp_net_get_nsp_hwindex()
1770 nfp_net_get_port_mac_by_hwinfo(struct net_device *netdev, in nfp_net_get_port_mac_by_hwinfo() argument
1778 err = nfp_net_get_nsp_hwindex(netdev, &nsp, &index); in nfp_net_get_port_mac_by_hwinfo()
1786 netdev_err(netdev, "Reading persistent MAC address failed: %d\n", in nfp_net_get_port_mac_by_hwinfo()
1794 netdev_err(netdev, "Can't parse persistent MAC address (%s)\n", in nfp_net_get_port_mac_by_hwinfo()
1803 nfp_net_set_port_mac_by_hwinfo(struct net_device *netdev, in nfp_net_set_port_mac_by_hwinfo() argument
1811 err = nfp_net_get_nsp_hwindex(netdev, &nsp, &index); in nfp_net_set_port_mac_by_hwinfo()
1823 netdev_err(netdev, "HWinfo set failed: %d, hwinfo: %s\n", in nfp_net_set_port_mac_by_hwinfo()
1832 nfp_net_get_eeprom(struct net_device *netdev, in nfp_net_get_eeprom() argument
1835 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_get_eeprom()
1841 if (nfp_net_get_port_mac_by_hwinfo(netdev, buf)) in nfp_net_get_eeprom()
1851 nfp_net_set_eeprom(struct net_device *netdev, in nfp_net_set_eeprom() argument
1854 struct nfp_net *nn = netdev_priv(netdev); in nfp_net_set_eeprom()
1863 if (nfp_net_get_port_mac_by_hwinfo(netdev, buf)) in nfp_net_set_eeprom()
1867 if (nfp_net_set_port_mac_by_hwinfo(netdev, buf)) in nfp_net_set_eeprom()
1935 void nfp_net_set_ethtool_ops(struct net_device *netdev) in nfp_net_set_ethtool_ops() argument
1937 netdev->ethtool_ops = &nfp_net_ethtool_ops; in nfp_net_set_ethtool_ops()