From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
kernel@pengutronix.de, Dong Aisheng <b29396@freescale.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 14/17] can: m_can: fix not set can_dlc for remote frame
Date: Tue, 18 Nov 2014 21:37:44 +0100 [thread overview]
Message-ID: <1416343067-9810-15-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1416343067-9810-1-git-send-email-mkl@pengutronix.de>
From: Dong Aisheng <b29396@freescale.com>
The original code missed to set the cf->can_dlc in the RTR case, so add it.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/m_can/m_can.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 214160b4c314..98f7e0ea7f6a 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -330,7 +330,7 @@ static void m_can_read_fifo(const struct net_device *dev, struct can_frame *cf,
u32 rxfs)
{
struct m_can_priv *priv = netdev_priv(dev);
- u32 id, fgi;
+ u32 id, fgi, dlc;
/* calculate the fifo get index for where to read data */
fgi = (rxfs & RXFS_FGI_MASK) >> RXFS_FGI_OFF;
@@ -340,11 +340,12 @@ static void m_can_read_fifo(const struct net_device *dev, struct can_frame *cf,
else
cf->can_id = (id >> 18) & CAN_SFF_MASK;
+ dlc = m_can_fifo_read(priv, fgi, M_CAN_FIFO_DLC);
+ cf->can_dlc = get_can_dlc((dlc >> 16) & 0x0F);
+
if (id & RX_BUF_RTR) {
cf->can_id |= CAN_RTR_FLAG;
} else {
- id = m_can_fifo_read(priv, fgi, M_CAN_FIFO_DLC);
- cf->can_dlc = get_can_dlc((id >> 16) & 0x0F);
*(u32 *)(cf->data + 0) = m_can_fifo_read(priv, fgi,
M_CAN_FIFO_DATA(0));
*(u32 *)(cf->data + 4) = m_can_fifo_read(priv, fgi,
--
2.1.3
next prev parent reply other threads:[~2014-11-18 20:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 20:37 pull-request: can 2014-11-18 Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 01/17] can: dev: avoid calling kfree_skb() from interrupt context Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 02/17] can: dev: fix typo CIA -> CiA, CAN in Automation Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 03/17] can: dev: add can_is_canfd_skb() API Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 04/17] can: esd_usb2: fix memory leak on disconnect Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 05/17] can: remove unused variable Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 06/17] can: xilinx_can: fix comparison of unsigned variable Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 07/17] can: xilinx_can: add .ndo_change_mtu function Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 08/17] can: rcar_can: " Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 09/17] can: gs_usb: " Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 10/17] can: m_can: " Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 11/17] can: m_can: add CONFIG_HAS_IOMEM dependence Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 12/17] can: m_can: add missing message RAM initialization Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 13/17] can: m_can: fix possible sleep in napi poll Marc Kleine-Budde
2014-11-18 20:37 ` Marc Kleine-Budde [this message]
2014-11-18 20:37 ` [PATCH 15/17] can: m_can: add missing delay after setting CCCR_INIT bit Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 16/17] can: m_can: fix incorrect error messages Marc Kleine-Budde
2014-11-18 20:37 ` [PATCH 17/17] can: m_can: update to support CAN FD features Marc Kleine-Budde
2014-11-19 20:29 ` pull-request: can 2014-11-18 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416343067-9810-15-git-send-email-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=b29396@freescale.com \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox