Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mauro Carvalho Chehab and committed by
David S. Miller
40e79150 10ebb221

+84 -41
+1
Documentation/networking/index.rst
··· 75 75 ipvs-sysctl 76 76 kcm 77 77 l2tp 78 + lapb-module 78 79 79 80 .. only:: subproject and html 80 81
+81 -39
Documentation/networking/lapb-module.txt Documentation/networking/lapb-module.rst
··· 1 - The Linux LAPB Module Interface 1.3 1 + .. SPDX-License-Identifier: GPL-2.0 2 2 3 - Jonathan Naylor 29.12.96 3 + =============================== 4 + The Linux LAPB Module Interface 5 + =============================== 4 6 5 - Changed (Henner Eisen, 2000-10-29): int return value for data_indication() 7 + Version 1.3 8 + 9 + Jonathan Naylor 29.12.96 10 + 11 + Changed (Henner Eisen, 2000-10-29): int return value for data_indication() 6 12 7 13 The LAPB module will be a separately compiled module for use by any parts of 8 14 the Linux operating system that require a LAPB service. This document ··· 38 32 39 33 This structure is used only once, in the call to lapb_register (see below). 40 34 It contains information about the device driver that requires the services 41 - of the LAPB module. 35 + of the LAPB module:: 42 36 43 - struct lapb_register_struct { 44 - void (*connect_confirmation)(int token, int reason); 45 - void (*connect_indication)(int token, int reason); 46 - void (*disconnect_confirmation)(int token, int reason); 47 - void (*disconnect_indication)(int token, int reason); 48 - int (*data_indication)(int token, struct sk_buff *skb); 49 - void (*data_transmit)(int token, struct sk_buff *skb); 50 - }; 37 + struct lapb_register_struct { 38 + void (*connect_confirmation)(int token, int reason); 39 + void (*connect_indication)(int token, int reason); 40 + void (*disconnect_confirmation)(int token, int reason); 41 + void (*disconnect_indication)(int token, int reason); 42 + int (*data_indication)(int token, struct sk_buff *skb); 43 + void (*data_transmit)(int token, struct sk_buff *skb); 44 + }; 51 45 52 46 Each member of this structure corresponds to a function in the device driver 53 47 that is called when a particular event in the LAPB module occurs. These will ··· 60 54 61 55 This structure is used with the lapb_getparms and lapb_setparms functions 62 56 (see below). They are used to allow the device driver to get and set the 63 - operational parameters of the LAPB implementation for a given connection. 57 + operational parameters of the LAPB implementation for a given connection:: 64 58 65 - struct lapb_parms_struct { 66 - unsigned int t1; 67 - unsigned int t1timer; 68 - unsigned int t2; 69 - unsigned int t2timer; 70 - unsigned int n2; 71 - unsigned int n2count; 72 - unsigned int window; 73 - unsigned int state; 74 - unsigned int mode; 75 - }; 59 + struct lapb_parms_struct { 60 + unsigned int t1; 61 + unsigned int t1timer; 62 + unsigned int t2; 63 + unsigned int t2timer; 64 + unsigned int n2; 65 + unsigned int n2count; 66 + unsigned int window; 67 + unsigned int state; 68 + unsigned int mode; 69 + }; 76 70 77 71 T1 and T2 are protocol timing parameters and are given in units of 100ms. N2 78 72 is the maximum number of tries on the link before it is declared a failure. ··· 84 78 The mode variable is a bit field used for setting (at present) three values. 85 79 The bit fields have the following meanings: 86 80 81 + ====== ================================================= 87 82 Bit Meaning 83 + ====== ================================================= 88 84 0 LAPB operation (0=LAPB_STANDARD 1=LAPB_EXTENDED). 89 85 1 [SM]LP operation (0=LAPB_SLP 1=LAPB=MLP). 90 86 2 DTE/DCE operation (0=LAPB_DTE 1=LAPB_DCE) 91 87 3-31 Reserved, must be 0. 88 + ====== ================================================= 92 89 93 90 Extended LAPB operation indicates the use of extended sequence numbers and 94 91 consequently larger window sizes, the default is standard LAPB operation. ··· 108 99 109 100 The LAPB module provides a number of function entry points. 110 101 102 + :: 111 103 112 - int lapb_register(void *token, struct lapb_register_struct); 104 + int lapb_register(void *token, struct lapb_register_struct); 113 105 114 106 This must be called before the LAPB module may be used. If the call is 115 107 successful then LAPB_OK is returned. The token must be a unique identifier ··· 121 111 lapb_register must be made. The format of the lapb_register_struct is given 122 112 above. The return values are: 123 113 114 + ============= ============================= 124 115 LAPB_OK LAPB registered successfully. 125 116 LAPB_BADTOKEN Token is already registered. 126 117 LAPB_NOMEM Out of memory 118 + ============= ============================= 127 119 120 + :: 128 121 129 - int lapb_unregister(void *token); 122 + int lapb_unregister(void *token); 130 123 131 124 This releases all the resources associated with a LAPB link. Any current 132 125 LAPB link will be abandoned without further messages being passed. After 133 126 this call, the value of token is no longer valid for any calls to the LAPB 134 127 function. The valid return values are: 135 128 129 + ============= =============================== 136 130 LAPB_OK LAPB unregistered successfully. 137 131 LAPB_BADTOKEN Invalid/unknown LAPB token. 132 + ============= =============================== 138 133 134 + :: 139 135 140 - int lapb_getparms(void *token, struct lapb_parms_struct *parms); 136 + int lapb_getparms(void *token, struct lapb_parms_struct *parms); 141 137 142 138 This allows the device driver to get the values of the current LAPB 143 139 variables, the lapb_parms_struct is described above. The valid return values 144 140 are: 145 141 142 + ============= ============================= 146 143 LAPB_OK LAPB getparms was successful. 147 144 LAPB_BADTOKEN Invalid/unknown LAPB token. 145 + ============= ============================= 148 146 147 + :: 149 148 150 - int lapb_setparms(void *token, struct lapb_parms_struct *parms); 149 + int lapb_setparms(void *token, struct lapb_parms_struct *parms); 151 150 152 151 This allows the device driver to set the values of the current LAPB 153 152 variables, the lapb_parms_struct is described above. The values of t1timer, ··· 164 145 connected will be ignored. An error implies that none of the values have 165 146 been changed. The valid return values are: 166 147 148 + ============= ================================================= 167 149 LAPB_OK LAPB getparms was successful. 168 150 LAPB_BADTOKEN Invalid/unknown LAPB token. 169 151 LAPB_INVALUE One of the values was out of its allowable range. 152 + ============= ================================================= 170 153 154 + :: 171 155 172 - int lapb_connect_request(void *token); 156 + int lapb_connect_request(void *token); 173 157 174 158 Initiate a connect using the current parameter settings. The valid return 175 159 values are: 176 160 161 + ============== ================================= 177 162 LAPB_OK LAPB is starting to connect. 178 163 LAPB_BADTOKEN Invalid/unknown LAPB token. 179 164 LAPB_CONNECTED LAPB module is already connected. 165 + ============== ================================= 180 166 167 + :: 181 168 182 - int lapb_disconnect_request(void *token); 169 + int lapb_disconnect_request(void *token); 183 170 184 171 Initiate a disconnect. The valid return values are: 185 172 173 + ================= =============================== 186 174 LAPB_OK LAPB is starting to disconnect. 187 175 LAPB_BADTOKEN Invalid/unknown LAPB token. 188 176 LAPB_NOTCONNECTED LAPB module is not connected. 177 + ================= =============================== 189 178 179 + :: 190 180 191 - int lapb_data_request(void *token, struct sk_buff *skb); 181 + int lapb_data_request(void *token, struct sk_buff *skb); 192 182 193 183 Queue data with the LAPB module for transmitting over the link. If the call 194 184 is successful then the skbuff is owned by the LAPB module and may not be 195 185 used by the device driver again. The valid return values are: 196 186 187 + ================= ============================= 197 188 LAPB_OK LAPB has accepted the data. 198 189 LAPB_BADTOKEN Invalid/unknown LAPB token. 199 190 LAPB_NOTCONNECTED LAPB module is not connected. 191 + ================= ============================= 200 192 193 + :: 201 194 202 - int lapb_data_received(void *token, struct sk_buff *skb); 195 + int lapb_data_received(void *token, struct sk_buff *skb); 203 196 204 197 Queue data with the LAPB module which has been received from the device. It 205 198 is expected that the data passed to the LAPB module has skb->data pointing ··· 219 188 is owned by the LAPB module and may not be used by the device driver again. 220 189 The valid return values are: 221 190 191 + ============= =========================== 222 192 LAPB_OK LAPB has accepted the data. 223 193 LAPB_BADTOKEN Invalid/unknown LAPB token. 224 - 194 + ============= =========================== 225 195 226 196 Callbacks 227 197 --------- ··· 232 200 module with lapb_register (see above) in the structure lapb_register_struct 233 201 (see above). 234 202 203 + :: 235 204 236 - void (*connect_confirmation)(void *token, int reason); 205 + void (*connect_confirmation)(void *token, int reason); 237 206 238 207 This is called by the LAPB module when a connection is established after 239 208 being requested by a call to lapb_connect_request (see above). The reason is 240 209 always LAPB_OK. 241 210 211 + :: 242 212 243 - void (*connect_indication)(void *token, int reason); 213 + void (*connect_indication)(void *token, int reason); 244 214 245 215 This is called by the LAPB module when the link is established by the remote 246 216 system. The value of reason is always LAPB_OK. 247 217 218 + :: 248 219 249 - void (*disconnect_confirmation)(void *token, int reason); 220 + void (*disconnect_confirmation)(void *token, int reason); 250 221 251 222 This is called by the LAPB module when an event occurs after the device 252 223 driver has called lapb_disconnect_request (see above). The reason indicates 253 224 what has happened. In all cases the LAPB link can be regarded as being 254 225 terminated. The values for reason are: 255 226 227 + ================= ==================================================== 256 228 LAPB_OK The LAPB link was terminated normally. 257 229 LAPB_NOTCONNECTED The remote system was not connected. 258 230 LAPB_TIMEDOUT No response was received in N2 tries from the remote 259 231 system. 232 + ================= ==================================================== 260 233 234 + :: 261 235 262 - void (*disconnect_indication)(void *token, int reason); 236 + void (*disconnect_indication)(void *token, int reason); 263 237 264 238 This is called by the LAPB module when the link is terminated by the remote 265 239 system or another event has occurred to terminate the link. This may be 266 240 returned in response to a lapb_connect_request (see above) if the remote 267 241 system refused the request. The values for reason are: 268 242 243 + ================= ==================================================== 269 244 LAPB_OK The LAPB link was terminated normally by the remote 270 245 system. 271 246 LAPB_REFUSED The remote system refused the connect request. 272 247 LAPB_NOTCONNECTED The remote system was not connected. 273 248 LAPB_TIMEDOUT No response was received in N2 tries from the remote 274 249 system. 250 + ================= ==================================================== 275 251 252 + :: 276 253 277 - int (*data_indication)(void *token, struct sk_buff *skb); 254 + int (*data_indication)(void *token, struct sk_buff *skb); 278 255 279 256 This is called by the LAPB module when data has been received from the 280 257 remote system that should be passed onto the next layer in the protocol ··· 295 254 file include/linux/netdevice.h) if and only if the frame was dropped 296 255 before it could be delivered to the upper layer. 297 256 257 + :: 298 258 299 - void (*data_transmit)(void *token, struct sk_buff *skb); 259 + void (*data_transmit)(void *token, struct sk_buff *skb); 300 260 301 261 This is called by the LAPB module when data is to be transmitted to the 302 262 remote system by the device driver. The skbuff becomes the property of the
+1 -1
MAINTAINERS
··· 9515 9515 LAPB module 9516 9516 L: linux-x25@vger.kernel.org 9517 9517 S: Orphan 9518 - F: Documentation/networking/lapb-module.txt 9518 + F: Documentation/networking/lapb-module.rst 9519 9519 F: include/*/lapb.h 9520 9520 F: net/lapb/ 9521 9521
+1 -1
net/lapb/Kconfig
··· 15 15 currently supports LAPB only over Ethernet connections. If you want 16 16 to use LAPB connections over Ethernet, say Y here and to "LAPB over 17 17 Ethernet driver" below. Read 18 - <file:Documentation/networking/lapb-module.txt> for technical 18 + <file:Documentation/networking/lapb-module.rst> for technical 19 19 details. 20 20 21 21 To compile this driver as a module, choose M here: the