.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2014-2015 Hisilicon Limited. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License as published by |
---|
6 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
7 | | - * (at your option) any later version. |
---|
8 | 4 | */ |
---|
9 | 5 | |
---|
10 | 6 | #include <linux/etherdevice.h> |
---|
.. | .. |
---|
309 | 305 | break; |
---|
310 | 306 | case MAC_LOOP_PHY_NONE: |
---|
311 | 307 | ret = hns_nic_config_phy_loopback(phy_dev, 0x0); |
---|
312 | | - /* fall through */ |
---|
| 308 | + fallthrough; |
---|
313 | 309 | case MAC_LOOP_NONE: |
---|
314 | 310 | if (!ret && h->dev->ops->set_loopback) { |
---|
315 | 311 | if (priv->ae_handle->phy_if != PHY_INTERFACE_MODE_XGMII) |
---|
.. | .. |
---|
470 | 466 | } |
---|
471 | 467 | |
---|
472 | 468 | /** |
---|
473 | | - * nic_run_loopback_test - run loopback test |
---|
474 | | - * @nic_dev: net device |
---|
475 | | - * @loopback_type: loopback type |
---|
| 469 | + * __lb_run_test - run loopback test |
---|
| 470 | + * @ndev: net device |
---|
| 471 | + * @loop_mode: loopback mode |
---|
476 | 472 | */ |
---|
477 | 473 | static int __lb_run_test(struct net_device *ndev, |
---|
478 | 474 | enum hnae_loop loop_mode) |
---|
.. | .. |
---|
580 | 576 | |
---|
581 | 577 | /** |
---|
582 | 578 | * hns_nic_self_test - self test |
---|
583 | | - * @dev: net device |
---|
| 579 | + * @ndev: net device |
---|
584 | 580 | * @eth_test: test cmd |
---|
585 | 581 | * @data: test result |
---|
586 | 582 | */ |
---|
.. | .. |
---|
632 | 628 | clear_bit(NIC_STATE_TESTING, &priv->state); |
---|
633 | 629 | |
---|
634 | 630 | if (if_running) |
---|
635 | | - (void)dev_open(ndev); |
---|
| 631 | + (void)dev_open(ndev, NULL); |
---|
636 | 632 | } |
---|
637 | 633 | /* Online tests aren't run; pass by default */ |
---|
638 | 634 | |
---|
.. | .. |
---|
641 | 637 | |
---|
642 | 638 | /** |
---|
643 | 639 | * hns_nic_get_drvinfo - get net driver info |
---|
644 | | - * @dev: net device |
---|
| 640 | + * @net_dev: net device |
---|
645 | 641 | * @drvinfo: driver info |
---|
646 | 642 | */ |
---|
647 | 643 | static void hns_nic_get_drvinfo(struct net_device *net_dev, |
---|
.. | .. |
---|
666 | 662 | |
---|
667 | 663 | /** |
---|
668 | 664 | * hns_get_ringparam - get ring parameter |
---|
669 | | - * @dev: net device |
---|
| 665 | + * @net_dev: net device |
---|
670 | 666 | * @param: ethtool parameter |
---|
671 | 667 | */ |
---|
672 | 668 | static void hns_get_ringparam(struct net_device *net_dev, |
---|
.. | .. |
---|
691 | 687 | |
---|
692 | 688 | /** |
---|
693 | 689 | * hns_get_pauseparam - get pause parameter |
---|
694 | | - * @dev: net device |
---|
| 690 | + * @net_dev: net device |
---|
695 | 691 | * @param: pause parameter |
---|
696 | 692 | */ |
---|
697 | 693 | static void hns_get_pauseparam(struct net_device *net_dev, |
---|
.. | .. |
---|
709 | 705 | |
---|
710 | 706 | /** |
---|
711 | 707 | * hns_set_pauseparam - set pause parameter |
---|
712 | | - * @dev: net device |
---|
| 708 | + * @net_dev: net device |
---|
713 | 709 | * @param: pause parameter |
---|
714 | 710 | * |
---|
715 | 711 | * Return 0 on success, negative on failure |
---|
.. | .. |
---|
733 | 729 | |
---|
734 | 730 | /** |
---|
735 | 731 | * hns_get_coalesce - get coalesce info. |
---|
736 | | - * @dev: net device |
---|
| 732 | + * @net_dev: net device |
---|
737 | 733 | * @ec: coalesce info. |
---|
738 | 734 | * |
---|
739 | 735 | * Return 0 on success, negative on failure. |
---|
.. | .. |
---|
777 | 773 | |
---|
778 | 774 | /** |
---|
779 | 775 | * hns_set_coalesce - set coalesce info. |
---|
780 | | - * @dev: net device |
---|
| 776 | + * @net_dev: net device |
---|
781 | 777 | * @ec: coalesce info. |
---|
782 | 778 | * |
---|
783 | 779 | * Return 0 on success, negative on failure. |
---|
.. | .. |
---|
816 | 812 | |
---|
817 | 813 | /** |
---|
818 | 814 | * hns_get_channels - get channel info. |
---|
819 | | - * @dev: net device |
---|
| 815 | + * @net_dev: net device |
---|
820 | 816 | * @ch: channel info. |
---|
821 | 817 | */ |
---|
822 | 818 | static void |
---|
.. | .. |
---|
833 | 829 | |
---|
834 | 830 | /** |
---|
835 | 831 | * get_ethtool_stats - get detail statistics. |
---|
836 | | - * @dev: net device |
---|
| 832 | + * @netdev: net device |
---|
837 | 833 | * @stats: statistics info. |
---|
838 | 834 | * @data: statistics data. |
---|
839 | 835 | */ |
---|
.. | .. |
---|
891 | 887 | |
---|
892 | 888 | /** |
---|
893 | 889 | * get_strings: Return a set of strings that describe the requested objects |
---|
894 | | - * @dev: net device |
---|
895 | | - * @stats: string set ID. |
---|
| 890 | + * @netdev: net device |
---|
| 891 | + * @stringset: string set ID. |
---|
896 | 892 | * @data: objects data. |
---|
897 | 893 | */ |
---|
898 | 894 | static void hns_get_strings(struct net_device *netdev, u32 stringset, u8 *data) |
---|
.. | .. |
---|
979 | 975 | } |
---|
980 | 976 | |
---|
981 | 977 | /** |
---|
982 | | - * nic_get_sset_count - get string set count witch returned by nic_get_strings. |
---|
983 | | - * @dev: net device |
---|
| 978 | + * hns_get_sset_count - get string set count returned by nic_get_strings |
---|
| 979 | + * @netdev: net device |
---|
984 | 980 | * @stringset: string set index, 0: self test string; 1: statistics string. |
---|
985 | 981 | * |
---|
986 | 982 | * Return string set count. |
---|
.. | .. |
---|
1014 | 1010 | |
---|
1015 | 1011 | /** |
---|
1016 | 1012 | * hns_phy_led_set - set phy LED status. |
---|
1017 | | - * @dev: net device |
---|
| 1013 | + * @netdev: net device |
---|
1018 | 1014 | * @value: LED state. |
---|
1019 | 1015 | * |
---|
1020 | 1016 | * Return 0 on success, negative on failure. |
---|
.. | .. |
---|
1035 | 1031 | } |
---|
1036 | 1032 | |
---|
1037 | 1033 | /** |
---|
1038 | | - * nic_set_phys_id - set phy identify LED. |
---|
1039 | | - * @dev: net device |
---|
| 1034 | + * hns_set_phys_id - set phy identify LED. |
---|
| 1035 | + * @netdev: net device |
---|
1040 | 1036 | * @state: LED state. |
---|
1041 | 1037 | * |
---|
1042 | 1038 | * Return 0 on success, negative on failure. |
---|
.. | .. |
---|
1112 | 1108 | |
---|
1113 | 1109 | /** |
---|
1114 | 1110 | * hns_get_regs - get net device register |
---|
1115 | | - * @dev: net device |
---|
| 1111 | + * @net_dev: net device |
---|
1116 | 1112 | * @cmd: ethtool cmd |
---|
1117 | | - * @date: register data |
---|
| 1113 | + * @data: register data |
---|
1118 | 1114 | */ |
---|
1119 | 1115 | static void hns_get_regs(struct net_device *net_dev, struct ethtool_regs *cmd, |
---|
1120 | 1116 | void *data) |
---|
.. | .. |
---|
1133 | 1129 | } |
---|
1134 | 1130 | |
---|
1135 | 1131 | /** |
---|
1136 | | - * nic_get_regs_len - get total register len. |
---|
1137 | | - * @dev: net device |
---|
| 1132 | + * hns_get_regs_len - get total register len. |
---|
| 1133 | + * @net_dev: net device |
---|
1138 | 1134 | * |
---|
1139 | 1135 | * Return total register len. |
---|
1140 | 1136 | */ |
---|
.. | .. |
---|
1159 | 1155 | |
---|
1160 | 1156 | /** |
---|
1161 | 1157 | * hns_nic_nway_reset - nway reset |
---|
1162 | | - * @dev: net device |
---|
| 1158 | + * @netdev: net device |
---|
1163 | 1159 | * |
---|
1164 | 1160 | * Return 0 on success, negative on failure |
---|
1165 | 1161 | */ |
---|
.. | .. |
---|
1272 | 1268 | } |
---|
1273 | 1269 | |
---|
1274 | 1270 | static const struct ethtool_ops hns_ethtool_ops = { |
---|
| 1271 | + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | |
---|
| 1272 | + ETHTOOL_COALESCE_MAX_FRAMES | |
---|
| 1273 | + ETHTOOL_COALESCE_USE_ADAPTIVE | |
---|
| 1274 | + ETHTOOL_COALESCE_USECS_LOW_HIGH | |
---|
| 1275 | + ETHTOOL_COALESCE_MAX_FRAMES_LOW_HIGH, |
---|
1275 | 1276 | .get_drvinfo = hns_nic_get_drvinfo, |
---|
1276 | 1277 | .get_link = hns_nic_get_link, |
---|
1277 | 1278 | .get_ringparam = hns_get_ringparam, |
---|