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

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

atlantic forwarding driver v1.1.4

  [ATLDRV-1371] - Add supported eee with 2.5G and 5G
  [ATLDRV-1376] - Send notification when macsec offload turned on/off
  [ATLDRV-1378] - check FW capability instead of FW version for MSM Apply Settings

Change-Id: I50349b58f934896b161c38d0292416a4ba40b2bf
Signed-off: Dmitry Bogdanov <dbogdanov@marvell.com>
Git-commit: 5be5557abd1f19f510d4b32df46bf196f68e8a4e
Git-repo: https://github.com/aquantia/linux-4.14-atlantic-forwarding


Signed-off-by: default avatarJinesh K. Jayakumar <jineshk@codeaurora.org>
parent d1503063
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -18,10 +18,9 @@
#include <linux/netdevice.h>
#include <linux/moduleparam.h>

#define ATL_VERSION "1.1.3"
#define ATL_VERSION "1.1.4"

struct atl_nic;
enum atl_fwd_notify;

#include "atl_compat.h"
#include "atl_hw.h"
@@ -210,7 +209,7 @@ struct atl_fwd {
	struct blocking_notifier_head nh_clients;
};

#ifdef CONFIG_ATLFWD_FWD_NETLINK
#if IS_ENABLED(CONFIG_ATLFWD_FWD_NETLINK)
struct atl_fwdnl {
	struct atl_desc_ring ring_desc[ATL_NUM_FWD_RINGS * 2];
	/* State of forced redirections */
@@ -241,10 +240,10 @@ struct atl_nic {
	spinlock_t stats_lock;
	struct work_struct work;

#ifdef CONFIG_ATLFWD_FWD
#if IS_ENABLED(CONFIG_ATLFWD_FWD)
	struct atl_fwd fwd;
#endif
#ifdef CONFIG_ATLFWD_FWD_NETLINK
#if IS_ENABLED(CONFIG_ATLFWD_FWD_NETLINK)
	struct atl_fwdnl fwdnl;
#endif

@@ -383,12 +382,16 @@ int atl_update_eth_stats(struct atl_nic *nic);
void atl_adjust_eth_stats(struct atl_ether_stats *stats,
	struct atl_ether_stats *base, bool add);
void atl_fwd_release_rings(struct atl_nic *nic);
#ifdef CONFIG_ATLFWD_FWD
#if IS_ENABLED(CONFIG_ATLFWD_FWD)
enum atl_fwd_notify;
int atl_fwd_suspend_rings(struct atl_nic *nic);
int atl_fwd_resume_rings(struct atl_nic *nic);
void atl_fwd_notify(struct atl_nic *nic, enum atl_fwd_notify notif, void *data);
#else
static inline int atl_fwd_suspend_rings(struct atl_nic *nic) { return 0; }
static inline int atl_fwd_resume_rings(struct atl_nic *nic) { return 0; }
static inline void atl_fwd_notify(struct atl_nic *nic,
				  enum atl_fwd_notify notif, void *data) {}
#endif
int atl_get_lpi_timer(struct atl_nic *nic, uint32_t *lpi_delay);
void atl_refresh_rxfs(struct atl_nic *nic);
+13 −16
Original line number Diff line number Diff line
@@ -190,9 +190,9 @@ static int atl_set_fixed_speed(struct atl_hw *hw, unsigned int speed,

	if (lstate->eee_enabled) {
		atl_link_to_kernel(lstate->supported >> ATL_EEE_BIT_OFFT,
				   &tmp, true);
				   &tmp, false);
		/* advertize the supported links */
		tmp = atl_kernel_to_link(&tmp, true);
		tmp = atl_kernel_to_link(&tmp, false);
		lstate->advertized |= tmp << ATL_EEE_BIT_OFFT;
	}

@@ -470,31 +470,28 @@ static int atl_set_eee(struct net_device *ndev, struct ethtool_eee *eee)
	struct atl_nic *nic = netdev_priv(ndev);
	struct atl_hw *hw = &nic->hw;
	struct atl_link_state *lstate = &hw->link_state;
	uint32_t tmp = 0;
	uint32_t lpi_timer = 0;
	unsigned long tmp = 0;

	if ((hw->chip_id == ATL_ATLANTIC) && (atl_fw_major(hw) < 2))
		return -EOPNOTSUPP;

	atl_get_lpi_timer(nic, &tmp);
	if (eee->tx_lpi_timer != tmp)
	atl_get_lpi_timer(nic, &lpi_timer);
	if (eee->tx_lpi_timer != lpi_timer)
		return -EOPNOTSUPP;

	lstate->eee_enabled = eee->eee_enabled;

	if (lstate->eee_enabled) {
		atl_link_to_kernel(lstate->supported >> ATL_EEE_BIT_OFFT,
			(unsigned long *)&tmp, true);
				   &tmp, false);
		if (eee->advertised & ~tmp)
			return -EINVAL;

		/* advertize the requested link or all supported */
		if (eee->advertised)
			tmp = atl_kernel_to_link(
					(unsigned long *)&eee->advertised,
					true);
		else
			tmp = atl_kernel_to_link(
					(unsigned long *)&tmp, true);
			tmp = eee->advertised;
		tmp = atl_kernel_to_link(&tmp, false);
	}

