diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-05-07 08:36:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-05-13 01:31:44 -0400 |
commit | 3273c2e8c66a21ae1c53b0c730ee937c6efde7e2 (patch) | |
tree | ee2a1f187c0310e229f51fbfc5fbbe7a5fce5b76 /drivers/net/sfc/net_driver.h | |
parent | 05e3ec04460180f48810cddc2f78e80a725657ad (diff) |
[netdrvr] sfc: sfc: Add self-test support
Add a set of self-tests accessible thorugh ethtool.
Add hardware loopback and TX disable control code to support them.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/net_driver.h')
-rw-r--r-- | drivers/net/sfc/net_driver.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 9c285fb6153c..59f261b4171f 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -448,6 +448,9 @@ struct efx_board { | |||
448 | struct efx_blinker blinker; | 448 | struct efx_blinker blinker; |
449 | }; | 449 | }; |
450 | 450 | ||
451 | #define STRING_TABLE_LOOKUP(val, member) \ | ||
452 | member ## _names[val] | ||
453 | |||
451 | enum efx_int_mode { | 454 | enum efx_int_mode { |
452 | /* Be careful if altering to correct macro below */ | 455 | /* Be careful if altering to correct macro below */ |
453 | EFX_INT_MODE_MSIX = 0, | 456 | EFX_INT_MODE_MSIX = 0, |
@@ -520,6 +523,7 @@ enum efx_fc_type { | |||
520 | * @check_hw: Check hardware | 523 | * @check_hw: Check hardware |
521 | * @reset_xaui: Reset XAUI side of PHY for (software sequenced reset) | 524 | * @reset_xaui: Reset XAUI side of PHY for (software sequenced reset) |
522 | * @mmds: MMD presence mask | 525 | * @mmds: MMD presence mask |
526 | * @loopbacks: Supported loopback modes mask | ||
523 | */ | 527 | */ |
524 | struct efx_phy_operations { | 528 | struct efx_phy_operations { |
525 | int (*init) (struct efx_nic *efx); | 529 | int (*init) (struct efx_nic *efx); |
@@ -529,6 +533,7 @@ struct efx_phy_operations { | |||
529 | int (*check_hw) (struct efx_nic *efx); | 533 | int (*check_hw) (struct efx_nic *efx); |
530 | void (*reset_xaui) (struct efx_nic *efx); | 534 | void (*reset_xaui) (struct efx_nic *efx); |
531 | int mmds; | 535 | int mmds; |
536 | unsigned loopbacks; | ||
532 | }; | 537 | }; |
533 | 538 | ||
534 | /* | 539 | /* |
@@ -667,6 +672,7 @@ union efx_multicast_hash { | |||
667 | * @phy_op: PHY interface | 672 | * @phy_op: PHY interface |
668 | * @phy_data: PHY private data (including PHY-specific stats) | 673 | * @phy_data: PHY private data (including PHY-specific stats) |
669 | * @mii: PHY interface | 674 | * @mii: PHY interface |
675 | * @tx_disabled: PHY transmitter turned off | ||
670 | * @link_up: Link status | 676 | * @link_up: Link status |
671 | * @link_options: Link options (MII/GMII format) | 677 | * @link_options: Link options (MII/GMII format) |
672 | * @n_link_state_changes: Number of times the link has changed state | 678 | * @n_link_state_changes: Number of times the link has changed state |
@@ -674,6 +680,9 @@ union efx_multicast_hash { | |||
674 | * @multicast_hash: Multicast hash table | 680 | * @multicast_hash: Multicast hash table |
675 | * @flow_control: Flow control flags - separate RX/TX so can't use link_options | 681 | * @flow_control: Flow control flags - separate RX/TX so can't use link_options |
676 | * @reconfigure_work: work item for dealing with PHY events | 682 | * @reconfigure_work: work item for dealing with PHY events |
683 | * @loopback_mode: Loopback status | ||
684 | * @loopback_modes: Supported loopback mode bitmask | ||
685 | * @loopback_selftest: Offline self-test private state | ||
677 | * | 686 | * |
678 | * The @priv field of the corresponding &struct net_device points to | 687 | * The @priv field of the corresponding &struct net_device points to |
679 | * this. | 688 | * this. |
@@ -733,6 +742,7 @@ struct efx_nic { | |||
733 | struct efx_phy_operations *phy_op; | 742 | struct efx_phy_operations *phy_op; |
734 | void *phy_data; | 743 | void *phy_data; |
735 | struct mii_if_info mii; | 744 | struct mii_if_info mii; |
745 | unsigned tx_disabled; | ||
736 | 746 | ||
737 | int link_up; | 747 | int link_up; |
738 | unsigned int link_options; | 748 | unsigned int link_options; |
@@ -744,6 +754,10 @@ struct efx_nic { | |||
744 | struct work_struct reconfigure_work; | 754 | struct work_struct reconfigure_work; |
745 | 755 | ||
746 | atomic_t rx_reset; | 756 | atomic_t rx_reset; |
757 | enum efx_loopback_mode loopback_mode; | ||
758 | unsigned int loopback_modes; | ||
759 | |||
760 | void *loopback_selftest; | ||
747 | }; | 761 | }; |
748 | 762 | ||
749 | /** | 763 | /** |