Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /****************************************************************************
0003  * Driver for Solarflare network controllers and boards
0004  * Copyright 2018 Solarflare Communications Inc.
0005  *
0006  * This program is free software; you can redistribute it and/or modify it
0007  * under the terms of the GNU General Public License version 2 as published
0008  * by the Free Software Foundation, incorporated herein by reference.
0009  */
0010 #ifndef EFX_MCDI_PORT_COMMON_H
0011 #define EFX_MCDI_PORT_COMMON_H
0012 
0013 #include "net_driver.h"
0014 #include "mcdi.h"
0015 #include "mcdi_pcol.h"
0016 
0017 struct efx_mcdi_phy_data {
0018     u32 flags;
0019     u32 type;
0020     u32 supported_cap;
0021     u32 channel;
0022     u32 port;
0023     u32 stats_mask;
0024     u8 name[20];
0025     u32 media;
0026     u32 mmd_mask;
0027     u8 revision[20];
0028     u32 forced_cap;
0029 };
0030 
0031 int efx_mcdi_get_phy_cfg(struct efx_nic *efx, struct efx_mcdi_phy_data *cfg);
0032 void efx_link_set_advertising(struct efx_nic *efx,
0033                   const unsigned long *advertising);
0034 int efx_mcdi_set_link(struct efx_nic *efx, u32 capabilities,
0035               u32 flags, u32 loopback_mode, u32 loopback_speed);
0036 int efx_mcdi_loopback_modes(struct efx_nic *efx, u64 *loopback_modes);
0037 void mcdi_to_ethtool_linkset(u32 media, u32 cap, unsigned long *linkset);
0038 u32 ethtool_linkset_to_mcdi_cap(const unsigned long *linkset);
0039 u32 efx_get_mcdi_phy_flags(struct efx_nic *efx);
0040 u8 mcdi_to_ethtool_media(u32 media);
0041 void efx_mcdi_phy_decode_link(struct efx_nic *efx,
0042                   struct efx_link_state *link_state,
0043                   u32 speed, u32 flags, u32 fcntl);
0044 u32 ethtool_fec_caps_to_mcdi(u32 supported_cap, u32 ethtool_cap);
0045 u32 mcdi_fec_caps_to_ethtool(u32 caps, bool is_25g);
0046 void efx_mcdi_phy_check_fcntl(struct efx_nic *efx, u32 lpa);
0047 bool efx_mcdi_phy_poll(struct efx_nic *efx);
0048 int efx_mcdi_phy_probe(struct efx_nic *efx);
0049 void efx_mcdi_phy_remove(struct efx_nic *efx);
0050 void efx_mcdi_phy_get_link_ksettings(struct efx_nic *efx, struct ethtool_link_ksettings *cmd);
0051 int efx_mcdi_phy_set_link_ksettings(struct efx_nic *efx, const struct ethtool_link_ksettings *cmd);
0052 int efx_mcdi_phy_get_fecparam(struct efx_nic *efx, struct ethtool_fecparam *fec);
0053 int efx_mcdi_phy_set_fecparam(struct efx_nic *efx, const struct ethtool_fecparam *fec);
0054 int efx_mcdi_phy_test_alive(struct efx_nic *efx);
0055 int efx_mcdi_port_reconfigure(struct efx_nic *efx);
0056 int efx_mcdi_phy_run_tests(struct efx_nic *efx, int *results, unsigned int flags);
0057 const char *efx_mcdi_phy_test_name(struct efx_nic *efx, unsigned int index);
0058 int efx_mcdi_phy_get_module_eeprom(struct efx_nic *efx, struct ethtool_eeprom *ee, u8 *data);
0059 int efx_mcdi_phy_get_module_info(struct efx_nic *efx, struct ethtool_modinfo *modinfo);
0060 int efx_mcdi_set_mac(struct efx_nic *efx);
0061 int efx_mcdi_set_mtu(struct efx_nic *efx);
0062 int efx_mcdi_mac_init_stats(struct efx_nic *efx);
0063 void efx_mcdi_mac_fini_stats(struct efx_nic *efx);
0064 int efx_mcdi_port_get_number(struct efx_nic *efx);
0065 void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
0066 
0067 #endif