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

Commit 09f39a95 authored by Christophe Ricard's avatar Christophe Ricard Committed by Samuel Ortiz
Browse files

NFC: st21nfcb: Do not remove header once the payload is sent



Once the data is sent, we need to preserve the full frame for
the ndlc state machine. If the NDLC ACK is not received in time,
the ndlc layer will resend the same frame.
Having the header byte pulled will corrupt the frame.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 38bd83f0
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -87,11 +87,6 @@ static void st21nfcb_nci_i2c_disable(void *phy_id)
	gpio_set_value(phy->gpio_reset, 1);
}

static void st21nfcb_nci_remove_header(struct sk_buff *skb)
{
	skb_pull(skb, ST21NFCB_FRAME_HEADROOM);
}

/*
 * Writing a frame must not return the number of written bytes.
 * It must return either zero for success, or <0 for error.
@@ -121,8 +116,6 @@ static int st21nfcb_nci_i2c_write(void *phy_id, struct sk_buff *skb)
			r = 0;
	}

	st21nfcb_nci_remove_header(skb);

	return r;
}