Skip to content

Commit 107db7e

Browse files
mchehabholtmann
authored andcommitted
docs: networking: convert 6lowpan.txt to ReST
- add SPDX header; - use document title markup; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Reviewed-by: Stefan Schmidt <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 8788a1e commit 107db7e

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

Documentation/networking/6lowpan.txt renamed to Documentation/networking/6lowpan.rst

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
1+
.. SPDX-License-Identifier: GPL-2.0
12
2-
Netdev private dataroom for 6lowpan interfaces:
3+
==============================================
4+
Netdev private dataroom for 6lowpan interfaces
5+
==============================================
36

47
All 6lowpan able net devices, means all interfaces with ARPHRD_6LOWPAN,
58
must have "struct lowpan_priv" placed at beginning of netdev_priv.
69

7-
The priv_size of each interface should be calculate by:
10+
The priv_size of each interface should be calculate by::
811

912
dev->priv_size = LOWPAN_PRIV_SIZE(LL_6LOWPAN_PRIV_DATA);
1013

1114
Where LL_PRIV_6LOWPAN_DATA is sizeof linklayer 6lowpan private data struct.
12-
To access the LL_PRIV_6LOWPAN_DATA structure you can cast:
15+
To access the LL_PRIV_6LOWPAN_DATA structure you can cast::
1316

1417
lowpan_priv(dev)-priv;
1518

1619
to your LL_6LOWPAN_PRIV_DATA structure.
1720

18-
Before registering the lowpan netdev interface you must run:
21+
Before registering the lowpan netdev interface you must run::
1922

2023
lowpan_netdev_setup(dev, LOWPAN_LLTYPE_FOOBAR);
2124

2225
wheres LOWPAN_LLTYPE_FOOBAR is a define for your 6LoWPAN linklayer type of
2326
enum lowpan_lltypes.
2427

25-
Example to evaluate the private usually you can do:
28+
Example to evaluate the private usually you can do::
2629

27-
static inline struct lowpan_priv_foobar *
28-
lowpan_foobar_priv(struct net_device *dev)
29-
{
30+
static inline struct lowpan_priv_foobar *
31+
lowpan_foobar_priv(struct net_device *dev)
32+
{
3033
return (struct lowpan_priv_foobar *)lowpan_priv(dev)->priv;
31-
}
34+
}
3235

33-
switch (dev->type) {
34-
case ARPHRD_6LOWPAN:
36+
switch (dev->type) {
37+
case ARPHRD_6LOWPAN:
3538
lowpan_priv = lowpan_priv(dev);
3639
/* do great stuff which is ARPHRD_6LOWPAN related */
3740
switch (lowpan_priv->lltype) {
@@ -42,8 +45,8 @@ case ARPHRD_6LOWPAN:
4245
...
4346
}
4447
break;
45-
...
46-
}
48+
...
49+
}
4750

4851
In case of generic 6lowpan branch ("net/6lowpan") you can remove the check
4952
on ARPHRD_6LOWPAN, because you can be sure that these function are called

Documentation/networking/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Contents:
3333
tls
3434
tls-offload
3535
nfc
36+
6lowpan
3637

3738
.. only:: subproject and html
3839

0 commit comments

Comments
 (0)