[PATCH v1 07/25] j1939: move PGN defines to uapi

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

 



Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 include/uapi/linux/can/j1939.h | 8 ++++++--
 net/can/j1939/j1939-priv.h     | 4 ----
 net/can/j1939/main.c           | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/uapi/linux/can/j1939.h b/include/uapi/linux/can/j1939.h
index 5b2505e36d0e..cd60d70814da 100644
--- a/include/uapi/linux/can/j1939.h
+++ b/include/uapi/linux/can/j1939.h
@@ -16,10 +16,14 @@
 #include <linux/socket.h>
 #include <linux/can.h>
 
-#define J1939_MAX_UNICAST_ADDR 0xfd
 #define J1939_IDLE_ADDR 0xfe
-#define J1939_NO_ADDR 0xff
+#define J1939_MAX_UNICAST_ADDR 0xfd
+#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_PDU1_MAX 0x3ff00
+#define J1939_PGN_MAX 0x3ffff
 #define J1939_NO_PGN 0x40000
 
 /* J1939 Parameter Group Number
diff --git a/net/can/j1939/j1939-priv.h b/net/can/j1939/j1939-priv.h
index 127b4e28b16a..95025a6ca10e 100644
--- a/net/can/j1939/j1939-priv.h
+++ b/net/can/j1939/j1939-priv.h
@@ -10,10 +10,6 @@
 
 /* TODO: return ENETRESET on busoff. */
 
-#define J1939_PGN_REQUEST 0x0ea00
-#define J1939_PGN_ADDRESS_CLAIMED 0x0ee00
-#define J1939_PGN_MAX 0x3ffff
-
 /* j1939 devices */
 struct j1939_ecu {
 	struct list_head list;
diff --git a/net/can/j1939/main.c b/net/can/j1939/main.c
index 3b2fb742cb71..854d81536a39 100644
--- a/net/can/j1939/main.c
+++ b/net/can/j1939/main.c
@@ -243,7 +243,7 @@ int j1939_send_one(struct j1939_priv *priv, struct sk_buff *skb)
 
 	/* apply sanity checks */
 	if (j1939_pgn_is_pdu1(skcb->addr.dst_pgn))
-		skcb->addr.dst_pgn &= 0x3ff00;
+		skcb->addr.dst_pgn &= J1939_PGN_PDU1_MAX;
 	else
 		skcb->addr.dst_pgn &= J1939_PGN_MAX;
 
-- 
2.20.1




[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