-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eth: fbnic: Add ethtool support for fbnic
Add ethtool ops support and enable 'get_drvinfo' for fbnic. The driver provides firmware version information while the driver name and bus information is provided by ethtool_get_drvinfo(). Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Mohsin Bashir
authored and
David S. Miller
committed
Sep 4, 2024
1 parent
5c26516
commit bd2557a
Showing
7 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <linux/ethtool.h> | ||
#include <linux/netdevice.h> | ||
#include <linux/pci.h> | ||
|
||
#include "fbnic.h" | ||
#include "fbnic_netdev.h" | ||
#include "fbnic_tlv.h" | ||
|
||
static void | ||
fbnic_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) | ||
{ | ||
struct fbnic_net *fbn = netdev_priv(netdev); | ||
struct fbnic_dev *fbd = fbn->fbd; | ||
|
||
fbnic_get_fw_ver_commit_str(fbd, drvinfo->fw_version, | ||
sizeof(drvinfo->fw_version)); | ||
} | ||
|
||
static const struct ethtool_ops fbnic_ethtool_ops = { | ||
.get_drvinfo = fbnic_get_drvinfo, | ||
}; | ||
|
||
void fbnic_set_ethtool_ops(struct net_device *dev) | ||
{ | ||
dev->ethtool_ops = &fbnic_ethtool_ops; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters