Commit 4d49e5cd authored by Martin Habets's avatar Martin Habets Committed by Jakub Kicinski

sfc/siena: Rename functions in mcdi headers to avoid conflicts with sfc

For siena use efx_siena_ as the function prefix.
Several functions are not used in Siena, so they are removed.
Signed-off-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 95e96f77
...@@ -153,7 +153,7 @@ static int efx_init_port(struct efx_nic *efx) ...@@ -153,7 +153,7 @@ static int efx_init_port(struct efx_nic *efx)
efx->port_initialized = true; efx->port_initialized = true;
/* Ensure the PHY advertises the correct flow control settings */ /* Ensure the PHY advertises the correct flow control settings */
rc = efx_mcdi_port_reconfigure(efx); rc = efx_siena_mcdi_port_reconfigure(efx);
if (rc && rc != -EPERM) if (rc && rc != -EPERM)
goto fail; goto fail;
...@@ -526,7 +526,7 @@ static int efx_net_open(struct net_device *net_dev) ...@@ -526,7 +526,7 @@ static int efx_net_open(struct net_device *net_dev)
return rc; return rc;
if (efx->phy_mode & PHY_MODE_SPECIAL) if (efx->phy_mode & PHY_MODE_SPECIAL)
return -EBUSY; return -EBUSY;
if (efx_mcdi_poll_reboot(efx) && efx_siena_reset(efx, RESET_TYPE_ALL)) if (efx_siena_mcdi_poll_reboot(efx) && efx_siena_reset(efx, RESET_TYPE_ALL))
return -EIO; return -EIO;
/* Notify the kernel of the link state polled during driver load, /* Notify the kernel of the link state polled during driver load,
...@@ -1158,7 +1158,7 @@ static int efx_pm_thaw(struct device *dev) ...@@ -1158,7 +1158,7 @@ static int efx_pm_thaw(struct device *dev)
goto fail; goto fail;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
efx_mcdi_port_reconfigure(efx); efx_siena_mcdi_port_reconfigure(efx);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
efx_siena_start_all(efx); efx_siena_start_all(efx);
......
...@@ -1022,7 +1022,7 @@ static int efx_soft_enable_interrupts(struct efx_nic *efx) ...@@ -1022,7 +1022,7 @@ static int efx_soft_enable_interrupts(struct efx_nic *efx)
efx_siena_start_eventq(channel); efx_siena_start_eventq(channel);
} }
efx_mcdi_mode_event(efx); efx_siena_mcdi_mode_event(efx);
return 0; return 0;
fail: fail:
...@@ -1045,7 +1045,7 @@ static void efx_soft_disable_interrupts(struct efx_nic *efx) ...@@ -1045,7 +1045,7 @@ static void efx_soft_disable_interrupts(struct efx_nic *efx)
if (efx->state == STATE_DISABLED) if (efx->state == STATE_DISABLED)
return; return;
efx_mcdi_mode_poll(efx); efx_siena_mcdi_mode_poll(efx);
efx->irq_soft_enabled = false; efx->irq_soft_enabled = false;
smp_wmb(); smp_wmb();
...@@ -1063,7 +1063,7 @@ static void efx_soft_disable_interrupts(struct efx_nic *efx) ...@@ -1063,7 +1063,7 @@ static void efx_soft_disable_interrupts(struct efx_nic *efx)
} }
/* Flush the asynchronous MCDI request queue */ /* Flush the asynchronous MCDI request queue */
efx_mcdi_flush_async(efx); efx_siena_mcdi_flush_async(efx);
} }
int efx_siena_enable_interrupts(struct efx_nic *efx) int efx_siena_enable_interrupts(struct efx_nic *efx)
......
...@@ -456,7 +456,7 @@ static void efx_stop_datapath(struct efx_nic *efx) ...@@ -456,7 +456,7 @@ static void efx_stop_datapath(struct efx_nic *efx)
* *
**************************************************************************/ **************************************************************************/
/* Equivalent to efx_link_set_advertising with all-zeroes, except does not /* Equivalent to efx_siena_link_set_advertising with all-zeroes, except does not
* force the Autoneg bit on. * force the Autoneg bit on.
*/ */
void efx_siena_link_clear_advertising(struct efx_nic *efx) void efx_siena_link_clear_advertising(struct efx_nic *efx)
...@@ -547,7 +547,7 @@ void efx_siena_start_all(struct efx_nic *efx) ...@@ -547,7 +547,7 @@ void efx_siena_start_all(struct efx_nic *efx)
* to poll now because we could have missed a change * to poll now because we could have missed a change
*/ */
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
if (efx_mcdi_phy_poll(efx)) if (efx_siena_mcdi_phy_poll(efx))
efx_siena_link_status_changed(efx); efx_siena_link_status_changed(efx);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
...@@ -665,7 +665,7 @@ static void efx_wait_for_bist_end(struct efx_nic *efx) ...@@ -665,7 +665,7 @@ static void efx_wait_for_bist_end(struct efx_nic *efx)
int i; int i;
for (i = 0; i < BIST_WAIT_DELAY_COUNT; ++i) { for (i = 0; i < BIST_WAIT_DELAY_COUNT; ++i) {
if (efx_mcdi_poll_reboot(efx)) if (efx_siena_mcdi_poll_reboot(efx))
goto out; goto out;
msleep(BIST_WAIT_DELAY_MS); msleep(BIST_WAIT_DELAY_MS);
} }
...@@ -760,7 +760,7 @@ int efx_siena_reset_up(struct efx_nic *efx, enum reset_type method, bool ok) ...@@ -760,7 +760,7 @@ int efx_siena_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
if (efx->port_initialized && method != RESET_TYPE_INVISIBLE && if (efx->port_initialized && method != RESET_TYPE_INVISIBLE &&
method != RESET_TYPE_DATAPATH) { method != RESET_TYPE_DATAPATH) {
rc = efx_mcdi_port_reconfigure(efx); rc = efx_siena_mcdi_port_reconfigure(efx);
if (rc && rc != -EPERM) if (rc && rc != -EPERM)
netif_err(efx, drv, efx->net_dev, netif_err(efx, drv, efx->net_dev,
"could not restore PHY settings\n"); "could not restore PHY settings\n");
...@@ -950,7 +950,7 @@ void efx_siena_schedule_reset(struct efx_nic *efx, enum reset_type type) ...@@ -950,7 +950,7 @@ void efx_siena_schedule_reset(struct efx_nic *efx, enum reset_type type)
/* efx_process_channel() will no longer read events once a /* efx_process_channel() will no longer read events once a
* reset is scheduled. So switch back to poll'd MCDI completions. * reset is scheduled. So switch back to poll'd MCDI completions.
*/ */
efx_mcdi_mode_poll(efx); efx_siena_mcdi_mode_poll(efx);
efx_siena_queue_reset_work(efx); efx_siena_queue_reset_work(efx);
} }
......
...@@ -50,7 +50,7 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, ...@@ -50,7 +50,7 @@ static int efx_ethtool_phys_id(struct net_device *net_dev,
return 1; /* cycle on/off once per second */ return 1; /* cycle on/off once per second */
} }
return efx_mcdi_set_id_led(efx, mode); return efx_siena_mcdi_set_id_led(efx, mode);
} }
static int efx_ethtool_get_regs_len(struct net_device *net_dev) static int efx_ethtool_get_regs_len(struct net_device *net_dev)
......
...@@ -106,8 +106,8 @@ void efx_siena_ethtool_get_drvinfo(struct net_device *net_dev, ...@@ -106,8 +106,8 @@ void efx_siena_ethtool_get_drvinfo(struct net_device *net_dev,
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = netdev_priv(net_dev);
strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
efx_mcdi_print_fwver(efx, info->fw_version, efx_siena_mcdi_print_fwver(efx, info->fw_version,
sizeof(info->fw_version)); sizeof(info->fw_version));
strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info)); strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
} }
...@@ -173,7 +173,7 @@ int efx_siena_ethtool_set_pauseparam(struct net_device *net_dev, ...@@ -173,7 +173,7 @@ int efx_siena_ethtool_set_pauseparam(struct net_device *net_dev,
efx_siena_link_set_wanted_fc(efx, wanted_fc); efx_siena_link_set_wanted_fc(efx, wanted_fc);
if (efx->link_advertising[0] != old_adv || if (efx->link_advertising[0] != old_adv ||
(efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) { (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
rc = efx_mcdi_port_reconfigure(efx); rc = efx_siena_mcdi_port_reconfigure(efx);
if (rc) { if (rc) {
netif_err(efx, drv, efx->net_dev, netif_err(efx, drv, efx->net_dev,
"Unable to advertise requested flow " "Unable to advertise requested flow "
...@@ -328,7 +328,7 @@ static int efx_ethtool_fill_self_tests(struct efx_nic *efx, ...@@ -328,7 +328,7 @@ static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
const char *name; const char *name;
EFX_WARN_ON_PARANOID(i >= EFX_MAX_PHY_TESTS); EFX_WARN_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
name = efx_mcdi_phy_test_name(efx, i); name = efx_siena_mcdi_phy_test_name(efx, i);
if (name == NULL) if (name == NULL)
break; break;
...@@ -565,7 +565,7 @@ int efx_siena_ethtool_get_link_ksettings(struct net_device *net_dev, ...@@ -565,7 +565,7 @@ int efx_siena_ethtool_get_link_ksettings(struct net_device *net_dev,
struct efx_link_state *link_state = &efx->link_state; struct efx_link_state *link_state = &efx->link_state;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
efx_mcdi_phy_get_link_ksettings(efx, cmd); efx_siena_mcdi_phy_get_link_ksettings(efx, cmd);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
/* Both MACs support pause frames (bidirectional and respond-only) */ /* Both MACs support pause frames (bidirectional and respond-only) */
...@@ -597,7 +597,7 @@ efx_siena_ethtool_set_link_ksettings(struct net_device *net_dev, ...@@ -597,7 +597,7 @@ efx_siena_ethtool_set_link_ksettings(struct net_device *net_dev,
} }
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
rc = efx_mcdi_phy_set_link_ksettings(efx, cmd); rc = efx_siena_mcdi_phy_set_link_ksettings(efx, cmd);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
return rc; return rc;
} }
...@@ -609,7 +609,7 @@ int efx_siena_ethtool_get_fecparam(struct net_device *net_dev, ...@@ -609,7 +609,7 @@ int efx_siena_ethtool_get_fecparam(struct net_device *net_dev,
int rc; int rc;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
rc = efx_mcdi_phy_get_fecparam(efx, fecparam); rc = efx_siena_mcdi_phy_get_fecparam(efx, fecparam);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
return rc; return rc;
...@@ -622,7 +622,7 @@ int efx_siena_ethtool_set_fecparam(struct net_device *net_dev, ...@@ -622,7 +622,7 @@ int efx_siena_ethtool_set_fecparam(struct net_device *net_dev,
int rc; int rc;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
rc = efx_mcdi_phy_set_fecparam(efx, fecparam); rc = efx_siena_mcdi_phy_set_fecparam(efx, fecparam);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
return rc; return rc;
...@@ -1320,7 +1320,7 @@ int efx_siena_ethtool_get_module_eeprom(struct net_device *net_dev, ...@@ -1320,7 +1320,7 @@ int efx_siena_ethtool_get_module_eeprom(struct net_device *net_dev,
int ret; int ret;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
ret = efx_mcdi_phy_get_module_eeprom(efx, ee, data); ret = efx_siena_mcdi_phy_get_module_eeprom(efx, ee, data);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
return ret; return ret;
...@@ -1333,7 +1333,7 @@ int efx_siena_ethtool_get_module_info(struct net_device *net_dev, ...@@ -1333,7 +1333,7 @@ int efx_siena_ethtool_get_module_info(struct net_device *net_dev,
int ret; int ret;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
ret = efx_mcdi_phy_get_module_info(efx, modinfo); ret = efx_siena_mcdi_phy_get_module_info(efx, modinfo);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
return ret; return ret;
......
...@@ -667,7 +667,7 @@ static int efx_farch_do_flush(struct efx_nic *efx) ...@@ -667,7 +667,7 @@ static int efx_farch_do_flush(struct efx_nic *efx)
* completion). If that fails, fall back to the old scheme. * completion). If that fails, fall back to the old scheme.
*/ */
if (efx_siena_sriov_enabled(efx)) { if (efx_siena_sriov_enabled(efx)) {
rc = efx_mcdi_flush_rxqs(efx); rc = efx_siena_mcdi_flush_rxqs(efx);
if (!rc) if (!rc)
goto wait; goto wait;
} }
...@@ -1313,7 +1313,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget) ...@@ -1313,7 +1313,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget)
break; break;
#endif #endif
case FSE_CZ_EV_CODE_MCDI_EV: case FSE_CZ_EV_CODE_MCDI_EV:
efx_mcdi_process_event(channel, &event); efx_siena_mcdi_process_event(channel, &event);
break; break;
case FSE_AZ_EV_CODE_GLOBAL_EV: case FSE_AZ_EV_CODE_GLOBAL_EV:
if (efx->type->handle_global_event && if (efx->type->handle_global_event &&
......
This diff is collapsed.
...@@ -138,52 +138,54 @@ static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx) ...@@ -138,52 +138,54 @@ static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx)
} }
#endif #endif
int efx_mcdi_init(struct efx_nic *efx); int efx_siena_mcdi_init(struct efx_nic *efx);
void efx_mcdi_detach(struct efx_nic *efx); void efx_siena_mcdi_detach(struct efx_nic *efx);
void efx_mcdi_fini(struct efx_nic *efx); void efx_siena_mcdi_fini(struct efx_nic *efx);
int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf, int efx_siena_mcdi_rpc(struct efx_nic *efx, unsigned int cmd,
size_t inlen, efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual);
int efx_mcdi_rpc_quiet(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen, const efx_dword_t *inbuf, size_t inlen,
efx_dword_t *outbuf, size_t outlen, efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual); size_t *outlen_actual);
int efx_siena_mcdi_rpc_quiet(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen,
efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual);
int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd, int efx_siena_mcdi_rpc_start(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen); const efx_dword_t *inbuf, size_t inlen);
int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, int efx_siena_mcdi_rpc_finish(struct efx_nic *efx, unsigned int cmd,
efx_dword_t *outbuf, size_t outlen, size_t inlen, efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual); size_t *outlen_actual);
int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd, int efx_siena_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned int cmd,
size_t inlen, efx_dword_t *outbuf, size_t inlen, efx_dword_t *outbuf,
size_t outlen, size_t *outlen_actual); size_t outlen, size_t *outlen_actual);
typedef void efx_mcdi_async_completer(struct efx_nic *efx, typedef void efx_mcdi_async_completer(struct efx_nic *efx,
unsigned long cookie, int rc, unsigned long cookie, int rc,
efx_dword_t *outbuf, efx_dword_t *outbuf,
size_t outlen_actual); size_t outlen_actual);
int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd, int efx_siena_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen, size_t outlen,
efx_mcdi_async_completer *complete,
unsigned long cookie);
int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen, const efx_dword_t *inbuf, size_t inlen,
size_t outlen, size_t outlen,
efx_mcdi_async_completer *complete, efx_mcdi_async_completer *complete,
unsigned long cookie); unsigned long cookie);
int efx_siena_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen,
size_t outlen,
efx_mcdi_async_completer *complete,
unsigned long cookie);
void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd, void efx_siena_mcdi_display_error(struct efx_nic *efx, unsigned int cmd,
size_t inlen, efx_dword_t *outbuf, size_t inlen, efx_dword_t *outbuf,
size_t outlen, int rc); size_t outlen, int rc);
int efx_mcdi_poll_reboot(struct efx_nic *efx); int efx_siena_mcdi_poll_reboot(struct efx_nic *efx);
void efx_mcdi_mode_poll(struct efx_nic *efx); void efx_siena_mcdi_mode_poll(struct efx_nic *efx);
void efx_mcdi_mode_event(struct efx_nic *efx); void efx_siena_mcdi_mode_event(struct efx_nic *efx);
void efx_mcdi_flush_async(struct efx_nic *efx); void efx_siena_mcdi_flush_async(struct efx_nic *efx);
void efx_mcdi_process_event(struct efx_channel *channel, efx_qword_t *event); void efx_siena_mcdi_process_event(struct efx_channel *channel, efx_qword_t *event);
void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); void efx_siena_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
/* We expect that 16- and 32-bit fields in MCDI requests and responses /* We expect that 16- and 32-bit fields in MCDI requests and responses
* are appropriately aligned, but 64-bit fields are only * are appropriately aligned, but 64-bit fields are only
...@@ -338,51 +340,47 @@ void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); ...@@ -338,51 +340,47 @@ void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
MCDI_CAPABILITY(field), \ MCDI_CAPABILITY(field), \
MCDI_CAPABILITY_OFST(field)) MCDI_CAPABILITY_OFST(field))
void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); void efx_siena_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, int efx_siena_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address,
u16 *fw_subtype_list, u32 *capabilities); u16 *fw_subtype_list, u32 *capabilities);
int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq); int efx_siena_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart,
int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out); u32 dest_evq);
int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type, int efx_siena_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out);
size_t *size_out, size_t *erase_size_out, int efx_siena_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
bool *protected_out); size_t *size_out, size_t *erase_size_out,
int efx_new_mcdi_nvram_test_all(struct efx_nic *efx); bool *protected_out);
int efx_mcdi_nvram_test_all(struct efx_nic *efx); int efx_siena_mcdi_nvram_test_all(struct efx_nic *efx);
int efx_mcdi_handle_assertion(struct efx_nic *efx); int efx_siena_mcdi_handle_assertion(struct efx_nic *efx);
int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); int efx_siena_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac, int efx_siena_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
int *id_out); int *id_out);
int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out); int efx_siena_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id); int efx_siena_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
int efx_mcdi_wol_filter_reset(struct efx_nic *efx); int efx_siena_mcdi_wol_filter_reset(struct efx_nic *efx);
int efx_mcdi_flush_rxqs(struct efx_nic *efx); int efx_siena_mcdi_flush_rxqs(struct efx_nic *efx);
void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev); void efx_siena_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
void efx_mcdi_mac_start_stats(struct efx_nic *efx); void efx_siena_mcdi_mac_start_stats(struct efx_nic *efx);
void efx_mcdi_mac_stop_stats(struct efx_nic *efx); void efx_siena_mcdi_mac_stop_stats(struct efx_nic *efx);
void efx_mcdi_mac_pull_stats(struct efx_nic *efx); void efx_siena_mcdi_mac_pull_stats(struct efx_nic *efx);
enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason); enum reset_type efx_siena_mcdi_map_reset_reason(enum reset_type reason);
int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method); int efx_siena_mcdi_reset(struct efx_nic *efx, enum reset_type method);
int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled,
unsigned int *flags);
int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out,
unsigned int *enabled_out);
#ifdef CONFIG_SFC_MCDI_MON #ifdef CONFIG_SFC_MCDI_MON
int efx_mcdi_mon_probe(struct efx_nic *efx); int efx_siena_mcdi_mon_probe(struct efx_nic *efx);
void efx_mcdi_mon_remove(struct efx_nic *efx); void efx_siena_mcdi_mon_remove(struct efx_nic *efx);
#else #else
static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; } static inline int efx_siena_mcdi_mon_probe(struct efx_nic *efx) { return 0; }
static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {} static inline void efx_siena_mcdi_mon_remove(struct efx_nic *efx) {}
#endif #endif
#ifdef CONFIG_SFC_MTD #ifdef CONFIG_SFC_MTD
int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len, int efx_siena_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
size_t *retlen, u8 *buffer); size_t *retlen, u8 *buffer);
int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len); int efx_siena_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len, int efx_siena_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len,
size_t *retlen, const u8 *buffer); size_t *retlen, const u8 *buffer);
int efx_mcdi_mtd_sync(struct mtd_info *mtd); int efx_siena_mcdi_mtd_sync(struct mtd_info *mtd);
void efx_mcdi_mtd_rename(struct efx_mtd_partition *part); void efx_siena_mcdi_mtd_rename(struct efx_mtd_partition *part);
#endif #endif
#endif /* EFX_MCDI_H */ #endif /* EFX_MCDI_H */
...@@ -100,7 +100,7 @@ static const char *const sensor_status_names[] = { ...@@ -100,7 +100,7 @@ static const char *const sensor_status_names[] = {
[MC_CMD_SENSOR_STATE_NO_READING] = "No reading", [MC_CMD_SENSOR_STATE_NO_READING] = "No reading",
}; };
void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev) void efx_siena_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev)
{ {
unsigned int type, state, value; unsigned int type, state, value;
enum efx_hwmon_type hwmon_type = EFX_HWMON_UNKNOWN; enum efx_hwmon_type hwmon_type = EFX_HWMON_UNKNOWN;
...@@ -151,8 +151,8 @@ static int efx_mcdi_mon_update(struct efx_nic *efx) ...@@ -151,8 +151,8 @@ static int efx_mcdi_mon_update(struct efx_nic *efx)
hwmon->dma_buf.dma_addr); hwmon->dma_buf.dma_addr);
MCDI_SET_DWORD(inbuf, READ_SENSORS_EXT_IN_LENGTH, hwmon->dma_buf.len); MCDI_SET_DWORD(inbuf, READ_SENSORS_EXT_IN_LENGTH, hwmon->dma_buf.len);
rc = efx_mcdi_rpc(efx, MC_CMD_READ_SENSORS, rc = efx_siena_mcdi_rpc(efx, MC_CMD_READ_SENSORS,
inbuf, sizeof(inbuf), NULL, 0, NULL); inbuf, sizeof(inbuf), NULL, 0, NULL);
if (rc == 0) if (rc == 0)
hwmon->last_update = jiffies; hwmon->last_update = jiffies;
return rc; return rc;
...@@ -300,7 +300,7 @@ efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name, ...@@ -300,7 +300,7 @@ efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name,
hwmon->group.attrs[hwmon->n_attrs++] = &attr->dev_attr.attr; hwmon->group.attrs[hwmon->n_attrs++] = &attr->dev_attr.attr;
} }
int efx_mcdi_mon_probe(struct efx_nic *efx) int efx_siena_mcdi_mon_probe(struct efx_nic *efx)
{ {
unsigned int n_temp = 0, n_cool = 0, n_in = 0, n_curr = 0, n_power = 0; unsigned int n_temp = 0, n_cool = 0, n_in = 0, n_curr = 0, n_power = 0;
struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);
...@@ -318,8 +318,9 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) ...@@ -318,8 +318,9 @@ int efx_mcdi_mon_probe(struct efx_nic *efx)
do { do {
MCDI_SET_DWORD(inbuf, SENSOR_INFO_EXT_IN_PAGE, page); MCDI_SET_DWORD(inbuf, SENSOR_INFO_EXT_IN_PAGE, page);
rc = efx_mcdi_rpc(efx, MC_CMD_SENSOR_INFO, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc(efx, MC_CMD_SENSOR_INFO, inbuf,
outbuf, sizeof(outbuf), &outlen); sizeof(inbuf), outbuf, sizeof(outbuf),
&outlen);
if (rc) if (rc)
return rc; return rc;
if (outlen < MC_CMD_SENSOR_INFO_OUT_LENMIN) if (outlen < MC_CMD_SENSOR_INFO_OUT_LENMIN)
...@@ -380,10 +381,10 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) ...@@ -380,10 +381,10 @@ int efx_mcdi_mon_probe(struct efx_nic *efx)
MCDI_SET_DWORD(inbuf, SENSOR_INFO_EXT_IN_PAGE, MCDI_SET_DWORD(inbuf, SENSOR_INFO_EXT_IN_PAGE,
page); page);
rc = efx_mcdi_rpc(efx, MC_CMD_SENSOR_INFO, rc = efx_siena_mcdi_rpc(efx, MC_CMD_SENSOR_INFO,
inbuf, sizeof(inbuf), inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), outbuf, sizeof(outbuf),
&outlen); &outlen);
if (rc) if (rc)
goto fail; goto fail;
if (outlen < MC_CMD_SENSOR_INFO_OUT_LENMIN) { if (outlen < MC_CMD_SENSOR_INFO_OUT_LENMIN) {
...@@ -513,11 +514,11 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) ...@@ -513,11 +514,11 @@ int efx_mcdi_mon_probe(struct efx_nic *efx)
return 0; return 0;
fail: fail:
efx_mcdi_mon_remove(efx); efx_siena_mcdi_mon_remove(efx);
return rc; return rc;
} }
void efx_mcdi_mon_remove(struct efx_nic *efx) void efx_siena_mcdi_mon_remove(struct efx_nic *efx)
{ {
struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx);
......
...@@ -31,8 +31,8 @@ static int efx_mcdi_mdio_read(struct net_device *net_dev, ...@@ -31,8 +31,8 @@ static int efx_mcdi_mdio_read(struct net_device *net_dev,
MCDI_SET_DWORD(inbuf, MDIO_READ_IN_DEVAD, devad); MCDI_SET_DWORD(inbuf, MDIO_READ_IN_DEVAD, devad);
MCDI_SET_DWORD(inbuf, MDIO_READ_IN_ADDR, addr); MCDI_SET_DWORD(inbuf, MDIO_READ_IN_ADDR, addr);
rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_READ, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc(efx, MC_CMD_MDIO_READ, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), &outlen); outbuf, sizeof(outbuf), &outlen);
if (rc) if (rc)
return rc; return rc;
...@@ -58,8 +58,8 @@ static int efx_mcdi_mdio_write(struct net_device *net_dev, ...@@ -58,8 +58,8 @@ static int efx_mcdi_mdio_write(struct net_device *net_dev,
MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_ADDR, addr); MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_ADDR, addr);
MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_VALUE, value); MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_VALUE, value);
rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_WRITE, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc(efx, MC_CMD_MDIO_WRITE, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), &outlen); outbuf, sizeof(outbuf), &outlen);
if (rc) if (rc)
return rc; return rc;
...@@ -70,14 +70,7 @@ static int efx_mcdi_mdio_write(struct net_device *net_dev, ...@@ -70,14 +70,7 @@ static int efx_mcdi_mdio_write(struct net_device *net_dev,
return 0; return 0;
} }
u32 efx_mcdi_phy_get_caps(struct efx_nic *efx) bool efx_siena_mcdi_mac_check_fault(struct efx_nic *efx)
{
struct efx_mcdi_phy_data *phy_data = efx->phy_data;
return phy_data->supported_cap;
}
bool efx_mcdi_mac_check_fault(struct efx_nic *efx)
{ {
MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_LINK_OUT_LEN); MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_LINK_OUT_LEN);
size_t outlength; size_t outlength;
...@@ -85,15 +78,15 @@ bool efx_mcdi_mac_check_fault(struct efx_nic *efx) ...@@ -85,15 +78,15 @@ bool efx_mcdi_mac_check_fault(struct efx_nic *efx)
BUILD_BUG_ON(MC_CMD_GET_LINK_IN_LEN != 0); BUILD_BUG_ON(MC_CMD_GET_LINK_IN_LEN != 0);
rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, rc = efx_siena_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0,
outbuf, sizeof(outbuf), &outlength); outbuf, sizeof(outbuf), &outlength);
if (rc) if (rc)
return true; return true;
return MCDI_DWORD(outbuf, GET_LINK_OUT_MAC_FAULT) != 0; return MCDI_DWORD(outbuf, GET_LINK_OUT_MAC_FAULT) != 0;
} }
int efx_mcdi_port_probe(struct efx_nic *efx) int efx_siena_mcdi_port_probe(struct efx_nic *efx)
{ {
int rc; int rc;
...@@ -103,15 +96,15 @@ int efx_mcdi_port_probe(struct efx_nic *efx) ...@@ -103,15 +96,15 @@ int efx_mcdi_port_probe(struct efx_nic *efx)
efx->mdio.mdio_write = efx_mcdi_mdio_write; efx->mdio.mdio_write = efx_mcdi_mdio_write;
/* Fill out MDIO structure, loopback modes, and initial link state */ /* Fill out MDIO structure, loopback modes, and initial link state */
rc = efx_mcdi_phy_probe(efx); rc = efx_siena_mcdi_phy_probe(efx);
if (rc != 0) if (rc != 0)
return rc; return rc;
return efx_mcdi_mac_init_stats(efx); return efx_siena_mcdi_mac_init_stats(efx);
} }
void efx_mcdi_port_remove(struct efx_nic *efx) void efx_siena_mcdi_port_remove(struct efx_nic *efx)
{ {
efx_mcdi_phy_remove(efx); efx_siena_mcdi_phy_remove(efx);
efx_mcdi_mac_fini_stats(efx); efx_siena_mcdi_mac_fini_stats(efx);
} }
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
#include "net_driver.h" #include "net_driver.h"
u32 efx_mcdi_phy_get_caps(struct efx_nic *efx); bool efx_siena_mcdi_mac_check_fault(struct efx_nic *efx);
bool efx_mcdi_mac_check_fault(struct efx_nic *efx); int efx_siena_mcdi_port_probe(struct efx_nic *efx);
int efx_mcdi_port_probe(struct efx_nic *efx); void efx_siena_mcdi_port_remove(struct efx_nic *efx);
void efx_mcdi_port_remove(struct efx_nic *efx);
#endif /* EFX_MCDI_PORT_H */ #endif /* EFX_MCDI_PORT_H */
...@@ -28,40 +28,31 @@ struct efx_mcdi_phy_data { ...@@ -28,40 +28,31 @@ struct efx_mcdi_phy_data {
u32 forced_cap; u32 forced_cap;
}; };
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,
void efx_link_set_advertising(struct efx_nic *efx, const unsigned long *advertising);
const unsigned long *advertising); bool efx_siena_mcdi_phy_poll(struct efx_nic *efx);
int efx_mcdi_set_link(struct efx_nic *efx, u32 capabilities, int efx_siena_mcdi_phy_probe(struct efx_nic *efx);
u32 flags, u32 loopback_mode, u32 loopback_speed); void efx_siena_mcdi_phy_remove(struct efx_nic *efx);
int efx_mcdi_loopback_modes(struct efx_nic *efx, u64 *loopback_modes); void efx_siena_mcdi_phy_get_link_ksettings(struct efx_nic *efx,
void mcdi_to_ethtool_linkset(u32 media, u32 cap, unsigned long *linkset); struct ethtool_link_ksettings *cmd);
u32 ethtool_linkset_to_mcdi_cap(const unsigned long *linkset); int efx_siena_mcdi_phy_set_link_ksettings(struct efx_nic *efx,
u32 efx_get_mcdi_phy_flags(struct efx_nic *efx); const struct ethtool_link_ksettings *cmd);
u8 mcdi_to_ethtool_media(u32 media); int efx_siena_mcdi_phy_get_fecparam(struct efx_nic *efx,
void efx_mcdi_phy_decode_link(struct efx_nic *efx, struct ethtool_fecparam *fec);
struct efx_link_state *link_state, int efx_siena_mcdi_phy_set_fecparam(struct efx_nic *efx,
u32 speed, u32 flags, u32 fcntl); const struct ethtool_fecparam *fec);
u32 ethtool_fec_caps_to_mcdi(u32 supported_cap, u32 ethtool_cap); int efx_siena_mcdi_phy_test_alive(struct efx_nic *efx);
u32 mcdi_fec_caps_to_ethtool(u32 caps, bool is_25g); int efx_siena_mcdi_port_reconfigure(struct efx_nic *efx);
void efx_mcdi_phy_check_fcntl(struct efx_nic *efx, u32 lpa); int efx_siena_mcdi_phy_run_tests(struct efx_nic *efx, int *results,
bool efx_mcdi_phy_poll(struct efx_nic *efx); unsigned int flags);
int efx_mcdi_phy_probe(struct efx_nic *efx); const char *efx_siena_mcdi_phy_test_name(struct efx_nic *efx,
void efx_mcdi_phy_remove(struct efx_nic *efx); unsigned int index);
void efx_mcdi_phy_get_link_ksettings(struct efx_nic *efx, struct ethtool_link_ksettings *cmd); int efx_siena_mcdi_phy_get_module_eeprom(struct efx_nic *efx,
int efx_mcdi_phy_set_link_ksettings(struct efx_nic *efx, const struct ethtool_link_ksettings *cmd); struct ethtool_eeprom *ee, u8 *data);
int efx_mcdi_phy_get_fecparam(struct efx_nic *efx, struct ethtool_fecparam *fec); int efx_siena_mcdi_phy_get_module_info(struct efx_nic *efx,
int efx_mcdi_phy_set_fecparam(struct efx_nic *efx, const struct ethtool_fecparam *fec); struct ethtool_modinfo *modinfo);
int efx_mcdi_phy_test_alive(struct efx_nic *efx); int efx_siena_mcdi_set_mac(struct efx_nic *efx);
int efx_mcdi_port_reconfigure(struct efx_nic *efx); int efx_siena_mcdi_mac_init_stats(struct efx_nic *efx);
int efx_mcdi_phy_run_tests(struct efx_nic *efx, int *results, unsigned int flags); void efx_siena_mcdi_mac_fini_stats(struct efx_nic *efx);
const char *efx_mcdi_phy_test_name(struct efx_nic *efx, unsigned int index);
int efx_mcdi_phy_get_module_eeprom(struct efx_nic *efx, struct ethtool_eeprom *ee, u8 *data);
int efx_mcdi_phy_get_module_info(struct efx_nic *efx, struct ethtool_modinfo *modinfo);
int efx_mcdi_set_mac(struct efx_nic *efx);
int efx_mcdi_set_mtu(struct efx_nic *efx);
int efx_mcdi_mac_init_stats(struct efx_nic *efx);
void efx_mcdi_mac_fini_stats(struct efx_nic *efx);
int efx_mcdi_port_get_number(struct efx_nic *efx);
void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
#endif #endif
...@@ -426,8 +426,8 @@ size_t efx_siena_ptp_update_stats(struct efx_nic *efx, u64 *stats) ...@@ -426,8 +426,8 @@ size_t efx_siena_ptp_update_stats(struct efx_nic *efx, u64 *stats)
*/ */
MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_STATUS); MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_STATUS);
MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0); MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0);
rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), NULL); outbuf, sizeof(outbuf), NULL);
if (rc) if (rc)
memset(outbuf, 0, sizeof(outbuf)); memset(outbuf, 0, sizeof(outbuf));
efx_nic_update_stats(efx_ptp_stat_desc, PTP_STAT_COUNT, efx_nic_update_stats(efx_ptp_stat_desc, PTP_STAT_COUNT,
...@@ -641,8 +641,8 @@ static int efx_ptp_get_attributes(struct efx_nic *efx) ...@@ -641,8 +641,8 @@ static int efx_ptp_get_attributes(struct efx_nic *efx)
*/ */
MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_GET_ATTRIBUTES); MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_GET_ATTRIBUTES);
MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0); MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0);
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), &out_len); outbuf, sizeof(outbuf), &out_len);
if (rc == 0) { if (rc == 0) {
fmt = MCDI_DWORD(outbuf, PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT); fmt = MCDI_DWORD(outbuf, PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT);
} else if (rc == -EINVAL) { } else if (rc == -EINVAL) {
...@@ -651,8 +651,8 @@ static int efx_ptp_get_attributes(struct efx_nic *efx) ...@@ -651,8 +651,8 @@ static int efx_ptp_get_attributes(struct efx_nic *efx)
pci_info(efx->pci_dev, "no PTP support\n"); pci_info(efx->pci_dev, "no PTP support\n");
return rc; return rc;
} else { } else {
efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf), efx_siena_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf),
outbuf, sizeof(outbuf), rc); outbuf, sizeof(outbuf), rc);
return rc; return rc;
} }
...@@ -739,8 +739,8 @@ static int efx_ptp_get_timestamp_corrections(struct efx_nic *efx) ...@@ -739,8 +739,8 @@ static int efx_ptp_get_timestamp_corrections(struct efx_nic *efx)
MC_CMD_PTP_OP_GET_TIMESTAMP_CORRECTIONS); MC_CMD_PTP_OP_GET_TIMESTAMP_CORRECTIONS);
MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0); MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0);
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), &out_len); outbuf, sizeof(outbuf), &out_len);
if (rc == 0) { if (rc == 0) {
efx->ptp_data->ts_corrections.ptp_tx = MCDI_DWORD(outbuf, efx->ptp_data->ts_corrections.ptp_tx = MCDI_DWORD(outbuf,
PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT); PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT);
...@@ -772,8 +772,8 @@ static int efx_ptp_get_timestamp_corrections(struct efx_nic *efx) ...@@ -772,8 +772,8 @@ static int efx_ptp_get_timestamp_corrections(struct efx_nic *efx)
efx->ptp_data->ts_corrections.general_tx = 0; efx->ptp_data->ts_corrections.general_tx = 0;
efx->ptp_data->ts_corrections.general_rx = 0; efx->ptp_data->ts_corrections.general_rx = 0;
} else { } else {
efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf), outbuf, efx_siena_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf),
sizeof(outbuf), rc); outbuf, sizeof(outbuf), rc);
return rc; return rc;
} }
...@@ -794,13 +794,13 @@ static int efx_ptp_enable(struct efx_nic *efx) ...@@ -794,13 +794,13 @@ static int efx_ptp_enable(struct efx_nic *efx)
efx->ptp_data->channel->channel : 0); efx->ptp_data->channel->channel : 0);
MCDI_SET_DWORD(inbuf, PTP_IN_ENABLE_MODE, efx->ptp_data->mode); MCDI_SET_DWORD(inbuf, PTP_IN_ENABLE_MODE, efx->ptp_data->mode);
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), NULL); outbuf, sizeof(outbuf), NULL);
rc = (rc == -EALREADY) ? 0 : rc; rc = (rc == -EALREADY) ? 0 : rc;
if (rc) if (rc)
efx_mcdi_display_error(efx, MC_CMD_PTP, efx_siena_mcdi_display_error(efx, MC_CMD_PTP,
MC_CMD_PTP_IN_ENABLE_LEN, MC_CMD_PTP_IN_ENABLE_LEN,
outbuf, sizeof(outbuf), rc); outbuf, sizeof(outbuf), rc);
return rc; return rc;
} }
...@@ -817,8 +817,8 @@ static int efx_ptp_disable(struct efx_nic *efx) ...@@ -817,8 +817,8 @@ static int efx_ptp_disable(struct efx_nic *efx)
MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_DISABLE); MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_DISABLE);
MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0); MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0);
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), NULL); outbuf, sizeof(outbuf), NULL);
rc = (rc == -EALREADY) ? 0 : rc; rc = (rc == -EALREADY) ? 0 : rc;
/* If we get ENOSYS, the NIC doesn't support PTP, and thus this function /* If we get ENOSYS, the NIC doesn't support PTP, and thus this function
* should only have been called during probe. * should only have been called during probe.
...@@ -826,9 +826,9 @@ static int efx_ptp_disable(struct efx_nic *efx) ...@@ -826,9 +826,9 @@ static int efx_ptp_disable(struct efx_nic *efx)
if (rc == -ENOSYS || rc == -EPERM) if (rc == -ENOSYS || rc == -EPERM)
pci_info(efx->pci_dev, "no PTP support\n"); pci_info(efx->pci_dev, "no PTP support\n");
else if (rc) else if (rc)
efx_mcdi_display_error(efx, MC_CMD_PTP, efx_siena_mcdi_display_error(efx, MC_CMD_PTP,
MC_CMD_PTP_IN_DISABLE_LEN, MC_CMD_PTP_IN_DISABLE_LEN,
outbuf, sizeof(outbuf), rc); outbuf, sizeof(outbuf), rc);
return rc; return rc;
} }
...@@ -1042,8 +1042,8 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings) ...@@ -1042,8 +1042,8 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
/* Clear flag that signals MC ready */ /* Clear flag that signals MC ready */
WRITE_ONCE(*start, 0); WRITE_ONCE(*start, 0);
rc = efx_mcdi_rpc_start(efx, MC_CMD_PTP, synch_buf, rc = efx_siena_mcdi_rpc_start(efx, MC_CMD_PTP, synch_buf,
MC_CMD_PTP_IN_SYNCHRONIZE_LEN); MC_CMD_PTP_IN_SYNCHRONIZE_LEN);
EFX_WARN_ON_ONCE_PARANOID(rc); EFX_WARN_ON_ONCE_PARANOID(rc);
/* Wait for start from MCDI (or timeout) */ /* Wait for start from MCDI (or timeout) */
...@@ -1062,10 +1062,10 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings) ...@@ -1062,10 +1062,10 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
efx_ptp_send_times(efx, &last_time); efx_ptp_send_times(efx, &last_time);
/* Collect results */ /* Collect results */
rc = efx_mcdi_rpc_finish(efx, MC_CMD_PTP, rc = efx_siena_mcdi_rpc_finish(efx, MC_CMD_PTP,
MC_CMD_PTP_IN_SYNCHRONIZE_LEN, MC_CMD_PTP_IN_SYNCHRONIZE_LEN,
synch_buf, sizeof(synch_buf), synch_buf, sizeof(synch_buf),
&response_length); &response_length);
if (rc == 0) { if (rc == 0) {
rc = efx_ptp_process_times(efx, synch_buf, response_length, rc = efx_ptp_process_times(efx, synch_buf, response_length,
&last_time); &last_time);
...@@ -1127,9 +1127,9 @@ static void efx_ptp_xmit_skb_mc(struct efx_nic *efx, struct sk_buff *skb) ...@@ -1127,9 +1127,9 @@ static void efx_ptp_xmit_skb_mc(struct efx_nic *efx, struct sk_buff *skb)
MCDI_PTR(ptp_data->txbuf, MCDI_PTR(ptp_data->txbuf,
PTP_IN_TRANSMIT_PACKET), PTP_IN_TRANSMIT_PACKET),
skb->len); skb->len);
rc = efx_mcdi_rpc(efx, MC_CMD_PTP, rc = efx_siena_mcdi_rpc(efx, MC_CMD_PTP, ptp_data->txbuf,
ptp_data->txbuf, MC_CMD_PTP_IN_TRANSMIT_LEN(skb->len), MC_CMD_PTP_IN_TRANSMIT_LEN(skb->len), txtime,
txtime, sizeof(txtime), &len); sizeof(txtime), &len);
if (rc != 0) if (rc != 0)
goto fail; goto fail;
...@@ -2068,8 +2068,8 @@ static int efx_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) ...@@ -2068,8 +2068,8 @@ static int efx_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
MCDI_SET_QWORD(inadj, PTP_IN_ADJUST_FREQ, adjustment_ns); MCDI_SET_QWORD(inadj, PTP_IN_ADJUST_FREQ, adjustment_ns);
MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_SECONDS, 0); MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_SECONDS, 0);
MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_NANOSECONDS, 0); MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_NANOSECONDS, 0);
rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inadj, sizeof(inadj), rc = efx_siena_mcdi_rpc(efx, MC_CMD_PTP, inadj, sizeof(inadj),
NULL, 0, NULL); NULL, 0, NULL);
if (rc != 0) if (rc != 0)
return rc; return rc;
...@@ -2093,8 +2093,8 @@ static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta) ...@@ -2093,8 +2093,8 @@ static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
MCDI_SET_QWORD(inbuf, PTP_IN_ADJUST_FREQ, ptp_data->current_adjfreq); MCDI_SET_QWORD(inbuf, PTP_IN_ADJUST_FREQ, ptp_data->current_adjfreq);
MCDI_SET_DWORD(inbuf, PTP_IN_ADJUST_MAJOR, nic_major); MCDI_SET_DWORD(inbuf, PTP_IN_ADJUST_MAJOR, nic_major);
MCDI_SET_DWORD(inbuf, PTP_IN_ADJUST_MINOR, nic_minor); MCDI_SET_DWORD(inbuf, PTP_IN_ADJUST_MINOR, nic_minor);
return efx_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), return efx_siena_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
NULL, 0, NULL); NULL, 0, NULL);
} }
static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
...@@ -2111,8 +2111,8 @@ static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) ...@@ -2111,8 +2111,8 @@ static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_READ_NIC_TIME); MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_READ_NIC_TIME);
MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0); MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0);
rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), rc = efx_siena_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
outbuf, sizeof(outbuf), NULL); outbuf, sizeof(outbuf), NULL);
if (rc != 0) if (rc != 0)
return rc; return rc;
......
...@@ -100,7 +100,7 @@ static int efx_test_phy_alive(struct efx_nic *efx, struct efx_self_tests *tests) ...@@ -100,7 +100,7 @@ static int efx_test_phy_alive(struct efx_nic *efx, struct efx_self_tests *tests)
{ {
int rc = 0; int rc = 0;
rc = efx_mcdi_phy_test_alive(efx); rc = efx_siena_mcdi_phy_test_alive(efx);
tests->phy_alive = rc ? -1 : 1; tests->phy_alive = rc ? -1 : 1;
return rc; return rc;
...@@ -257,7 +257,7 @@ static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests, ...@@ -257,7 +257,7 @@ static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests,
int rc; int rc;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
rc = efx_mcdi_phy_run_tests(efx, tests->phy_ext, flags); rc = efx_siena_mcdi_phy_run_tests(efx, tests->phy_ext, flags);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
if (rc == -EPERM) if (rc == -EPERM)
rc = 0; rc = 0;
......
...@@ -59,13 +59,13 @@ static void siena_push_irq_moderation(struct efx_channel *channel) ...@@ -59,13 +59,13 @@ static void siena_push_irq_moderation(struct efx_channel *channel)
void efx_siena_prepare_flush(struct efx_nic *efx) void efx_siena_prepare_flush(struct efx_nic *efx)
{ {
if (efx->fc_disable++ == 0) if (efx->fc_disable++ == 0)
efx_mcdi_set_mac(efx); efx_siena_mcdi_set_mac(efx);
} }
void siena_finish_flush(struct efx_nic *efx) void siena_finish_flush(struct efx_nic *efx)
{ {
if (--efx->fc_disable == 0) if (--efx->fc_disable == 0)
efx_mcdi_set_mac(efx); efx_siena_mcdi_set_mac(efx);
} }
static const struct efx_farch_register_test siena_register_tests[] = { static const struct efx_farch_register_test siena_register_tests[] = {
...@@ -107,7 +107,7 @@ static int siena_test_chip(struct efx_nic *efx, struct efx_self_tests *tests) ...@@ -107,7 +107,7 @@ static int siena_test_chip(struct efx_nic *efx, struct efx_self_tests *tests)
/* Reset the chip immediately so that it is completely /* Reset the chip immediately so that it is completely
* quiescent regardless of what any VF driver does. * quiescent regardless of what any VF driver does.
*/ */
rc = efx_mcdi_reset(efx, reset_method); rc = efx_siena_mcdi_reset(efx, reset_method);
if (rc) if (rc)
goto out; goto out;
...@@ -116,7 +116,7 @@ static int siena_test_chip(struct efx_nic *efx, struct efx_self_tests *tests) ...@@ -116,7 +116,7 @@ static int siena_test_chip(struct efx_nic *efx, struct efx_self_tests *tests)
ARRAY_SIZE(siena_register_tests)) ARRAY_SIZE(siena_register_tests))
? -1 : 1; ? -1 : 1;
rc = efx_mcdi_reset(efx, reset_method); rc = efx_siena_mcdi_reset(efx, reset_method);
out: out:
rc2 = efx_siena_reset_up(efx, reset_method, rc == 0); rc2 = efx_siena_reset_up(efx, reset_method, rc == 0);
return rc ? rc : rc2; return rc ? rc : rc2;
...@@ -223,7 +223,8 @@ static int siena_probe_nvconfig(struct efx_nic *efx) ...@@ -223,7 +223,8 @@ static int siena_probe_nvconfig(struct efx_nic *efx)
u32 caps = 0; u32 caps = 0;
int rc; int rc;
rc = efx_mcdi_get_board_cfg(efx, efx->net_dev->perm_addr, NULL, &caps); rc = efx_siena_mcdi_get_board_cfg(efx, efx->net_dev->perm_addr, NULL,
&caps);
efx->timer_quantum_ns = efx->timer_quantum_ns =
(caps & (1 << MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN)) ? (caps & (1 << MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN)) ?
...@@ -286,12 +287,12 @@ static int siena_probe_nic(struct efx_nic *efx) ...@@ -286,12 +287,12 @@ static int siena_probe_nic(struct efx_nic *efx)
efx_reado(efx, &reg, FR_AZ_CS_DEBUG); efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1; efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
rc = efx_mcdi_init(efx); rc = efx_siena_mcdi_init(efx);
if (rc) if (rc)
goto fail1; goto fail1;
/* Now we can reset the NIC */ /* Now we can reset the NIC */
rc = efx_mcdi_reset(efx, RESET_TYPE_ALL); rc = efx_siena_mcdi_reset(efx, RESET_TYPE_ALL);
if (rc) { if (rc) {
netif_err(efx, probe, efx->net_dev, "failed to reset NIC\n"); netif_err(efx, probe, efx->net_dev, "failed to reset NIC\n");
goto fail3; goto fail3;
...@@ -323,7 +324,7 @@ static int siena_probe_nic(struct efx_nic *efx) ...@@ -323,7 +324,7 @@ static int siena_probe_nic(struct efx_nic *efx)
goto fail5; goto fail5;
} }
rc = efx_mcdi_mon_probe(efx); rc = efx_siena_mcdi_mon_probe(efx);
if (rc) if (rc)
goto fail5; goto fail5;
...@@ -338,8 +339,8 @@ static int siena_probe_nic(struct efx_nic *efx) ...@@ -338,8 +339,8 @@ static int siena_probe_nic(struct efx_nic *efx)
efx_nic_free_buffer(efx, &efx->irq_status); efx_nic_free_buffer(efx, &efx->irq_status);
fail4: fail4:
fail3: fail3:
efx_mcdi_detach(efx); efx_siena_mcdi_detach(efx);
efx_mcdi_fini(efx); efx_siena_mcdi_fini(efx);
fail1: fail1:
kfree(efx->nic_data); kfree(efx->nic_data);
return rc; return rc;
...@@ -406,7 +407,7 @@ static int siena_init_nic(struct efx_nic *efx) ...@@ -406,7 +407,7 @@ static int siena_init_nic(struct efx_nic *efx)
int rc; int rc;
/* Recover from a failed assertion post-reset */ /* Recover from a failed assertion post-reset */
rc = efx_mcdi_handle_assertion(efx); rc = efx_siena_mcdi_handle_assertion(efx);
if (rc) if (rc)
return rc; return rc;
...@@ -440,7 +441,7 @@ static int siena_init_nic(struct efx_nic *efx) ...@@ -440,7 +441,7 @@ static int siena_init_nic(struct efx_nic *efx)
efx->rss_context.context_id = 0; /* indicates RSS is active */ efx->rss_context.context_id = 0; /* indicates RSS is active */
/* Enable event logging */ /* Enable event logging */
rc = efx_mcdi_log_ctrl(efx, true, false, 0); rc = efx_siena_mcdi_log_ctrl(efx, true, false, 0);
if (rc) if (rc)
return rc; return rc;
...@@ -457,14 +458,14 @@ static int siena_init_nic(struct efx_nic *efx) ...@@ -457,14 +458,14 @@ static int siena_init_nic(struct efx_nic *efx)
static void siena_remove_nic(struct efx_nic *efx) static void siena_remove_nic(struct efx_nic *efx)
{ {
efx_mcdi_mon_remove(efx); efx_siena_mcdi_mon_remove(efx);
efx_nic_free_buffer(efx, &efx->irq_status); efx_nic_free_buffer(efx, &efx->irq_status);
efx_mcdi_reset(efx, RESET_TYPE_ALL); efx_siena_mcdi_reset(efx, RESET_TYPE_ALL);
efx_mcdi_detach(efx); efx_siena_mcdi_detach(efx);
efx_mcdi_fini(efx); efx_siena_mcdi_fini(efx);
/* Tear down the private nic state */ /* Tear down the private nic state */
kfree(efx->nic_data); kfree(efx->nic_data);
...@@ -649,14 +650,14 @@ static int siena_mac_reconfigure(struct efx_nic *efx, bool mtu_only __always_unu ...@@ -649,14 +650,14 @@ static int siena_mac_reconfigure(struct efx_nic *efx, bool mtu_only __always_unu
WARN_ON(!mutex_is_locked(&efx->mac_lock)); WARN_ON(!mutex_is_locked(&efx->mac_lock));
rc = efx_mcdi_set_mac(efx); rc = efx_siena_mcdi_set_mac(efx);
if (rc != 0) if (rc != 0)
return rc; return rc;
memcpy(MCDI_PTR(inbuf, SET_MCAST_HASH_IN_HASH0), memcpy(MCDI_PTR(inbuf, SET_MCAST_HASH_IN_HASH0),
efx->multicast_hash.byte, sizeof(efx->multicast_hash)); efx->multicast_hash.byte, sizeof(efx->multicast_hash));
return efx_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH, return efx_siena_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH,
inbuf, sizeof(inbuf), NULL, 0, NULL); inbuf, sizeof(inbuf), NULL, 0, NULL);
} }
/************************************************************************** /**************************************************************************
...@@ -689,16 +690,17 @@ static int siena_set_wol(struct efx_nic *efx, u32 type) ...@@ -689,16 +690,17 @@ static int siena_set_wol(struct efx_nic *efx, u32 type)
if (type & WAKE_MAGIC) { if (type & WAKE_MAGIC) {
if (nic_data->wol_filter_id != -1) if (nic_data->wol_filter_id != -1)
efx_mcdi_wol_filter_remove(efx, efx_siena_mcdi_wol_filter_remove(efx,
nic_data->wol_filter_id); nic_data->wol_filter_id);
rc = efx_mcdi_wol_filter_set_magic(efx, efx->net_dev->dev_addr, rc = efx_siena_mcdi_wol_filter_set_magic(efx,
&nic_data->wol_filter_id); efx->net_dev->dev_addr,
&nic_data->wol_filter_id);
if (rc) if (rc)
goto fail; goto fail;
pci_wake_from_d3(efx->pci_dev, true); pci_wake_from_d3(efx->pci_dev, true);
} else { } else {
rc = efx_mcdi_wol_filter_reset(efx); rc = efx_siena_mcdi_wol_filter_reset(efx);
nic_data->wol_filter_id = -1; nic_data->wol_filter_id = -1;
pci_wake_from_d3(efx->pci_dev, false); pci_wake_from_d3(efx->pci_dev, false);
if (rc) if (rc)
...@@ -718,12 +720,12 @@ static void siena_init_wol(struct efx_nic *efx) ...@@ -718,12 +720,12 @@ static void siena_init_wol(struct efx_nic *efx)
struct siena_nic_data *nic_data = efx->nic_data; struct siena_nic_data *nic_data = efx->nic_data;
int rc; int rc;
rc = efx_mcdi_wol_filter_get_magic(efx, &nic_data->wol_filter_id); rc = efx_siena_mcdi_wol_filter_get_magic(efx, &nic_data->wol_filter_id);
if (rc != 0) { if (rc != 0) {
/* If it failed, attempt to get into a synchronised /* If it failed, attempt to get into a synchronised
* state with MC by resetting any set WoL filters */ * state with MC by resetting any set WoL filters */
efx_mcdi_wol_filter_reset(efx); efx_siena_mcdi_wol_filter_reset(efx);
nic_data->wol_filter_id = -1; nic_data->wol_filter_id = -1;
} else if (nic_data->wol_filter_id != -1) { } else if (nic_data->wol_filter_id != -1) {
pci_wake_from_d3(efx->pci_dev, true); pci_wake_from_d3(efx->pci_dev, true);
...@@ -869,7 +871,8 @@ static int siena_mtd_probe_partition(struct efx_nic *efx, ...@@ -869,7 +871,8 @@ static int siena_mtd_probe_partition(struct efx_nic *efx,
if (info->port != efx_port_num(efx)) if (info->port != efx_port_num(efx))
return -ENODEV; return -ENODEV;
rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &protected); rc = efx_siena_mcdi_nvram_info(efx, type, &size, &erase_size,
&protected);
if (rc) if (rc)
return rc; return rc;
if (protected) if (protected)
...@@ -896,7 +899,7 @@ static int siena_mtd_get_fw_subtypes(struct efx_nic *efx, ...@@ -896,7 +899,7 @@ static int siena_mtd_get_fw_subtypes(struct efx_nic *efx,
size_t i; size_t i;
int rc; int rc;
rc = efx_mcdi_get_board_cfg(efx, NULL, fw_subtype_list, NULL); rc = efx_siena_mcdi_get_board_cfg(efx, NULL, fw_subtype_list, NULL);
if (rc) if (rc)
return rc; return rc;
...@@ -916,7 +919,7 @@ static int siena_mtd_probe(struct efx_nic *efx) ...@@ -916,7 +919,7 @@ static int siena_mtd_probe(struct efx_nic *efx)
ASSERT_RTNL(); ASSERT_RTNL();
rc = efx_mcdi_nvram_types(efx, &nvram_types); rc = efx_siena_mcdi_nvram_types(efx, &nvram_types);
if (rc) if (rc)
return rc; return rc;
...@@ -987,11 +990,11 @@ const struct efx_nic_type siena_a0_nic_type = { ...@@ -987,11 +990,11 @@ const struct efx_nic_type siena_a0_nic_type = {
#else #else
.monitor = NULL, .monitor = NULL,
#endif #endif
.map_reset_reason = efx_mcdi_map_reset_reason, .map_reset_reason = efx_siena_mcdi_map_reset_reason,
.map_reset_flags = siena_map_reset_flags, .map_reset_flags = siena_map_reset_flags,
.reset = efx_mcdi_reset, .reset = efx_siena_mcdi_reset,
.probe_port = efx_mcdi_port_probe, .probe_port = efx_siena_mcdi_port_probe,
.remove_port = efx_mcdi_port_remove, .remove_port = efx_siena_mcdi_port_remove,
.fini_dmaq = efx_farch_fini_dmaq, .fini_dmaq = efx_farch_fini_dmaq,
.prepare_flush = efx_siena_prepare_flush, .prepare_flush = efx_siena_prepare_flush,
.finish_flush = siena_finish_flush, .finish_flush = siena_finish_flush,
...@@ -999,18 +1002,18 @@ const struct efx_nic_type siena_a0_nic_type = { ...@@ -999,18 +1002,18 @@ const struct efx_nic_type siena_a0_nic_type = {
.finish_flr = efx_farch_finish_flr, .finish_flr = efx_farch_finish_flr,
.describe_stats = siena_describe_nic_stats, .describe_stats = siena_describe_nic_stats,
.update_stats = siena_update_nic_stats, .update_stats = siena_update_nic_stats,
.start_stats = efx_mcdi_mac_start_stats, .start_stats = efx_siena_mcdi_mac_start_stats,
.pull_stats = efx_mcdi_mac_pull_stats, .pull_stats = efx_siena_mcdi_mac_pull_stats,
.stop_stats = efx_mcdi_mac_stop_stats, .stop_stats = efx_siena_mcdi_mac_stop_stats,
.push_irq_moderation = siena_push_irq_moderation, .push_irq_moderation = siena_push_irq_moderation,
.reconfigure_mac = siena_mac_reconfigure, .reconfigure_mac = siena_mac_reconfigure,
.check_mac_fault = efx_mcdi_mac_check_fault, .check_mac_fault = efx_siena_mcdi_mac_check_fault,
.reconfigure_port = efx_mcdi_port_reconfigure, .reconfigure_port = efx_siena_mcdi_port_reconfigure,
.get_wol = siena_get_wol, .get_wol = siena_get_wol,
.set_wol = siena_set_wol, .set_wol = siena_set_wol,
.resume_wol = siena_init_wol, .resume_wol = siena_init_wol,
.test_chip = siena_test_chip, .test_chip = siena_test_chip,
.test_nvram = efx_mcdi_nvram_test_all, .test_nvram = efx_siena_mcdi_nvram_test_all,
.mcdi_request = siena_mcdi_request, .mcdi_request = siena_mcdi_request,
.mcdi_poll_response = siena_mcdi_poll_response, .mcdi_poll_response = siena_mcdi_poll_response,
.mcdi_read_response = siena_mcdi_read_response, .mcdi_read_response = siena_mcdi_read_response,
...@@ -1057,11 +1060,11 @@ const struct efx_nic_type siena_a0_nic_type = { ...@@ -1057,11 +1060,11 @@ const struct efx_nic_type siena_a0_nic_type = {
#endif #endif
#ifdef CONFIG_SFC_MTD #ifdef CONFIG_SFC_MTD
.mtd_probe = siena_mtd_probe, .mtd_probe = siena_mtd_probe,
.mtd_rename = efx_mcdi_mtd_rename, .mtd_rename = efx_siena_mcdi_mtd_rename,
.mtd_read = efx_mcdi_mtd_read, .mtd_read = efx_siena_mcdi_mtd_read,
.mtd_erase = efx_mcdi_mtd_erase, .mtd_erase = efx_siena_mcdi_mtd_erase,
.mtd_write = efx_mcdi_mtd_write, .mtd_write = efx_siena_mcdi_mtd_write,
.mtd_sync = efx_mcdi_mtd_sync, .mtd_sync = efx_siena_mcdi_mtd_sync,
#endif #endif
.ptp_write_host_time = siena_ptp_write_host_time, .ptp_write_host_time = siena_ptp_write_host_time,
.ptp_set_ts_config = siena_ptp_set_ts_config, .ptp_set_ts_config = siena_ptp_set_ts_config,
...@@ -1105,6 +1108,6 @@ const struct efx_nic_type siena_a0_nic_type = { ...@@ -1105,6 +1108,6 @@ const struct efx_nic_type siena_a0_nic_type = {
1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT), 1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT),
.rx_hash_key_size = 16, .rx_hash_key_size = 16,
.check_caps = siena_check_caps, .check_caps = siena_check_caps,
.sensor_event = efx_mcdi_sensor_event, .sensor_event = efx_siena_mcdi_sensor_event,
.rx_recycle_ring_size = efx_siena_recycle_ring_size, .rx_recycle_ring_size = efx_siena_recycle_ring_size,
}; };
...@@ -206,8 +206,9 @@ static int efx_siena_sriov_cmd(struct efx_nic *efx, bool enable, ...@@ -206,8 +206,9 @@ static int efx_siena_sriov_cmd(struct efx_nic *efx, bool enable,
MCDI_SET_DWORD(inbuf, SRIOV_IN_VI_BASE, EFX_VI_BASE); MCDI_SET_DWORD(inbuf, SRIOV_IN_VI_BASE, EFX_VI_BASE);
MCDI_SET_DWORD(inbuf, SRIOV_IN_VF_COUNT, efx->vf_count); MCDI_SET_DWORD(inbuf, SRIOV_IN_VF_COUNT, efx->vf_count);
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_SRIOV, inbuf, MC_CMD_SRIOV_IN_LEN, rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_SRIOV, inbuf,
outbuf, MC_CMD_SRIOV_OUT_LEN, &outlen); MC_CMD_SRIOV_IN_LEN, outbuf,
MC_CMD_SRIOV_OUT_LEN, &outlen);
if (rc) if (rc)
return rc; return rc;
if (outlen < MC_CMD_SRIOV_OUT_LEN) if (outlen < MC_CMD_SRIOV_OUT_LEN)
...@@ -288,7 +289,7 @@ static int efx_siena_sriov_memcpy(struct efx_nic *efx, ...@@ -288,7 +289,7 @@ static int efx_siena_sriov_memcpy(struct efx_nic *efx,
++req; ++req;
} }
rc = efx_mcdi_rpc(efx, MC_CMD_MEMCPY, inbuf, used, NULL, 0, NULL); rc = efx_siena_mcdi_rpc(efx, MC_CMD_MEMCPY, inbuf, used, NULL, 0, NULL);
out: out:
mb(); /* Don't write source/read dest before DMA is complete */ mb(); /* Don't write source/read dest before DMA is complete */
...@@ -712,7 +713,7 @@ static int efx_vfdi_fini_all_queues(struct siena_vf *vf) ...@@ -712,7 +713,7 @@ static int efx_vfdi_fini_all_queues(struct siena_vf *vf)
atomic_set(&vf->rxq_retry_count, 0); atomic_set(&vf->rxq_retry_count, 0);
while (timeout && (vf->rxq_count || vf->txq_count)) { while (timeout && (vf->rxq_count || vf->txq_count)) {
rc = efx_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf, rc = efx_siena_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf,
MC_CMD_FLUSH_RX_QUEUES_IN_LEN(rxqs_count), MC_CMD_FLUSH_RX_QUEUES_IN_LEN(rxqs_count),
NULL, 0, NULL); NULL, 0, NULL);
WARN_ON(rc < 0); WARN_ON(rc < 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment