diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-23 11:08:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-24 13:59:04 -0500 |
commit | c459302db655c1a7fd05fd4266b18990854e8386 (patch) | |
tree | 94adde79f8c3a5a447305cf425a5caa1c7091df7 /drivers/net/sfc/efx.c | |
parent | f5e7adc3d4aa8edab63bb63f0ce5fe92c3dd7604 (diff) |
sfc: Log interrupt and reset type names, not numbers
Define name tables for these enumerations in a similar way as for
loopback. Move the loopback name table together with them.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r-- | drivers/net/sfc/efx.c | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index cb7899532659..4787faaf30c1 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -25,6 +25,50 @@ | |||
25 | #include "mdio_10g.h" | 25 | #include "mdio_10g.h" |
26 | #include "falcon.h" | 26 | #include "falcon.h" |
27 | 27 | ||
28 | /************************************************************************** | ||
29 | * | ||
30 | * Type name strings | ||
31 | * | ||
32 | ************************************************************************** | ||
33 | */ | ||
34 | |||
35 | /* Loopback mode names (see LOOPBACK_MODE()) */ | ||
36 | const unsigned int efx_loopback_mode_max = LOOPBACK_MAX; | ||
37 | const char *efx_loopback_mode_names[] = { | ||
38 | [LOOPBACK_NONE] = "NONE", | ||
39 | [LOOPBACK_GMAC] = "GMAC", | ||
40 | [LOOPBACK_XGMII] = "XGMII", | ||
41 | [LOOPBACK_XGXS] = "XGXS", | ||
42 | [LOOPBACK_XAUI] = "XAUI", | ||
43 | [LOOPBACK_GPHY] = "GPHY", | ||
44 | [LOOPBACK_PHYXS] = "PHYXS", | ||
45 | [LOOPBACK_PCS] = "PCS", | ||
46 | [LOOPBACK_PMAPMD] = "PMA/PMD", | ||
47 | [LOOPBACK_NETWORK] = "NETWORK", | ||
48 | }; | ||
49 | |||
50 | /* Interrupt mode names (see INT_MODE())) */ | ||
51 | const unsigned int efx_interrupt_mode_max = EFX_INT_MODE_MAX; | ||
52 | const char *efx_interrupt_mode_names[] = { | ||
53 | [EFX_INT_MODE_MSIX] = "MSI-X", | ||
54 | [EFX_INT_MODE_MSI] = "MSI", | ||
55 | [EFX_INT_MODE_LEGACY] = "legacy", | ||
56 | }; | ||
57 | |||
58 | const unsigned int efx_reset_type_max = RESET_TYPE_MAX; | ||
59 | const char *efx_reset_type_names[] = { | ||
60 | [RESET_TYPE_INVISIBLE] = "INVISIBLE", | ||
61 | [RESET_TYPE_ALL] = "ALL", | ||
62 | [RESET_TYPE_WORLD] = "WORLD", | ||
63 | [RESET_TYPE_DISABLE] = "DISABLE", | ||
64 | [RESET_TYPE_TX_WATCHDOG] = "TX_WATCHDOG", | ||
65 | [RESET_TYPE_INT_ERROR] = "INT_ERROR", | ||
66 | [RESET_TYPE_RX_RECOVERY] = "RX_RECOVERY", | ||
67 | [RESET_TYPE_RX_DESC_FETCH] = "RX_DESC_FETCH", | ||
68 | [RESET_TYPE_TX_DESC_FETCH] = "TX_DESC_FETCH", | ||
69 | [RESET_TYPE_TX_SKIP] = "TX_SKIP", | ||
70 | }; | ||
71 | |||
28 | #define EFX_MAX_MTU (9 * 1024) | 72 | #define EFX_MAX_MTU (9 * 1024) |
29 | 73 | ||
30 | /* RX slow fill workqueue. If memory allocation fails in the fast path, | 74 | /* RX slow fill workqueue. If memory allocation fails in the fast path, |
@@ -1772,7 +1816,7 @@ static int efx_reset(struct efx_nic *efx) | |||
1772 | goto out_unlock; | 1816 | goto out_unlock; |
1773 | } | 1817 | } |
1774 | 1818 | ||
1775 | EFX_INFO(efx, "resetting (%d)\n", method); | 1819 | EFX_INFO(efx, "resetting (%s)\n", RESET_TYPE(method)); |
1776 | 1820 | ||
1777 | efx_reset_down(efx, method, &ecmd); | 1821 | efx_reset_down(efx, method, &ecmd); |
1778 | 1822 | ||
@@ -1851,9 +1895,10 @@ void efx_schedule_reset(struct efx_nic *efx, enum reset_type type) | |||
1851 | } | 1895 | } |
1852 | 1896 | ||
1853 | if (method != type) | 1897 | if (method != type) |
1854 | EFX_LOG(efx, "scheduling reset (%d:%d)\n", type, method); | 1898 | EFX_LOG(efx, "scheduling %s reset for %s\n", |
1899 | RESET_TYPE(method), RESET_TYPE(type)); | ||
1855 | else | 1900 | else |
1856 | EFX_LOG(efx, "scheduling reset (%d)\n", method); | 1901 | EFX_LOG(efx, "scheduling %s reset\n", RESET_TYPE(method)); |
1857 | 1902 | ||
1858 | efx->reset_pending = method; | 1903 | efx->reset_pending = method; |
1859 | 1904 | ||