[PATCH v1 05/34] j1939: transport: call J1939_ERRQUEUE_SCHED on CTS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



only here we can really talk about acked part of session

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 net/can/j1939/transport.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index 858c4587af8f..8b15c5d529a1 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -809,7 +809,7 @@ static int j1939_tp_txnext(struct j1939_session *session)
 			j1939_tp_set_rxtimeout(session, 250);
 		if (ret)
 			goto failed;
-		j1939_sk_errqueue(session, J1939_ERRQUEUE_SCHED);
+
 		break;
 	}
 
@@ -1056,6 +1056,7 @@ j1939_xtp_rx_eoma(struct j1939_session *session, struct sk_buff *skb)
 	if (j1939_xtp_rx_cmd_bad_pgn(session, skb))
 		return;
 
+	session->pkt.tx_acked = session->pkt.total;
 	j1939_session_timers_cancel(session);
 	/* transmitted without problems */
 	j1939_session_completed(session);
@@ -1104,8 +1105,11 @@ j1939_xtp_rx_cts(struct j1939_session *session, struct sk_buff *skb)
 	j1939_session_unlock(session);
 	if (dat[1]) {
 		j1939_tp_set_rxtimeout(session, 1250);
-		if (j1939_tp_im_transmitter(&session->skcb))
+		if (j1939_tp_im_transmitter(&session->skcb)) {
+			if (session->pkt.tx_acked)
+				j1939_sk_errqueue(session, J1939_ERRQUEUE_SCHED);
 			j1939_tp_schedule_txtimer(session, 0);
+		}
 	} else {
 		/* CTS(0) */
 		j1939_tp_set_rxtimeout(session, 550);
-- 
2.20.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux