Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h +6 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <linux/netdevice.h> #include <linux/moduleparam.h> #define ATL_VERSION "1.0.20" #define ATL_VERSION "1.0.22" struct atl_nic; Loading Loading @@ -262,6 +262,7 @@ enum atl_priv_flags { ATL_PF_LPI_TX_PHY, ATL_PF_STATS_RESET, ATL_PF_STRIP_PAD, ATL_PF_MEDIA_DETECT, }; enum atl_priv_flag_bits { Loading @@ -282,9 +283,10 @@ enum atl_priv_flag_bits { ATL_DEF_PF_BIT(STATS_RESET), ATL_DEF_PF_BIT(STRIP_PAD), ATL_DEF_PF_BIT(MEDIA_DETECT), ATL_PF_RW_MASK = ATL_PF_LPB_MASK | ATL_PF_BIT(STATS_RESET) | ATL_PF_BIT(STRIP_PAD), ATL_PF_BIT(STRIP_PAD) | ATL_PF_BIT(MEDIA_DETECT), ATL_PF_RO_MASK = ATL_PF_LPI_MASK, }; Loading Loading @@ -372,6 +374,7 @@ void atl_clear_datapath(struct atl_nic *nic); int atl_start_rings(struct atl_nic *nic); void atl_stop_rings(struct atl_nic *nic); void atl_clear_rdm_cache(struct atl_nic *nic); void atl_clear_tdm_cache(struct atl_nic *nic); int atl_alloc_rings(struct atl_nic *nic); void atl_free_rings(struct atl_nic *nic); irqreturn_t atl_ring_irq(int irq, void *priv); Loading Loading @@ -418,5 +421,6 @@ int atl_hwmon_init(struct atl_nic *nic); int atl_update_thermal(struct atl_hw *hw); int atl_update_thermal_flag(struct atl_hw *hw, int bit, bool val); int atl_verify_thermal_limits(struct atl_hw *hw, struct atl_thermal *thermal); int atl_do_reset(struct atl_nic *nic); #endif drivers/net/ethernet/aquantia/atlantic-fwd/atl_ethtool.c +28 −2 Original line number Diff line number Diff line Loading @@ -394,7 +394,7 @@ static void atl_get_pauseparam(struct net_device *ndev, struct atl_nic *nic = netdev_priv(ndev); struct atl_fc_state *fc = &nic->hw.link_state.fc; pause->autoneg = 1; pause->autoneg = 0; pause->rx_pause = !!(fc->cur & atl_fc_rx); pause->tx_pause = !!(fc->cur & atl_fc_tx); } Loading @@ -410,7 +410,7 @@ static int atl_set_pauseparam(struct net_device *ndev, if (atl_fw_major(hw) < 2) return -EOPNOTSUPP; if (pause->autoneg && !lstate->autoneg) if (pause->autoneg) return -EINVAL; fc->req = (!!pause->rx_pause << atl_fc_rx_shift) | Loading Loading @@ -617,6 +617,7 @@ static const char atl_priv_flags[][ETH_GSTRING_LEN] = { ATL_PRIV_FLAG(TX_LPI_PHY, LPI_TX_PHY), ATL_PRIV_FLAG(ResetStatistics, STATS_RESET), ATL_PRIV_FLAG(StripEtherPadding, STRIP_PAD), ATL_PRIV_FLAG(MediaDetect, MEDIA_DETECT), }; static int atl_get_sset_count(struct net_device *ndev, int sset) Loading Loading @@ -700,6 +701,7 @@ static void atl_get_ethtool_stats(struct net_device *ndev, struct atl_nic *nic = netdev_priv(ndev); int i; atl_update_eth_stats(nic); atl_update_global_stats(nic); atl_write_stats(&nic->stats.tx, tx_stat_descs, data, uint64_t); Loading Loading @@ -821,6 +823,23 @@ static int atl_set_pad_stripping(struct atl_nic *nic, bool on) return 0; } static int atl_set_media_detect(struct atl_nic *nic, bool on) { struct atl_hw *hw = &nic->hw; int ret; if (hw->mcp.fw_rev < 0x0301005a) return -EOPNOTSUPP; ret = atl_write_fwsettings_word(hw, atl_fw2_setings_media_detect, on); if (ret) return ret; /* Restart aneg to make FW apply the new settings */ hw->mcp.ops->restart_aneg(hw); return 0; } static uint32_t atl_get_priv_flags(struct net_device *ndev) { struct atl_nic *nic = netdev_priv(ndev); Loading Loading @@ -854,6 +873,13 @@ static int atl_set_priv_flags(struct net_device *ndev, uint32_t flags) return ret; } if (diff & ATL_PF_BIT(MEDIA_DETECT)) { ret = atl_set_media_detect(nic, !!(flags & ATL_PF_BIT(MEDIA_DETECT))); if (ret) return ret; } if (hweight32(lpb) > 1) { atl_nic_err("Can't enable more than one loopback simultaneously\n"); return -EINVAL; Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_fw.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ enum atl_fw2_stat_offt { enum atl_fw2_settings_offt { atl_fw2_setings_msm_opts = 0x90, atl_fw2_setings_media_detect = 0x98, }; enum atl_fw2_msm_opts { Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.c +5 −13 Original line number Diff line number Diff line Loading @@ -301,6 +301,8 @@ void atl_fwd_release_ring(struct atl_fwd_ring *ring) atl_fwd_release_event(ring->evt); } atl_do_reset(nic); __clear_bit(idx, map); rings[idx - ATL_FWD_RING_BASE] = NULL; atl_fwd_free_bufs(ring); Loading Loading @@ -416,7 +418,6 @@ struct atl_fwd_ring *atl_fwd_request_ring(struct net_device *ndev, } memset(hwring->descs, 0, hwring->size * sizeof(*hwring->descs)); hwring->reg_base = dir_tx ? ATL_TX_RING(idx) : ATL_RX_RING(idx); ret = atl_fwd_alloc_bufs(ring, page_order); Loading Loading @@ -496,16 +497,6 @@ void atl_fwd_release_rings(struct atl_nic *nic) atl_fwd_release_ring(rings[i]); } static void atl_fwd_reset_ring(struct atl_fwd_ring *fwd_ring) { struct atl_hw *hw = &fwd_ring->nic->hw; struct atl_hw_ring *ring = &fwd_ring->hw; atl_write(hw, ATL_RING_CTL(ring), BIT(19)); udelay(10); atl_write(hw, ATL_RING_CTL(ring), 0); } int atl_fwd_enable_ring(struct atl_fwd_ring *ring) { struct atl_hw *hw = &ring->nic->hw; Loading @@ -519,11 +510,12 @@ EXPORT_SYMBOL(atl_fwd_enable_ring); void atl_fwd_disable_ring(struct atl_fwd_ring *ring) { struct atl_hw *hw = &ring->nic->hw; if (!(ring->state & ATL_FWR_ST_ENABLED)) return; atl_fwd_reset_ring(ring); atl_fwd_init_ring(ring); atl_clear_bits(hw, ATL_RING_CTL(&ring->hw), BIT(31)); ring->state &= ~ATL_FWR_ST_ENABLED; } EXPORT_SYMBOL(atl_fwd_disable_ring); Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.h +1 −2 Original line number Diff line number Diff line Loading @@ -302,8 +302,7 @@ int atl_fwd_enable_ring(struct atl_fwd_ring *ring); * * @ring: ring to be disabled * * Stops and resets the ring. On next ring enable head and tail * pointers will be zero. * Stops the ring. */ void atl_fwd_disable_ring(struct atl_fwd_ring *ring); Loading Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h +6 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <linux/netdevice.h> #include <linux/moduleparam.h> #define ATL_VERSION "1.0.20" #define ATL_VERSION "1.0.22" struct atl_nic; Loading Loading @@ -262,6 +262,7 @@ enum atl_priv_flags { ATL_PF_LPI_TX_PHY, ATL_PF_STATS_RESET, ATL_PF_STRIP_PAD, ATL_PF_MEDIA_DETECT, }; enum atl_priv_flag_bits { Loading @@ -282,9 +283,10 @@ enum atl_priv_flag_bits { ATL_DEF_PF_BIT(STATS_RESET), ATL_DEF_PF_BIT(STRIP_PAD), ATL_DEF_PF_BIT(MEDIA_DETECT), ATL_PF_RW_MASK = ATL_PF_LPB_MASK | ATL_PF_BIT(STATS_RESET) | ATL_PF_BIT(STRIP_PAD), ATL_PF_BIT(STRIP_PAD) | ATL_PF_BIT(MEDIA_DETECT), ATL_PF_RO_MASK = ATL_PF_LPI_MASK, }; Loading Loading @@ -372,6 +374,7 @@ void atl_clear_datapath(struct atl_nic *nic); int atl_start_rings(struct atl_nic *nic); void atl_stop_rings(struct atl_nic *nic); void atl_clear_rdm_cache(struct atl_nic *nic); void atl_clear_tdm_cache(struct atl_nic *nic); int atl_alloc_rings(struct atl_nic *nic); void atl_free_rings(struct atl_nic *nic); irqreturn_t atl_ring_irq(int irq, void *priv); Loading Loading @@ -418,5 +421,6 @@ int atl_hwmon_init(struct atl_nic *nic); int atl_update_thermal(struct atl_hw *hw); int atl_update_thermal_flag(struct atl_hw *hw, int bit, bool val); int atl_verify_thermal_limits(struct atl_hw *hw, struct atl_thermal *thermal); int atl_do_reset(struct atl_nic *nic); #endif
drivers/net/ethernet/aquantia/atlantic-fwd/atl_ethtool.c +28 −2 Original line number Diff line number Diff line Loading @@ -394,7 +394,7 @@ static void atl_get_pauseparam(struct net_device *ndev, struct atl_nic *nic = netdev_priv(ndev); struct atl_fc_state *fc = &nic->hw.link_state.fc; pause->autoneg = 1; pause->autoneg = 0; pause->rx_pause = !!(fc->cur & atl_fc_rx); pause->tx_pause = !!(fc->cur & atl_fc_tx); } Loading @@ -410,7 +410,7 @@ static int atl_set_pauseparam(struct net_device *ndev, if (atl_fw_major(hw) < 2) return -EOPNOTSUPP; if (pause->autoneg && !lstate->autoneg) if (pause->autoneg) return -EINVAL; fc->req = (!!pause->rx_pause << atl_fc_rx_shift) | Loading Loading @@ -617,6 +617,7 @@ static const char atl_priv_flags[][ETH_GSTRING_LEN] = { ATL_PRIV_FLAG(TX_LPI_PHY, LPI_TX_PHY), ATL_PRIV_FLAG(ResetStatistics, STATS_RESET), ATL_PRIV_FLAG(StripEtherPadding, STRIP_PAD), ATL_PRIV_FLAG(MediaDetect, MEDIA_DETECT), }; static int atl_get_sset_count(struct net_device *ndev, int sset) Loading Loading @@ -700,6 +701,7 @@ static void atl_get_ethtool_stats(struct net_device *ndev, struct atl_nic *nic = netdev_priv(ndev); int i; atl_update_eth_stats(nic); atl_update_global_stats(nic); atl_write_stats(&nic->stats.tx, tx_stat_descs, data, uint64_t); Loading Loading @@ -821,6 +823,23 @@ static int atl_set_pad_stripping(struct atl_nic *nic, bool on) return 0; } static int atl_set_media_detect(struct atl_nic *nic, bool on) { struct atl_hw *hw = &nic->hw; int ret; if (hw->mcp.fw_rev < 0x0301005a) return -EOPNOTSUPP; ret = atl_write_fwsettings_word(hw, atl_fw2_setings_media_detect, on); if (ret) return ret; /* Restart aneg to make FW apply the new settings */ hw->mcp.ops->restart_aneg(hw); return 0; } static uint32_t atl_get_priv_flags(struct net_device *ndev) { struct atl_nic *nic = netdev_priv(ndev); Loading Loading @@ -854,6 +873,13 @@ static int atl_set_priv_flags(struct net_device *ndev, uint32_t flags) return ret; } if (diff & ATL_PF_BIT(MEDIA_DETECT)) { ret = atl_set_media_detect(nic, !!(flags & ATL_PF_BIT(MEDIA_DETECT))); if (ret) return ret; } if (hweight32(lpb) > 1) { atl_nic_err("Can't enable more than one loopback simultaneously\n"); return -EINVAL; Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_fw.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ enum atl_fw2_stat_offt { enum atl_fw2_settings_offt { atl_fw2_setings_msm_opts = 0x90, atl_fw2_setings_media_detect = 0x98, }; enum atl_fw2_msm_opts { Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.c +5 −13 Original line number Diff line number Diff line Loading @@ -301,6 +301,8 @@ void atl_fwd_release_ring(struct atl_fwd_ring *ring) atl_fwd_release_event(ring->evt); } atl_do_reset(nic); __clear_bit(idx, map); rings[idx - ATL_FWD_RING_BASE] = NULL; atl_fwd_free_bufs(ring); Loading Loading @@ -416,7 +418,6 @@ struct atl_fwd_ring *atl_fwd_request_ring(struct net_device *ndev, } memset(hwring->descs, 0, hwring->size * sizeof(*hwring->descs)); hwring->reg_base = dir_tx ? ATL_TX_RING(idx) : ATL_RX_RING(idx); ret = atl_fwd_alloc_bufs(ring, page_order); Loading Loading @@ -496,16 +497,6 @@ void atl_fwd_release_rings(struct atl_nic *nic) atl_fwd_release_ring(rings[i]); } static void atl_fwd_reset_ring(struct atl_fwd_ring *fwd_ring) { struct atl_hw *hw = &fwd_ring->nic->hw; struct atl_hw_ring *ring = &fwd_ring->hw; atl_write(hw, ATL_RING_CTL(ring), BIT(19)); udelay(10); atl_write(hw, ATL_RING_CTL(ring), 0); } int atl_fwd_enable_ring(struct atl_fwd_ring *ring) { struct atl_hw *hw = &ring->nic->hw; Loading @@ -519,11 +510,12 @@ EXPORT_SYMBOL(atl_fwd_enable_ring); void atl_fwd_disable_ring(struct atl_fwd_ring *ring) { struct atl_hw *hw = &ring->nic->hw; if (!(ring->state & ATL_FWR_ST_ENABLED)) return; atl_fwd_reset_ring(ring); atl_fwd_init_ring(ring); atl_clear_bits(hw, ATL_RING_CTL(&ring->hw), BIT(31)); ring->state &= ~ATL_FWR_ST_ENABLED; } EXPORT_SYMBOL(atl_fwd_disable_ring); Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.h +1 −2 Original line number Diff line number Diff line Loading @@ -302,8 +302,7 @@ int atl_fwd_enable_ring(struct atl_fwd_ring *ring); * * @ring: ring to be disabled * * Stops and resets the ring. On next ring enable head and tail * pointers will be zero. * Stops the ring. */ void atl_fwd_disable_ring(struct atl_fwd_ring *ring); Loading