Re: [PATCH v1 4/4] j1939: rename J1939_PGN_REQUEST to J1939_PGN_ADDRESS_REQUEST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/10/19 1:54 PM, Kurt Van Dijck wrote:
> On wo, 10 apr 2019 10:36:26 +0200, Oleksij Rempel wrote:
>> and add J1939_PGN_ADDRESS_COMMANDED define
>>
>> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
>> ---
>>  include/uapi/linux/can/j1939.h | 5 +++--
>>  net/can/j1939/address-claim.c  | 2 +-
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/uapi/linux/can/j1939.h b/include/uapi/linux/can/j1939.h
>> index 0c76bd2caf90..160e960cdc7b 100644
>> --- a/include/uapi/linux/can/j1939.h
>> +++ b/include/uapi/linux/can/j1939.h
>> @@ -20,8 +20,9 @@
>>  #define J1939_IDLE_ADDR 0xfe
>>  #define J1939_NO_ADDR 0xff		/* == broadcast or no addr */
>>  #define J1939_NO_NAME 0
>> -#define J1939_PGN_REQUEST 0x0ea00
>> -#define J1939_PGN_ADDRESS_CLAIMED 0x0ee00
>> +#define J1939_PGN_ADDRESS_REQUEST 0x0ea00	/* Request for Address Claimed */
> 
> From kernel point of view, the request PGN is only used in context of
> address claim, but j1939 defines it as a generic request pgn.
> The pgn to be requested, is in the 3 byte payload.
> Making it J1939_PGN_ADDRESS_REQUEST is wrong.

We had a look at a manual (don't remember which one) and it suggested
that it's an address request only.

I've changed the commit to:

commit 6ad09b6d8d7501b6c45faa6f17d18c84df9619a7
Author: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Date:   Wed Apr 10 10:17:07 2019 +0200

    j1939: j1939.h: add PGN description form the standard

    and add J1939_PGN_ADDRESS_COMMANDED define.

    Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
    Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

diff --git a/include/uapi/linux/can/j1939.h b/include/uapi/linux/can/j1939.h
index 0c76bd2caf90..c7eb94d2ab10 100644
--- a/include/uapi/linux/can/j1939.h
+++ b/include/uapi/linux/can/j1939.h
@@ -20,8 +20,9 @@
 #define J1939_IDLE_ADDR 0xfe
 #define J1939_NO_ADDR 0xff		/* == broadcast or no addr */
 #define J1939_NO_NAME 0
-#define J1939_PGN_REQUEST 0x0ea00
-#define J1939_PGN_ADDRESS_CLAIMED 0x0ee00
+#define J1939_PGN_REQUEST 0x0ea00		/* Request PG */
+#define J1939_PGN_ADDRESS_CLAIMED 0x0ee00	/* Address Claimed */
+#define J1939_PGN_ADDRESS_COMMANDED 0x0fed8	/* Commanded Address */
 #define J1939_PGN_PDU1_MAX 0x3ff00
 #define J1939_PGN_MAX 0x3ffff
 #define J1939_NO_PGN 0x40000

>> +#define J1939_PGN_ADDRESS_CLAIMED 0x0ee00	/* Address Claimed */
>> +#define J1939_PGN_ADDRESS_COMMANDED 0x0fed8	/* Commanded Address */
> 
> Responding to commanded address is, IMO, definitely a userspace thing.
> So, I will never be used in kernel.
> Why is in the uapi header files? Adding all j1939 PGN definitions is a
> project on it own already.h

This way we could move the define from the jacd. And other AC
implementation can use the PGN from the UAPI header.

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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux