Commit 95e96f77 authored by Martin Habets's avatar Martin Habets Committed by Jakub Kicinski

sfc/siena: Rename peripheral functions to avoid conflicts with sfc

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: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 7f9e4b2a
...@@ -494,9 +494,9 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) ...@@ -494,9 +494,9 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
struct mii_ioctl_data *data = if_mii(ifr); struct mii_ioctl_data *data = if_mii(ifr);
if (cmd == SIOCSHWTSTAMP) if (cmd == SIOCSHWTSTAMP)
return efx_ptp_set_ts_config(efx, ifr); return efx_siena_ptp_set_ts_config(efx, ifr);
if (cmd == SIOCGHWTSTAMP) 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 */ /* Convert phy_id from older PRTAD/DEVAD format */
if ((cmd == SIOCGMIIREG || cmd == SIOCSMIIREG) && if ((cmd == SIOCGMIIREG || cmd == SIOCSMIIREG) &&
...@@ -536,7 +536,7 @@ static int efx_net_open(struct net_device *net_dev) ...@@ -536,7 +536,7 @@ static int efx_net_open(struct net_device *net_dev)
efx_siena_start_all(efx); efx_siena_start_all(efx);
if (efx->state == STATE_DISABLED || efx->reset_pending) if (efx->state == STATE_DISABLED || efx->reset_pending)
netif_device_detach(efx->net_dev); netif_device_detach(efx->net_dev);
efx_selftest_async_start(efx); efx_siena_selftest_async_start(efx);
return 0; return 0;
} }
......
...@@ -73,8 +73,8 @@ static const char *const efx_reset_type_names[] = { ...@@ -73,8 +73,8 @@ static const char *const efx_reset_type_names[] = {
STRING_TABLE_LOOKUP(type, efx_reset_type) STRING_TABLE_LOOKUP(type, efx_reset_type)
/* Loopback mode names (see LOOPBACK_MODE()) */ /* Loopback mode names (see LOOPBACK_MODE()) */
const unsigned int efx_loopback_mode_max = LOOPBACK_MAX; const unsigned int efx_siena_loopback_mode_max = LOOPBACK_MAX;
const char *const efx_loopback_mode_names[] = { const char *const efx_siena_loopback_mode_names[] = {
[LOOPBACK_NONE] = "NONE", [LOOPBACK_NONE] = "NONE",
[LOOPBACK_DATA] = "DATAPATH", [LOOPBACK_DATA] = "DATAPATH",
[LOOPBACK_GMAC] = "GMAC", [LOOPBACK_GMAC] = "GMAC",
...@@ -434,7 +434,7 @@ static void efx_start_datapath(struct efx_nic *efx) ...@@ -434,7 +434,7 @@ static void efx_start_datapath(struct efx_nic *efx)
/* Initialise the channels */ /* Initialise the channels */
efx_siena_start_channels(efx); efx_siena_start_channels(efx);
efx_ptp_start_datapath(efx); efx_siena_ptp_start_datapath(efx);
if (netif_device_present(efx->net_dev)) if (netif_device_present(efx->net_dev))
netif_tx_wake_all_queues(efx->net_dev); netif_tx_wake_all_queues(efx->net_dev);
...@@ -445,7 +445,7 @@ static void efx_stop_datapath(struct efx_nic *efx) ...@@ -445,7 +445,7 @@ static void efx_stop_datapath(struct efx_nic *efx)
EFX_ASSERT_RESET_SERIALISED(efx); EFX_ASSERT_RESET_SERIALISED(efx);
BUG_ON(efx->port_enabled); BUG_ON(efx->port_enabled);
efx_ptp_stop_datapath(efx); efx_siena_ptp_stop_datapath(efx);
efx_siena_stop_channels(efx); efx_siena_stop_channels(efx);
} }
...@@ -514,7 +514,7 @@ static void efx_stop_port(struct efx_nic *efx) ...@@ -514,7 +514,7 @@ static void efx_stop_port(struct efx_nic *efx)
netif_addr_unlock_bh(efx->net_dev); netif_addr_unlock_bh(efx->net_dev);
cancel_delayed_work_sync(&efx->monitor_work); cancel_delayed_work_sync(&efx->monitor_work);
efx_selftest_async_cancel(efx); efx_siena_selftest_async_cancel(efx);
cancel_work_sync(&efx->mac_work); cancel_work_sync(&efx->mac_work);
} }
...@@ -994,7 +994,7 @@ int efx_siena_init_struct(struct efx_nic *efx, ...@@ -994,7 +994,7 @@ int efx_siena_init_struct(struct efx_nic *efx,
#endif #endif
INIT_WORK(&efx->reset_work, efx_reset_work); INIT_WORK(&efx->reset_work, efx_reset_work);
INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor); 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->pci_dev = pci_dev;
efx->msg_enable = debug; efx->msg_enable = debug;
efx->state = STATE_UNINIT; efx->state = STATE_UNINIT;
......
...@@ -235,7 +235,7 @@ static int efx_ethtool_get_ts_info(struct net_device *net_dev, ...@@ -235,7 +235,7 @@ static int efx_ethtool_get_ts_info(struct net_device *net_dev,
SOF_TIMESTAMPING_SOFTWARE); SOF_TIMESTAMPING_SOFTWARE);
ts_info->phc_index = -1; ts_info->phc_index = -1;
efx_ptp_get_ts_info(efx, ts_info); efx_siena_ptp_get_ts_info(efx, ts_info);
return 0; return 0;
} }
...@@ -243,40 +243,40 @@ const struct ethtool_ops efx_siena_ethtool_ops = { ...@@ -243,40 +243,40 @@ const struct ethtool_ops efx_siena_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS | .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_USECS_IRQ | ETHTOOL_COALESCE_USECS_IRQ |
ETHTOOL_COALESCE_USE_ADAPTIVE_RX, 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_len = efx_ethtool_get_regs_len,
.get_regs = efx_ethtool_get_regs, .get_regs = efx_ethtool_get_regs,
.get_msglevel = efx_ethtool_get_msglevel, .get_msglevel = efx_siena_ethtool_get_msglevel,
.set_msglevel = efx_ethtool_set_msglevel, .set_msglevel = efx_siena_ethtool_set_msglevel,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_coalesce = efx_ethtool_get_coalesce, .get_coalesce = efx_ethtool_get_coalesce,
.set_coalesce = efx_ethtool_set_coalesce, .set_coalesce = efx_ethtool_set_coalesce,
.get_ringparam = efx_ethtool_get_ringparam, .get_ringparam = efx_ethtool_get_ringparam,
.set_ringparam = efx_ethtool_set_ringparam, .set_ringparam = efx_ethtool_set_ringparam,
.get_pauseparam = efx_ethtool_get_pauseparam, .get_pauseparam = efx_siena_ethtool_get_pauseparam,
.set_pauseparam = efx_ethtool_set_pauseparam, .set_pauseparam = efx_siena_ethtool_set_pauseparam,
.get_sset_count = efx_ethtool_get_sset_count, .get_sset_count = efx_siena_ethtool_get_sset_count,
.self_test = efx_ethtool_self_test, .self_test = efx_siena_ethtool_self_test,
.get_strings = efx_ethtool_get_strings, .get_strings = efx_siena_ethtool_get_strings,
.set_phys_id = efx_ethtool_phys_id, .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, .get_wol = efx_ethtool_get_wol,
.set_wol = efx_ethtool_set_wol, .set_wol = efx_ethtool_set_wol,
.reset = efx_ethtool_reset, .reset = efx_siena_ethtool_reset,
.get_rxnfc = efx_ethtool_get_rxnfc, .get_rxnfc = efx_siena_ethtool_get_rxnfc,
.set_rxnfc = efx_ethtool_set_rxnfc, .set_rxnfc = efx_siena_ethtool_set_rxnfc,
.get_rxfh_indir_size = efx_ethtool_get_rxfh_indir_size, .get_rxfh_indir_size = efx_siena_ethtool_get_rxfh_indir_size,
.get_rxfh_key_size = efx_ethtool_get_rxfh_key_size, .get_rxfh_key_size = efx_siena_ethtool_get_rxfh_key_size,
.get_rxfh = efx_ethtool_get_rxfh, .get_rxfh = efx_siena_ethtool_get_rxfh,
.set_rxfh = efx_ethtool_set_rxfh, .set_rxfh = efx_siena_ethtool_set_rxfh,
.get_rxfh_context = efx_ethtool_get_rxfh_context, .get_rxfh_context = efx_siena_ethtool_get_rxfh_context,
.set_rxfh_context = efx_ethtool_set_rxfh_context, .set_rxfh_context = efx_siena_ethtool_set_rxfh_context,
.get_ts_info = efx_ethtool_get_ts_info, .get_ts_info = efx_ethtool_get_ts_info,
.get_module_info = efx_ethtool_get_module_info, .get_module_info = efx_siena_ethtool_get_module_info,
.get_module_eeprom = efx_ethtool_get_module_eeprom, .get_module_eeprom = efx_siena_ethtool_get_module_eeprom,
.get_link_ksettings = efx_ethtool_get_link_ksettings, .get_link_ksettings = efx_siena_ethtool_get_link_ksettings,
.set_link_ksettings = efx_ethtool_set_link_ksettings, .set_link_ksettings = efx_siena_ethtool_set_link_ksettings,
.get_fec_stats = efx_ethtool_get_fec_stats, .get_fec_stats = efx_ethtool_get_fec_stats,
.get_fecparam = efx_ethtool_get_fecparam, .get_fecparam = efx_siena_ethtool_get_fecparam,
.set_fecparam = efx_ethtool_set_fecparam, .set_fecparam = efx_siena_ethtool_set_fecparam,
}; };
...@@ -11,53 +11,50 @@ ...@@ -11,53 +11,50 @@
#ifndef EFX_ETHTOOL_COMMON_H #ifndef EFX_ETHTOOL_COMMON_H
#define EFX_ETHTOOL_COMMON_H #define EFX_ETHTOOL_COMMON_H
void efx_ethtool_get_drvinfo(struct net_device *net_dev, void efx_siena_ethtool_get_drvinfo(struct net_device *net_dev,
struct ethtool_drvinfo *info); struct ethtool_drvinfo *info);
u32 efx_ethtool_get_msglevel(struct net_device *net_dev); u32 efx_siena_ethtool_get_msglevel(struct net_device *net_dev);
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);
void efx_ethtool_self_test(struct net_device *net_dev, void efx_siena_ethtool_self_test(struct net_device *net_dev,
struct ethtool_test *test, u64 *data); struct ethtool_test *test, u64 *data);
void efx_ethtool_get_pauseparam(struct net_device *net_dev, void efx_siena_ethtool_get_pauseparam(struct net_device *net_dev,
struct ethtool_pauseparam *pause); struct ethtool_pauseparam *pause);
int efx_ethtool_set_pauseparam(struct net_device *net_dev, int efx_siena_ethtool_set_pauseparam(struct net_device *net_dev,
struct ethtool_pauseparam *pause); struct ethtool_pauseparam *pause);
int efx_ethtool_fill_self_tests(struct efx_nic *efx, int efx_siena_ethtool_get_sset_count(struct net_device *net_dev, int string_set);
struct efx_self_tests *tests, void efx_siena_ethtool_get_strings(struct net_device *net_dev, u32 string_set,
u8 *strings, u64 *data); u8 *strings);
int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set); void efx_siena_ethtool_get_stats(struct net_device *net_dev,
void efx_ethtool_get_strings(struct net_device *net_dev, u32 string_set, struct ethtool_stats *stats __always_unused,
u8 *strings); u64 *data);
void efx_ethtool_get_stats(struct net_device *net_dev, int efx_siena_ethtool_get_link_ksettings(struct net_device *net_dev,
struct ethtool_stats *stats __attribute__ ((unused)), struct ethtool_link_ksettings *out);
u64 *data); int efx_siena_ethtool_set_link_ksettings(struct net_device *net_dev,
int efx_ethtool_get_link_ksettings(struct net_device *net_dev, const struct ethtool_link_ksettings *settings);
struct ethtool_link_ksettings *out); int efx_siena_ethtool_get_fecparam(struct net_device *net_dev,
int efx_ethtool_set_link_ksettings(struct net_device *net_dev, struct ethtool_fecparam *fecparam);
const struct ethtool_link_ksettings *settings); int efx_siena_ethtool_set_fecparam(struct net_device *net_dev,
int efx_ethtool_get_fecparam(struct net_device *net_dev, struct ethtool_fecparam *fecparam);
struct ethtool_fecparam *fecparam); int efx_siena_ethtool_get_rxnfc(struct net_device *net_dev,
int efx_ethtool_set_fecparam(struct net_device *net_dev, struct ethtool_rxnfc *info, u32 *rule_locs);
struct ethtool_fecparam *fecparam); int efx_siena_ethtool_set_rxnfc(struct net_device *net_dev,
int efx_ethtool_get_rxnfc(struct net_device *net_dev, struct ethtool_rxnfc *info);
struct ethtool_rxnfc *info, u32 *rule_locs); u32 efx_siena_ethtool_get_rxfh_indir_size(struct net_device *net_dev);
int efx_ethtool_set_rxnfc(struct net_device *net_dev, u32 efx_siena_ethtool_get_rxfh_key_size(struct net_device *net_dev);
struct ethtool_rxnfc *info); int efx_siena_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev); u8 *hfunc);
u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev); int efx_siena_ethtool_set_rxfh(struct net_device *net_dev,
int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key, const u32 *indir, const u8 *key, const u8 hfunc);
u8 *hfunc); int efx_siena_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir,
int efx_ethtool_set_rxfh(struct net_device *net_dev, u8 *key, u8 *hfunc, u32 rss_context);
const u32 *indir, const u8 *key, const u8 hfunc); int efx_siena_ethtool_set_rxfh_context(struct net_device *net_dev,
int efx_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir, const u32 *indir, const u8 *key,
u8 *key, u8 *hfunc, u32 rss_context); const u8 hfunc, u32 *rss_context,
int efx_ethtool_set_rxfh_context(struct net_device *net_dev, bool delete);
const u32 *indir, const u8 *key, int efx_siena_ethtool_reset(struct net_device *net_dev, u32 *flags);
const u8 hfunc, u32 *rss_context, int efx_siena_ethtool_get_module_eeprom(struct net_device *net_dev,
bool delete); struct ethtool_eeprom *ee,
int efx_ethtool_reset(struct net_device *net_dev, u32 *flags); u8 *data);
int efx_ethtool_get_module_eeprom(struct net_device *net_dev, int efx_siena_ethtool_get_module_info(struct net_device *net_dev,
struct ethtool_eeprom *ee, struct ethtool_modinfo *modinfo);
u8 *data);
int efx_ethtool_get_module_info(struct net_device *net_dev,
struct ethtool_modinfo *modinfo);
#endif #endif
...@@ -1363,10 +1363,10 @@ void efx_mcdi_process_event(struct efx_channel *channel, ...@@ -1363,10 +1363,10 @@ void efx_mcdi_process_event(struct efx_channel *channel,
case MCDI_EVENT_CODE_PTP_RX: case MCDI_EVENT_CODE_PTP_RX:
case MCDI_EVENT_CODE_PTP_FAULT: case MCDI_EVENT_CODE_PTP_FAULT:
case MCDI_EVENT_CODE_PTP_PPS: case MCDI_EVENT_CODE_PTP_PPS:
efx_ptp_event(efx, event); efx_siena_ptp_event(efx, event);
break; break;
case MCDI_EVENT_CODE_PTP_TIME: case MCDI_EVENT_CODE_PTP_TIME:
efx_time_sync_event(channel, event); efx_siena_time_sync_event(channel, event);
break; break;
case MCDI_EVENT_CODE_TX_FLUSH: case MCDI_EVENT_CODE_TX_FLUSH:
case MCDI_EVENT_CODE_RX_FLUSH: case MCDI_EVENT_CODE_RX_FLUSH:
......
...@@ -606,10 +606,10 @@ enum efx_led_mode { ...@@ -606,10 +606,10 @@ enum efx_led_mode {
#define STRING_TABLE_LOOKUP(val, member) \ #define STRING_TABLE_LOOKUP(val, member) \
((val) < member ## _max) ? member ## _names[val] : "(invalid)" ((val) < member ## _max) ? member ## _names[val] : "(invalid)"
extern const char *const efx_loopback_mode_names[]; extern const char *const efx_siena_loopback_mode_names[];
extern const unsigned int efx_loopback_mode_max; extern const unsigned int efx_siena_loopback_mode_max;
#define LOOPBACK_MODE(efx) \ #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 { enum efx_int_mode {
/* Be careful if altering to correct macro below */ /* Be careful if altering to correct macro below */
......
...@@ -355,7 +355,7 @@ static int efx_phc_settime(struct ptp_clock_info *ptp, ...@@ -355,7 +355,7 @@ static int efx_phc_settime(struct ptp_clock_info *ptp,
static int efx_phc_enable(struct ptp_clock_info *ptp, static int efx_phc_enable(struct ptp_clock_info *ptp,
struct ptp_clock_request *request, int on); 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); return efx_has_cap(efx, TX_MAC_TIMESTAMPING);
} }
...@@ -365,7 +365,7 @@ bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx) ...@@ -365,7 +365,7 @@ bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx)
*/ */
static bool efx_ptp_want_txqs(struct efx_channel *channel) 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) \ #define PTP_SW_STAT(ext_name, field_name) \
...@@ -393,7 +393,7 @@ static const unsigned long efx_ptp_stat_mask[] = { ...@@ -393,7 +393,7 @@ static const unsigned long efx_ptp_stat_mask[] = {
[0 ... BITS_TO_LONGS(PTP_STAT_COUNT) - 1] = ~0UL, [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) if (!efx->ptp_data)
return 0; return 0;
...@@ -402,7 +402,7 @@ size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings) ...@@ -402,7 +402,7 @@ size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings)
efx_ptp_stat_mask, strings); 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(inbuf, MC_CMD_PTP_IN_STATUS_LEN);
MCDI_DECLARE_BUF(outbuf, MC_CMD_PTP_OUT_STATUS_LEN); MCDI_DECLARE_BUF(outbuf, MC_CMD_PTP_OUT_STATUS_LEN);
...@@ -536,14 +536,14 @@ static ktime_t efx_ptp_s_qns_to_ktime_correction(u32 nic_major, u32 nic_minor, ...@@ -536,14 +536,14 @@ static ktime_t efx_ptp_s_qns_to_ktime_correction(u32 nic_major, u32 nic_minor,
return kt; 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; return efx->ptp_data ? efx->ptp_data->channel : NULL;
} }
static u32 last_sync_timestamp_major(struct efx_nic *efx) 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; u32 major = 0;
if (channel) if (channel)
...@@ -606,13 +606,13 @@ efx_ptp_mac_nic_to_ktime_correction(struct efx_nic *efx, ...@@ -606,13 +606,13 @@ efx_ptp_mac_nic_to_ktime_correction(struct efx_nic *efx,
return kt; 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_nic *efx = tx_queue->efx;
struct efx_ptp_data *ptp = efx->ptp_data; struct efx_ptp_data *ptp = efx->ptp_data;
ktime_t kt; 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, kt = efx_ptp_mac_nic_to_ktime_correction(efx, ptp,
tx_queue->completed_timestamp_major, tx_queue->completed_timestamp_major,
tx_queue->completed_timestamp_minor, tx_queue->completed_timestamp_minor,
...@@ -1437,7 +1437,7 @@ static const struct ptp_clock_info efx_phc_clock_info = { ...@@ -1437,7 +1437,7 @@ static const struct ptp_clock_info efx_phc_clock_info = {
}; };
/* Initialise PTP state. */ /* 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; struct efx_ptp_data *ptp;
int rc = 0; int rc = 0;
...@@ -1464,7 +1464,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel) ...@@ -1464,7 +1464,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
goto fail2; 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; ptp->xmit_skb = efx_ptp_xmit_skb_queue;
/* Request sync events on this channel. */ /* Request sync events on this channel. */
channel->sync_events_state = SYNC_EVENTS_QUIESCENT; channel->sync_events_state = SYNC_EVENTS_QUIESCENT;
...@@ -1553,7 +1553,7 @@ static int efx_ptp_probe_channel(struct efx_channel *channel) ...@@ -1553,7 +1553,7 @@ static int efx_ptp_probe_channel(struct efx_channel *channel)
return 0; return 0;
} }
void efx_ptp_remove(struct efx_nic *efx) static void efx_ptp_remove(struct efx_nic *efx)
{ {
if (!efx->ptp_data) if (!efx->ptp_data)
return; return;
...@@ -1593,7 +1593,7 @@ static void efx_ptp_get_channel_name(struct efx_channel *channel, ...@@ -1593,7 +1593,7 @@ static void efx_ptp_get_channel_name(struct efx_channel *channel,
/* Determine whether this packet should be processed by the PTP module /* Determine whether this packet should be processed by the PTP module
* or transmitted conventionally. * 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 && return efx->ptp_data &&
efx->ptp_data->enabled && efx->ptp_data->enabled &&
...@@ -1699,7 +1699,7 @@ static bool efx_ptp_rx(struct efx_channel *channel, struct sk_buff *skb) ...@@ -1699,7 +1699,7 @@ static bool efx_ptp_rx(struct efx_channel *channel, struct sk_buff *skb)
* itself, through an MCDI call. MCDI calls aren't permitted * itself, through an MCDI call. MCDI calls aren't permitted
* in the transmit path so defer the actual transmission to a suitable worker. * 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; struct efx_ptp_data *ptp = efx->ptp_data;
...@@ -1713,13 +1713,13 @@ int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb) ...@@ -1713,13 +1713,13 @@ int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
return NETDEV_TX_OK; 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; return efx->ptp_data->mode;
} }
int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted, int efx_siena_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
unsigned int new_mode) unsigned int new_mode)
{ {
if ((enable_wanted != efx->ptp_data->enabled) || if ((enable_wanted != efx->ptp_data->enabled) ||
(enable_wanted && (efx->ptp_data->mode != new_mode))) { (enable_wanted && (efx->ptp_data->mode != new_mode))) {
...@@ -1777,7 +1777,8 @@ static int efx_ptp_ts_init(struct efx_nic *efx, struct hwtstamp_config *init) ...@@ -1777,7 +1777,8 @@ static int efx_ptp_ts_init(struct efx_nic *efx, struct hwtstamp_config *init)
return 0; 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_ptp_data *ptp = efx->ptp_data;
struct efx_nic *primary = efx->primary; struct efx_nic *primary = efx->primary;
...@@ -1797,7 +1798,7 @@ void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info) ...@@ -1797,7 +1798,7 @@ void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info)
ts_info->rx_filters = ptp->efx->type->hwtstamp_filters; 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; struct hwtstamp_config config;
int rc; int rc;
...@@ -1817,7 +1818,7 @@ int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr) ...@@ -1817,7 +1818,7 @@ int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr)
? -EFAULT : 0; ? -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) if (!efx->ptp_data)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -1898,7 +1899,7 @@ static void ptp_event_pps(struct efx_nic *efx, struct efx_ptp_data *ptp) ...@@ -1898,7 +1899,7 @@ static void ptp_event_pps(struct efx_nic *efx, struct efx_ptp_data *ptp)
queue_work(ptp->pps_workwq, &ptp->pps_work); 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; struct efx_ptp_data *ptp = efx->ptp_data;
int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE); int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE);
...@@ -1949,7 +1950,7 @@ void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev) ...@@ -1949,7 +1950,7 @@ void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev)
} }
} }
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_nic *efx = channel->efx;
struct efx_ptp_data *ptp = efx->ptp_data; struct efx_ptp_data *ptp = efx->ptp_data;
...@@ -1985,8 +1986,8 @@ static inline u32 efx_rx_buf_timestamp_minor(struct efx_nic *efx, const u8 *eh) ...@@ -1985,8 +1986,8 @@ static inline u32 efx_rx_buf_timestamp_minor(struct efx_nic *efx, const u8 *eh)
#endif #endif
} }
void __efx_rx_skb_attach_timestamp(struct efx_channel *channel, void __efx_siena_rx_skb_attach_timestamp(struct efx_channel *channel,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct efx_nic *efx = channel->efx; struct efx_nic *efx = channel->efx;
struct efx_ptp_data *ptp = efx->ptp_data; struct efx_ptp_data *ptp = efx->ptp_data;
...@@ -2171,7 +2172,7 @@ static const struct efx_channel_type efx_ptp_channel_type = { ...@@ -2171,7 +2172,7 @@ static const struct efx_channel_type efx_ptp_channel_type = {
.keep_eventq = false, .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 /* Check whether PTP is implemented on this NIC. The DISABLE
* operation will succeed if and only if it is implemented. * operation will succeed if and only if it is implemented.
...@@ -2181,7 +2182,7 @@ void efx_ptp_defer_probe_with_channel(struct efx_nic *efx) ...@@ -2181,7 +2182,7 @@ void efx_ptp_defer_probe_with_channel(struct efx_nic *efx)
&efx_ptp_channel_type; &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)) if (efx_ptp_restart(efx))
netif_err(efx, drv, efx->net_dev, "Failed to restart PTP.\n"); netif_err(efx, drv, efx->net_dev, "Failed to restart PTP.\n");
...@@ -2190,7 +2191,7 @@ void efx_ptp_start_datapath(struct efx_nic *efx) ...@@ -2190,7 +2191,7 @@ void efx_ptp_start_datapath(struct efx_nic *efx)
efx->type->ptp_set_ts_sync_events(efx, true, true); 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 */ /* temporarily disable timestamping */
if (efx->type->ptp_set_ts_sync_events) if (efx->type->ptp_set_ts_sync_events)
......
...@@ -13,33 +13,33 @@ ...@@ -13,33 +13,33 @@
#include "net_driver.h" #include "net_driver.h"
struct ethtool_ts_info; struct ethtool_ts_info;
int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel); void efx_siena_ptp_defer_probe_with_channel(struct efx_nic *efx);
void efx_ptp_defer_probe_with_channel(struct efx_nic *efx); struct efx_channel *efx_siena_ptp_channel(struct efx_nic *efx);
struct efx_channel *efx_ptp_channel(struct efx_nic *efx); int efx_siena_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr);
void efx_ptp_remove(struct efx_nic *efx); int efx_siena_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr);
int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr); void efx_siena_ptp_get_ts_info(struct efx_nic *efx,
int efx_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr); struct ethtool_ts_info *ts_info);
void efx_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);
bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); int efx_siena_ptp_get_mode(struct efx_nic *efx);
int efx_ptp_get_mode(struct efx_nic *efx); int efx_siena_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted, unsigned int new_mode);
unsigned int new_mode); int efx_siena_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); void efx_siena_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
void efx_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_ptp_describe_stats(struct efx_nic *efx, u8 *strings); size_t efx_siena_ptp_update_stats(struct efx_nic *efx, u64 *stats);
size_t efx_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_time_sync_event(struct efx_channel *channel, efx_qword_t *ev); void __efx_siena_rx_skb_attach_timestamp(struct efx_channel *channel,
void __efx_rx_skb_attach_timestamp(struct efx_channel *channel, struct sk_buff *skb);
struct sk_buff *skb);
static inline void efx_rx_skb_attach_timestamp(struct efx_channel *channel, static inline void efx_rx_skb_attach_timestamp(struct efx_channel *channel,
struct sk_buff *skb) struct sk_buff *skb)
{ {
if (channel->sync_events_state == SYNC_EVENTS_VALID) 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); void efx_siena_ptp_start_datapath(struct efx_nic *efx);
bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx); void efx_siena_ptp_stop_datapath(struct efx_nic *efx);
ktime_t efx_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue); 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 */ #endif /* EFX_PTP_H */
...@@ -377,7 +377,7 @@ void __efx_siena_rx_packet(struct efx_channel *channel) ...@@ -377,7 +377,7 @@ void __efx_siena_rx_packet(struct efx_channel *channel)
if (unlikely(efx->loopback_selftest)) { if (unlikely(efx->loopback_selftest)) {
struct efx_rx_queue *rx_queue; 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); rx_queue = efx_channel_get_rx_queue(channel);
efx_siena_free_rx_buffers(rx_queue, rx_buf, efx_siena_free_rx_buffers(rx_queue, rx_buf,
channel->rx_pkt_n_frags); channel->rx_pkt_n_frags);
......
...@@ -69,7 +69,7 @@ static const char *const efx_siena_interrupt_mode_names[] = { ...@@ -69,7 +69,7 @@ static const char *const efx_siena_interrupt_mode_names[] = {
/** /**
* struct efx_loopback_state - persistent state during a loopback selftest * 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 * @packet_count: Number of packets being used in this test
* @skbs: An array of skbs transmitted * @skbs: An array of skbs transmitted
* @offload_csum: Checksums are being offloaded * @offload_csum: Checksums are being offloaded
...@@ -278,8 +278,8 @@ static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests, ...@@ -278,8 +278,8 @@ static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests,
/* Loopback test RX callback /* Loopback test RX callback
* This is called for each received packet during loopback testing. * This is called for each received packet during loopback testing.
*/ */
void efx_loopback_rx_packet(struct efx_nic *efx, void efx_siena_loopback_rx_packet(struct efx_nic *efx,
const char *buf_ptr, int pkt_len) const char *buf_ptr, int pkt_len)
{ {
struct efx_loopback_state *state = efx->loopback_selftest; struct efx_loopback_state *state = efx->loopback_selftest;
struct efx_loopback_payload *received; struct efx_loopback_payload *received;
...@@ -369,7 +369,7 @@ void efx_loopback_rx_packet(struct efx_nic *efx, ...@@ -369,7 +369,7 @@ void efx_loopback_rx_packet(struct efx_nic *efx,
atomic_inc(&state->rx_bad); 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) static void efx_iterate_state(struct efx_nic *efx)
{ {
struct efx_loopback_state *state = efx->loopback_selftest; struct efx_loopback_state *state = efx->loopback_selftest;
...@@ -684,14 +684,14 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests, ...@@ -684,14 +684,14 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests,
* *
*************************************************************************/ *************************************************************************/
int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, int efx_siena_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
unsigned flags) unsigned int flags)
{ {
enum efx_loopback_mode loopback_mode = efx->loopback_mode; enum efx_loopback_mode loopback_mode = efx->loopback_mode;
int phy_mode = efx->phy_mode; int phy_mode = efx->phy_mode;
int rc_test = 0, rc_reset, rc; int rc_test = 0, rc_reset, rc;
efx_selftest_async_cancel(efx); efx_siena_selftest_async_cancel(efx);
/* Online (i.e. non-disruptive) testing /* Online (i.e. non-disruptive) testing
* This checks interrupt generation, event delivery and PHY presence. */ * This checks interrupt generation, event delivery and PHY presence. */
...@@ -767,7 +767,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, ...@@ -767,7 +767,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
return rc_test; 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; struct efx_channel *channel;
...@@ -776,12 +776,12 @@ void efx_selftest_async_start(struct efx_nic *efx) ...@@ -776,12 +776,12 @@ void efx_selftest_async_start(struct efx_nic *efx)
schedule_delayed_work(&efx->selftest_work, IRQ_TIMEOUT); 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); 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, struct efx_nic *efx = container_of(data, struct efx_nic,
selftest_work.work); selftest_work.work);
...@@ -801,7 +801,7 @@ static void efx_selftest_async_work(struct work_struct *data) ...@@ -801,7 +801,7 @@ static void efx_selftest_async_work(struct work_struct *data)
} }
} }
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);
} }
...@@ -41,12 +41,12 @@ struct efx_self_tests { ...@@ -41,12 +41,12 @@ struct efx_self_tests {
struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1]; struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
}; };
void efx_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr, void efx_siena_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
int pkt_len); int pkt_len);
int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, int efx_siena_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
unsigned flags); unsigned int flags);
void efx_selftest_async_init(struct efx_nic *efx); void efx_siena_selftest_async_init(struct efx_nic *efx);
void efx_selftest_async_start(struct efx_nic *efx); void efx_siena_selftest_async_start(struct efx_nic *efx);
void efx_selftest_async_cancel(struct efx_nic *efx); void efx_siena_selftest_async_cancel(struct efx_nic *efx);
#endif /* EFX_SELFTEST_H */ #endif /* EFX_SELFTEST_H */
...@@ -143,27 +143,28 @@ static int siena_ptp_set_ts_config(struct efx_nic *efx, ...@@ -143,27 +143,28 @@ static int siena_ptp_set_ts_config(struct efx_nic *efx,
switch (init->rx_filter) { switch (init->rx_filter) {
case HWTSTAMP_FILTER_NONE: case HWTSTAMP_FILTER_NONE:
/* if TX timestamping is still requested then leave PTP on */ /* if TX timestamping is still requested then leave PTP on */
return efx_ptp_change_mode(efx, return efx_siena_ptp_change_mode(efx,
init->tx_type != HWTSTAMP_TX_OFF, init->tx_type != HWTSTAMP_TX_OFF,
efx_ptp_get_mode(efx)); efx_siena_ptp_get_mode(efx));
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT: case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
init->rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT; 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_EVENT:
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC: case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
init->rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT; init->rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
rc = efx_ptp_change_mode(efx, true, rc = efx_siena_ptp_change_mode(efx, true,
MC_CMD_PTP_MODE_V2_ENHANCED); MC_CMD_PTP_MODE_V2_ENHANCED);
/* bug 33070 - old versions of the firmware do not support the /* bug 33070 - old versions of the firmware do not support the
* improved UUID filtering option. Similarly old versions of the * improved UUID filtering option. Similarly old versions of the
* application do not expect it to be enabled. If the firmware * application do not expect it to be enabled. If the firmware
* does not accept the enhanced mode, fall back to the standard * does not accept the enhanced mode, fall back to the standard
* PTP v2 UUID filtering. */ * PTP v2 UUID filtering. */
if (rc != 0) 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; return rc;
default: default:
return -ERANGE; return -ERANGE;
...@@ -329,7 +330,7 @@ static int siena_probe_nic(struct efx_nic *efx) ...@@ -329,7 +330,7 @@ static int siena_probe_nic(struct efx_nic *efx)
#ifdef CONFIG_SFC_SRIOV #ifdef CONFIG_SFC_SRIOV
efx_siena_sriov_probe(efx); efx_siena_sriov_probe(efx);
#endif #endif
efx_ptp_defer_probe_with_channel(efx); efx_siena_ptp_defer_probe_with_channel(efx);
return 0; return 0;
......
...@@ -321,14 +321,14 @@ netdev_tx_t efx_siena_hard_start_xmit(struct sk_buff *skb, ...@@ -321,14 +321,14 @@ netdev_tx_t efx_siena_hard_start_xmit(struct sk_buff *skb,
/* PTP "event" packet */ /* PTP "event" packet */
if (unlikely(efx_xmit_with_hwtstamp(skb)) && if (unlikely(efx_xmit_with_hwtstamp(skb)) &&
((efx_ptp_use_mac_tx_timestamps(efx) && efx->ptp_data) || ((efx_siena_ptp_use_mac_tx_timestamps(efx) && efx->ptp_data) ||
unlikely(efx_ptp_is_ptp_tx(efx, skb)))) { unlikely(efx_siena_ptp_is_ptp_tx(efx, skb)))) {
/* There may be existing transmits on the channel that are /* There may be existing transmits on the channel that are
* waiting for this packet to trigger the doorbell write. * waiting for this packet to trigger the doorbell write.
* We need to send the packets at this point. * We need to send the packets at this point.
*/ */
efx_tx_send_pending(efx_get_tx_channel(efx, index)); 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 = efx_get_tx_queue(efx, index, type);
......
...@@ -80,8 +80,8 @@ void efx_siena_init_tx_queue(struct efx_tx_queue *tx_queue) ...@@ -80,8 +80,8 @@ void efx_siena_init_tx_queue(struct efx_tx_queue *tx_queue)
tx_queue->old_read_count = 0; tx_queue->old_read_count = 0;
tx_queue->empty_read_count = 0 | EFX_EMPTY_COUNT_VALID; tx_queue->empty_read_count = 0 | EFX_EMPTY_COUNT_VALID;
tx_queue->xmit_pending = false; tx_queue->xmit_pending = false;
tx_queue->timestamping = (efx_ptp_use_mac_tx_timestamps(efx) && tx_queue->timestamping = (efx_siena_ptp_use_mac_tx_timestamps(efx) &&
tx_queue->channel == efx_ptp_channel(efx)); tx_queue->channel == efx_siena_ptp_channel(efx));
tx_queue->completed_timestamp_major = 0; tx_queue->completed_timestamp_major = 0;
tx_queue->completed_timestamp_minor = 0; tx_queue->completed_timestamp_minor = 0;
...@@ -148,7 +148,7 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue, ...@@ -148,7 +148,7 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
struct skb_shared_hwtstamps hwtstamp; struct skb_shared_hwtstamps hwtstamp;
hwtstamp.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); skb_tstamp_tx(skb, &hwtstamp);
tx_queue->completed_timestamp_major = 0; tx_queue->completed_timestamp_major = 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