Lines Matching +full:tp +full:- +full:link

1 .. SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
4 ISO 15765-2 (ISO-TP)
10 ISO 15765-2, also known as ISO-TP, is a transport protocol specifically defined
12 industry, for example as the transport protocol for UDSonCAN (ISO 14229-3) or
13 emission-related diagnostic services (ISO 15031-5).
15 ISO-TP can be used both on CAN CC (aka Classical CAN) and CAN FD (CAN with
17 CAN network using SAE J1939 as data link layer (however, this is not a
21 -------------------
23 * ISO 15765-2:2024 : Road vehicles - Diagnostic communication over Controller
27 ----------
29 In its simplest form, ISO-TP is based on two kinds of addressing modes for the
32 * physical addressing is implemented by two node-specific addresses and is used
33 in 1-to-1 communication.
35 * functional addressing is implemented by one node-specific address and is used
36 in 1-to-N communication.
51 ---------------------------------------------
53 When transmitting data using the ISO-TP protocol, the payload can either fit
56 is transmitted at once using a so-called Single Frame (SF). In the second case,
57 ISO-TP defines a multi-frame protocol, in which the sender provides (through a
58 First Frame - FF) the PDU length which is to be transmitted and also asks for a
63 Consecutive Frames - CF), stopping after every ``blocksize``-sized block to wait
67 How to Use ISO-TP
70 As with others CAN protocols, the ISO-TP stack support is built into the
71 Linux network subsystem for the CAN bus, aka. Linux-CAN or SocketCAN, and
74 Creation and basic usage of an ISO-TP socket
75 --------------------------------------------
77 To use the ISO-TP stack, ``#include <linux/can/isotp.h>`` shall be used. A
79 ``SOCK_DGRAM`` type (as the underlying protocol is datagram-based by design)
82 .. code-block:: C
98 Unlike the CAN_RAW socket API, only the ISO-TP data field (the actual payload)
100 information and the protocol information are automatically filled by the ISO-TP
105 The sockaddr structure used for SocketCAN has extensions for use with ISO-TP,
108 .. code-block:: C
114 struct { canid_t rx_id, tx_id; } tp;
122 * ``can_addr.tp.rx_id`` specifies the receive (RX) CAN ID and will be used as
125 * ``can_addr.tp.tx_id`` specifies the transmit (TX) CAN ID
127 ISO-TP socket options
128 ---------------------
130 When creating an ISO-TP socket, reasonable defaults are set. Some options can
138 .. code-block:: C
145 .. code-block:: C
156 * ``flags``: modifiers to be applied to the default behaviour of the ISO-TP
180 * ``CAN_ISOTP_HALF_DUPLEX``: force ISO-TP socket in half duplex mode
198 * ``CAN_ISOTP_SF_BROADCAST``: use 1-to-N functional addressing (cannot be
201 * ``CAN_ISOTP_CF_BROADCAST``: use 1-to-N transmission without flow control
203 NOTE: this is not covered by the ISO 15765-2 standard.
227 to provide the communication parameters for receiving ISO-TP PDUs.
229 .. code-block:: C
236 .. code-block:: C
249 * 0x00 - 0x7F : 0 - 127 ms
251 * 0xF1 - 0xF9 : 100 us - 900 us
255 Link Layer options
258 Link Layer (LL) options can be passed using the ``CAN_ISOTP_LL_OPTS`` optname:
260 .. code-block:: C
267 .. code-block:: C
293 .. code-block:: C
306 .. code-block:: C
311 Multi-frame transport support
312 -----------------------------
314 The ISO-TP stack contained inside the Linux kernel supports the multi-frame
328 ------
336 -ETIMEDOUT timeout of data reception
337 -EILSEQ sequence number mismatch during a multi-frame reception
338 -EBADMSG data reception with wrong padding
345 -ECOMM flow control reception timeout
346 -EMSGSIZE flow control reception overflow
347 -EBADMSG flow control reception with wrong layout/padding
354 ------------------
360 .. code-block:: C
372 addr.tp.tx_id = 0x18DA42F1 | CAN_EFF_FLAG;
373 addr.tp.rx_id = 0x18DAF142 | CAN_EFF_FLAG;
382 -------------------
385 tools, distributed as part of the ``can-utils`` utilities at:
386 https://github.com/linux-can/can-utils