]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
sfc: Move xmac_poll_required into struct falcon_nic_data
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 2 Dec 2010 13:47:51 +0000 (13:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Dec 2010 17:08:09 +0000 (09:08 -0800)
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sfc/falcon.c
drivers/net/sfc/falcon_boards.c
drivers/net/sfc/falcon_xmac.c
drivers/net/sfc/net_driver.h
drivers/net/sfc/nic.h

index fd5bf0b7e8a271dbeb0999b30db526319406d36e..07f684ed2d9be5acb204cf7044b19da03ccf9081 100644 (file)
@@ -886,6 +886,7 @@ static bool
 falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
 {
        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) ||
            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)
 
        if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) &&
            EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
-               efx->xmac_poll_required = true;
+               nic_data->xmac_poll_required = true;
                return true;
        }
 
index a6fc5ce88c88a952dfa356669ace9b61139b323d..2dd16f0b3ced007ff2aeb761373ce98d40c76af3 100644 (file)
@@ -415,10 +415,11 @@ static void sfe4001_fini(struct efx_nic *efx)
 
 static int sfe4001_check_hw(struct efx_nic *efx)
 {
+       struct falcon_nic_data *nic_data = efx->nic_data;
        s32 status;
 
        /* 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;
 
        /* Check the powered status of the PHY. Lack of power implies that
index e293e25d13483ef95d9b38726cbd1a0d86e811e3..b49e84394641a1493c2afd6b896402eb8f588821 100644 (file)
@@ -87,6 +87,7 @@ int falcon_reset_xaui(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;
 
        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)
 
        /* We can only use this interrupt to signal the negative edge of
         * xaui_align [we have to poll the positive edge]. */
-       if (efx->xmac_poll_required)
+       if (nic_data->xmac_poll_required)
                return;
 
        efx_reado(efx, &reg, FR_AB_XM_MGT_INT_MSK);
@@ -276,12 +277,14 @@ static bool falcon_xmac_check_fault(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_xmac_core(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);
 
        return 0;
@@ -349,11 +352,13 @@ static void falcon_update_stats_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 ||
-           !efx->xmac_poll_required)
+           !nic_data->xmac_poll_required)
                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);
 }
 
index f9d53a01bbc57b8f3bc2450b4260968a759ea892..b7e8fe967826e88fedaa0e2ae8d583fa88015ae1 100644 (file)
@@ -684,7 +684,6 @@ struct efx_filter_state;
  * @mdio: PHY MDIO interface
  * @mdio_bus: PHY MDIO bus ID (only used by Siena)
  * @phy_mode: PHY operating mode. Serialised by @mac_lock.
- * @xmac_poll_required: XMAC link state needs polling
  * @link_advertising: Autonegotiation advertising flags
  * @link_state: Current state of the link
  * @n_link_state_changes: Number of times the link has changed state
@@ -771,7 +770,6 @@ struct efx_nic {
        unsigned int mdio_bus;
        enum efx_phy_mode phy_mode;
 
-       bool xmac_poll_required;
        u32 link_advertising;
        struct efx_link_state link_state;
        unsigned int n_link_state_changes;
index 980cf4b5a868921dd5672a60f94f655beb7b446f..f107dc7d67c0fc2ed2eb9c2b92ffb47f22043acf 100644 (file)
@@ -118,6 +118,7 @@ struct falcon_board {
  * @spi_eeprom: SPI EEPROM device
  * @spi_lock: SPI bus lock
  * @mdio_lock: MDIO bus lock
+ * @xmac_poll_required: XMAC link state needs polling
  */
 struct falcon_nic_data {
        struct pci_dev *pci_dev2;
@@ -130,6 +131,7 @@ struct falcon_nic_data {
        struct efx_spi_device spi_eeprom;
        struct mutex spi_lock;
        struct mutex mdio_lock;
+       bool xmac_poll_required;
 };
 
 static inline struct falcon_board *falcon_board(struct efx_nic *efx)