Merge remote-tracking branch 'mmc-uh/next'
[deliverable/linux.git] / drivers / net / ethernet / sfc / selftest.h
CommitLineData
3273c2e8 1/****************************************************************************
f7a6d2c4 2 * Driver for Solarflare network controllers and boards
3273c2e8 3 * Copyright 2005-2006 Fen Systems Ltd.
f7a6d2c4 4 * Copyright 2006-2012 Solarflare Communications Inc.
3273c2e8
BH
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation, incorporated herein by reference.
9 */
10
11#ifndef EFX_SELFTEST_H
12#define EFX_SELFTEST_H
13
14#include "net_driver.h"
15
16/*
17 * Self tests
18 */
19
20struct efx_loopback_self_tests {
a4900ac9
BH
21 int tx_sent[EFX_TXQ_TYPES];
22 int tx_done[EFX_TXQ_TYPES];
3273c2e8
BH
23 int rx_good;
24 int rx_bad;
25};
26
1796721a
BH
27#define EFX_MAX_PHY_TESTS 20
28
3273c2e8
BH
29/* Efx self test results
30 * For fields which are not counters, 1 indicates success and -1
942e298e 31 * indicates failure; 0 indicates test could not be run.
3273c2e8
BH
32 */
33struct efx_self_tests {
8c8661e4 34 /* online tests */
4f16c073 35 int phy_alive;
8c8661e4 36 int nvram;
3273c2e8
BH
37 int interrupt;
38 int eventq_dma[EFX_MAX_CHANNELS];
39 int eventq_int[EFX_MAX_CHANNELS];
8c8661e4 40 /* offline tests */
74cd60a4 41 int memory;
8c8661e4 42 int registers;
4f16c073 43 int phy_ext[EFX_MAX_PHY_TESTS];
8c8661e4 44 struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
3273c2e8
BH
45};
46
00aef986
JP
47void efx_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
48 int pkt_len);
49int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
50 unsigned flags);
51void efx_selftest_async_start(struct efx_nic *efx);
52void efx_selftest_async_cancel(struct efx_nic *efx);
53void efx_selftest_async_work(struct work_struct *data);
3273c2e8
BH
54
55#endif /* EFX_SELFTEST_H */
This page took 0.92022 seconds and 5 git commands to generate.