162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciX.25 Device Driver Interface 462306a36Sopenharmony_ci============================ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciVersion 1.1 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci Jonathan Naylor 26.12.96 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ciThis is a description of the messages to be passed between the X.25 Packet 1162306a36Sopenharmony_ciLayer and the X.25 device driver. They are designed to allow for the easy 1262306a36Sopenharmony_cisetting of the LAPB mode from within the Packet Layer. 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ciThe X.25 device driver will be coded normally as per the Linux device driver 1562306a36Sopenharmony_cistandards. Most X.25 device drivers will be moderately similar to the 1662306a36Sopenharmony_cialready existing Ethernet device drivers. However unlike those drivers, the 1762306a36Sopenharmony_ciX.25 device driver has a state associated with it, and this information 1862306a36Sopenharmony_cineeds to be passed to and from the Packet Layer for proper operation. 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ciAll messages are held in sk_buff's just like real data to be transmitted 2162306a36Sopenharmony_ciover the LAPB link. The first byte of the skbuff indicates the meaning of 2262306a36Sopenharmony_cithe rest of the skbuff, if any more information does exist. 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ciPacket Layer to Device Driver 2662306a36Sopenharmony_ci----------------------------- 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ciFirst Byte = 0x00 (X25_IFACE_DATA) 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ciThis indicates that the rest of the skbuff contains data to be transmitted 3162306a36Sopenharmony_ciover the LAPB link. The LAPB link should already exist before any data is 3262306a36Sopenharmony_cipassed down. 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ciFirst Byte = 0x01 (X25_IFACE_CONNECT) 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ciEstablish the LAPB link. If the link is already established then the connect 3762306a36Sopenharmony_ciconfirmation message should be returned as soon as possible. 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ciFirst Byte = 0x02 (X25_IFACE_DISCONNECT) 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ciTerminate the LAPB link. If it is already disconnected then the disconnect 4262306a36Sopenharmony_ciconfirmation message should be returned as soon as possible. 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ciFirst Byte = 0x03 (X25_IFACE_PARAMS) 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ciLAPB parameters. To be defined. 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ciDevice Driver to Packet Layer 5062306a36Sopenharmony_ci----------------------------- 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ciFirst Byte = 0x00 (X25_IFACE_DATA) 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ciThis indicates that the rest of the skbuff contains data that has been 5562306a36Sopenharmony_cireceived over the LAPB link. 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ciFirst Byte = 0x01 (X25_IFACE_CONNECT) 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ciLAPB link has been established. The same message is used for both a LAPB 6062306a36Sopenharmony_cilink connect_confirmation and a connect_indication. 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ciFirst Byte = 0x02 (X25_IFACE_DISCONNECT) 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ciLAPB link has been terminated. This same message is used for both a LAPB 6562306a36Sopenharmony_cilink disconnect_confirmation and a disconnect_indication. 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ciFirst Byte = 0x03 (X25_IFACE_PARAMS) 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ciLAPB parameters. To be defined. 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ciRequirements for the device driver 7362306a36Sopenharmony_ci---------------------------------- 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ciPackets should not be reordered or dropped when delivering between the 7662306a36Sopenharmony_ciPacket Layer and the device driver. 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ciTo avoid packets from being reordered or dropped when delivering from 7962306a36Sopenharmony_cithe device driver to the Packet Layer, the device driver should not 8062306a36Sopenharmony_cicall "netif_rx" to deliver the received packets. Instead, it should 8162306a36Sopenharmony_cicall "netif_receive_skb_core" from softirq context to deliver them. 82