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

Commit ef454a95 authored by Sunil Paidimarri's avatar Sunil Paidimarri Committed by Gerrit - the friendly Code Review server
Browse files

net: stmmac: disable CRC stripping in SW



CRC should not be stripped in SW.

Change-Id: Ie3640a6a394dd11a4d37047d789d4a02d0a560bd
Acked-by: default avatarNing Cai <ncai@qti.qualcomm.com>
Signed-off-by: default avatarSunil Paidimarri <hisunil@codeaurora.org>
parent 08d4c1e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -603,6 +603,7 @@ struct mac_device_info {
	unsigned int pmt;
	unsigned int ps;
	unsigned int crc_strip_en;
	unsigned int acs_strip_en;
};

struct stmmac_rx_routing {
+5 −0
Original line number Diff line number Diff line
@@ -93,6 +93,11 @@ static int dwmac4_wrback_get_rx_status(void *data, struct stmmac_extra_stats *x,
	if (likely(!(rdes3 & RDES3_LAST_DESCRIPTOR)))
		return discard_frame;

	if (unlikely(!(rdes3 & RDES3_PACKET_LEN_TYPE_MASK))) {
		pr_info("rdes3 = 0xX\n", rdes3);
		ret = llc_snap;
	}

	if (unlikely(rdes3 & RDES3_ERROR_SUMMARY)) {
		if (unlikely(rdes3 & RDES3_GIANT_PACKET))
			stats->rx_length_errors++;
+8 −2
Original line number Diff line number Diff line
@@ -2626,6 +2626,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
		}
	}
	priv->hw->crc_strip_en = priv->plat->crc_strip_en;
	priv->hw->acs_strip_en = 0;

	/* Initialize the MAC Core */
	priv->hw->mac->core_init(priv->hw, dev);
@@ -3608,8 +3609,13 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
			 * feature is always disabled and packets need to be
			 * stripped manually.
			 */
			if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
			    unlikely(status != llc_snap))
			if ((likely(priv->synopsys_id >= DWMAC_CORE_4_00) &&
			     ((unlikely(!priv->hw->crc_strip_en) &&
			       status != llc_snap) ||
			      (unlikely(!priv->hw->acs_strip_en) &&
			       status == llc_snap))) ||
			    (unlikely(priv->synopsys_id < DWMAC_CORE_4_00) &&
			     unlikely(status != llc_snap)))
				frame_len -= ETH_FCS_LEN;

			if (netif_msg_rx_status(priv)) {