linux/drivers/net/ethernet/sfc/siena/mcdi_port_common.c

// SPDX-License-Identifier: GPL-2.0-only
/****************************************************************************
 * Driver for Solarflare network controllers and boards
 * Copyright 2018 Solarflare Communications Inc.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published
 * by the Free Software Foundation, incorporated herein by reference.
 */

#include "mcdi_port_common.h"
#include "efx_common.h"
#include "nic.h"

static int efx_mcdi_get_phy_cfg(struct efx_nic *efx,
				struct efx_mcdi_phy_data *cfg)
{}

void efx_siena_link_set_advertising(struct efx_nic *efx,
				    const unsigned long *advertising)
{}

static int efx_mcdi_set_link(struct efx_nic *efx, u32 capabilities,
			     u32 flags, u32 loopback_mode, u32 loopback_speed)
{}

static int efx_mcdi_loopback_modes(struct efx_nic *efx, u64 *loopback_modes)
{}

static void mcdi_to_ethtool_linkset(u32 media, u32 cap, unsigned long *linkset)
{}

static u32 ethtool_linkset_to_mcdi_cap(const unsigned long *linkset)
{}

static u32 efx_get_mcdi_phy_flags(struct efx_nic *efx)
{}

static u8 mcdi_to_ethtool_media(u32 media)
{}

static void efx_mcdi_phy_decode_link(struct efx_nic *efx,
				     struct efx_link_state *link_state,
				     u32 speed, u32 flags, u32 fcntl)
{}

/* The semantics of the ethtool FEC mode bitmask are not well defined,
 * particularly the meaning of combinations of bits.  Which means we get to
 * define our own semantics, as follows:
 * OFF overrides any other bits, and means "disable all FEC" (with the
 * exception of 25G KR4/CR4, where it is not possible to reject it if AN
 * partner requests it).
 * AUTO on its own means use cable requirements and link partner autoneg with
 * fw-default preferences for the cable type.
 * AUTO and either RS or BASER means use the specified FEC type if cable and
 * link partner support it, otherwise autoneg/fw-default.
 * RS or BASER alone means use the specified FEC type if cable and link partner
 * support it and either requests it, otherwise no FEC.
 * Both RS and BASER (whether AUTO or not) means use FEC if cable and link
 * partner support it, preferring RS to BASER.
 */
static u32 ethtool_fec_caps_to_mcdi(u32 supported_cap, u32 ethtool_cap)
{}

/* Invert ethtool_fec_caps_to_mcdi.  There are two combinations that function
 * can never produce, (baser xor rs) and neither req; the implementation below
 * maps both of those to AUTO.  This should never matter, and it's not clear
 * what a better mapping would be anyway.
 */
static u32 mcdi_fec_caps_to_ethtool(u32 caps, bool is_25g)
{}

/* Verify that the forced flow control settings (!EFX_FC_AUTO) are
 * supported by the link partner. Warn the user if this isn't the case
 */
static void efx_mcdi_phy_check_fcntl(struct efx_nic *efx, u32 lpa)
{}

bool efx_siena_mcdi_phy_poll(struct efx_nic *efx)
{}

int efx_siena_mcdi_phy_probe(struct efx_nic *efx)
{}

void efx_siena_mcdi_phy_remove(struct efx_nic *efx)
{}

void efx_siena_mcdi_phy_get_link_ksettings(struct efx_nic *efx,
					   struct ethtool_link_ksettings *cmd)
{}

int
efx_siena_mcdi_phy_set_link_ksettings(struct efx_nic *efx,
				      const struct ethtool_link_ksettings *cmd)
{}

int efx_siena_mcdi_phy_get_fecparam(struct efx_nic *efx,
				    struct ethtool_fecparam *fec)
{}

/* Basic validation to ensure that the caps we are going to attempt to set are
 * in fact supported by the adapter.  Note that 'no FEC' is always supported.
 */
static int ethtool_fec_supported(u32 supported_cap, u32 ethtool_cap)
{}

int efx_siena_mcdi_phy_set_fecparam(struct efx_nic *efx,
				    const struct ethtool_fecparam *fec)
{}

int efx_siena_mcdi_phy_test_alive(struct efx_nic *efx)
{}

int efx_siena_mcdi_port_reconfigure(struct efx_nic *efx)
{}

static const char *const mcdi_sft9001_cable_diag_names[] =;

static int efx_mcdi_bist(struct efx_nic *efx, unsigned int bist_mode,
			 int *results)
{}

int efx_siena_mcdi_phy_run_tests(struct efx_nic *efx, int *results,
				 unsigned int flags)
{}

const char *efx_siena_mcdi_phy_test_name(struct efx_nic *efx,
					 unsigned int index)
{}

#define SFP_PAGE_SIZE
#define SFF_DIAG_TYPE_OFFSET
#define SFF_DIAG_ADDR_CHANGE
#define SFF_8079_NUM_PAGES
#define SFF_8472_NUM_PAGES
#define SFF_8436_NUM_PAGES
#define SFF_DMT_LEVEL_OFFSET

/** efx_mcdi_phy_get_module_eeprom_page() - Get a single page of module eeprom
 * @efx:	NIC context
 * @page:	EEPROM page number
 * @data:	Destination data pointer
 * @offset:	Offset in page to copy from in to data
 * @space:	Space available in data
 *
 * Return:
 *   >=0 - amount of data copied
 *   <0  - error
 */
static int efx_mcdi_phy_get_module_eeprom_page(struct efx_nic *efx,
					       unsigned int page,
					       u8 *data, ssize_t offset,
					       ssize_t space)
{}

static int efx_mcdi_phy_get_module_eeprom_byte(struct efx_nic *efx,
					       unsigned int page,
					       u8 byte)
{}

static int efx_mcdi_phy_diag_type(struct efx_nic *efx)
{}

static int efx_mcdi_phy_sff_8472_level(struct efx_nic *efx)
{}

static u32 efx_mcdi_phy_module_type(struct efx_nic *efx)
{}

int efx_siena_mcdi_phy_get_module_eeprom(struct efx_nic *efx,
					 struct ethtool_eeprom *ee, u8 *data)
{}

int efx_siena_mcdi_phy_get_module_info(struct efx_nic *efx, struct ethtool_modinfo *modinfo)
{}

static unsigned int efx_calc_mac_mtu(struct efx_nic *efx)
{}

int efx_siena_mcdi_set_mac(struct efx_nic *efx)
{}

enum efx_stats_action {};

static int efx_mcdi_mac_stats(struct efx_nic *efx,
			      enum efx_stats_action action, int clear)
{}

void efx_siena_mcdi_mac_start_stats(struct efx_nic *efx)
{}

void efx_siena_mcdi_mac_stop_stats(struct efx_nic *efx)
{}

#define EFX_MAC_STATS_WAIT_US
#define EFX_MAC_STATS_WAIT_ATTEMPTS

void efx_siena_mcdi_mac_pull_stats(struct efx_nic *efx)
{}

int efx_siena_mcdi_mac_init_stats(struct efx_nic *efx)
{}

void efx_siena_mcdi_mac_fini_stats(struct efx_nic *efx)
{}

static unsigned int efx_mcdi_event_link_speed[] =;

void efx_siena_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev)
{}