blob: f34e9ec6493729d96745c914879a75cd48abb97f [file] [log] [blame]
Mauro Carvalho Chehab883780a2020-05-01 16:44:27 +02001.. SPDX-License-Identifier: GPL-2.0
2
3============================-
4X.25 Device Driver Interface
5============================-
6
7Version 1.1
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9 Jonathan Naylor 26.12.96
10
11This is a description of the messages to be passed between the X.25 Packet
12Layer and the X.25 device driver. They are designed to allow for the easy
13setting of the LAPB mode from within the Packet Layer.
14
15The X.25 device driver will be coded normally as per the Linux device driver
16standards. Most X.25 device drivers will be moderately similar to the
17already existing Ethernet device drivers. However unlike those drivers, the
18X.25 device driver has a state associated with it, and this information
19needs to be passed to and from the Packet Layer for proper operation.
20
21All messages are held in sk_buff's just like real data to be transmitted
22over the LAPB link. The first byte of the skbuff indicates the meaning of
23the rest of the skbuff, if any more information does exist.
24
25
26Packet Layer to Device Driver
27-----------------------------
28
andrew hendrye904f0a2010-04-19 13:30:36 +000029First Byte = 0x00 (X25_IFACE_DATA)
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31This indicates that the rest of the skbuff contains data to be transmitted
32over the LAPB link. The LAPB link should already exist before any data is
33passed down.
34
andrew hendrye904f0a2010-04-19 13:30:36 +000035First Byte = 0x01 (X25_IFACE_CONNECT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
37Establish the LAPB link. If the link is already established then the connect
38confirmation message should be returned as soon as possible.
39
andrew hendrye904f0a2010-04-19 13:30:36 +000040First Byte = 0x02 (X25_IFACE_DISCONNECT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42Terminate the LAPB link. If it is already disconnected then the disconnect
43confirmation message should be returned as soon as possible.
44
andrew hendrye904f0a2010-04-19 13:30:36 +000045First Byte = 0x03 (X25_IFACE_PARAMS)
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
47LAPB parameters. To be defined.
48
49
50Device Driver to Packet Layer
51-----------------------------
52
andrew hendrye904f0a2010-04-19 13:30:36 +000053First Byte = 0x00 (X25_IFACE_DATA)
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55This indicates that the rest of the skbuff contains data that has been
56received over the LAPB link.
57
andrew hendrye904f0a2010-04-19 13:30:36 +000058First Byte = 0x01 (X25_IFACE_CONNECT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
60LAPB link has been established. The same message is used for both a LAPB
61link connect_confirmation and a connect_indication.
62
andrew hendrye904f0a2010-04-19 13:30:36 +000063First Byte = 0x02 (X25_IFACE_DISCONNECT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
65LAPB link has been terminated. This same message is used for both a LAPB
66link disconnect_confirmation and a disconnect_indication.
67
andrew hendrye904f0a2010-04-19 13:30:36 +000068First Byte = 0x03 (X25_IFACE_PARAMS)
Linus Torvalds1da177e2005-04-16 15:20:36 -070069
70LAPB parameters. To be defined.
71
72
Xie He514e1152021-04-02 02:30:00 -070073Requirements for the device driver
74----------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -070075
Xie He514e1152021-04-02 02:30:00 -070076Packets should not be reordered or dropped when delivering between the
77Packet Layer and the device driver.
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
Xie He514e1152021-04-02 02:30:00 -070079To avoid packets from being reordered or dropped when delivering from
80the device driver to the Packet Layer, the device driver should not
81call "netif_rx" to deliver the received packets. Instead, it should
82call "netif_receive_skb_core" from softirq context to deliver them.