Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19b76591 authored by Dmitry Bogdanov's avatar Dmitry Bogdanov Committed by Jinesh K. Jayakumar
Browse files

atlantic-forwarding driver v1.0.22



  [ATLDRV-871] - pause frame does not turn off
  [ATLDRV-994] - failed set StripEtherPadding
  [ATLDRV-1062] - FWD: IPA: AQ058: Crash caused due to 32 Tx descs are zero'ed
  [ATLDRV-1066] - AQ062: atl_update_eth_stats() - sleeping function called from invalid context
  [ATLDRV-1067] - AQ061: AQC FWD ring descriptor memory reset
  [ATLDRV-1068] - AQ060: AQC Rx accessing buffer address from previous atl_fwd_request_ring()
  [ATLDRV-1075] - AQ063: v1.0.20 driver - atl_update_thermal_flag() missing atl_unlock_fw()
  [ATLDRV-803] - AQ040: Validation for Interrupt Moderation in FWD API
  [ATLDRV-1022] - Media detect control

Signed-off-by: default avatarDmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Change-Id: I33ba3f0438767d5ea9581a0950829c3b2b434eb0
Git-commit: 27608814e0000857b338f5f0f43942db5171fe08
Git-commit: c0260b607c91b5d10be3d939c9adaa48f8ea162d
Git-repo: https://github.com/aquantia/linux-4.14-atlantic-forwarding


[jineshk@codeaurora.org: melds in release v1.0.22 to fix build errors]
Signed-off-by: default avatarJinesh K. Jayakumar <jineshk@codeaurora.org>
parent 73ad9c51
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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;

@@ -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 {
@@ -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,
};

@@ -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);
@@ -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
+28 −2
Original line number Diff line number Diff line
@@ -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);
}
@@ -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) |
@@ -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)
@@ -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);
@@ -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);
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -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 {
+5 −13
Original line number Diff line number Diff line
@@ -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);
@@ -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);
@@ -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;
@@ -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);
+1 −2
Original line number Diff line number Diff line
@@ -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