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

TOMOYO Linux Cross Reference
Linux/include/linux/linkmode.h

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 #ifndef __LINKMODE_H
  2 #define __LINKMODE_H
  3 
  4 #include <linux/bitmap.h>
  5 #include <linux/ethtool.h>
  6 #include <uapi/linux/ethtool.h>
  7 
  8 static inline void linkmode_zero(unsigned long *dst)
  9 {
 10         bitmap_zero(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
 11 }
 12 
 13 static inline void linkmode_fill(unsigned long *dst)
 14 {
 15         bitmap_fill(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
 16 }
 17 
 18 static inline void linkmode_copy(unsigned long *dst, const unsigned long *src)
 19 {
 20         bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS);
 21 }
 22 
 23 static inline void linkmode_and(unsigned long *dst, const unsigned long *a,
 24                                 const unsigned long *b)
 25 {
 26         bitmap_and(dst, a, b, __ETHTOOL_LINK_MODE_MASK_NBITS);
 27 }
 28 
 29 static inline void linkmode_or(unsigned long *dst, const unsigned long *a,
 30                                 const unsigned long *b)
 31 {
 32         bitmap_or(dst, a, b, __ETHTOOL_LINK_MODE_MASK_NBITS);
 33 }
 34 
 35 static inline bool linkmode_empty(const unsigned long *src)
 36 {
 37         return bitmap_empty(src, __ETHTOOL_LINK_MODE_MASK_NBITS);
 38 }
 39 
 40 static inline int linkmode_andnot(unsigned long *dst, const unsigned long *src1,
 41                                   const unsigned long *src2)
 42 {
 43         return bitmap_andnot(dst, src1, src2,  __ETHTOOL_LINK_MODE_MASK_NBITS);
 44 }
 45 
 46 #define linkmode_test_bit       test_bit
 47 #define linkmode_set_bit        __set_bit
 48 #define linkmode_clear_bit      __clear_bit
 49 #define linkmode_mod_bit        __assign_bit
 50 
 51 static inline void linkmode_set_bit_array(const int *array, int array_size,
 52                                           unsigned long *addr)
 53 {
 54         int i;
 55 
 56         for (i = 0; i < array_size; i++)
 57                 linkmode_set_bit(array[i], addr);
 58 }
 59 
 60 static inline int linkmode_equal(const unsigned long *src1,
 61                                  const unsigned long *src2)
 62 {
 63         return bitmap_equal(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
 64 }
 65 
 66 static inline int linkmode_intersects(const unsigned long *src1,
 67                                       const unsigned long *src2)
 68 {
 69         return bitmap_intersects(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
 70 }
 71 
 72 static inline int linkmode_subset(const unsigned long *src1,
 73                                   const unsigned long *src2)
 74 {
 75         return bitmap_subset(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
 76 }
 77 
 78 void linkmode_resolve_pause(const unsigned long *local_adv,
 79                             const unsigned long *partner_adv,
 80                             bool *tx_pause, bool *rx_pause);
 81 
 82 void linkmode_set_pause(unsigned long *advertisement, bool tx, bool rx);
 83 
 84 #endif /* __LINKMODE_H */
 85 

~ [ 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