Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1945964AbbDXR0i (ORCPT ); Fri, 24 Apr 2015 13:26:38 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:44301 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031556AbbDXRWY (ORCPT ); Fri, 24 Apr 2015 13:22:24 -0400 From: Michael Grzeschik To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/21] ARCNET: capmode: fix transfer length Date: Fri, 24 Apr 2015 19:20:37 +0200 Message-Id: <1429896055-31680-4-git-send-email-m.grzeschik@pengutronix.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1429896055-31680-1-git-send-email-m.grzeschik@pengutronix.de> References: <1429896055-31680-1-git-send-email-m.grzeschik@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mgr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1583 Lines: 48 The commit <52edc17f94f7bd4d9> ("bugfixes and new hardware support for arcnet driver") adds fixes for the packet length calculations in arc-rawmode. As the capmode protocol is derived from the arc-rawmode code, the capmode also needs the fixes. rx(): - Fixed error in received packet lengths; 256 byte packets were being received as 257 bytes packets. prepare_tx(): - Fixed error in transmit length calcs; 257 byte packets were being transmitted as 260 byte packets. Signed-off-by: Michael Grzeschik --- drivers/net/arcnet/capmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 42fce91..b6868a2 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c @@ -49,7 +49,7 @@ static void rx(struct net_device *dev, int bufnum, BUGMSG(D_DURING, "it's a raw(cap) packet (length=%d)\n", length); - if (length >= MinTU) + if (length > MTU) ofs = 512 - length; else ofs = 256 - length; @@ -156,7 +156,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, length, XMTU); length = XMTU; } - if (length > MinTU) { + if (length >= MinTU) { hard->offset[0] = 0; hard->offset[1] = ofs = 512 - length; } else if (length > MTU) { -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/