linux/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2014-2015 Hisilicon Limited.
 */

#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include "hns_enet.h"

#define HNS_PHY_PAGE_MDIX
#define HNS_PHY_PAGE_LED
#define HNS_PHY_PAGE_COPPER

#define HNS_PHY_PAGE_REG
#define HNS_PHY_CSC_REG
#define HNS_PHY_CSS_REG
#define HNS_LED_FC_REG

#define HNS_LED_FORCE_ON
#define HNS_LED_FORCE_OFF

#define HNS_CHIP_VERSION
#define HNS_NET_STATS_CNT

#define PHY_MDIX_CTRL_S
#define PHY_MDIX_CTRL_M

#define PHY_MDIX_STATUS_B
#define PHY_SPEED_DUP_RESOLVE_B

/**
 *hns_nic_get_link - get current link status
 *@net_dev: net_device
 *retuen 0 - success , negative --fail
 */
static u32 hns_nic_get_link(struct net_device *net_dev)
{}

static void hns_get_mdix_mode(struct net_device *net_dev,
			      struct ethtool_link_ksettings *cmd)
{}

/**
 *hns_nic_get_link_ksettings - implement ethtool get link ksettings
 *@net_dev: net_device
 *@cmd: ethtool_link_ksettings
 *retuen 0 - success , negative --fail
 */
static int hns_nic_get_link_ksettings(struct net_device *net_dev,
				      struct ethtool_link_ksettings *cmd)
{}

/**
 *hns_nic_set_link_ksettings - implement ethtool set link ksettings
 *@net_dev: net_device
 *@cmd: ethtool_link_ksettings
 *retuen 0 - success , negative --fail
 */
static int hns_nic_set_link_ksettings(struct net_device *net_dev,
				      const struct ethtool_link_ksettings *cmd)
{}

static const char hns_nic_test_strs[][ETH_GSTRING_LEN] =;

static int hns_nic_config_phy_loopback(struct phy_device *phy_dev, u8 en)
{}

static int __lb_setup(struct net_device *ndev,
		      enum hnae_loop loop)
{}

static int __lb_up(struct net_device *ndev,
		   enum hnae_loop loop_mode)
{}

static void __lb_other_process(struct hns_nic_ring_data *ring_data,
			       struct sk_buff *skb)
{}

static int __lb_clean_rings(struct hns_nic_priv *priv,
			    int ringid0, int ringid1, int budget)
{}

/**
 * __lb_run_test -  run loopback test
 * @ndev: net device
 * @loop_mode: loopback mode
 */
static int __lb_run_test(struct net_device *ndev,
			 enum hnae_loop loop_mode)
{}

static int __lb_down(struct net_device *ndev, enum hnae_loop loop)
{}

/**
 * hns_nic_self_test - self test
 * @ndev: net device
 * @eth_test: test cmd
 * @data: test result
 */
static void hns_nic_self_test(struct net_device *ndev,
			      struct ethtool_test *eth_test, u64 *data)
{}

/**
 * hns_nic_get_drvinfo - get net driver info
 * @net_dev: net device
 * @drvinfo: driver info
 */
static void hns_nic_get_drvinfo(struct net_device *net_dev,
				struct ethtool_drvinfo *drvinfo)
{}

/**
 * hns_get_ringparam - get ring parameter
 * @net_dev: net device
 * @param: ethtool parameter
 * @kernel_param: ethtool external parameter
 * @extack: netlink extended ACK report struct
 */
static void hns_get_ringparam(struct net_device *net_dev,
			      struct ethtool_ringparam *param,
			      struct kernel_ethtool_ringparam *kernel_param,
			      struct netlink_ext_ack *extack)
{}

/**
 * hns_get_pauseparam - get pause parameter
 * @net_dev: net device
 * @param: pause parameter
 */
static void hns_get_pauseparam(struct net_device *net_dev,
			       struct ethtool_pauseparam *param)
{}

