From: Marek Vasut <marex@denx.de>
To: linux-can@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Manivannan Sadhasivam <mani@kernel.org>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Mark Brown <broonie@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Thomas Kopp <thomas.kopp@microchip.com>,
Wolfgang Grandegger <wg@grandegger.com>
Subject: [PATCH v2 2/2] can: mcp251xfd: Move generic macros into length.h
Date: Sat, 6 May 2023 00:28:20 +0200 [thread overview]
Message-ID: <20230505222820.126441-2-marex@denx.de> (raw)
In-Reply-To: <20230505222820.126441-1-marex@denx.de>
Move CAN_BIT_STUFFING_OVERHEAD and CAN_IDLE_CONDITION_SAMPLES generic
CAN macros into linux/can/length.h . No functional change.
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Thomas Kopp <thomas.kopp@microchip.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-can@vger.kernel.org
---
V2: - New separate patch, separate from the mcp251xfd addition to ease backporting
---
drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 9 ---------
include/linux/can/length.h | 9 +++++++++
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd.h b/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
index 412d58d84fb63..7024ff0cc2c0c 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
@@ -432,15 +432,6 @@ static_assert(MCP251XFD_FIFO_RX_NUM <= 4U);
/* Use Half Duplex SPI transfers */
#define MCP251XFD_QUIRK_HALF_DUPLEX BIT(5)
-/* CAN bit stuffing overhead multiplication factor */
-#define CAN_BIT_STUFFING_OVERHEAD 1.2
-
-/* Number of samples after which an idle condition is present on the bus
- * as specified in the ISO. This is 11 consecutive sampled recessive bits
- * after a full frame (if one is currently in transmission).
- */
-#define CAN_IDLE_CONDITION_SAMPLES 11
-
struct mcp251xfd_hw_tef_obj {
u32 id;
u32 flags;
diff --git a/include/linux/can/length.h b/include/linux/can/length.h
index 6995092b774ec..0e20e153955d4 100644
--- a/include/linux/can/length.h
+++ b/include/linux/can/length.h
@@ -122,6 +122,15 @@
*/
#define CANFD_FRAME_LEN_MAX (CANFD_FRAME_OVERHEAD_EFF + CANFD_MAX_DLEN)
+/* CAN bit stuffing overhead multiplication factor */
+#define CAN_BIT_STUFFING_OVERHEAD 1.2
+
+/* Number of samples after which an idle condition is present on the bus
+ * as specified in the ISO. This is 11 consecutive sampled recessive bits
+ * after a full frame (if one is currently in transmission).
+ */
+#define CAN_IDLE_CONDITION_SAMPLES 11
+
/*
* can_cc_dlc2len(value) - convert a given data length code (dlc) of a
* Classical CAN frame into a valid data length of max. 8 bytes.
--
2.39.2
next prev parent reply other threads:[~2023-05-05 22:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-05 22:28 [PATCH v2 1/2] can: mcp251xfd: Increase poll timeout Marek Vasut
2023-05-05 22:28 ` Marek Vasut [this message]
2023-05-07 15:58 ` Vincent Mailhol
2023-05-07 17:14 ` Marek Vasut
2023-05-08 4:01 ` Vincent Mailhol
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=20230505222820.126441-2-marex@denx.de \
--to=marex@denx.de \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mkl@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=thomas.kopp@microchip.com \
--cc=wg@grandegger.com \
/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