All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Grosjean <s.grosjean@peak-system.com>
To: linux-can Mailing List <linux-can@vger.kernel.org>
Cc: Stephane Grosjean <s.grosjean@peak-system.com>
Subject: [PATCH 4/5] can: peak_usb: pcan_usb_encode_msg(): adds information
Date: Fri, 25 Jun 2021 15:09:30 +0200	[thread overview]
Message-ID: <20210625130931.27438-5-s.grosjean@peak-system.com> (raw)
In-Reply-To: <20210625130931.27438-1-s.grosjean@peak-system.com>

This patch adds information by replacing hard-coded values with their
symbol and adding comments.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
---
 drivers/net/can/usb/peak_usb/pcan_usb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index 341ace36570b..7d18bc6911f5 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -63,6 +63,8 @@
 
 #define PCAN_USB_MSG_HEADER_LEN		2
 
+#define PCAN_USB_MSG_TX_CAN		2	/* Tx msg is a CAN frame */
+
 /* PCAN-USB adapter internal clock (MHz) */
 #define PCAN_USB_CRYSTAL_HZ		16000000
 
@@ -836,8 +838,8 @@ static int pcan_usb_encode_msg(struct peak_usb_device *dev, struct sk_buff *skb,
 	u32 can_id_flags = cf->can_id & CAN_ERR_MASK;
 	u8 *pc;
 
-	obuf[0] = 2;
-	obuf[1] = 1;
+	obuf[0] = PCAN_USB_MSG_TX_CAN;
+	obuf[1] = 1;	/* only one CAN frame is stored in the packet */
 
 	pc = obuf + PCAN_USB_MSG_HEADER_LEN;
 
-- 
2.25.1


  parent reply	other threads:[~2021-06-25 13:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 13:09 [PATCH 0/5] can: peak_usb: upgrade driver for PCAN-USB Stephane Grosjean
2021-06-25 13:09 ` [PATCH 1/5] can: peak_usb: pcan_usb_get_device_id(): read value only in case of success Stephane Grosjean
2021-06-25 13:09 ` [PATCH 2/5] can: peak_usb: PCAN-USB: add support of loopback and one-short mode Stephane Grosjean
2021-06-28  7:00   ` Marc Kleine-Budde
2021-06-25 13:09 ` [PATCH 3/5] can: peak_usb: pcan_usb_handle_bus_evt(): fix reading rxerr/txerr values Stephane Grosjean
2021-06-28  6:52   ` Marc Kleine-Budde
2021-06-25 13:09 ` Stephane Grosjean [this message]
2021-06-25 13:09 ` [PATCH 5/5] can: peak_usb: upgrades the handling of bus state changes Stephane Grosjean
2021-06-28  6:54   ` Marc Kleine-Budde
2021-06-28  6:57 ` [PATCH 0/5] can: peak_usb: upgrade driver for PCAN-USB Marc Kleine-Budde

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=20210625130931.27438-5-s.grosjean@peak-system.com \
    --to=s.grosjean@peak-system.com \
    --cc=linux-can@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.