#include <linux/netdevice.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/kernel_stat.h>
#include <linux/pci.h>
#include <linux/ethtool.h>
#include <linux/ip.h>
#include <linux/in.h>
#include <linux/udp.h>
#include <linux/rtnetlink.h>
#include <linux/slab.h>
#include "net_driver.h"
#include "efx.h"
#include "efx_common.h"
#include "efx_channels.h"
#include "nic.h"
#include "mcdi_port_common.h"
#include "selftest.h"
#include "workarounds.h"
#define IRQ_TIMEOUT …
struct efx_loopback_payload { … } __packed __aligned(…);
#define EFX_LOOPBACK_PAYLOAD_LEN …
static const u8 payload_source[ETH_ALEN] __aligned(2) = …;
static const char payload_msg[] = …;
static const unsigned int efx_interrupt_mode_max = …;
static const char *const efx_interrupt_mode_names[] = …;
#define INT_MODE(efx) …
struct efx_loopback_state { … };
#define LOOPBACK_TIMEOUT_MS …
static int efx_test_phy_alive(struct efx_nic *efx, struct efx_self_tests *tests)
{ … }
static int efx_test_nvram(struct efx_nic *efx, struct efx_self_tests *tests)
{ … }
static int efx_test_interrupts(struct efx_nic *efx,
struct efx_self_tests *tests)
{ … }
static int efx_test_eventq_irq(struct efx_nic *efx,
struct efx_self_tests *tests)
{ … }
static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests,
unsigned flags)
{ … }
void efx_loopback_rx_packet(struct efx_nic *efx,
const char *buf_ptr, int pkt_len)
{ … }
static void efx_iterate_state(struct efx_nic *efx)
{ … }
static int efx_begin_loopback(struct efx_tx_queue *tx_queue)
{ … }
static int efx_poll_loopback(struct efx_nic *efx)
{ … }
static int efx_end_loopback(struct efx_tx_queue *tx_queue,
struct efx_loopback_self_tests *lb_tests)
{ … }
static int
efx_test_loopback(struct efx_tx_queue *tx_queue,
struct efx_loopback_self_tests *lb_tests)
{ … }
static int efx_wait_for_link(struct efx_nic *efx)
{ … }
static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests,
unsigned int loopback_modes)
{ … }
int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
unsigned flags)
{ … }
void efx_selftest_async_start(struct efx_nic *efx)
{ … }
void efx_selftest_async_cancel(struct efx_nic *efx)
{ … }
static void efx_selftest_async_work(struct work_struct *data)
{ … }
void efx_selftest_async_init(struct efx_nic *efx)
{ … }