hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/include/uapi/linux/can.h
....@@ -1,4 +1,4 @@
1
-/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
1
+/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
22 /*
33 * linux/can.h
44 *
....@@ -157,7 +157,8 @@
157157 #define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
158158 #define CAN_MCNET 5 /* Bosch MCNet */
159159 #define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
160
-#define CAN_NPROTO 7
160
+#define CAN_J1939 7 /* SAE J1939 */
161
+#define CAN_NPROTO 8
161162
162163 #define SOL_CAN_BASE 100
163164
....@@ -174,6 +175,23 @@
174175 /* transport protocol class address information (e.g. ISOTP) */
175176 struct { canid_t rx_id, tx_id; } tp;
176177
178
+ /* J1939 address information */
179
+ struct {
180
+ /* 8 byte name when using dynamic addressing */
181
+ __u64 name;
182
+
183
+ /* pgn:
184
+ * 8 bit: PS in PDU2 case, else 0
185
+ * 8 bit: PF
186
+ * 1 bit: DP
187
+ * 1 bit: reserved
188
+ */
189
+ __u32 pgn;
190
+
191
+ /* 1 byte address */
192
+ __u8 addr;
193
+ } j1939;
194
+
177195 /* reserved for future CAN protocols address information */
178196 } can_addr;
179197 };