qlge: Fix ethtool WOL calls to operate only on devices that support WOL.
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d0de73096e
commit
206d78e0c5
@@ -25,6 +25,8 @@
|
|||||||
#define QLGE_VENDOR_ID 0x1077
|
#define QLGE_VENDOR_ID 0x1077
|
||||||
#define QLGE_DEVICE_ID_8012 0x8012
|
#define QLGE_DEVICE_ID_8012 0x8012
|
||||||
#define QLGE_DEVICE_ID_8000 0x8000
|
#define QLGE_DEVICE_ID_8000 0x8000
|
||||||
|
#define QLGE_MEZZ_SSYS_ID_068 0x0068
|
||||||
|
#define QLGE_MEZZ_SSYS_ID_180 0x0180
|
||||||
#define MAX_CPUS 8
|
#define MAX_CPUS 8
|
||||||
#define MAX_TX_RINGS MAX_CPUS
|
#define MAX_TX_RINGS MAX_CPUS
|
||||||
#define MAX_RX_RINGS ((MAX_CPUS * 2) + 1)
|
#define MAX_RX_RINGS ((MAX_CPUS * 2) + 1)
|
||||||
|
@@ -388,17 +388,29 @@ static void ql_get_drvinfo(struct net_device *ndev,
|
|||||||
static void ql_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
|
static void ql_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
|
||||||
{
|
{
|
||||||
struct ql_adapter *qdev = netdev_priv(ndev);
|
struct ql_adapter *qdev = netdev_priv(ndev);
|
||||||
/* What we support. */
|
unsigned short ssys_dev = qdev->pdev->subsystem_device;
|
||||||
wol->supported = WAKE_MAGIC;
|
|
||||||
/* What we've currently got set. */
|
/* WOL is only supported for mezz card. */
|
||||||
wol->wolopts = qdev->wol;
|
if (ssys_dev == QLGE_MEZZ_SSYS_ID_068 ||
|
||||||
|
ssys_dev == QLGE_MEZZ_SSYS_ID_180) {
|
||||||
|
wol->supported = WAKE_MAGIC;
|
||||||
|
wol->wolopts = qdev->wol;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
|
static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
|
||||||
{
|
{
|
||||||
struct ql_adapter *qdev = netdev_priv(ndev);
|
struct ql_adapter *qdev = netdev_priv(ndev);
|
||||||
int status;
|
int status;
|
||||||
|
unsigned short ssys_dev = qdev->pdev->subsystem_device;
|
||||||
|
|
||||||
|
/* WOL is only supported for mezz card. */
|
||||||
|
if (ssys_dev != QLGE_MEZZ_SSYS_ID_068 ||
|
||||||
|
ssys_dev != QLGE_MEZZ_SSYS_ID_180) {
|
||||||
|
netif_info(qdev, drv, qdev->ndev,
|
||||||
|
"WOL is only supported for mezz card\n");
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
}
|
||||||
if (wol->wolopts & ~WAKE_MAGIC)
|
if (wol->wolopts & ~WAKE_MAGIC)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
qdev->wol = wol->wolopts;
|
qdev->wol = wol->wolopts;
|
||||||
|
Reference in New Issue
Block a user