Skip to contentSkip to conversation

for C_CAN driver.

PATCH New Holger Bechtold 1 participant 1 message Nov 25, 2013 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 for C_CAN driver.

Hello all

As suggested by Marc Kleine-Budde I re-submit a modified version of the patch for the transmitted bytes counter.

---------- patch description -----------------------------------------------

The number of bytes transmitted was not updated correctly, if several CAN messages (with different length) were transmitted in one 'bunch'. Thus programs like 'ifconfig' showed wrong transmit byte counts. Reason was, that the message object whose DLC is to be read was not necessarily the active one at the time when
priv->read_reg(priv, C_CAN_IFACE(MSGCTRL_REG, 0)) & IF_MCONT_DLC_MASK;
was executed.

---------- patch -----------------------------------------------------------

drivers/net/can/c_can/c_can.c renamed from drivers/net/can/c_can/c_can.c.Orig +1 -0
@@ -751,6 +751,7 @@ static void c_can_do_tx(struct net_devic
 		if (!(val & (1 << (msg_obj_no - 1)))) {
 			can_get_echo_skb(dev,
 					msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST);
+			c_can_object_get(dev, 0, msg_obj_no, IF_COMM_ALL);
 			stats->tx_bytes += priv->read_reg(priv,
 					C_CAN_IFACE(MSGCTRL_REG, 0))
 					& IF_MCONT_DLC_MASK;

------------------------------------------------------------------------------