	lstate->advertized &= ~ATL_EEE_MASK;
@@ -736,7 +733,7 @@ static int atl_get_sset_count(struct net_device *ndev, int sset)
		return ARRAY_SIZE(tx_stat_descs) * (nic->nvecs + 1) +
		       ARRAY_SIZE(rx_stat_descs) * (nic->nvecs + 1) +
		       ARRAY_SIZE(eth_stat_descs)
#ifdef CONFIG_ATLFWD_FWD_NETLINK
#if IS_ENABLED(CONFIG_ATLFWD_FWD_NETLINK)
		       + ARRAY_SIZE(tx_stat_descs) *
				 hweight_long(nic->fwd.ring_map[ATL_FWDIR_TX])
		       + ARRAY_SIZE(rx_stat_descs) *
@@ -801,7 +798,7 @@ static void atl_get_strings(struct net_device *ndev, uint32_t sset,
			atl_copy_stats_string_set(&p, prefix);
		}

#ifdef CONFIG_ATLFWD_FWD_NETLINK
#if IS_ENABLED(CONFIG_ATLFWD_FWD_NETLINK)
		for (i = 0; i < ATL_NUM_FWD_RINGS; i++) {
			snprintf(prefix, sizeof(prefix), "fwd_ring_%d_", i);

@@ -909,7 +906,7 @@ static void atl_get_ethtool_stats(struct net_device *ndev,
		atl_write_stats(&tmp.rx, rx_stat_descs, data, uint64_t);
	}

#ifdef CONFIG_ATLFWD_FWD_NETLINK
#if IS_ENABLED(CONFIG_ATLFWD_FWD_NETLINK)
	for (i = 0; i < ATL_NUM_FWD_RINGS; i++) {
		struct atl_ring_stats tmp;

@@ -1392,7 +1389,7 @@ static int atl_rxf_check_ring(struct atl_nic *nic, uint32_t ring)
	if (ring < nic->nvecs || ring == ATL_RXF_RING_ANY)
		return 0;

#ifdef CONFIG_ATLFWD_FWD
#if IS_ENABLED(CONFIG_ATLFWD_FWD)
	if (test_bit(ring, &nic->fwd.ring_map[ATL_FWDIR_RX]))
		return 0;
#endif
+1 −1
Original line number Diff line number Diff line
@@ -630,7 +630,7 @@ static int __atl_fw2x_apply_msm_settings(struct atl_hw *hw)
	uint32_t high_status, high_req = 0;
	int ret = 0;

	if (hw->mcp.fw_rev < 0x0301006e)
	if (!(hw->mcp.caps_ex & atl_fw2_ex_caps_msm_settings_apply))
		return __atl_fw2_restart_aneg(hw);

	ret = atl_write_mcp_mem(hw, 0, &msg_id, sizeof(msg_id),
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ enum atl_fw2_opts {
enum atl_fw2_ex_caps {
	atl_define_bit(atl_fw2_ex_caps_wol_ex, 23)
	atl_define_bit(atl_fw2_ex_caps_mac_heartbeat, 25)
	atl_define_bit(atl_fw2_ex_caps_msm_settings_apply, 26)
};

enum atl_fw2_wol_ex {
+4 −4
Original line number Diff line number Diff line
@@ -825,9 +825,9 @@ int atl_fwd_unregister_notifier(struct net_device *ndev,
}
EXPORT_SYMBOL(atl_fwd_unregister_notifier);

void atl_fwd_notify(struct atl_nic *nic, enum atl_fwd_notify notif)
void atl_fwd_notify(struct atl_nic *nic, enum atl_fwd_notify notif, void *data)
{
	blocking_notifier_call_chain(&nic->fwd.nh_clients, notif, NULL);
	blocking_notifier_call_chain(&nic->fwd.nh_clients, notif, data);
}

int atl_fwd_reconfigure_rings(struct atl_nic *nic)
@@ -862,7 +862,7 @@ int atl_fwd_reconfigure_rings(struct atl_nic *nic)

int atl_fwd_suspend_rings(struct atl_nic *nic)
{
	atl_fwd_notify(nic, ATL_FWD_NOTIFY_RESET_PREPARE);
	atl_fwd_notify(nic, ATL_FWD_NOTIFY_RESET_PREPARE, NULL);

	return 0;
}
@@ -877,7 +877,7 @@ int atl_fwd_resume_rings(struct atl_nic *nic)
	if (ret)
		goto err;

	atl_fwd_notify(nic, ATL_FWD_NOTIFY_RESET_COMPLETE);
	atl_fwd_notify(nic, ATL_FWD_NOTIFY_RESET_COMPLETE, NULL);

	for (i = 0; i < ATL_NUM_FWD_RINGS * ATL_FWDIR_NUM; i++) {
		ring = nic->fwd.rings[i % ATL_FWDIR_NUM][i / ATL_FWDIR_NUM];
Loading