linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.18+] Tag current CAN FD controllers as non-ISO
@ 2015-01-05 18:47 Oliver Hartkopp
  2015-01-07 13:17 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Hartkopp @ 2015-01-05 18:47 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: linux-can@vger.kernel.org, Stephane Grosjean, Dong Aisheng

During the CAN FD standardization process within the ISO it turned out that
the failure detection capability has to be improved.

The CAN in Automation organization (CiA) defined the already implemented CAN
FD controllers as 'non-ISO' and the upcoming improved CAN FD controllers as
'ISO' compliant. See at http://www.can-cia.com/index.php?id=1937

Finally there will be three types of CAN FD controllers in the future:

1. ISO compliant (fixed)
2. non-ISO compliant (fixed, like the M_CAN IP v3.0.1 in m_can.c)
3. ISO/non-ISO CAN FD controllers (switchable, like the PEAK USB FD)

So the current M_CAN driver for the M_CAN IP v3.0.1 has to expose its non-ISO
implementation by setting the CAN_CTRLMODE_FD_NON_ISO ctrlmode at startup.
As this bit cannot be switched at configuration time CAN_CTRLMODE_FD_NON_ISO
must not be set in ctrlmode_supported of the current M_CAN driver.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

---

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index d7bc462..2445298 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -955,6 +955,11 @@ static struct net_device *alloc_m_can_dev(void)
 	priv->can.data_bittiming_const = &m_can_data_bittiming_const;
 	priv->can.do_set_mode = m_can_set_mode;
 	priv->can.do_get_berr_counter = m_can_get_berr_counter;
+
+	/* CAN_CTRLMODE_FD_NON_ISO is fixed with M_CAN IP v3.0.1 */
+	priv->can.ctrlmode = CAN_CTRLMODE_FD_NON_ISO;
+
+	/* CAN_CTRLMODE_FD_NON_ISO can not be changed with M_CAN IP v3.0.1 */
 	priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
 					CAN_CTRLMODE_LISTENONLY |
 					CAN_CTRLMODE_BERR_REPORTING |
diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h
index 3e4323a..94ffe0c 100644
--- a/include/uapi/linux/can/netlink.h
+++ b/include/uapi/linux/can/netlink.h
@@ -98,6 +98,7 @@ struct can_ctrlmode {
 #define CAN_CTRLMODE_BERR_REPORTING	0x10	/* Bus-error reporting */
 #define CAN_CTRLMODE_FD			0x20	/* CAN FD mode */
 #define CAN_CTRLMODE_PRESUME_ACK	0x40	/* Ignore missing CAN ACKs */
+#define CAN_CTRLMODE_FD_NON_ISO		0x80	/* CAN FD in non-ISO mode */
 
 /*
  * CAN device statistics



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3.18+] Tag current CAN FD controllers as non-ISO
  2015-01-05 18:47 [PATCH 3.18+] Tag current CAN FD controllers as non-ISO Oliver Hartkopp
@ 2015-01-07 13:17 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2015-01-07 13:17 UTC (permalink / raw)
  To: Oliver Hartkopp
  Cc: linux-can@vger.kernel.org, Stephane Grosjean, Dong Aisheng

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

On 01/05/2015 07:47 PM, Oliver Hartkopp wrote:
> During the CAN FD standardization process within the ISO it turned out that
> the failure detection capability has to be improved.
> 
> The CAN in Automation organization (CiA) defined the already implemented CAN
> FD controllers as 'non-ISO' and the upcoming improved CAN FD controllers as
> 'ISO' compliant. See at http://www.can-cia.com/index.php?id=1937
> 
> Finally there will be three types of CAN FD controllers in the future:
> 
> 1. ISO compliant (fixed)
> 2. non-ISO compliant (fixed, like the M_CAN IP v3.0.1 in m_can.c)
> 3. ISO/non-ISO CAN FD controllers (switchable, like the PEAK USB FD)
> 
> So the current M_CAN driver for the M_CAN IP v3.0.1 has to expose its non-ISO
> implementation by setting the CAN_CTRLMODE_FD_NON_ISO ctrlmode at startup.
> As this bit cannot be switched at configuration time CAN_CTRLMODE_FD_NON_ISO
> must not be set in ctrlmode_supported of the current M_CAN driver.
> 
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

Applied to can/master and added stable on Cc.

thanks,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-07 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-05 18:47 [PATCH 3.18+] Tag current CAN FD controllers as non-ISO Oliver Hartkopp
2015-01-07 13:17 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).