lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABGWkvohy1vQ4nbUpWcJ0jJTX6EPHhQSBmdmiGxT=uhf7hf3CA@mail.gmail.com>
Date: Tue, 15 Oct 2024 09:47:15 +0200
From: Dario Binacchi <dario.binacchi@...rulasolutions.com>
To: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: linux-kernel@...r.kernel.org, linux-amarula@...rulasolutions.com, 
	michael@...rulasolutions.com, Vincent Mailhol <mailhol.vincent@...adoo.fr>, 
	linux-can@...r.kernel.org
Subject: Re: [RFC PATCH 3/6] can: dev: add helper macros to setup an error frame

Hello Marc,

On Mon, Oct 14, 2024 at 10:00 PM Marc Kleine-Budde <mkl@...gutronix.de> wrote:
>
> On 14.10.2024 17:24:18, Dario Binacchi wrote:
> > These helpers can prevent errors and code duplication when setting up a
> > CAN error frame.
>
> I personally don't like the ideas of using macros here. Is there a
> reason not to use static inline functions?

I thought that the use of macros would certainly not introduce
additional overhead
compared to the previous version. In version 2, I will replace the
macros with inline
functions.

I noticed that the ACK error is handled differently by the drivers.

bxcan, flexcan, slcan, rcar_can.c, and xilinx_can, for example:
cf->can_id |= CAN_ERR_ACK;
cf->data[3] = CAN_ERR_PROT_LOC_ACK;

at91_can, mcp251xfd-core:
cf->can_id |= CAN_ERR_ACK;
cf->data[2] |= CAN_ERR_PROT_TX;

cc770, kvaser_pciefd and es58x_core only
cf->can_id |= CAN_ERR_ACK;

So, what is the correct/best way to notify a CAN frame error from an ACK?

Thanks and regards,
Dario

>
> Marc
>
> --
> Pengutronix e.K.                 | Marc Kleine-Budde          |
> Embedded Linux                   | https://www.pengutronix.de |
> Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |



-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@...rulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@...rulasolutions.com

www.amarulasolutions.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