diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-28 22:43:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 19:46:30 -0500 |
commit | 9bfc4bb1f9b5863b177752b88e8bfa364e83a4fa (patch) | |
tree | c4ca25f993298ec1a2a10f6027e3958186b364dc /drivers/net/sfc | |
parent | eb9f6744cbfa97674c13263802259b5aa0034594 (diff) |
sfc: Add efx_nic_type operation for register self-test
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/falcon.c | 3 | ||||
-rw-r--r-- | drivers/net/sfc/falcon.h | 1 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 2 | ||||
-rw-r--r-- | drivers/net/sfc/selftest.c | 12 |
4 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 6a96c699e15b..bcdc5452bfd0 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -2458,7 +2458,7 @@ static bool efx_masked_compare_oword(const efx_oword_t *a, const efx_oword_t *b, | |||
2458 | ((a->u64[1] ^ b->u64[1]) & mask->u64[1]); | 2458 | ((a->u64[1] ^ b->u64[1]) & mask->u64[1]); |
2459 | } | 2459 | } |
2460 | 2460 | ||
2461 | int falcon_test_registers(struct efx_nic *efx) | 2461 | static int falcon_b0_test_registers(struct efx_nic *efx) |
2462 | { | 2462 | { |
2463 | unsigned address = 0, i, j; | 2463 | unsigned address = 0, i, j; |
2464 | efx_oword_t mask, imask, original, reg, buf; | 2464 | efx_oword_t mask, imask, original, reg, buf; |
@@ -3327,6 +3327,7 @@ struct efx_nic_type falcon_b0_nic_type = { | |||
3327 | .get_wol = falcon_get_wol, | 3327 | .get_wol = falcon_get_wol, |
3328 | .set_wol = falcon_set_wol, | 3328 | .set_wol = falcon_set_wol, |
3329 | .resume_wol = efx_port_dummy_op_void, | 3329 | .resume_wol = efx_port_dummy_op_void, |
3330 | .test_registers = falcon_b0_test_registers, | ||
3330 | .default_mac_ops = &falcon_xmac_operations, | 3331 | .default_mac_ops = &falcon_xmac_operations, |
3331 | 3332 | ||
3332 | .revision = EFX_REV_FALCON_B0, | 3333 | .revision = EFX_REV_FALCON_B0, |
diff --git a/drivers/net/sfc/falcon.h b/drivers/net/sfc/falcon.h index 560a3f9895a5..cfcc2a38366f 100644 --- a/drivers/net/sfc/falcon.h +++ b/drivers/net/sfc/falcon.h | |||
@@ -154,7 +154,6 @@ extern int falcon_reset_xaui(struct efx_nic *efx); | |||
154 | struct falcon_nvconfig; | 154 | struct falcon_nvconfig; |
155 | extern int falcon_read_nvram(struct efx_nic *efx, | 155 | extern int falcon_read_nvram(struct efx_nic *efx, |
156 | struct falcon_nvconfig *nvconfig); | 156 | struct falcon_nvconfig *nvconfig); |
157 | extern int falcon_test_registers(struct efx_nic *efx); | ||
158 | 157 | ||
159 | /************************************************************************** | 158 | /************************************************************************** |
160 | * | 159 | * |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 58bf761d7317..9d353d923eec 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -864,6 +864,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx) | |||
864 | * @get_wol: Get WoL configuration from driver state | 864 | * @get_wol: Get WoL configuration from driver state |
865 | * @set_wol: Push WoL configuration to the NIC | 865 | * @set_wol: Push WoL configuration to the NIC |
866 | * @resume_wol: Synchronise WoL state between driver and MC (e.g. after resume) | 866 | * @resume_wol: Synchronise WoL state between driver and MC (e.g. after resume) |
867 | * @test_registers: Test read/write functionality of control registers | ||
867 | * @default_mac_ops: efx_mac_operations to set at startup | 868 | * @default_mac_ops: efx_mac_operations to set at startup |
868 | * @revision: Hardware architecture revision | 869 | * @revision: Hardware architecture revision |
869 | * @mem_map_size: Memory BAR mapped size | 870 | * @mem_map_size: Memory BAR mapped size |
@@ -902,6 +903,7 @@ struct efx_nic_type { | |||
902 | void (*get_wol)(struct efx_nic *efx, struct ethtool_wolinfo *wol); | 903 | void (*get_wol)(struct efx_nic *efx, struct ethtool_wolinfo *wol); |
903 | int (*set_wol)(struct efx_nic *efx, u32 type); | 904 | int (*set_wol)(struct efx_nic *efx, u32 type); |
904 | void (*resume_wol)(struct efx_nic *efx); | 905 | void (*resume_wol)(struct efx_nic *efx); |
906 | int (*test_registers)(struct efx_nic *efx); | ||
905 | struct efx_mac_operations *default_mac_ops; | 907 | struct efx_mac_operations *default_mac_ops; |
906 | 908 | ||
907 | int revision; | 909 | int revision; |
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index f45bf7442154..f30355210044 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -122,14 +122,14 @@ static int efx_test_nvram(struct efx_nic *efx, struct efx_self_tests *tests) | |||
122 | 122 | ||
123 | static int efx_test_chip(struct efx_nic *efx, struct efx_self_tests *tests) | 123 | static int efx_test_chip(struct efx_nic *efx, struct efx_self_tests *tests) |
124 | { | 124 | { |
125 | int rc; | 125 | int rc = 0; |
126 | 126 | ||
127 | /* Not supported on A-series silicon */ | 127 | /* Test register access */ |
128 | if (efx_nic_rev(efx) < EFX_REV_FALCON_B0) | 128 | if (efx->type->test_registers) { |
129 | return 0; | 129 | rc = efx->type->test_registers(efx); |
130 | tests->registers = rc ? -1 : 1; | ||
131 | } | ||
130 | 132 | ||
131 | rc = falcon_test_registers(efx); | ||
132 | tests->registers = rc ? -1 : 1; | ||
133 | return rc; | 133 | return rc; |
134 | } | 134 | } |
135 | 135 | ||