For siena use efx_siena_ as the function prefix.
This patch covers selftest.h, ptp.h, net_driver.h and ethtool_common.h.
efx_ethtool_fill_self_tests() can become static.
Some functions in ptp.c can also become static.
Rename loopback_mode in net_driver.h.
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mii_ioctl_data *data = if_mii(ifr);
if (cmd == SIOCSHWTSTAMP)
- return efx_ptp_set_ts_config(efx, ifr);
+ return efx_siena_ptp_set_ts_config(efx, ifr);
if (cmd == SIOCGHWTSTAMP)
- return efx_ptp_get_ts_config(efx, ifr);
+ return efx_siena_ptp_get_ts_config(efx, ifr);
/* Convert phy_id from older PRTAD/DEVAD format */
if ((cmd == SIOCGMIIREG || cmd == SIOCSMIIREG) &&
efx_siena_start_all(efx);
if (efx->state == STATE_DISABLED || efx->reset_pending)
netif_device_detach(efx->net_dev);
- efx_selftest_async_start(efx);
+ efx_siena_selftest_async_start(efx);
return 0;
}
STRING_TABLE_LOOKUP(type, efx_reset_type)
/* Loopback mode names (see LOOPBACK_MODE()) */
-const unsigned int efx_loopback_mode_max = LOOPBACK_MAX;
-const char *const efx_loopback_mode_names[] = {
+const unsigned int efx_siena_loopback_mode_max = LOOPBACK_MAX;
+const char *const efx_siena_loopback_mode_names[] = {
[LOOPBACK_NONE] = "NONE",
[LOOPBACK_DATA] = "DATAPATH",
[LOOPBACK_GMAC] = "GMAC",
/* Initialise the channels */
efx_siena_start_channels(efx);
- efx_ptp_start_datapath(efx);
+ efx_siena_ptp_start_datapath(efx);
if (netif_device_present(efx->net_dev))
netif_tx_wake_all_queues(efx->net_dev);
EFX_ASSERT_RESET_SERIALISED(efx);
BUG_ON(efx->port_enabled);
- efx_ptp_stop_datapath(efx);
+ efx_siena_ptp_stop_datapath(efx);
efx_siena_stop_channels(efx);
}
netif_addr_unlock_bh(efx->net_dev);
cancel_delayed_work_sync(&efx->monitor_work);
- efx_selftest_async_cancel(efx);
+ efx_siena_selftest_async_cancel(efx);
cancel_work_sync(&efx->mac_work);
}
#endif
INIT_WORK(&efx->reset_work, efx_reset_work);
INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor);
- efx_selftest_async_init(efx);
+ efx_siena_selftest_async_init(efx);
efx->pci_dev = pci_dev;
efx->msg_enable = debug;
efx->state = STATE_UNINIT;
SOF_TIMESTAMPING_SOFTWARE);
ts_info->phc_index = -1;
- efx_ptp_get_ts_info(efx, ts_info);
+ efx_siena_ptp_get_ts_info(efx, ts_info);
return 0;
}
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_USECS_IRQ |
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
- .get_drvinfo = efx_ethtool_get_drvinfo,
+ .get_drvinfo = efx_siena_ethtool_get_drvinfo,
.get_regs_len = efx_ethtool_get_regs_len,
.get_regs = efx_ethtool_get_regs,
- .get_msglevel = efx_ethtool_get_msglevel,
- .set_msglevel = efx_ethtool_set_msglevel,
+ .get_msglevel = efx_siena_ethtool_get_msglevel,
+ .set_msglevel = efx_siena_ethtool_set_msglevel,
.get_link = ethtool_op_get_link,
.get_coalesce = efx_ethtool_get_coalesce,
.set_coalesce = efx_ethtool_set_coalesce,
.get_ringparam = efx_ethtool_get_ringparam,
.set_ringparam = efx_ethtool_set_ringparam,
- .get_pauseparam = efx_ethtool_get_pauseparam,
- .set_pauseparam = efx_ethtool_set_pauseparam,
- .get_sset_count = efx_ethtool_get_sset_count,
- .self_test = efx_ethtool_self_test,
- .get_strings = efx_ethtool_get_strings,
+ .get_pauseparam = efx_siena_ethtool_get_pauseparam,
+ .set_pauseparam = efx_siena_ethtool_set_pauseparam,
+ .get_sset_count = efx_siena_ethtool_get_sset_count,
+ .self_test = efx_siena_ethtool_self_test,
+ .get_strings = efx_siena_ethtool_get_strings,
.set_phys_id = efx_ethtool_phys_id,
- .get_ethtool_stats = efx_ethtool_get_stats,
+ .get_ethtool_stats = efx_siena_ethtool_get_stats,
.get_wol = efx_ethtool_get_wol,
.set_wol = efx_ethtool_set_wol,
- .reset = efx_ethtool_reset,
- .get_rxnfc = efx_ethtool_get_rxnfc,
- .set_rxnfc = efx_ethtool_set_rxnfc,
- .get_rxfh_indir_size = efx_ethtool_get_rxfh_indir_size,
- .get_rxfh_key_size = efx_ethtool_get_rxfh_key_size,
- .get_rxfh = efx_ethtool_get_rxfh,
- .set_rxfh = efx_ethtool_set_rxfh,
- .get_rxfh_context = efx_ethtool_get_rxfh_context,
- .set_rxfh_context = efx_ethtool_set_rxfh_context,
+ .reset = efx_siena_ethtool_reset,
+ .get_rxnfc = efx_siena_ethtool_get_rxnfc,
+ .set_rxnfc = efx_siena_ethtool_set_rxnfc,
+ .get_rxfh_indir_size = efx_siena_ethtool_get_rxfh_indir_size,
+ .get_rxfh_key_size = efx_siena_ethtool_get_rxfh_key_size,
+ .get_rxfh = efx_siena_ethtool_get_rxfh,
+ .set_rxfh = efx_siena_ethtool_set_rxfh,
+ .get_rxfh_context = efx_siena_ethtool_get_rxfh_context,
+ .set_rxfh_context = efx_siena_ethtool_set_rxfh_context,
.get_ts_info = efx_ethtool_get_ts_info,
- .get_module_info = efx_ethtool_get_module_info,
- .get_module_eeprom = efx_ethtool_get_module_eeprom,
- .get_link_ksettings = efx_ethtool_get_link_ksettings,
- .set_link_ksettings = efx_ethtool_set_link_ksettings,
+ .get_module_info = efx_siena_ethtool_get_module_info,
+ .get_module_eeprom = efx_siena_ethtool_get_module_eeprom,
+ .get_link_ksettings = efx_siena_ethtool_get_link_ksettings,
+ .set_link_ksettings = efx_siena_ethtool_set_link_ksettings,
.get_fec_stats = efx_ethtool_get_fec_stats,
- .get_fecparam = efx_ethtool_get_fecparam,
- .set_fecparam = efx_ethtool_set_fecparam,
+ .get_fecparam = efx_siena_ethtool_get_fecparam,
+ .set_fecparam = efx_siena_ethtool_set_fecparam,
};
#define EFX_ETHTOOL_SW_STAT_COUNT ARRAY_SIZE(efx_sw_stat_desc)
-void efx_ethtool_get_drvinfo(struct net_device *net_dev,
- struct ethtool_drvinfo *info)
+void efx_siena_ethtool_get_drvinfo(struct net_device *net_dev,
+ struct ethtool_drvinfo *info)
{
struct efx_nic *efx = netdev_priv(net_dev);
strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
}
-u32 efx_ethtool_get_msglevel(struct net_device *net_dev)
+u32 efx_siena_ethtool_get_msglevel(struct net_device *net_dev)
{
struct efx_nic *efx = netdev_priv(net_dev);
return efx->msg_enable;
}
-void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
+void efx_siena_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
{
struct efx_nic *efx = netdev_priv(net_dev);
efx->msg_enable = msg_enable;
}
-void efx_ethtool_self_test(struct net_device *net_dev,
- struct ethtool_test *test, u64 *data)
-{
- struct efx_nic *efx = netdev_priv(net_dev);
- struct efx_self_tests *efx_tests;
- bool already_up;
- int rc = -ENOMEM;
-
- efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL);
- if (!efx_tests)
- goto fail;
-
- if (efx->state != STATE_READY) {
- rc = -EBUSY;
- goto out;
- }
-
- netif_info(efx, drv, efx->net_dev, "starting %sline testing\n",
- (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
-
- /* We need rx buffers and interrupts. */
- already_up = (efx->net_dev->flags & IFF_UP);
- if (!already_up) {
- rc = dev_open(efx->net_dev, NULL);
- if (rc) {
- netif_err(efx, drv, efx->net_dev,
- "failed opening device.\n");
- goto out;
- }
- }
-
- rc = efx_selftest(efx, efx_tests, test->flags);
-
- if (!already_up)
- dev_close(efx->net_dev);
-
- netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n",
- rc == 0 ? "passed" : "failed",
- (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
-
-out:
- efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data);
- kfree(efx_tests);
-fail:
- if (rc)
- test->flags |= ETH_TEST_FL_FAILED;
-}
-
-void efx_ethtool_get_pauseparam(struct net_device *net_dev,
- struct ethtool_pauseparam *pause)
+void efx_siena_ethtool_get_pauseparam(struct net_device *net_dev,
+ struct ethtool_pauseparam *pause)
{
struct efx_nic *efx = netdev_priv(net_dev);
pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO);
}
-int efx_ethtool_set_pauseparam(struct net_device *net_dev,
- struct ethtool_pauseparam *pause)
+int efx_siena_ethtool_set_pauseparam(struct net_device *net_dev,
+ struct ethtool_pauseparam *pause)
{
struct efx_nic *efx = netdev_priv(net_dev);
u8 wanted_fc, old_fc;
#define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
#define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->label
#define EFX_LOOPBACK_NAME(_mode, _counter) \
- "loopback.%s." _counter, STRING_TABLE_LOOKUP(_mode, efx_loopback_mode)
+ "loopback.%s." _counter, STRING_TABLE_LOOKUP(_mode, efx_siena_loopback_mode)
/**
* efx_fill_loopback_test - fill in a block of loopback self-test entries
* The reason for merging these three functions is to make sure that
* they can never be inconsistent.
*/
-int efx_ethtool_fill_self_tests(struct efx_nic *efx,
- struct efx_self_tests *tests,
- u8 *strings, u64 *data)
+static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
+ struct efx_self_tests *tests,
+ u8 *strings, u64 *data)
{
struct efx_channel *channel;
unsigned int n = 0, i;
return n;
}
+void efx_siena_ethtool_self_test(struct net_device *net_dev,
+ struct ethtool_test *test, u64 *data)
+{
+ struct efx_nic *efx = netdev_priv(net_dev);
+ struct efx_self_tests *efx_tests;
+ bool already_up;
+ int rc = -ENOMEM;
+
+ efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL);
+ if (!efx_tests)
+ goto fail;
+
+ if (efx->state != STATE_READY) {
+ rc = -EBUSY;
+ goto out;
+ }
+
+ netif_info(efx, drv, efx->net_dev, "starting %sline testing\n",
+ (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
+
+ /* We need rx buffers and interrupts. */
+ already_up = (efx->net_dev->flags & IFF_UP);
+ if (!already_up) {
+ rc = dev_open(efx->net_dev, NULL);
+ if (rc) {
+ netif_err(efx, drv, efx->net_dev,
+ "failed opening device.\n");
+ goto out;
+ }
+ }
+
+ rc = efx_siena_selftest(efx, efx_tests, test->flags);
+
+ if (!already_up)
+ dev_close(efx->net_dev);
+
+ netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n",
+ rc == 0 ? "passed" : "failed",
+ (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
+
+out:
+ efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data);
+ kfree(efx_tests);
+fail:
+ if (rc)
+ test->flags |= ETH_TEST_FL_FAILED;
+}
+
static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings)
{
size_t n_stats = 0;
return n_stats;
}
-int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set)
+int efx_siena_ethtool_get_sset_count(struct net_device *net_dev, int string_set)
{
struct efx_nic *efx = netdev_priv(net_dev);
return efx->type->describe_stats(efx, NULL) +
EFX_ETHTOOL_SW_STAT_COUNT +
efx_describe_per_queue_stats(efx, NULL) +
- efx_ptp_describe_stats(efx, NULL);
+ efx_siena_ptp_describe_stats(efx, NULL);
case ETH_SS_TEST:
return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL);
default:
}
}
-void efx_ethtool_get_strings(struct net_device *net_dev,
- u32 string_set, u8 *strings)
+void efx_siena_ethtool_get_strings(struct net_device *net_dev,
+ u32 string_set, u8 *strings)
{
struct efx_nic *efx = netdev_priv(net_dev);
int i;
strings += EFX_ETHTOOL_SW_STAT_COUNT * ETH_GSTRING_LEN;
strings += (efx_describe_per_queue_stats(efx, strings) *
ETH_GSTRING_LEN);
- efx_ptp_describe_stats(efx, strings);
+ efx_siena_ptp_describe_stats(efx, strings);
break;
case ETH_SS_TEST:
efx_ethtool_fill_self_tests(efx, NULL, strings, NULL);
}
}
-void efx_ethtool_get_stats(struct net_device *net_dev,
- struct ethtool_stats *stats,
- u64 *data)
+void efx_siena_ethtool_get_stats(struct net_device *net_dev,
+ struct ethtool_stats *stats,
+ u64 *data)
{
struct efx_nic *efx = netdev_priv(net_dev);
const struct efx_sw_stat_desc *stat;
}
}
- efx_ptp_update_stats(efx, data);
+ efx_siena_ptp_update_stats(efx, data);
}
/* This must be called with rtnl_lock held. */
-int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
- struct ethtool_link_ksettings *cmd)
+int efx_siena_ethtool_get_link_ksettings(struct net_device *net_dev,
+ struct ethtool_link_ksettings *cmd)
{
struct efx_nic *efx = netdev_priv(net_dev);
struct efx_link_state *link_state = &efx->link_state;
}
/* This must be called with rtnl_lock held. */
-int efx_ethtool_set_link_ksettings(struct net_device *net_dev,
- const struct ethtool_link_ksettings *cmd)
+int
+efx_siena_ethtool_set_link_ksettings(struct net_device *net_dev,
+ const struct ethtool_link_ksettings *cmd)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;
return rc;
}
-int efx_ethtool_get_fecparam(struct net_device *net_dev,
- struct ethtool_fecparam *fecparam)
+int efx_siena_ethtool_get_fecparam(struct net_device *net_dev,
+ struct ethtool_fecparam *fecparam)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;
return rc;
}
-int efx_ethtool_set_fecparam(struct net_device *net_dev,
- struct ethtool_fecparam *fecparam)
+int efx_siena_ethtool_set_fecparam(struct net_device *net_dev,
+ struct ethtool_fecparam *fecparam)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;
return rc;
}
-int efx_ethtool_get_rxnfc(struct net_device *net_dev,
- struct ethtool_rxnfc *info, u32 *rule_locs)
+int efx_siena_ethtool_get_rxnfc(struct net_device *net_dev,
+ struct ethtool_rxnfc *info, u32 *rule_locs)
{
struct efx_nic *efx = netdev_priv(net_dev);
u32 rss_context = 0;
return 0;
}
-int efx_ethtool_set_rxnfc(struct net_device *net_dev,
- struct ethtool_rxnfc *info)
+int efx_siena_ethtool_set_rxnfc(struct net_device *net_dev,
+ struct ethtool_rxnfc *info)
{
struct efx_nic *efx = netdev_priv(net_dev);
}
}
-u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
+u32 efx_siena_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
{
struct efx_nic *efx = netdev_priv(net_dev);
return ARRAY_SIZE(efx->rss_context.rx_indir_table);
}
-u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev)
+u32 efx_siena_ethtool_get_rxfh_key_size(struct net_device *net_dev)
{
struct efx_nic *efx = netdev_priv(net_dev);
return efx->type->rx_hash_key_size;
}
-int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
- u8 *hfunc)
+int efx_siena_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
+ u8 *hfunc)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;
return 0;
}
-int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir,
- const u8 *key, const u8 hfunc)
+int efx_siena_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir,
+ const u8 *key, const u8 hfunc)
{
struct efx_nic *efx = netdev_priv(net_dev);
return efx->type->rx_push_rss_config(efx, true, indir, key);
}
-int efx_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir,
- u8 *key, u8 *hfunc, u32 rss_context)
+int efx_siena_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir,
+ u8 *key, u8 *hfunc, u32 rss_context)
{
struct efx_nic *efx = netdev_priv(net_dev);
struct efx_rss_context *ctx;
return rc;
}
-int efx_ethtool_set_rxfh_context(struct net_device *net_dev,
- const u32 *indir, const u8 *key,
- const u8 hfunc, u32 *rss_context,
- bool delete)
+int efx_siena_ethtool_set_rxfh_context(struct net_device *net_dev,
+ const u32 *indir, const u8 *key,
+ const u8 hfunc, u32 *rss_context,
+ bool delete)
{
struct efx_nic *efx = netdev_priv(net_dev);
struct efx_rss_context *ctx;
return rc;
}
-int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
+int efx_siena_ethtool_reset(struct net_device *net_dev, u32 *flags)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;
return efx_siena_reset(efx, rc);
}
-int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
- struct ethtool_eeprom *ee,
- u8 *data)
+int efx_siena_ethtool_get_module_eeprom(struct net_device *net_dev,
+ struct ethtool_eeprom *ee,
+ u8 *data)
{
struct efx_nic *efx = netdev_priv(net_dev);
int ret;
return ret;
}
-int efx_ethtool_get_module_info(struct net_device *net_dev,
- struct ethtool_modinfo *modinfo)
+int efx_siena_ethtool_get_module_info(struct net_device *net_dev,
+ struct ethtool_modinfo *modinfo)
{
struct efx_nic *efx = netdev_priv(net_dev);
int ret;
#ifndef EFX_ETHTOOL_COMMON_H
#define EFX_ETHTOOL_COMMON_H
-void efx_ethtool_get_drvinfo(struct net_device *net_dev,
- struct ethtool_drvinfo *info);
-u32 efx_ethtool_get_msglevel(struct net_device *net_dev);
-void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable);
-void efx_ethtool_self_test(struct net_device *net_dev,
- struct ethtool_test *test, u64 *data);
-void efx_ethtool_get_pauseparam(struct net_device *net_dev,
- struct ethtool_pauseparam *pause);
-int efx_ethtool_set_pauseparam(struct net_device *net_dev,
- struct ethtool_pauseparam *pause);
-int efx_ethtool_fill_self_tests(struct efx_nic *efx,
- struct efx_self_tests *tests,
- u8 *strings, u64 *data);
-int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set);
-void efx_ethtool_get_strings(struct net_device *net_dev, u32 string_set,
- u8 *strings);
-void efx_ethtool_get_stats(struct net_device *net_dev,
- struct ethtool_stats *stats __attribute__ ((unused)),
- u64 *data);
-int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
- struct ethtool_link_ksettings *out);
-int efx_ethtool_set_link_ksettings(struct net_device *net_dev,
- const struct ethtool_link_ksettings *settings);
-int efx_ethtool_get_fecparam(struct net_device *net_dev,
- struct ethtool_fecparam *fecparam);
-int efx_ethtool_set_fecparam(struct net_device *net_dev,
- struct ethtool_fecparam *fecparam);
-int efx_ethtool_get_rxnfc(struct net_device *net_dev,
- struct ethtool_rxnfc *info, u32 *rule_locs);
-int efx_ethtool_set_rxnfc(struct net_device *net_dev,
- struct ethtool_rxnfc *info);
-u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev);
-u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev);
-int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
- u8 *hfunc);
-int efx_ethtool_set_rxfh(struct net_device *net_dev,
- const u32 *indir, const u8 *key, const u8 hfunc);
-int efx_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir,
- u8 *key, u8 *hfunc, u32 rss_context);
-int efx_ethtool_set_rxfh_context(struct net_device *net_dev,
- const u32 *indir, const u8 *key,
- const u8 hfunc, u32 *rss_context,
- bool delete);
-int efx_ethtool_reset(struct net_device *net_dev, u32 *flags);
-int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
- struct ethtool_eeprom *ee,
- u8 *data);
-int efx_ethtool_get_module_info(struct net_device *net_dev,
- struct ethtool_modinfo *modinfo);
+void efx_siena_ethtool_get_drvinfo(struct net_device *net_dev,
+ struct ethtool_drvinfo *info);
+u32 efx_siena_ethtool_get_msglevel(struct net_device *net_dev);
+void efx_siena_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable);
+void efx_siena_ethtool_self_test(struct net_device *net_dev,
+ struct ethtool_test *test, u64 *data);
+void efx_siena_ethtool_get_pauseparam(struct net_device *net_dev,
+ struct ethtool_pauseparam *pause);
+int efx_siena_ethtool_set_pauseparam(struct net_device *net_dev,
+ struct ethtool_pauseparam *pause);
+int efx_siena_ethtool_get_sset_count(struct net_device *net_dev, int string_set);
+void efx_siena_ethtool_get_strings(struct net_device *net_dev, u32 string_set,
+ u8 *strings);
+void efx_siena_ethtool_get_stats(struct net_device *net_dev,
+ struct ethtool_stats *stats __always_unused,
+ u64 *data);
+int efx_siena_ethtool_get_link_ksettings(struct net_device *net_dev,
+ struct ethtool_link_ksettings *out);
+int efx_siena_ethtool_set_link_ksettings(struct net_device *net_dev,
+ const struct ethtool_link_ksettings *settings);
+int efx_siena_ethtool_get_fecparam(struct net_device *net_dev,
+ struct ethtool_fecparam *fecparam);
+int efx_siena_ethtool_set_fecparam(struct net_device *net_dev,
+ struct ethtool_fecparam *fecparam);
+int efx_siena_ethtool_get_rxnfc(struct net_device *net_dev,
+ struct ethtool_rxnfc *info, u32 *rule_locs);
+int efx_siena_ethtool_set_rxnfc(struct net_device *net_dev,
+ struct ethtool_rxnfc *info);
+u32 efx_siena_ethtool_get_rxfh_indir_size(struct net_device *net_dev);
+u32 efx_siena_ethtool_get_rxfh_key_size(struct net_device *net_dev);
+int efx_siena_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
+ u8 *hfunc);
+int efx_siena_ethtool_set_rxfh(struct net_device *net_dev,
+ const u32 *indir, const u8 *key, const u8 hfunc);
+int efx_siena_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir,
+ u8 *key, u8 *hfunc, u32 rss_context);
+int efx_siena_ethtool_set_rxfh_context(struct net_device *net_dev,
+ const u32 *indir, const u8 *key,
+ const u8 hfunc, u32 *rss_context,
+ bool delete);
+int efx_siena_ethtool_reset(struct net_device *net_dev, u32 *flags);
+int efx_siena_ethtool_get_module_eeprom(struct net_device *net_dev,
+ struct ethtool_eeprom *ee,
+ u8 *data);
+int efx_siena_ethtool_get_module_info(struct net_device *net_dev,
+ struct ethtool_modinfo *modinfo);
#endif
case MCDI_EVENT_CODE_PTP_RX:
case MCDI_EVENT_CODE_PTP_FAULT:
case MCDI_EVENT_CODE_PTP_PPS:
- efx_ptp_event(efx, event);
+ efx_siena_ptp_event(efx, event);
break;
case MCDI_EVENT_CODE_PTP_TIME:
- efx_time_sync_event(channel, event);
+ efx_siena_time_sync_event(channel, event);
break;
case MCDI_EVENT_CODE_TX_FLUSH:
case MCDI_EVENT_CODE_RX_FLUSH:
#define STRING_TABLE_LOOKUP(val, member) \
((val) < member ## _max) ? member ## _names[val] : "(invalid)"
-extern const char *const efx_loopback_mode_names[];
-extern const unsigned int efx_loopback_mode_max;
+extern const char *const efx_siena_loopback_mode_names[];
+extern const unsigned int efx_siena_loopback_mode_max;
#define LOOPBACK_MODE(efx) \
- STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_loopback_mode)
+ STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_siena_loopback_mode)
enum efx_int_mode {
/* Be careful if altering to correct macro below */
static int efx_phc_enable(struct ptp_clock_info *ptp,
struct ptp_clock_request *request, int on);
-bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx)
+bool efx_siena_ptp_use_mac_tx_timestamps(struct efx_nic *efx)
{
return efx_has_cap(efx, TX_MAC_TIMESTAMPING);
}
*/
static bool efx_ptp_want_txqs(struct efx_channel *channel)
{
- return efx_ptp_use_mac_tx_timestamps(channel->efx);
+ return efx_siena_ptp_use_mac_tx_timestamps(channel->efx);
}
#define PTP_SW_STAT(ext_name, field_name) \
[0 ... BITS_TO_LONGS(PTP_STAT_COUNT) - 1] = ~0UL,
};
-size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings)
+size_t efx_siena_ptp_describe_stats(struct efx_nic *efx, u8 *strings)
{
if (!efx->ptp_data)
return 0;
efx_ptp_stat_mask, strings);
}
-size_t efx_ptp_update_stats(struct efx_nic *efx, u64 *stats)
+size_t efx_siena_ptp_update_stats(struct efx_nic *efx, u64 *stats)
{
MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_STATUS_LEN);
MCDI_DECLARE_BUF(outbuf, MC_CMD_PTP_OUT_STATUS_LEN);
return kt;
}
-struct efx_channel *efx_ptp_channel(struct efx_nic *efx)
+struct efx_channel *efx_siena_ptp_channel(struct efx_nic *efx)
{
return efx->ptp_data ? efx->ptp_data->channel : NULL;
}
static u32 last_sync_timestamp_major(struct efx_nic *efx)
{
- struct efx_channel *channel = efx_ptp_channel(efx);
+ struct efx_channel *channel = efx_siena_ptp_channel(efx);
u32 major = 0;
if (channel)
return kt;
}
-ktime_t efx_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue)
+ktime_t efx_siena_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue)
{
struct efx_nic *efx = tx_queue->efx;
struct efx_ptp_data *ptp = efx->ptp_data;
ktime_t kt;
- if (efx_ptp_use_mac_tx_timestamps(efx))
+ if (efx_siena_ptp_use_mac_tx_timestamps(efx))
kt = efx_ptp_mac_nic_to_ktime_correction(efx, ptp,
tx_queue->completed_timestamp_major,
tx_queue->completed_timestamp_minor,
};
/* Initialise PTP state. */
-int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
+static int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
{
struct efx_ptp_data *ptp;
int rc = 0;
goto fail2;
}
- if (efx_ptp_use_mac_tx_timestamps(efx)) {
+ if (efx_siena_ptp_use_mac_tx_timestamps(efx)) {
ptp->xmit_skb = efx_ptp_xmit_skb_queue;
/* Request sync events on this channel. */
channel->sync_events_state = SYNC_EVENTS_QUIESCENT;
return 0;
}
-void efx_ptp_remove(struct efx_nic *efx)
+static void efx_ptp_remove(struct efx_nic *efx)
{
if (!efx->ptp_data)
return;
/* Determine whether this packet should be processed by the PTP module
* or transmitted conventionally.
*/
-bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
+bool efx_siena_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
{
return efx->ptp_data &&
efx->ptp_data->enabled &&
* itself, through an MCDI call. MCDI calls aren't permitted
* in the transmit path so defer the actual transmission to a suitable worker.
*/
-int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
+int efx_siena_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
{
struct efx_ptp_data *ptp = efx->ptp_data;
return NETDEV_TX_OK;
}
-int efx_ptp_get_mode(struct efx_nic *efx)
+int efx_siena_ptp_get_mode(struct efx_nic *efx)
{
return efx->ptp_data->mode;
}
-int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
- unsigned int new_mode)
+int efx_siena_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
+ unsigned int new_mode)
{
if ((enable_wanted != efx->ptp_data->enabled) ||
(enable_wanted && (efx->ptp_data->mode != new_mode))) {
return 0;
}
-void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info)
+void efx_siena_ptp_get_ts_info(struct efx_nic *efx,
+ struct ethtool_ts_info *ts_info)
{
struct efx_ptp_data *ptp = efx->ptp_data;
struct efx_nic *primary = efx->primary;
ts_info->rx_filters = ptp->efx->type->hwtstamp_filters;
}
-int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr)
+int efx_siena_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr)
{
struct hwtstamp_config config;
int rc;
? -EFAULT : 0;
}
-int efx_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr)
+int efx_siena_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr)
{
if (!efx->ptp_data)
return -EOPNOTSUPP;
queue_work(ptp->pps_workwq, &ptp->pps_work);
}
-void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev)
+void efx_siena_ptp_event(struct efx_nic *efx, efx_qword_t *ev)
{
struct efx_ptp_data *ptp = efx->ptp_data;
int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE);
}
}
-void efx_time_sync_event(struct efx_channel *channel, efx_qword_t *ev)
+void efx_siena_time_sync_event(struct efx_channel *channel, efx_qword_t *ev)
{
struct efx_nic *efx = channel->efx;
struct efx_ptp_data *ptp = efx->ptp_data;
#endif
}
-void __efx_rx_skb_attach_timestamp(struct efx_channel *channel,
- struct sk_buff *skb)
+void __efx_siena_rx_skb_attach_timestamp(struct efx_channel *channel,
+ struct sk_buff *skb)
{
struct efx_nic *efx = channel->efx;
struct efx_ptp_data *ptp = efx->ptp_data;
.keep_eventq = false,
};
-void efx_ptp_defer_probe_with_channel(struct efx_nic *efx)
+void efx_siena_ptp_defer_probe_with_channel(struct efx_nic *efx)
{
/* Check whether PTP is implemented on this NIC. The DISABLE
* operation will succeed if and only if it is implemented.
&efx_ptp_channel_type;
}
-void efx_ptp_start_datapath(struct efx_nic *efx)
+void efx_siena_ptp_start_datapath(struct efx_nic *efx)
{
if (efx_ptp_restart(efx))
netif_err(efx, drv, efx->net_dev, "Failed to restart PTP.\n");
efx->type->ptp_set_ts_sync_events(efx, true, true);
}
-void efx_ptp_stop_datapath(struct efx_nic *efx)
+void efx_siena_ptp_stop_datapath(struct efx_nic *efx)
{
/* temporarily disable timestamping */
if (efx->type->ptp_set_ts_sync_events)
#include "net_driver.h"
struct ethtool_ts_info;
-int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel);
-void efx_ptp_defer_probe_with_channel(struct efx_nic *efx);
-struct efx_channel *efx_ptp_channel(struct efx_nic *efx);
-void efx_ptp_remove(struct efx_nic *efx);
-int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr);
-int efx_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr);
-void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info);
-bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
-int efx_ptp_get_mode(struct efx_nic *efx);
-int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
- unsigned int new_mode);
-int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
-void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
-size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings);
-size_t efx_ptp_update_stats(struct efx_nic *efx, u64 *stats);
-void efx_time_sync_event(struct efx_channel *channel, efx_qword_t *ev);
-void __efx_rx_skb_attach_timestamp(struct efx_channel *channel,
- struct sk_buff *skb);
+void efx_siena_ptp_defer_probe_with_channel(struct efx_nic *efx);
+struct efx_channel *efx_siena_ptp_channel(struct efx_nic *efx);
+int efx_siena_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr);
+int efx_siena_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr);
+void efx_siena_ptp_get_ts_info(struct efx_nic *efx,
+ struct ethtool_ts_info *ts_info);
+bool efx_siena_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
+int efx_siena_ptp_get_mode(struct efx_nic *efx);
+int efx_siena_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
+ unsigned int new_mode);
+int efx_siena_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
+void efx_siena_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
+size_t efx_siena_ptp_describe_stats(struct efx_nic *efx, u8 *strings);
+size_t efx_siena_ptp_update_stats(struct efx_nic *efx, u64 *stats);
+void efx_siena_time_sync_event(struct efx_channel *channel, efx_qword_t *ev);
+void __efx_siena_rx_skb_attach_timestamp(struct efx_channel *channel,
+ struct sk_buff *skb);
static inline void efx_rx_skb_attach_timestamp(struct efx_channel *channel,
struct sk_buff *skb)
{
if (channel->sync_events_state == SYNC_EVENTS_VALID)
- __efx_rx_skb_attach_timestamp(channel, skb);
+ __efx_siena_rx_skb_attach_timestamp(channel, skb);
}
-void efx_ptp_start_datapath(struct efx_nic *efx);
-void efx_ptp_stop_datapath(struct efx_nic *efx);
-bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx);
-ktime_t efx_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue);
+
+void efx_siena_ptp_start_datapath(struct efx_nic *efx);
+void efx_siena_ptp_stop_datapath(struct efx_nic *efx);
+bool efx_siena_ptp_use_mac_tx_timestamps(struct efx_nic *efx);
+ktime_t efx_siena_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue);
#endif /* EFX_PTP_H */
if (unlikely(efx->loopback_selftest)) {
struct efx_rx_queue *rx_queue;
- efx_loopback_rx_packet(efx, eh, rx_buf->len);
+ efx_siena_loopback_rx_packet(efx, eh, rx_buf->len);
rx_queue = efx_channel_get_rx_queue(channel);
efx_siena_free_rx_buffers(rx_queue, rx_buf,
channel->rx_pkt_n_frags);
/**
* struct efx_loopback_state - persistent state during a loopback selftest
- * @flush: Drop all packets in efx_loopback_rx_packet
+ * @flush: Drop all packets in efx_siena_loopback_rx_packet
* @packet_count: Number of packets being used in this test
* @skbs: An array of skbs transmitted
* @offload_csum: Checksums are being offloaded
/* Loopback test RX callback
* This is called for each received packet during loopback testing.
*/
-void efx_loopback_rx_packet(struct efx_nic *efx,
- const char *buf_ptr, int pkt_len)
+void efx_siena_loopback_rx_packet(struct efx_nic *efx,
+ const char *buf_ptr, int pkt_len)
{
struct efx_loopback_state *state = efx->loopback_selftest;
struct efx_loopback_payload *received;
atomic_inc(&state->rx_bad);
}
-/* Initialise an efx_selftest_state for a new iteration */
+/* Initialise an efx_siena_selftest_state for a new iteration */
static void efx_iterate_state(struct efx_nic *efx)
{
struct efx_loopback_state *state = efx->loopback_selftest;
*
*************************************************************************/
-int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
- unsigned flags)
+int efx_siena_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
+ unsigned int flags)
{
enum efx_loopback_mode loopback_mode = efx->loopback_mode;
int phy_mode = efx->phy_mode;
int rc_test = 0, rc_reset, rc;
- efx_selftest_async_cancel(efx);
+ efx_siena_selftest_async_cancel(efx);
/* Online (i.e. non-disruptive) testing
* This checks interrupt generation, event delivery and PHY presence. */
return rc_test;
}
-void efx_selftest_async_start(struct efx_nic *efx)
+void efx_siena_selftest_async_start(struct efx_nic *efx)
{
struct efx_channel *channel;
schedule_delayed_work(&efx->selftest_work, IRQ_TIMEOUT);
}
-void efx_selftest_async_cancel(struct efx_nic *efx)
+void efx_siena_selftest_async_cancel(struct efx_nic *efx)
{
cancel_delayed_work_sync(&efx->selftest_work);
}
-static void efx_selftest_async_work(struct work_struct *data)
+static void efx_siena_selftest_async_work(struct work_struct *data)
{
struct efx_nic *efx = container_of(data, struct efx_nic,
selftest_work.work);
}
}
-void efx_selftest_async_init(struct efx_nic *efx)
+void efx_siena_selftest_async_init(struct efx_nic *efx)
{
- INIT_DELAYED_WORK(&efx->selftest_work, efx_selftest_async_work);
+ INIT_DELAYED_WORK(&efx->selftest_work, efx_siena_selftest_async_work);
}
struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
};
-void efx_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
- int pkt_len);
-int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
- unsigned flags);
-void efx_selftest_async_init(struct efx_nic *efx);
-void efx_selftest_async_start(struct efx_nic *efx);
-void efx_selftest_async_cancel(struct efx_nic *efx);
+void efx_siena_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
+ int pkt_len);
+int efx_siena_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
+ unsigned int flags);
+void efx_siena_selftest_async_init(struct efx_nic *efx);
+void efx_siena_selftest_async_start(struct efx_nic *efx);
+void efx_siena_selftest_async_cancel(struct efx_nic *efx);
#endif /* EFX_SELFTEST_H */
switch (init->rx_filter) {
case HWTSTAMP_FILTER_NONE:
/* if TX timestamping is still requested then leave PTP on */
- return efx_ptp_change_mode(efx,
- init->tx_type != HWTSTAMP_TX_OFF,
- efx_ptp_get_mode(efx));
+ return efx_siena_ptp_change_mode(efx,
+ init->tx_type != HWTSTAMP_TX_OFF,
+ efx_siena_ptp_get_mode(efx));
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
init->rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
- return efx_ptp_change_mode(efx, true, MC_CMD_PTP_MODE_V1);
+ return efx_siena_ptp_change_mode(efx, true, MC_CMD_PTP_MODE_V1);
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
init->rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
- rc = efx_ptp_change_mode(efx, true,
- MC_CMD_PTP_MODE_V2_ENHANCED);
+ rc = efx_siena_ptp_change_mode(efx, true,
+ MC_CMD_PTP_MODE_V2_ENHANCED);
/* bug 33070 - old versions of the firmware do not support the
* improved UUID filtering option. Similarly old versions of the
* application do not expect it to be enabled. If the firmware
* does not accept the enhanced mode, fall back to the standard
* PTP v2 UUID filtering. */
if (rc != 0)
- rc = efx_ptp_change_mode(efx, true, MC_CMD_PTP_MODE_V2);
+ rc = efx_siena_ptp_change_mode(efx, true,
+ MC_CMD_PTP_MODE_V2);
return rc;
default:
return -ERANGE;
#ifdef CONFIG_SFC_SRIOV
efx_siena_sriov_probe(efx);
#endif
- efx_ptp_defer_probe_with_channel(efx);
+ efx_siena_ptp_defer_probe_with_channel(efx);
return 0;
/* PTP "event" packet */
if (unlikely(efx_xmit_with_hwtstamp(skb)) &&
- ((efx_ptp_use_mac_tx_timestamps(efx) && efx->ptp_data) ||
- unlikely(efx_ptp_is_ptp_tx(efx, skb)))) {
+ ((efx_siena_ptp_use_mac_tx_timestamps(efx) && efx->ptp_data) ||
+ unlikely(efx_siena_ptp_is_ptp_tx(efx, skb)))) {
/* There may be existing transmits on the channel that are
* waiting for this packet to trigger the doorbell write.
* We need to send the packets at this point.
*/
efx_tx_send_pending(efx_get_tx_channel(efx, index));
- return efx_ptp_tx(efx, skb);
+ return efx_siena_ptp_tx(efx, skb);
}
tx_queue = efx_get_tx_queue(efx, index, type);
tx_queue->old_read_count = 0;
tx_queue->empty_read_count = 0 | EFX_EMPTY_COUNT_VALID;
tx_queue->xmit_pending = false;
- tx_queue->timestamping = (efx_ptp_use_mac_tx_timestamps(efx) &&
- tx_queue->channel == efx_ptp_channel(efx));
+ tx_queue->timestamping = (efx_siena_ptp_use_mac_tx_timestamps(efx) &&
+ tx_queue->channel == efx_siena_ptp_channel(efx));
tx_queue->completed_timestamp_major = 0;
tx_queue->completed_timestamp_minor = 0;
struct skb_shared_hwtstamps hwtstamp;
hwtstamp.hwtstamp =
- efx_ptp_nic_to_kernel_time(tx_queue);
+ efx_siena_ptp_nic_to_kernel_time(tx_queue);
skb_tstamp_tx(skb, &hwtstamp);
tx_queue->completed_timestamp_major = 0;