aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorAlan Brady <alan.brady@intel.com>2017-10-05 14:53:40 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2017-10-17 10:48:51 -0700
commit5a6cd6de76ae78b651e7c36eba8b1da465d65f06 (patch)
treec9811c2b2602b081a541f65805a58ecb4b91a993 /include/linux/ethtool.h
parenti40e: Add new PHY types for 25G AOC and ACC support (diff)
downloadlinux-dev-5a6cd6de76ae78b651e7c36eba8b1da465d65f06.tar.xz
linux-dev-5a6cd6de76ae78b651e7c36eba8b1da465d65f06.zip
ethtool: add ethtool_intersect_link_masks
This function provides a way to intersect two link masks together to find the common ground between them. For example in i40e, the driver first generates link masks for what is supported by the PHY type. The driver then gets the link masks for what the NVM supports. The resulting intersection between them yields what can truly be supported. Signed-off-by: Alan Brady <alan.brady@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 4587a4c36923..c77fa3529e15 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -163,6 +163,16 @@ extern int
__ethtool_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *link_ksettings);
+/**
+ * ethtool_intersect_link_masks - Given two link masks, AND them together
+ * @dst: first mask and where result is stored
+ * @src: second mask to intersect with
+ *
+ * Given two link mode masks, AND them together and save the result in dst.
+ */
+void ethtool_intersect_link_masks(struct ethtool_link_ksettings *dst,
+ struct ethtool_link_ksettings *src);
+
void ethtool_convert_legacy_u32_to_link_mode(unsigned long *dst,
u32 legacy_u32);