diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-26 16:47:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-26 16:47:25 -0500 |
commit | 1796721a5a691a5d392abf8070ad40a0b787b667 (patch) | |
tree | 16ed5a5a8c77db9e8f70c9b23f6b26cde491c336 /drivers/net/sfc/tenxpress.c | |
parent | 2ef3068e6c40ec44d27f6f8027616e284d1b0466 (diff) |
sfc: Add support for multiple PHY self-tests
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/tenxpress.c')
-rw-r--r-- | drivers/net/sfc/tenxpress.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c index 1567ab538e27..bd204820e189 100644 --- a/drivers/net/sfc/tenxpress.c +++ b/drivers/net/sfc/tenxpress.c | |||
@@ -654,10 +654,22 @@ void tenxpress_phy_blink(struct efx_nic *efx, bool blink) | |||
654 | PMA_PMD_LED_OVERR_REG, reg); | 654 | PMA_PMD_LED_OVERR_REG, reg); |
655 | } | 655 | } |
656 | 656 | ||
657 | static int tenxpress_phy_test(struct efx_nic *efx) | 657 | static const char *const tenxpress_test_names[] = { |
658 | "bist" | ||
659 | }; | ||
660 | |||
661 | static int | ||
662 | tenxpress_run_tests(struct efx_nic *efx, int *results, unsigned flags) | ||
658 | { | 663 | { |
664 | int rc; | ||
665 | |||
666 | if (!(flags & ETH_TEST_FL_OFFLINE)) | ||
667 | return 0; | ||
668 | |||
659 | /* BIST is automatically run after a special software reset */ | 669 | /* BIST is automatically run after a special software reset */ |
660 | return tenxpress_special_reset(efx); | 670 | rc = tenxpress_special_reset(efx); |
671 | results[0] = rc ? -1 : 1; | ||
672 | return rc; | ||
661 | } | 673 | } |
662 | 674 | ||
663 | static u32 tenxpress_get_xnp_lpa(struct efx_nic *efx) | 675 | static u32 tenxpress_get_xnp_lpa(struct efx_nic *efx) |
@@ -770,9 +782,11 @@ struct efx_phy_operations falcon_sfx7101_phy_ops = { | |||
770 | .poll = tenxpress_phy_poll, | 782 | .poll = tenxpress_phy_poll, |
771 | .fini = tenxpress_phy_fini, | 783 | .fini = tenxpress_phy_fini, |
772 | .clear_interrupt = efx_port_dummy_op_void, | 784 | .clear_interrupt = efx_port_dummy_op_void, |
773 | .test = tenxpress_phy_test, | ||
774 | .get_settings = sfx7101_get_settings, | 785 | .get_settings = sfx7101_get_settings, |
775 | .set_settings = mdio_clause45_set_settings, | 786 | .set_settings = mdio_clause45_set_settings, |
787 | .num_tests = ARRAY_SIZE(tenxpress_test_names), | ||
788 | .test_names = tenxpress_test_names, | ||
789 | .run_tests = tenxpress_run_tests, | ||
776 | .mmds = TENXPRESS_REQUIRED_DEVS, | 790 | .mmds = TENXPRESS_REQUIRED_DEVS, |
777 | .loopbacks = SFX7101_LOOPBACKS, | 791 | .loopbacks = SFX7101_LOOPBACKS, |
778 | }; | 792 | }; |
@@ -784,10 +798,12 @@ struct efx_phy_operations falcon_sft9001_phy_ops = { | |||
784 | .poll = tenxpress_phy_poll, | 798 | .poll = tenxpress_phy_poll, |
785 | .fini = tenxpress_phy_fini, | 799 | .fini = tenxpress_phy_fini, |
786 | .clear_interrupt = efx_port_dummy_op_void, | 800 | .clear_interrupt = efx_port_dummy_op_void, |
787 | .test = tenxpress_phy_test, | ||
788 | .get_settings = sft9001_get_settings, | 801 | .get_settings = sft9001_get_settings, |
789 | .set_settings = sft9001_set_settings, | 802 | .set_settings = sft9001_set_settings, |
790 | .set_xnp_advertise = sft9001_set_xnp_advertise, | 803 | .set_xnp_advertise = sft9001_set_xnp_advertise, |
804 | .num_tests = ARRAY_SIZE(tenxpress_test_names), | ||
805 | .test_names = tenxpress_test_names, | ||
806 | .run_tests = tenxpress_run_tests, | ||
791 | .mmds = TENXPRESS_REQUIRED_DEVS, | 807 | .mmds = TENXPRESS_REQUIRED_DEVS, |
792 | .loopbacks = SFT9001_LOOPBACKS, | 808 | .loopbacks = SFT9001_LOOPBACKS, |
793 | }; | 809 | }; |