Skip to content

Commit

Permalink
sfc/siena: Rename functions in mcdi headers to avoid conflicts with sfc
Browse files Browse the repository at this point in the history
For siena use efx_siena_ as the function prefix.
Several functions are not used in Siena, so they are removed.

Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Martin Habets authored and Jakub Kicinski committed May 10, 2022
1 parent 95e96f7 commit 4d49e5c
Show file tree
Hide file tree
Showing 17 changed files with 459 additions and 609 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/sfc/siena/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static int efx_init_port(struct efx_nic *efx)
efx->port_initialized = true;

/* 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)
goto fail;

Expand Down Expand Up @@ -526,7 +526,7 @@ static int efx_net_open(struct net_device *net_dev)
return rc;
if (efx->phy_mode & PHY_MODE_SPECIAL)
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;

/* Notify the kernel of the link state polled during driver load,
Expand Down Expand Up @@ -1158,7 +1158,7 @@ static int efx_pm_thaw(struct device *dev)
goto fail;

mutex_lock(&efx->mac_lock);
efx_mcdi_port_reconfigure(efx);
efx_siena_mcdi_port_reconfigure(efx);
mutex_unlock(&efx->mac_lock);

efx_siena_start_all(efx);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/sfc/siena/efx_channels.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ static int efx_soft_enable_interrupts(struct efx_nic *efx)
efx_siena_start_eventq(channel);
}

efx_mcdi_mode_event(efx);
efx_siena_mcdi_mode_event(efx);

return 0;
fail:
Expand All @@ -1045,7 +1045,7 @@ static void efx_soft_disable_interrupts(struct efx_nic *efx)
if (efx->state == STATE_DISABLED)
return;

efx_mcdi_mode_poll(efx);
efx_siena_mcdi_mode_poll(efx);

efx->irq_soft_enabled = false;
smp_wmb();
Expand All @@ -1063,7 +1063,7 @@ static void efx_soft_disable_interrupts(struct efx_nic *efx)
}

/* 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)
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/ethernet/sfc/siena/efx_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
void efx_siena_link_clear_advertising(struct efx_nic *efx)
Expand Down Expand Up @@ -547,7 +547,7 @@ void efx_siena_start_all(struct efx_nic *efx)
* to poll now because we could have missed a change
*/
mutex_lock(&efx->mac_lock);
if (efx_mcdi_phy_poll(efx))
if (efx_siena_mcdi_phy_poll(efx))
efx_siena_link_status_changed(efx);
mutex_unlock(&efx->mac_lock);

Expand Down Expand Up @@ -665,7 +665,7 @@ static void efx_wait_for_bist_end(struct efx_nic *efx)
int 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;
msleep(BIST_WAIT_DELAY_MS);
}
Expand Down Expand Up @@ -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 &&
method != RESET_TYPE_DATAPATH) {
rc = efx_mcdi_port_reconfigure(efx);
rc = efx_siena_mcdi_port_reconfigure(efx);
if (rc && rc != -EPERM)
netif_err(efx, drv, efx->net_dev,
"could not restore PHY settings\n");
Expand Down Expand Up @@ -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
* 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);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sfc/siena/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int efx_ethtool_phys_id(struct net_device *net_dev,
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)
Expand Down
20 changes: 10 additions & 10 deletions drivers/net/ethernet/sfc/siena/ethtool_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ void efx_siena_ethtool_get_drvinfo(struct net_device *net_dev,
struct efx_nic *efx = netdev_priv(net_dev);

strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
efx_mcdi_print_fwver(efx, info->fw_version,
sizeof(info->fw_version));
efx_siena_mcdi_print_fwver(efx, info->fw_version,
sizeof(info->fw_version));
strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
}

Expand Down Expand Up @@ -173,7 +173,7 @@ int efx_siena_ethtool_set_pauseparam(struct net_device *net_dev,
efx_siena_link_set_wanted_fc(efx, wanted_fc);
if (efx->link_advertising[0] != old_adv ||
(efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
rc = efx_mcdi_port_reconfigure(efx);
rc = efx_siena_mcdi_port_reconfigure(efx);
if (rc) {
netif_err(efx, drv, efx->net_dev,
"Unable to advertise requested flow "
Expand Down Expand Up @@ -328,7 +328,7 @@ static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
const char *name;

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)
break;

Expand Down Expand Up @@ -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;

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);

/* Both MACs support pause frames (bidirectional and respond-only) */
Expand Down Expand Up @@ -597,7 +597,7 @@ efx_siena_ethtool_set_link_ksettings(struct net_device *net_dev,
}

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);
return rc;
}
Expand All @@ -609,7 +609,7 @@ int efx_siena_ethtool_get_fecparam(struct net_device *net_dev,
int rc;

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);

return rc;
Expand All @@ -622,7 +622,7 @@ int efx_siena_ethtool_set_fecparam(struct net_device *net_dev,
int rc;

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);

return rc;
Expand Down Expand Up @@ -1320,7 +1320,7 @@ int efx_siena_ethtool_get_module_eeprom(struct net_device *net_dev,
int ret;

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);

return ret;
Expand All @@ -1333,7 +1333,7 @@ int efx_siena_ethtool_get_module_info(struct net_device *net_dev,
int ret;

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);

return ret;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/sfc/siena/farch.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ static int efx_farch_do_flush(struct efx_nic *efx)
* completion). If that fails, fall back to the old scheme.
*/
if (efx_siena_sriov_enabled(efx)) {
rc = efx_mcdi_flush_rxqs(efx);
rc = efx_siena_mcdi_flush_rxqs(efx);
if (!rc)
goto wait;
}
Expand Down Expand Up @@ -1313,7 +1313,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget)
break;
#endif
case FSE_CZ_EV_CODE_MCDI_EV:
efx_mcdi_process_event(channel, &event);
efx_siena_mcdi_process_event(channel, &event);
break;
case FSE_AZ_EV_CODE_GLOBAL_EV:
if (efx->type->handle_global_event &&
Expand Down
Loading

0 comments on commit 4d49e5c

Please sign in to comment.