lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 29 Feb 2016 20:59:29 +0100
From:	Marek Vasut <marex@...x.de>
To:	linux-can@...r.kernel.org
Cc:	netdev@...r.kernel.org, Marek Vasut <marex@...x.de>,
	Marc Kleine-Budde <mkl@...gutronix.de>,
	Mark Rutland <mark.rutland@....com>,
	Oliver Hartkopp <socketcan@...tkopp.net>,
	Wolfgang Grandegger <wg@...ndegger.com>
Subject: [PATCH 2/4] net: can: ifi: Fix TX DLC configuration

The TX DLC, the transmission length information, was not written
into the transmit configuration register. When using the CAN core
with different CAN controller, the receiving CAN controller will
receive only the ID part of the CAN frame, but no data at all.

This patch adds the TX DLC into the register to fix this issue.

Signed-off-by: Marek Vasut <marex@...x.de>
Cc: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Oliver Hartkopp <socketcan@...tkopp.net>
Cc: Wolfgang Grandegger <wg@...ndegger.com>
---
 drivers/net/can/ifi_canfd/ifi_canfd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c
index 72f5205..82a33bd 100644
--- a/drivers/net/can/ifi_canfd/ifi_canfd.c
+++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
@@ -774,10 +774,15 @@ static netdev_tx_t ifi_canfd_start_xmit(struct sk_buff *skb,
 
 	if (priv->can.ctrlmode & (CAN_CTRLMODE_FD | CAN_CTRLMODE_FD_NON_ISO)) {
 		if (can_is_canfd_skb(skb)) {
+			txdlc |= can_len2dlc(cf->len);
 			txdlc |= IFI_CANFD_TXFIFO_DLC_EDL;
 			if (cf->flags & CANFD_BRS)
 				txdlc |= IFI_CANFD_TXFIFO_DLC_BRS;
+		} else {
+			txdlc |= cf->len;
 		}
+	} else {
+		txdlc |= cf->len;
 	}
 
 	if (cf->can_id & CAN_RTR_FLAG)
-- 
2.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