aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/falcon.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-12-02 08:47:45 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-03 12:08:08 -0500
commit40641ed93cd53561f7d53b5fd5ed656b35f3aabd (patch)
treec7cffd1b3df358e825111d3aa21f396f70f03e22 /drivers/net/sfc/falcon.c
parent4833f02a2972b7da4c8a15e1e329db0f984a75d9 (diff)
sfc: Move Falcon global event handling to falcon.c
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r--drivers/net/sfc/falcon.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index af62899bb981..fd5bf0b7e8a2 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -881,6 +881,40 @@ static void falcon_remove_port(struct efx_nic *efx)
881 efx_nic_free_buffer(efx, &efx->stats_buffer); 881 efx_nic_free_buffer(efx, &efx->stats_buffer);
882} 882}
883 883
884/* Global events are basically PHY events */
885static bool
886falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
887{
888 struct efx_nic *efx = channel->efx;
889
890 if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) ||
891 EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
892 EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XFP_PHY0_INTR))
893 /* Ignored */
894 return true;
895
896 if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) &&
897 EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
898 efx->xmac_poll_required = true;
899 return true;
900 }
901
902 if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1 ?
903 EFX_QWORD_FIELD(*event, FSF_AA_GLB_EV_RX_RECOVERY) :
904 EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_RX_RECOVERY)) {
905 netif_err(efx, rx_err, efx->net_dev,
906 "channel %d seen global RX_RESET event. Resetting.\n",
907 channel->channel);
908
909 atomic_inc(&efx->rx_reset);
910 efx_schedule_reset(efx, EFX_WORKAROUND_6555(efx) ?
911 RESET_TYPE_RX_RECOVERY : RESET_TYPE_DISABLE);
912 return true;
913 }
914
915 return false;
916}
917
884/************************************************************************** 918/**************************************************************************
885 * 919 *
886 * Falcon test code 920 * Falcon test code
@@ -1702,6 +1736,7 @@ struct efx_nic_type falcon_a1_nic_type = {
1702 .reset = falcon_reset_hw, 1736 .reset = falcon_reset_hw,
1703 .probe_port = falcon_probe_port, 1737 .probe_port = falcon_probe_port,
1704 .remove_port = falcon_remove_port, 1738 .remove_port = falcon_remove_port,
1739 .handle_global_event = falcon_handle_global_event,
1705 .prepare_flush = falcon_prepare_flush, 1740 .prepare_flush = falcon_prepare_flush,
1706 .update_stats = falcon_update_nic_stats, 1741 .update_stats = falcon_update_nic_stats,
1707 .start_stats = falcon_start_nic_stats, 1742 .start_stats = falcon_start_nic_stats,
@@ -1742,6 +1777,7 @@ struct efx_nic_type falcon_b0_nic_type = {
1742 .reset = falcon_reset_hw, 1777 .reset = falcon_reset_hw,
1743 .probe_port = falcon_probe_port, 1778 .probe_port = falcon_probe_port,
1744 .remove_port = falcon_remove_port, 1779 .remove_port = falcon_remove_port,
1780 .handle_global_event = falcon_handle_global_event,
1745 .prepare_flush = falcon_prepare_flush, 1781 .prepare_flush = falcon_prepare_flush,
1746 .update_stats = falcon_update_nic_stats, 1782 .update_stats = falcon_update_nic_stats,
1747 .start_stats = falcon_start_nic_stats, 1783 .start_stats = falcon_start_nic_stats,