diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-12-02 08:47:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-03 12:08:09 -0500 |
commit | cef68bde74f083d83c18ce870ed834e82ee0ae5a (patch) | |
tree | 430ee1d641b6d4f6c54c120fc500de6f9dbee797 /drivers/net | |
parent | 40641ed93cd53561f7d53b5fd5ed656b35f3aabd (diff) |
sfc: Move xmac_poll_required into struct falcon_nic_data
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sfc/falcon.c | 3 | ||||
-rw-r--r-- | drivers/net/sfc/falcon_boards.c | 3 | ||||
-rw-r--r-- | drivers/net/sfc/falcon_xmac.c | 13 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 2 | ||||
-rw-r--r-- | drivers/net/sfc/nic.h | 2 |
5 files changed, 15 insertions, 8 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index fd5bf0b7e8a2..07f684ed2d9b 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -886,6 +886,7 @@ static bool | |||
886 | falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event) | 886 | falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event) |
887 | { | 887 | { |
888 | struct efx_nic *efx = channel->efx; | 888 | struct efx_nic *efx = channel->efx; |
889 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
889 | 890 | ||
890 | if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) || | 891 | 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_XG_PHY0_INTR) || |
@@ -895,7 +896,7 @@ falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event) | |||
895 | 896 | ||
896 | if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) && | 897 | if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) && |
897 | EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) { | 898 | EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) { |
898 | efx->xmac_poll_required = true; | 899 | nic_data->xmac_poll_required = true; |
899 | return true; | 900 | return true; |
900 | } | 901 | } |
901 | 902 | ||
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c index a6fc5ce88c88..2dd16f0b3ced 100644 --- a/drivers/net/sfc/falcon_boards.c +++ b/drivers/net/sfc/falcon_boards.c | |||
@@ -415,10 +415,11 @@ static void sfe4001_fini(struct efx_nic *efx) | |||
415 | 415 | ||
416 | static int sfe4001_check_hw(struct efx_nic *efx) | 416 | static int sfe4001_check_hw(struct efx_nic *efx) |
417 | { | 417 | { |
418 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
418 | s32 status; | 419 | s32 status; |
419 | 420 | ||
420 | /* If XAUI link is up then do not monitor */ | 421 | /* If XAUI link is up then do not monitor */ |
421 | if (EFX_WORKAROUND_7884(efx) && !efx->xmac_poll_required) | 422 | if (EFX_WORKAROUND_7884(efx) && !nic_data->xmac_poll_required) |
422 | return 0; | 423 | return 0; |
423 | 424 | ||
424 | /* Check the powered status of the PHY. Lack of power implies that | 425 | /* Check the powered status of the PHY. Lack of power implies that |
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c index e293e25d1348..b49e84394641 100644 --- a/drivers/net/sfc/falcon_xmac.c +++ b/drivers/net/sfc/falcon_xmac.c | |||
@@ -87,6 +87,7 @@ int falcon_reset_xaui(struct efx_nic *efx) | |||
87 | 87 | ||
88 | static void falcon_ack_status_intr(struct efx_nic *efx) | 88 | static void falcon_ack_status_intr(struct efx_nic *efx) |
89 | { | 89 | { |
90 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
90 | efx_oword_t reg; | 91 | efx_oword_t reg; |
91 | 92 | ||
92 | if ((efx_nic_rev(efx) != EFX_REV_FALCON_B0) || LOOPBACK_INTERNAL(efx)) | 93 | 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 | 99 | ||
99 | /* We can only use this interrupt to signal the negative edge of | 100 | /* We can only use this interrupt to signal the negative edge of |
100 | * xaui_align [we have to poll the positive edge]. */ | 101 | * xaui_align [we have to poll the positive edge]. */ |
101 | if (efx->xmac_poll_required) | 102 | if (nic_data->xmac_poll_required) |
102 | return; | 103 | return; |
103 | 104 | ||
104 | efx_reado(efx, ®, FR_AB_XM_MGT_INT_MSK); | 105 | efx_reado(efx, ®, FR_AB_XM_MGT_INT_MSK); |
@@ -276,12 +277,14 @@ static bool falcon_xmac_check_fault(struct efx_nic *efx) | |||
276 | 277 | ||
277 | static int falcon_reconfigure_xmac(struct efx_nic *efx) | 278 | static int falcon_reconfigure_xmac(struct efx_nic *efx) |
278 | { | 279 | { |
280 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
281 | |||
279 | falcon_reconfigure_xgxs_core(efx); | 282 | falcon_reconfigure_xgxs_core(efx); |
280 | falcon_reconfigure_xmac_core(efx); | 283 | falcon_reconfigure_xmac_core(efx); |
281 | 284 | ||
282 | falcon_reconfigure_mac_wrapper(efx); | 285 | falcon_reconfigure_mac_wrapper(efx); |
283 | 286 | ||
284 | efx->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 5); | 287 | nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 5); |
285 | falcon_ack_status_intr(efx); | 288 | falcon_ack_status_intr(efx); |
286 | 289 | ||
287 | return 0; | 290 | return 0; |
@@ -349,11 +352,13 @@ static void falcon_update_stats_xmac(struct efx_nic *efx) | |||
349 | 352 | ||
350 | void falcon_poll_xmac(struct efx_nic *efx) | 353 | void falcon_poll_xmac(struct efx_nic *efx) |
351 | { | 354 | { |
355 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
356 | |||
352 | if (!EFX_WORKAROUND_5147(efx) || !efx->link_state.up || | 357 | if (!EFX_WORKAROUND_5147(efx) || !efx->link_state.up || |
353 | !efx->xmac_poll_required) | 358 | !nic_data->xmac_poll_required) |
354 | return; | 359 | return; |
355 | 360 | ||
356 | efx->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 1); | 361 | nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 1); |
357 | falcon_ack_status_intr(efx); | 362 | falcon_ack_status_intr(efx); |
358 | } | 363 | } |
359 | 364 | ||
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index f9d53a01bbc5..b7e8fe967826 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -684,7 +684,6 @@ struct efx_filter_state; | |||
684 | * @mdio: PHY MDIO interface | 684 | * @mdio: PHY MDIO interface |
685 | * @mdio_bus: PHY MDIO bus ID (only used by Siena) | 685 | * @mdio_bus: PHY MDIO bus ID (only used by Siena) |
686 | * @phy_mode: PHY operating mode. Serialised by @mac_lock. | 686 | * @phy_mode: PHY operating mode. Serialised by @mac_lock. |
687 | * @xmac_poll_required: XMAC link state needs polling | ||
688 | * @link_advertising: Autonegotiation advertising flags | 687 | * @link_advertising: Autonegotiation advertising flags |
689 | * @link_state: Current state of the link | 688 | * @link_state: Current state of the link |
690 | * @n_link_state_changes: Number of times the link has changed state | 689 | * @n_link_state_changes: Number of times the link has changed state |
@@ -771,7 +770,6 @@ struct efx_nic { | |||
771 | unsigned int mdio_bus; | 770 | unsigned int mdio_bus; |
772 | enum efx_phy_mode phy_mode; | 771 | enum efx_phy_mode phy_mode; |
773 | 772 | ||
774 | bool xmac_poll_required; | ||
775 | u32 link_advertising; | 773 | u32 link_advertising; |
776 | struct efx_link_state link_state; | 774 | struct efx_link_state link_state; |
777 | unsigned int n_link_state_changes; | 775 | unsigned int n_link_state_changes; |
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h index 980cf4b5a868..f107dc7d67c0 100644 --- a/drivers/net/sfc/nic.h +++ b/drivers/net/sfc/nic.h | |||
@@ -118,6 +118,7 @@ struct falcon_board { | |||
118 | * @spi_eeprom: SPI EEPROM device | 118 | * @spi_eeprom: SPI EEPROM device |
119 | * @spi_lock: SPI bus lock | 119 | * @spi_lock: SPI bus lock |
120 | * @mdio_lock: MDIO bus lock | 120 | * @mdio_lock: MDIO bus lock |
121 | * @xmac_poll_required: XMAC link state needs polling | ||
121 | */ | 122 | */ |
122 | struct falcon_nic_data { | 123 | struct falcon_nic_data { |
123 | struct pci_dev *pci_dev2; | 124 | struct pci_dev *pci_dev2; |
@@ -130,6 +131,7 @@ struct falcon_nic_data { | |||
130 | struct efx_spi_device spi_eeprom; | 131 | struct efx_spi_device spi_eeprom; |
131 | struct mutex spi_lock; | 132 | struct mutex spi_lock; |
132 | struct mutex mdio_lock; | 133 | struct mutex mdio_lock; |
134 | bool xmac_poll_required; | ||
133 | }; | 135 | }; |
134 | 136 | ||
135 | static inline struct falcon_board *falcon_board(struct efx_nic *efx) | 137 | static inline struct falcon_board *falcon_board(struct efx_nic *efx) |