/**
 * hns_set_pauseparam - set pause parameter
 * @net_dev: net device
 * @param: pause parameter
 *
 * Return 0 on success, negative on failure
 */
static int hns_set_pauseparam(struct net_device *net_dev,
			      struct ethtool_pauseparam *param)
{}

/**
 * hns_get_coalesce - get coalesce info.
 * @net_dev: net device
 * @ec: coalesce info.
 * @kernel_coal: ethtool CQE mode setting structure
 * @extack: extack for reporting error messages
 *
 * Return 0 on success, negative on failure.
 */
static int hns_get_coalesce(struct net_device *net_dev,
			    struct ethtool_coalesce *ec,
			    struct kernel_ethtool_coalesce *kernel_coal,
			    struct netlink_ext_ack *extack)
{}

/**
 * hns_set_coalesce - set coalesce info.
 * @net_dev: net device
 * @ec: coalesce info.
 * @kernel_coal: ethtool CQE mode setting structure
 * @extack: extack for reporting error messages
 *
 * Return 0 on success, negative on failure.
 */
static int hns_set_coalesce(struct net_device *net_dev,
			    struct ethtool_coalesce *ec,
			    struct kernel_ethtool_coalesce *kernel_coal,
			    struct netlink_ext_ack *extack)
{}

/**
 * hns_get_channels - get channel info.
 * @net_dev: net device
 * @ch: channel info.
 */
static void
hns_get_channels(struct net_device *net_dev, struct ethtool_channels *ch)
{}

/**
 * hns_get_ethtool_stats - get detail statistics.
 * @netdev: net device
 * @stats: statistics info.
 * @data: statistics data.
 */
static void hns_get_ethtool_stats(struct net_device *netdev,
				  struct ethtool_stats *stats, u64 *data)
{}

/**
 * hns_get_strings: Return a set of strings that describe the requested objects
 * @netdev: net device
 * @stringset: string set ID.
 * @data: objects data.
 */
static void hns_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
{}

/**
 * hns_get_sset_count - get string set count returned by nic_get_strings
 * @netdev: net device
 * @stringset: string set index, 0: self test string; 1: statistics string.
 *
 * Return string set count.
 */
static int hns_get_sset_count(struct net_device *netdev, int stringset)
{}

/**
 * hns_phy_led_set - set phy LED status.
 * @netdev: net device
 * @value: LED state.
 *
 * Return 0 on success, negative on failure.
 */
static int hns_phy_led_set(struct net_device *netdev, int value)
{}

/**
 * hns_set_phys_id - set phy identify LED.
 * @netdev: net device
 * @state: LED state.
 *
 * Return 0 on success, negative on failure.
 */
static int
hns_set_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state)
{}

/**
 * hns_get_regs - get net device register
 * @net_dev: net device
 * @cmd: ethtool cmd
 * @data: register data
 */
static void hns_get_regs(struct net_device *net_dev, struct ethtool_regs *cmd,
			 void *data)
{}

/**
 * hns_get_regs_len - get total register len.
 * @net_dev: net device
 *
 * Return total register len.
 */
static int hns_get_regs_len(struct net_device *net_dev)
{}

/**
 * hns_nic_nway_reset - nway reset
 * @netdev: net device
 *
 * Return 0 on success, negative on failure
 */
static int hns_nic_nway_reset(struct net_device *netdev)
{}

static u32
hns_get_rss_key_size(struct net_device *netdev)
{}

static u32
hns_get_rss_indir_size(struct net_device *netdev)
{}

static int
hns_get_rss(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
{}

static int
hns_set_rss(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
	    struct netlink_ext_ack *extack)
{}

static int hns_get_rxnfc(struct net_device *netdev,
			 struct ethtool_rxnfc *cmd,
			 u32 *rule_locs)
{}

static const struct ethtool_ops hns_ethtool_ops =;

void hns_ethtool_set_ops(struct net_device *ndev)
{}