From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <aelior@marvell.com>, <mkalderon@marvell.com>
Subject: [PATCH net-next 2/2] qede: Add ethtool interface for SmartAN query.
Date: Thu, 7 Feb 2019 06:20:12 -0800 [thread overview]
Message-ID: <20190207142012.4521-3-skalluru@marvell.com> (raw)
In-Reply-To: <20190207142012.4521-1-skalluru@marvell.com>
The patch adds driver support to query SmartAN capability via ethtool.
Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
---
drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
index 16331c6..c623808 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
@@ -186,11 +186,13 @@
enum {
QEDE_PRI_FLAG_CMT,
+ QEDE_PRI_FLAG_SMART_AN_SUPPORT, /* MFW supports SmartAN */
QEDE_PRI_FLAG_LEN,
};
static const char qede_private_arr[QEDE_PRI_FLAG_LEN][ETH_GSTRING_LEN] = {
"Coupled-Function",
+ "SmartAN capable",
};
enum qede_ethtool_tests {
@@ -404,8 +406,15 @@ static int qede_get_sset_count(struct net_device *dev, int stringset)
static u32 qede_get_priv_flags(struct net_device *dev)
{
struct qede_dev *edev = netdev_priv(dev);
+ u32 flags = 0;
- return (!!(edev->dev_info.common.num_hwfns > 1)) << QEDE_PRI_FLAG_CMT;
+ if (edev->dev_info.common.num_hwfns > 1)
+ flags |= BIT(QEDE_PRI_FLAG_CMT);
+
+ if (edev->dev_info.common.smart_an)
+ flags |= BIT(QEDE_PRI_FLAG_SMART_AN_SUPPORT);
+
+ return flags;
}
struct qede_link_mode_mapping {
--
1.8.3.1
next prev parent reply other threads:[~2019-02-07 14:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 14:20 [PATCH net-next 0/2] qed*: SmartAN query support Sudarsana Reddy Kalluru
2019-02-07 14:20 ` [PATCH net-next 1/2] qed: Add API for SmartAN query Sudarsana Reddy Kalluru
2019-02-07 14:20 ` Sudarsana Reddy Kalluru [this message]
2019-02-07 19:54 ` [PATCH net-next 0/2] qed*: SmartAN query support Jakub Kicinski
2019-02-08 11:32 ` [EXT] " Sudarsana Reddy Kalluru
2019-02-08 16:04 ` Jakub Kicinski
2019-02-09 6:55 ` David Miller
2019-02-07 21:22 ` David Miller
2019-02-07 21:32 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190207142012.4521-3-skalluru@marvell.com \
--to=skalluru@marvell.com \
--cc=aelior@marvell.com \
--cc=davem@davemloft.net \
--cc=mkalderon@marvell.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).