요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
X.25 Device Driver Interface
============================
Version 1.1
Jonathan Naylor 26.12.96
This is a description of the messages to be passed between the X.25 Packet
Layer and the X.25 device driver. They are designed to allow for the easy
setting of the LAPB mode from within the Packet Layer.
The X.25 device driver will be coded normally as per the Linux device driver
standards. Most X.25 device drivers will be moderately similar to the
already existing Ethernet device drivers. However unlike those drivers, the
X.25 device driver has a state associated with it, and this information
needs to be passed to and from the Packet Layer for proper operation.
All messages are held in sk_buff's just like real data to be transmitted
over the LAPB link. The first byte of the skbuff indicates the meaning of
the rest of the skbuff, if any more information does exist.
Packet Layer to Device Driver
-----------------------------
First Byte = 0x00 (X25_IFACE_DATA)
This indicates that the rest of the skbuff contains data to be transmitted
over the LAPB link. The LAPB link should already exist before any data is
passed down.
First Byte = 0x01 (X25_IFACE_CONNECT)
Establish the LAPB link. If the link is already established then the connect
confirmation message should be returned as soon as possible.
First Byte = 0x02 (X25_IFACE_DISCONNECT)
Terminate the LAPB link. If it is already disconnected then the disconnect
confirmation message should be returned as soon as possible.
First Byte = 0x03 (X25_IFACE_PARAMS)
LAPB parameters. To be defined.
Device Driver to Packet Layer
-----------------------------
First Byte = 0x00 (X25_IFACE_DATA)
This indicates that the rest of the skbuff contains data that has been
received over the LAPB link.
First Byte = 0x01 (X25_IFACE_CONNECT)
LAPB link has been established. The same message is used for both a LAPB
link connect_confirmation and a connect_indication.
First Byte = 0x02 (X25_IFACE_DISCONNECT)
LAPB link has been terminated. This same message is used for both a LAPB
link disconnect_confirmation and a disconnect_indication.
First Byte = 0x03 (X25_IFACE_PARAMS)
LAPB parameters. To be defined.
Requirements for the device driver
----------------------------------
Packets should not be reordered or dropped when delivering between the
Packet Layer and the device driver.
To avoid packets from being reordered or dropped when delivering from
the device driver to the Packet Layer, the device driver should not
call "netif_rx" to deliver the received packets. Instead, it should
call "netif_receive_skb_core" from softirq context to deliver them.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Interface 개요
1-23이 문서는 Jonathan Naylor가 1996년 12월 26일 작성한 X.25 device driver interface version 1.1입니다.
X.25 Packet Layer와 X.25 device driver 사이에 전달하는 message를 정의하며 Packet Layer 안에서 LAPB mode를 쉽게 설정하도록 설계되었습니다.
X.25 driver는 일반 Linux device driver 표준에 따라 작성하고 기존 Ethernet driver와 대체로 비슷하지만, X.25 driver에는 연결 상태가 있습니다. 정상 동작을 위해 이 state 정보를 Packet Layer와 주고받아야 합니다.
모든 message는 LAPB link로 보낼 실제 data처럼 `sk_buff`에 담습니다. `skbuff`의 첫 byte가 나머지 payload의 의미를 나타냅니다.
.. SPDX-License-Identifier: GPL-2.0
X.25 Device Driver Interface
============================
Version 1.1
Jonathan Naylor 26.12.96
This is a description of the messages to be passed between the X.25 Packet
Layer and the X.25 device driver. They are designed to allow for the easy
setting of the LAPB mode from within the Packet Layer.
The X.25 device driver will be coded normally as per the Linux device driver
standards. Most X.25 device drivers will be moderately similar to the
already existing Ethernet device drivers. However unlike those drivers, the
X.25 device driver has a state associated with it, and this information
needs to be passed to and from the Packet Layer for proper operation.
All messages are held in sk_buff's just like real data to be transmitted
over the LAPB link. The first byte of the skbuff indicates the meaning of
the rest of the skbuff, if any more information does exist.
Packet Layer에서 driver로 보내는 message
24-48첫 byte `0x00`, 즉 `X25_IFACE_DATA`이면 나머지 `skbuff`는 LAPB link로 전송할 data입니다. Data를 내려보내기 전에 LAPB link가 이미 존재해야 합니다.
`0x01` `X25_IFACE_CONNECT`는 LAPB link를 확립하라는 요청입니다. 이미 연결되어 있다면 connect confirmation을 가능한 한 빨리 돌려줘야 합니다.
`0x02` `X25_IFACE_DISCONNECT`는 LAPB link를 종료하라는 요청입니다. 이미 끊겼다면 disconnect confirmation을 가능한 한 빨리 돌려줘야 합니다.
`0x03` `X25_IFACE_PARAMS`는 LAPB parameter용 message이지만 이 문서에서는 아직 정의되지 않았습니다.
첫 byte가 요청 종류를 결정합니다.
Packet Layer to Device Driver
-----------------------------
First Byte = 0x00 (X25_IFACE_DATA)
This indicates that the rest of the skbuff contains data to be transmitted
over the LAPB link. The LAPB link should already exist before any data is
passed down.
First Byte = 0x01 (X25_IFACE_CONNECT)
Establish the LAPB link. If the link is already established then the connect
confirmation message should be returned as soon as possible.
First Byte = 0x02 (X25_IFACE_DISCONNECT)
Terminate the LAPB link. If it is already disconnected then the disconnect
confirmation message should be returned as soon as possible.
First Byte = 0x03 (X25_IFACE_PARAMS)
LAPB parameters. To be defined.
Driver에서 Packet Layer로 보내는 message
49-71첫 byte `0x00` `X25_IFACE_DATA`이면 나머지 `skbuff`는 LAPB link에서 수신한 data입니다.
`0x01` `X25_IFACE_CONNECT`는 LAPB link가 확립되었음을 뜻합니다. 같은 message를 LAPB `connect_confirmation`과 `connect_indication` 모두에 사용합니다.
`0x02` `X25_IFACE_DISCONNECT`는 LAPB link가 종료되었음을 뜻합니다. 같은 message를 `disconnect_confirmation`과 `disconnect_indication` 모두에 사용합니다.
`0x03` `X25_IFACE_PARAMS`는 LAPB parameter용이며 아직 정의되지 않았습니다.
같은 first-byte protocol이 수신 event를 표현합니다.
Device Driver to Packet Layer
-----------------------------
First Byte = 0x00 (X25_IFACE_DATA)
This indicates that the rest of the skbuff contains data that has been
received over the LAPB link.
First Byte = 0x01 (X25_IFACE_CONNECT)
LAPB link has been established. The same message is used for both a LAPB
link connect_confirmation and a connect_indication.
First Byte = 0x02 (X25_IFACE_DISCONNECT)
LAPB link has been terminated. This same message is used for both a LAPB
link disconnect_confirmation and a disconnect_indication.
First Byte = 0x03 (X25_IFACE_PARAMS)
LAPB parameters. To be defined.
Driver delivery requirement
72-81Packet Layer와 device driver 사이에서 packet을 전달할 때 순서를 바꾸거나 drop해서는 안 됩니다.
Driver에서 Packet Layer로 전달할 때 reorder와 drop을 피하려면 수신 packet delivery에 `netif_rx`를 호출하지 않아야 합니다. 대신 softirq context에서 `netif_receive_skb_core`를 호출해야 합니다.
Ordering 보장을 위해 지정된 softirq 경로를 사용합니다.
Requirements for the device driver
----------------------------------
Packets should not be reordered or dropped when delivering between the
Packet Layer and the device driver.
To avoid packets from being reordered or dropped when delivering from
the device driver to the Packet Layer, the device driver should not
call "netif_rx" to deliver the received packets. Instead, it should
call "netif_receive_skb_core" from softirq context to deliver them.
요약·해설
x25-iface.rst:1-81X.25 interface는 `sk_buff` 첫 byte에 DATA, CONNECT, DISCONNECT, PARAMS 명령을 넣어 Packet Layer와 stateful LAPB driver가 같은 message 형식으로 통신하게 합니다.
양방향 delivery에서 packet 순서와 무손실을 보장해야 하며, driver 수신 경로는 `netif_rx` 대신 softirq의 `netif_receive_skb_core`를 사용합니다.