Commit cef68bde authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

sfc: Move xmac_poll_required into struct falcon_nic_data

Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40641ed9
...@@ -886,6 +886,7 @@ static bool ...@@ -886,6 +886,7 @@ static bool
falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event) falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
{ {
struct efx_nic *efx = channel->efx; struct efx_nic *efx = channel->efx;
struct falcon_nic_data *nic_data = efx->nic_data;
if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) || if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) ||
EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) || EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
...@@ -895,7 +896,7 @@ falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event) ...@@ -895,7 +896,7 @@ falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) && if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) &&
EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) { EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
efx->xmac_poll_required = true; nic_data->xmac_poll_required = true;
return true; return true;
} }
......
...@@ -415,10 +415,11 @@ static void sfe4001_fini(struct efx_nic *efx) ...@@ -415,10 +415,11 @@ static void sfe4001_fini(struct efx_nic *efx)
static int sfe4001_check_hw(struct efx_nic *efx) static int sfe4001_check_hw(struct efx_nic *efx)
{ {
struct falcon_nic_data *nic_data = efx->nic_data;
s32 status; s32 status;
/* If XAUI link is up then do not monitor */ /* If XAUI link is up then do not monitor */
if (EFX_WORKAROUND_7884(efx) && !efx->xmac_poll_required) if (EFX_WORKAROUND_7884(efx) && !nic_data->xmac_poll_required)
return 0; return 0;
/* Check the powered status of the PHY. Lack of power implies that /* Check the powered status of the PHY. Lack of power implies that
......
...@@ -87,6 +87,7 @@ int falcon_reset_xaui(struct efx_nic *efx) ...@@ -87,6 +87,7 @@ int falcon_reset_xaui(struct efx_nic *efx)
static void falcon_ack_status_intr(struct efx_nic *efx) static void falcon_ack_status_intr(struct efx_nic *efx)
{ {
struct falcon_nic_data *nic_data = efx->nic_data;
efx_oword_t reg; efx_oword_t reg;
if ((efx_nic_rev(efx) != EFX_REV_FALCON_B0) || LOOPBACK_INTERNAL(efx)) if ((efx_nic_rev(efx) != EFX_REV_FALCON_B0) || LOOPBACK_INTERNAL(efx))
...@@ -98,7 +99,7 @@ static void falcon_ack_status_intr(struct efx_nic *efx) ...@@ -98,7 +99,7 @@ static void falcon_ack_status_intr(struct efx_nic *efx)
/* We can only use this interrupt to signal the negative edge of /* We can only use this interrupt to signal the negative edge of
* xaui_align [we have to poll the positive edge]. */ * xaui_align [we have to poll the positive edge]. */
if (efx->xmac_poll_required) if (nic_data->xmac_poll_required)
return; return;
efx_reado(efx, &reg, FR_AB_XM_MGT_INT_MSK); efx_reado(efx, &reg, FR_AB_XM_MGT_INT_MSK);
...@@ -276,12 +277,14 @@ static bool falcon_xmac_check_fault(struct efx_nic *efx) ...@@ -276,12 +277,14 @@ static bool falcon_xmac_check_fault(struct efx_nic *efx)
static int falcon_reconfigure_xmac(struct efx_nic *efx) static int falcon_reconfigure_xmac(struct efx_nic *efx)
{ {
struct falcon_nic_data *nic_data = efx->nic_data;
falcon_reconfigure_xgxs_core(efx); falcon_reconfigure_xgxs_core(efx);
falcon_reconfigure_xmac_core(efx); falcon_reconfigure_xmac_core(efx);
falcon_reconfigure_mac_wrapper(efx); falcon_reconfigure_mac_wrapper(efx);
efx->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 5); nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 5);
falcon_ack_status_intr(efx); falcon_ack_status_intr(efx);
return 0; return 0;
...@@ -349,11 +352,13 @@ static void falcon_update_stats_xmac(struct efx_nic *efx) ...@@ -349,11 +352,13 @@ static void falcon_update_stats_xmac(struct efx_nic *efx)
void falcon_poll_xmac(struct efx_nic *efx) void falcon_poll_xmac(struct efx_nic *efx)
{ {
struct falcon_nic_data *nic_data = efx->nic_data;
if (!EFX_WORKAROUND_5147(efx) || !efx->link_state.up || if (!EFX_WORKAROUND_5147(efx) || !efx->link_state.up ||
!efx->xmac_poll_required) !nic_data->xmac_poll_required)
return; return;
efx->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 1); nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 1);
falcon_ack_status_intr(efx); falcon_ack_status_intr(efx);
} }
......
...@@ -684,7 +684,6 @@ struct efx_filter_state; ...@@ -684,7 +684,6 @@ struct efx_filter_state;
* @mdio: PHY MDIO interface * @mdio: PHY MDIO interface
* @mdio_bus: PHY MDIO bus ID (only used by Siena) * @mdio_bus: PHY MDIO bus ID (only used by Siena)
* @phy_mode: PHY operating mode. Serialised by @mac_lock. * @phy_mode: PHY operating mode. Serialised by @mac_lock.
* @xmac_poll_required: XMAC link state needs polling
* @link_advertising: Autonegotiation advertising flags * @link_advertising: Autonegotiation advertising flags
* @link_state: Current state of the link * @link_state: Current state of the link
* @n_link_state_changes: Number of times the link has changed state * @n_link_state_changes: Number of times the link has changed state
...@@ -771,7 +770,6 @@ struct efx_nic { ...@@ -771,7 +770,6 @@ struct efx_nic {
unsigned int mdio_bus; unsigned int mdio_bus;
enum efx_phy_mode phy_mode; enum efx_phy_mode phy_mode;
bool xmac_poll_required;
u32 link_advertising; u32 link_advertising;
struct efx_link_state link_state; struct efx_link_state link_state;
unsigned int n_link_state_changes; unsigned int n_link_state_changes;
......
...@@ -118,6 +118,7 @@ struct falcon_board { ...@@ -118,6 +118,7 @@ struct falcon_board {
* @spi_eeprom: SPI EEPROM device * @spi_eeprom: SPI EEPROM device
* @spi_lock: SPI bus lock * @spi_lock: SPI bus lock
* @mdio_lock: MDIO bus lock * @mdio_lock: MDIO bus lock
* @xmac_poll_required: XMAC link state needs polling
*/ */
struct falcon_nic_data { struct falcon_nic_data {
struct pci_dev *pci_dev2; struct pci_dev *pci_dev2;
...@@ -130,6 +131,7 @@ struct falcon_nic_data { ...@@ -130,6 +131,7 @@ struct falcon_nic_data {
struct efx_spi_device spi_eeprom; struct efx_spi_device spi_eeprom;
struct mutex spi_lock; struct mutex spi_lock;
struct mutex mdio_lock; struct mutex mdio_lock;
bool xmac_poll_required;
}; };
static inline struct falcon_board *falcon_board(struct efx_nic *efx) static inline struct falcon_board *falcon_board(struct efx_nic *efx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment