Commit 40e79150 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by David S. Miller
Browse files

docs: networking: convert lapb-module.txt to ReST



- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 10ebb221
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ Contents:
   ipvs-sysctl
   kcm
   l2tp
   lapb-module

.. only::  subproject and html

+82 −40
Original line number Diff line number Diff line
		The Linux LAPB Module Interface 1.3
.. SPDX-License-Identifier: GPL-2.0

===============================
The Linux LAPB Module Interface
===============================

Version 1.3

Jonathan Naylor 29.12.96

@@ -32,7 +38,7 @@ LAPB Initialisation Structure

This structure is used only once, in the call to lapb_register (see below).
It contains information about the device driver that requires the services
of the LAPB module.
of the LAPB module::

	struct lapb_register_struct {
		void (*connect_confirmation)(int token, int reason);
@@ -54,7 +60,7 @@ LAPB Parameter Structure

This structure is used with the lapb_getparms and lapb_setparms functions
(see below). They are used to allow the device driver to get and set the
operational parameters of the LAPB implementation for a given connection.
operational parameters of the LAPB implementation for a given connection::

	struct lapb_parms_struct {
		unsigned int t1;
@@ -78,11 +84,14 @@ link.
The mode variable is a bit field used for setting (at present) three values.
The bit fields have the following meanings:

======  =================================================
Bit	Meaning
======  =================================================
0	LAPB operation (0=LAPB_STANDARD 1=LAPB_EXTENDED).
1	[SM]LP operation (0=LAPB_SLP 1=LAPB=MLP).
2	DTE/DCE operation (0=LAPB_DTE 1=LAPB_DCE)
3-31	Reserved, must be 0.
======  =================================================

Extended LAPB operation indicates the use of extended sequence numbers and
consequently larger window sizes, the default is standard LAPB operation.
@@ -99,6 +108,7 @@ Functions

The LAPB module provides a number of function entry points.

::

    int lapb_register(void *token, struct lapb_register_struct);

@@ -111,10 +121,13 @@ For multiple LAPB links in a single device driver, multiple calls to
lapb_register must be made. The format of the lapb_register_struct is given
above. The return values are:

=============		=============================
LAPB_OK			LAPB registered successfully.
LAPB_BADTOKEN		Token is already registered.
LAPB_NOMEM		Out of memory
=============		=============================

::

    int lapb_unregister(void *token);

@@ -123,9 +136,12 @@ LAPB link will be abandoned without further messages being passed. After
this call, the value of token is no longer valid for any calls to the LAPB
function. The valid return values are:

=============		===============================
LAPB_OK			LAPB unregistered successfully.
LAPB_BADTOKEN		Invalid/unknown LAPB token.
=============		===============================

::

    int lapb_getparms(void *token, struct lapb_parms_struct *parms);

@@ -133,9 +149,12 @@ This allows the device driver to get the values of the current LAPB
variables, the lapb_parms_struct is described above. The valid return values
are:

=============		=============================
LAPB_OK			LAPB getparms was successful.
LAPB_BADTOKEN		Invalid/unknown LAPB token.
=============		=============================

::

    int lapb_setparms(void *token, struct lapb_parms_struct *parms);

@@ -145,29 +164,38 @@ t2timer and n2count are ignored, likewise changing the mode bits when
connected will be ignored. An error implies that none of the values have
been changed. The valid return values are:

=============		=================================================
LAPB_OK			LAPB getparms was successful.
LAPB_BADTOKEN		Invalid/unknown LAPB token.
LAPB_INVALUE		One of the values was out of its allowable range.
=============		=================================================

::

    int lapb_connect_request(void *token);

Initiate a connect using the current parameter settings. The valid return
values are:

==============		=================================
LAPB_OK			LAPB is starting to connect.
LAPB_BADTOKEN		Invalid/unknown LAPB token.
LAPB_CONNECTED		LAPB module is already connected.
==============		=================================

::

    int lapb_disconnect_request(void *token);

Initiate a disconnect. The valid return values are:

=================	===============================
LAPB_OK			LAPB is starting to disconnect.
LAPB_BADTOKEN		Invalid/unknown LAPB token.
LAPB_NOTCONNECTED	LAPB module is not connected.
=================	===============================

::

    int lapb_data_request(void *token, struct sk_buff *skb);

@@ -175,10 +203,13 @@ Queue data with the LAPB module for transmitting over the link. If the call
is successful then the skbuff is owned by the LAPB module and may not be
used by the device driver again. The valid return values are:

=================	=============================
LAPB_OK			LAPB has accepted the data.
LAPB_BADTOKEN		Invalid/unknown LAPB token.
LAPB_NOTCONNECTED	LAPB module is not connected.
=================	=============================

::

    int lapb_data_received(void *token, struct sk_buff *skb);

@@ -188,9 +219,10 @@ to the beginning of the LAPB data. If the call is successful then the skbuff
is owned by the LAPB module and may not be used by the device driver again.
The valid return values are:

=============		===========================
LAPB_OK			LAPB has accepted the data.
LAPB_BADTOKEN		Invalid/unknown LAPB token.

=============		===========================

Callbacks
---------
@@ -200,6 +232,7 @@ module to call when an event occurs. They are registered with the LAPB
module with lapb_register (see above) in the structure lapb_register_struct
(see above).

::

    void (*connect_confirmation)(void *token, int reason);

@@ -207,12 +240,14 @@ This is called by the LAPB module when a connection is established after
being requested by a call to lapb_connect_request (see above). The reason is
always LAPB_OK.

::

    void (*connect_indication)(void *token, int reason);

This is called by the LAPB module when the link is established by the remote
system. The value of reason is always LAPB_OK.

::

    void (*disconnect_confirmation)(void *token, int reason);

@@ -221,11 +256,14 @@ driver has called lapb_disconnect_request (see above). The reason indicates
what has happened. In all cases the LAPB link can be regarded as being
terminated. The values for reason are:

=================	====================================================
LAPB_OK			The LAPB link was terminated normally.
LAPB_NOTCONNECTED	The remote system was not connected.
LAPB_TIMEDOUT		No response was received in N2 tries from the remote
			system.
=================	====================================================

::

    void (*disconnect_indication)(void *token, int reason);

@@ -234,13 +272,16 @@ system or another event has occurred to terminate the link. This may be
returned in response to a lapb_connect_request (see above) if the remote
system refused the request. The values for reason are:

=================	====================================================
LAPB_OK			The LAPB link was terminated normally by the remote
			system.
LAPB_REFUSED		The remote system refused the connect request.
LAPB_NOTCONNECTED	The remote system was not connected.
LAPB_TIMEDOUT		No response was received in N2 tries from the remote
			system.
=================	====================================================

::

    int (*data_indication)(void *token, struct sk_buff *skb);

@@ -254,6 +295,7 @@ This method should return NET_RX_DROP (as defined in the header
file include/linux/netdevice.h) if and only if the frame was dropped
before it could be delivered to the upper layer.

::

    void (*data_transmit)(void *token, struct sk_buff *skb);

+1 −1
Original line number Diff line number Diff line
@@ -9515,7 +9515,7 @@ F: drivers/soc/lantiq
LAPB module
L:	linux-x25@vger.kernel.org
S:	Orphan
F:	Documentation/networking/lapb-module.txt
F:	Documentation/networking/lapb-module.rst
F:	include/*/lapb.h
F:	net/lapb/
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ config LAPB
	  currently supports LAPB only over Ethernet connections. If you want
	  to use LAPB connections over Ethernet, say Y here and to "LAPB over
	  Ethernet driver" below. Read
	  <file:Documentation/networking/lapb-module.txt> for technical
	  <file:Documentation/networking/lapb-module.rst> for technical
	  details.

	  To compile this driver as a module, choose M here: the