docs: networking: convert 6lowpan.txt to ReST
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 6 Feb 2020 15:17:22 +0000 (16:17 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 28 Feb 2020 13:52:36 +0000 (14:52 +0100)
- 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 <mchehab+huawei@kernel.org>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Documentation/networking/6lowpan.rst [new file with mode: 0644]
Documentation/networking/6lowpan.txt [deleted file]
Documentation/networking/index.rst

diff --git a/Documentation/networking/6lowpan.rst b/Documentation/networking/6lowpan.rst
new file mode 100644 (file)
index 0000000..e70a652
--- /dev/null
@@ -0,0 +1,53 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+==============================================
+Netdev private dataroom for 6lowpan interfaces
+==============================================
+
+All 6lowpan able net devices, means all interfaces with ARPHRD_6LOWPAN,
+must have "struct lowpan_priv" placed at beginning of netdev_priv.
+
+The priv_size of each interface should be calculate by::
+
+ dev->priv_size = LOWPAN_PRIV_SIZE(LL_6LOWPAN_PRIV_DATA);
+
+Where LL_PRIV_6LOWPAN_DATA is sizeof linklayer 6lowpan private data struct.
+To access the LL_PRIV_6LOWPAN_DATA structure you can cast::
+
+ lowpan_priv(dev)-priv;
+
+to your LL_6LOWPAN_PRIV_DATA structure.
+
+Before registering the lowpan netdev interface you must run::
+
+ lowpan_netdev_setup(dev, LOWPAN_LLTYPE_FOOBAR);
+
+wheres LOWPAN_LLTYPE_FOOBAR is a define for your 6LoWPAN linklayer type of
+enum lowpan_lltypes.
+
+Example to evaluate the private usually you can do::
+
+ static inline struct lowpan_priv_foobar *
+ lowpan_foobar_priv(struct net_device *dev)
+ {
+       return (struct lowpan_priv_foobar *)lowpan_priv(dev)->priv;
+ }
+
+ switch (dev->type) {
+ case ARPHRD_6LOWPAN:
+       lowpan_priv = lowpan_priv(dev);
+       /* do great stuff which is ARPHRD_6LOWPAN related */
+       switch (lowpan_priv->lltype) {
+       case LOWPAN_LLTYPE_FOOBAR:
+               /* do 802.15.4 6LoWPAN handling here */
+               lowpan_foobar_priv(dev)->bar = foo;
+               break;
+       ...
+       }
+       break;
+ ...
+ }
+
+In case of generic 6lowpan branch ("net/6lowpan") you can remove the check
+on ARPHRD_6LOWPAN, because you can be sure that these function are called
+by ARPHRD_6LOWPAN interfaces.
diff --git a/Documentation/networking/6lowpan.txt b/Documentation/networking/6lowpan.txt
deleted file mode 100644 (file)
index 2e5a939..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-
-Netdev private dataroom for 6lowpan interfaces:
-
-All 6lowpan able net devices, means all interfaces with ARPHRD_6LOWPAN,
-must have "struct lowpan_priv" placed at beginning of netdev_priv.
-
-The priv_size of each interface should be calculate by:
-
- dev->priv_size = LOWPAN_PRIV_SIZE(LL_6LOWPAN_PRIV_DATA);
-
-Where LL_PRIV_6LOWPAN_DATA is sizeof linklayer 6lowpan private data struct.
-To access the LL_PRIV_6LOWPAN_DATA structure you can cast:
-
- lowpan_priv(dev)-priv;
-
-to your LL_6LOWPAN_PRIV_DATA structure.
-
-Before registering the lowpan netdev interface you must run:
-
- lowpan_netdev_setup(dev, LOWPAN_LLTYPE_FOOBAR);
-
-wheres LOWPAN_LLTYPE_FOOBAR is a define for your 6LoWPAN linklayer type of
-enum lowpan_lltypes.
-
-Example to evaluate the private usually you can do:
-
-static inline struct lowpan_priv_foobar *
-lowpan_foobar_priv(struct net_device *dev)
-{
-       return (struct lowpan_priv_foobar *)lowpan_priv(dev)->priv;
-}
-
-switch (dev->type) {
-case ARPHRD_6LOWPAN:
-       lowpan_priv = lowpan_priv(dev);
-       /* do great stuff which is ARPHRD_6LOWPAN related */
-       switch (lowpan_priv->lltype) {
-       case LOWPAN_LLTYPE_FOOBAR:
-               /* do 802.15.4 6LoWPAN handling here */
-               lowpan_foobar_priv(dev)->bar = foo;
-               break;
-       ...
-       }
-       break;
-...
-}
-
-In case of generic 6lowpan branch ("net/6lowpan") you can remove the check
-on ARPHRD_6LOWPAN, because you can be sure that these function are called
-by ARPHRD_6LOWPAN interfaces.
index d07d9855dcd3e8b30dcdb5decb6a8e93a51a6400..683bcbfbed75e4e3a811c0be2ee389def50a8b6f 100644 (file)
@@ -33,6 +33,7 @@ Contents:
    tls
    tls-offload
    nfc
+   6lowpan
 
 .. only::  subproject and html