From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ron.mercer@qlogic.com,
Dept_NX_Linux_NIC_Driver@qlogic.com,
Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Subject: [PATCH net 2/7] qlge: Stand-up card should not report supporting wol.
Date: Mon, 2 Jul 2012 19:41:49 -0400 [thread overview]
Message-ID: <1341272514-5156-3-git-send-email-jitendra.kalsaria@qlogic.com> (raw)
In-Reply-To: <1341272514-5156-1-git-send-email-jitendra.kalsaria@qlogic.com>
From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
---
drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c | 46 ++++++++++++++---------
1 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
index 8e2c2a7..98f04d7 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
@@ -388,30 +388,40 @@ static void ql_get_drvinfo(struct net_device *ndev,
static void ql_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
{
struct ql_adapter *qdev = netdev_priv(ndev);
- /* What we support. */
- wol->supported = WAKE_MAGIC;
- /* What we've currently got set. */
- wol->wolopts = qdev->wol;
+ unsigned short ssys_dev = qdev->pdev->subsystem_device;
+
+ if (ssys_dev == 0x0068 || ssys_dev == 0x0180) {
+ wol->supported = WAKE_MAGIC;
+ wol->wolopts = qdev->wol;
+ }
}
static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
{
struct ql_adapter *qdev = netdev_priv(ndev);
- int status;
+ unsigned short ssys_dev = qdev->pdev->subsystem_device;
- if (wol->wolopts & ~WAKE_MAGIC)
- return -EINVAL;
- qdev->wol = wol->wolopts;
-
- netif_info(qdev, drv, qdev->ndev, "Set wol option 0x%x\n", qdev->wol);
- if (!qdev->wol) {
- u32 wol = 0;
- status = ql_mb_wol_mode(qdev, wol);
- netif_err(qdev, drv, qdev->ndev, "WOL %s (wol code 0x%x)\n",
- status == 0 ? "cleared successfully" : "clear failed",
- wol);
- }
+ if (ssys_dev == 0x0068 || ssys_dev == 0x0180) {
+ if (wol->wolopts & ~WAKE_MAGIC)
+ return -EINVAL;
+ qdev->wol = wol->wolopts;
+
+ netif_info(qdev, drv, qdev->ndev,
+ "Set wol option 0x%x\n", qdev->wol);
+ if (!qdev->wol) {
+ u32 wol = 0;
+ int status = 0;
+ status = ql_mb_wol_mode(qdev, wol);
+ netif_err(qdev, drv, qdev->ndev,
+ "WOL %s (wol code 0x%x)\n",
+ status == 0 ? "cleared successfully" : "clear failed",
+ wol);
+ }
+ } else {
+ netif_info(qdev, drv, qdev->ndev,
+ "WOL is not supported on stand-up card\n");
+ }
return 0;
}
--
1.7.1
next prev parent reply other threads:[~2012-07-02 23:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 23:41 [PATCH net 0/7] qlge: bug fix Jitendra Kalsaria
2012-07-02 23:41 ` [PATCH net 1/7] qlge: Fixed packet transmit errors due to potential driver errors Jitendra Kalsaria
2012-07-03 0:18 ` David Miller
2012-07-03 1:30 ` Jitendra Kalsaria
2012-07-03 1:38 ` David Miller
2012-07-03 1:41 ` David Miller
2012-07-03 3:28 ` Krishna Kumar2
2012-07-03 19:38 ` Jitendra Kalsaria
2012-07-03 20:27 ` Eric Dumazet
2012-07-03 22:22 ` Francois Romieu
2012-07-03 22:33 ` Jitendra Kalsaria
2012-07-03 23:14 ` David Miller
2012-07-02 23:41 ` Jitendra Kalsaria [this message]
2012-07-02 23:41 ` [PATCH net 3/7] qlge: Garbage values shown in extra info during selftest Jitendra Kalsaria
2012-07-05 7:23 ` David Miller
2012-07-05 17:13 ` Jitendra Kalsaria
2012-07-02 23:41 ` [PATCH net 4/7] qlge: Fixed double pci free upon tx_ring->q allocation failure Jitendra Kalsaria
2012-07-03 1:22 ` Ben Hutchings
2012-07-03 5:56 ` Jitendra Kalsaria
2012-07-02 23:41 ` [PATCH net 5/7] qlge: Categorize receive frame errors from firmware Jitendra Kalsaria
2012-07-02 23:41 ` [PATCH net 6/7] qlge: refactoring of ethtool stats Jitendra Kalsaria
2012-07-03 1:24 ` Ben Hutchings
2012-07-03 1:26 ` David Miller
2012-07-02 23:41 ` [PATCH net 7/7] qlge: Bumped driver version to 1.00.00.31 Jitendra Kalsaria
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=1341272514-5156-3-git-send-email-jitendra.kalsaria@qlogic.com \
--to=jitendra.kalsaria@qlogic.com \
--cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ron.mercer@qlogic.com \
/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).