~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/networking/6lowpan.rst

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 .. SPDX-License-Identifier: GPL-2.0
  2 
  3 ==============================================
  4 Netdev private dataroom for 6lowpan interfaces
  5 ==============================================
  6 
  7 All 6lowpan able net devices, means all interfaces with ARPHRD_6LOWPAN,
  8 must have "struct lowpan_priv" placed at beginning of netdev_priv.
  9 
 10 The priv_size of each interface should be calculate by::
 11 
 12  dev->priv_size = LOWPAN_PRIV_SIZE(LL_6LOWPAN_PRIV_DATA);
 13 
 14 Where LL_PRIV_6LOWPAN_DATA is sizeof linklayer 6lowpan private data struct.
 15 To access the LL_PRIV_6LOWPAN_DATA structure you can cast::
 16 
 17  lowpan_priv(dev)-priv;
 18 
 19 to your LL_6LOWPAN_PRIV_DATA structure.
 20 
 21 Before registering the lowpan netdev interface you must run::
 22 
 23  lowpan_netdev_setup(dev, LOWPAN_LLTYPE_FOOBAR);
 24 
 25 wheres LOWPAN_LLTYPE_FOOBAR is a define for your 6LoWPAN linklayer type of
 26 enum lowpan_lltypes.
 27 
 28 Example to evaluate the private usually you can do::
 29 
 30  static inline struct lowpan_priv_foobar *
 31  lowpan_foobar_priv(struct net_device *dev)
 32  {
 33         return (struct lowpan_priv_foobar *)lowpan_priv(dev)->priv;
 34  }
 35 
 36  switch (dev->type) {
 37  case ARPHRD_6LOWPAN:
 38         lowpan_priv = lowpan_priv(dev);
 39         /* do great stuff which is ARPHRD_6LOWPAN related */
 40         switch (lowpan_priv->lltype) {
 41         case LOWPAN_LLTYPE_FOOBAR:
 42                 /* do 802.15.4 6LoWPAN handling here */
 43                 lowpan_foobar_priv(dev)->bar = foo;
 44                 break;
 45         ...
 46         }
 47         break;
 48  ...
 49  }
 50 
 51 In case of generic 6lowpan branch ("net/6lowpan") you can remove the check
 52 on ARPHRD_6LOWPAN, because you can be sure that these function are called
 53 by ARPHRD_6LOWPAN interfaces.

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php