linux/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

/*
 * Copyright (c) 2015, Mellanox Technologies. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#include <linux/dim.h>
#include <linux/ethtool_netlink.h>

#include "en.h"
#include "en/channels.h"
#include "en/dim.h"
#include "en/port.h"
#include "en/params.h"
#include "en/ptp.h"
#include "lib/clock.h"
#include "en/fs_ethtool.h"

void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
			       struct ethtool_drvinfo *drvinfo)
{}

static void mlx5e_get_drvinfo(struct net_device *dev,
			      struct ethtool_drvinfo *drvinfo)
{}

struct ptys2ethtool_config {};

static
struct ptys2ethtool_config ptys2legacy_ethtool_table[MLX5E_LINK_MODES_NUMBER];
static
struct ptys2ethtool_config ptys2ext_ethtool_table[MLX5E_EXT_LINK_MODES_NUMBER];

#define MLX5_BUILD_PTYS2ETHTOOL_CONFIG(reg_, table, ...)

void mlx5e_build_ptys2ethtool_map(void)
{}

static void mlx5e_ethtool_get_speed_arr(struct mlx5_core_dev *mdev,
					struct ptys2ethtool_config **arr,
					u32 *size)
{}

mlx5e_pflag_handler;

struct pflag_desc {};

static const struct pflag_desc mlx5e_priv_flags[MLX5E_NUM_PFLAGS];

int mlx5e_ethtool_get_sset_count(struct mlx5e_priv *priv, int sset)
{}

static int mlx5e_get_sset_count(struct net_device *dev, int sset)
{}

void mlx5e_ethtool_get_strings(struct mlx5e_priv *priv, u32 stringset, u8 *data)
{}

static void mlx5e_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{}

void mlx5e_ethtool_get_ethtool_stats(struct mlx5e_priv *priv,
				     struct ethtool_stats *stats, u64 *data)
{}

static void mlx5e_get_ethtool_stats(struct net_device *dev,
				    struct ethtool_stats *stats,
				    u64 *data)
{}

void mlx5e_ethtool_get_ringparam(struct mlx5e_priv *priv,
				 struct ethtool_ringparam *param,
				 struct kernel_ethtool_ringparam *kernel_param)
{}

static void mlx5e_get_ringparam(struct net_device *dev,
				struct ethtool_ringparam *param,
				struct kernel_ethtool_ringparam *kernel_param,
				struct netlink_ext_ack *extack)
{}

int mlx5e_ethtool_set_ringparam(struct mlx5e_priv *priv,
				struct ethtool_ringparam *param)
{}

static int mlx5e_set_ringparam(struct net_device *dev,
			       struct ethtool_ringparam *param,
			       struct kernel_ethtool_ringparam *kernel_param,
			       struct netlink_ext_ack *extack)
{}

void mlx5e_ethtool_get_channels(struct mlx5e_priv *priv,
				struct ethtool_channels *ch)
{}

static void mlx5e_get_channels(struct net_device *dev,
			       struct ethtool_channels *ch)
{}

int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv,
			       struct ethtool_channels *ch)
{}

static int mlx5e_set_channels(struct net_device *dev,
			      struct ethtool_channels *ch)
{}

int mlx5e_ethtool_get_coalesce(struct mlx5e_priv *priv,
			       struct ethtool_coalesce *coal,
			       struct kernel_ethtool_coalesce *kernel_coal)
{}

static int mlx5e_get_coalesce(struct net_device *netdev,
			      struct ethtool_coalesce *coal,
			      struct kernel_ethtool_coalesce *kernel_coal,
			      struct netlink_ext_ack *extack)
{}

static int mlx5e_ethtool_get_per_queue_coalesce(struct mlx5e_priv *priv, u32 queue,
						struct ethtool_coalesce *coal)
{}

int mlx5e_get_per_queue_coalesce(struct net_device *dev, u32 queue,
				 struct ethtool_coalesce *coal)
{}

#define MLX5E_MAX_COAL_TIME
#define MLX5E_MAX_COAL_FRAMES

static void
mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct dim_cq_moder *moder)
{}

static void
mlx5e_set_priv_channels_rx_coalesce(struct mlx5e_priv *priv, struct dim_cq_moder *moder)
{}

int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
			       struct ethtool_coalesce *coal,
			       struct kernel_ethtool_coalesce *kernel_coal,
			       struct netlink_ext_ack *extack)
{}

static int mlx5e_set_coalesce(struct net_device *netdev,
			      struct ethtool_coalesce *coal,
			      struct kernel_ethtool_coalesce *kernel_coal,
			      struct netlink_ext_ack *extack)
{}

static int mlx5e_ethtool_set_per_queue_coalesce(struct mlx5e_priv *priv, u32 queue,
						struct ethtool_coalesce *coal)
{}

int mlx5e_set_per_queue_coalesce(struct net_device *dev, u32 queue,
				 struct ethtool_coalesce *coal)
{}

static void ptys2ethtool_supported_link(struct mlx5_core_dev *mdev,
					unsigned long *supported_modes,
					u32 eth_proto_cap)
{}

static void ptys2ethtool_adver_link(unsigned long *advertising_modes,
				    u32 eth_proto_cap, bool ext)
{}

static const u32 pplm_fec_2_ethtool[] =;

static u32 pplm2ethtool_fec(u_long fec_mode, unsigned long size)
{}

#define MLX5E_ADVERTISE_SUPPORTED_FEC(mlx5_fec, ethtool_fec)

static const u32 pplm_fec_2_ethtool_linkmodes[] =;

static int get_fec_supported_advertised(struct mlx5_core_dev *dev,
					struct ethtool_link_ksettings *link_ksettings)
{}

static void ptys2ethtool_supported_advertised_port(struct mlx5_core_dev *mdev,
						   struct ethtool_link_ksettings *link_ksettings,
						   u32 eth_proto_cap, u8 connector_type)
{}

static void get_speed_duplex(struct net_device *netdev,
			     u32 eth_proto_oper, bool force_legacy,
			     u16 data_rate_oper,
			     struct ethtool_link_ksettings *link_ksettings)
{}

static void get_supported(struct mlx5_core_dev *mdev, u32 eth_proto_cap,
			  struct ethtool_link_ksettings *link_ksettings)
{}

static void get_advertising(u32 eth_proto_cap, u8 tx_pause, u8 rx_pause,
			    struct ethtool_link_ksettings *link_ksettings,
			    bool ext)
{}

static int ptys2connector_type[MLX5E_CONNECTOR_TYPE_NUMBER] =;

static u8 get_connector_port(struct mlx5_core_dev *mdev, u32 eth_proto, u8 connector_type)
{}

static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp,
			       struct ethtool_link_ksettings *link_ksettings)
{}

static int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
					    struct ethtool_link_ksettings *link_ksettings)
{}

static int mlx5e_get_link_ksettings(struct net_device *netdev,
				    struct ethtool_link_ksettings *link_ksettings)
{}

static int mlx5e_speed_validate(struct net_device *netdev, bool ext,
				const unsigned long link_modes, u8 autoneg)
{}

static u32 mlx5e_ethtool2ptys_adver_link(const unsigned long *link_modes)
{}

static u32 mlx5e_ethtool2ptys_ext_adver_link(const unsigned long *link_modes)
{}

static bool ext_link_mode_requested(const unsigned long *adver)
{}

static bool ext_requested(u8 autoneg, const unsigned long *adver, bool ext_supported)
{}

static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
					    const struct ethtool_link_ksettings *link_ksettings)
{}

static int mlx5e_set_link_ksettings(struct net_device *netdev,
				    const struct ethtool_link_ksettings *link_ksettings)
{}

u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv)
{}

static u32 mlx5e_get_rxfh_key_size(struct net_device *netdev)
{}

u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv)
{}

static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev)
{}

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

static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
			  struct netlink_ext_ack *extack)
{}

#define MLX5E_PFC_PREVEN_AUTO_TOUT_MSEC
#define MLX5E_PFC_PREVEN_TOUT_MAX_MSEC
#define MLX5E_PFC_PREVEN_MINOR_PRECENT
#define MLX5E_PFC_PREVEN_TOUT_MIN_MSEC
#define MLX5E_DEVICE_STALL_MINOR_WATERMARK(critical_tout)

static int mlx5e_get_pfc_prevention_tout(struct net_device *netdev,
					 u16 *pfc_prevention_tout)
{}

static int mlx5e_set_pfc_prevention_tout(struct net_device *netdev,
					 u16 pfc_preven)
{}

static int mlx5e_get_tunable(struct net_device *dev,
			     const struct ethtool_tunable *tuna,
			     void *data)
{}

static int mlx5e_set_tunable(struct net_device *dev,
			     const struct ethtool_tunable *tuna,
			     const void *data)
{}

static void mlx5e_get_pause_stats(struct net_device *netdev,
				  struct ethtool_pause_stats *pause_stats)
{}

static void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
					 struct ethtool_pauseparam *pauseparam)
{}

static void mlx5e_get_pauseparam(struct net_device *netdev,
				 struct ethtool_pauseparam *pauseparam)
{}

static int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
					struct ethtool_pauseparam *pauseparam)
{}

static int mlx5e_set_pauseparam(struct net_device *netdev,
				struct ethtool_pauseparam *pauseparam)
{}

int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
			      struct kernel_ethtool_ts_info *info)
{}

static int mlx5e_get_ts_info(struct net_device *dev,
			     struct kernel_ethtool_ts_info *info)
{}

static __u32 mlx5e_get_wol_supported(struct mlx5_core_dev *mdev)
{}

static __u32 mlx5e_reformat_wol_mode_mlx5_to_linux(u8 mode)
{}

static u8 mlx5e_reformat_wol_mode_linux_to_mlx5(__u32 mode)
{}

static void mlx5e_get_wol(struct net_device *netdev,
			  struct ethtool_wolinfo *wol)
{}

static int mlx5e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{}

static void mlx5e_get_fec_stats(struct net_device *netdev,
				struct ethtool_fec_stats *fec_stats)
{}

static int mlx5e_get_fecparam(struct net_device *netdev,
			      struct ethtool_fecparam *fecparam)
{}

static int mlx5e_set_fecparam(struct net_device *netdev,
			      struct ethtool_fecparam *fecparam)
{}

static int mlx5e_set_phys_id(struct net_device *dev,
			     enum ethtool_phys_id_state state)
{}

static int mlx5e_get_module_info(struct net_device *netdev,
				 struct ethtool_modinfo *modinfo)
{}

static int mlx5e_get_module_eeprom(struct net_device *netdev,
				   struct ethtool_eeprom *ee,
				   u8 *data)
{}

static int mlx5e_get_module_eeprom_by_page(struct net_device *netdev,
					   const struct ethtool_module_eeprom *page_data,
					   struct netlink_ext_ack *extack)
{}

int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
			       struct ethtool_flash *flash)
{}

static int mlx5e_flash_device(struct net_device *dev,
			      struct ethtool_flash *flash)
{}

static int set_pflag_cqe_based_moder(struct net_device *netdev, bool enable,
				     bool is_rx_cq)
{}

static int set_pflag_tx_cqe_based_moder(struct net_device *netdev, bool enable)
{}

static int set_pflag_rx_cqe_based_moder(struct net_device *netdev, bool enable)
{}

int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool new_val, bool rx_filter)
{}

static int set_pflag_rx_cqe_compress(struct net_device *netdev,
				     bool enable)
{}

static int set_pflag_rx_striding_rq(struct net_device *netdev, bool enable)
{}

static int set_pflag_rx_no_csum_complete(struct net_device *netdev, bool enable)
{}

static int set_pflag_tx_mpwqe_common(struct net_device *netdev, u32 flag, bool enable)
{}

static int set_pflag_xdp_tx_mpwqe(struct net_device *netdev, bool enable)
{}

static int set_pflag_skb_tx_mpwqe(struct net_device *netdev, bool enable)
{}

static int set_pflag_tx_port_ts(struct net_device *netdev, bool enable)
{}

static const struct pflag_desc mlx5e_priv_flags[MLX5E_NUM_PFLAGS] =;

static int mlx5e_handle_pflag(struct net_device *netdev,
			      u32 wanted_flags,
			      enum mlx5e_priv_flag flag)
{}

static int mlx5e_set_priv_flags(struct net_device *netdev, u32 pflags)
{}

static u32 mlx5e_get_priv_flags(struct net_device *netdev)
{}

static int mlx5e_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
			   u32 *rule_locs)
{}

static int mlx5e_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
{}

static int query_port_status_opcode(struct mlx5_core_dev *mdev, u32 *status_opcode)
{}

struct mlx5e_ethtool_link_ext_state_opcode_mapping {};

static const struct mlx5e_ethtool_link_ext_state_opcode_mapping
mlx5e_link_ext_state_opcode_map[] =;

static void
mlx5e_set_link_ext_state(struct mlx5e_ethtool_link_ext_state_opcode_mapping
			 link_ext_state_mapping,
			 struct ethtool_link_ext_state_info *link_ext_state_info)
{}

static int
mlx5e_get_link_ext_state(struct net_device *dev,
			 struct ethtool_link_ext_state_info *link_ext_state_info)
{}

static void mlx5e_get_eth_phy_stats(struct net_device *netdev,
				    struct ethtool_eth_phy_stats *phy_stats)
{}

static void mlx5e_get_eth_mac_stats(struct net_device *netdev,
				    struct ethtool_eth_mac_stats *mac_stats)
{}

static void mlx5e_get_eth_ctrl_stats(struct net_device *netdev,
				     struct ethtool_eth_ctrl_stats *ctrl_stats)
{}

static void mlx5e_get_rmon_stats(struct net_device *netdev,
				 struct ethtool_rmon_stats *rmon_stats,
				 const struct ethtool_rmon_hist_range **ranges)
{}

static void mlx5e_get_ts_stats(struct net_device *netdev,
			       struct ethtool_ts_stats *ts_stats)
{}

const struct ethtool_ops mlx5e_ethtool_ops =;