Commit 1b329124 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

qlge: use ethtool set_phys_id

This is a stab at replacing old ethtool phys_id with set_phys_id
on the Qlogic 10Gb driver. Compile tested only.

Not sure if set_led_cfg will flash continuously, or needs
to be replaced by ETHTOOL_ID_ON/ETHTOOL_ID_OFF
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarRon Mercer <ron.mercer@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 127fe533
...@@ -412,31 +412,31 @@ static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) ...@@ -412,31 +412,31 @@ static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
return 0; return 0;
} }
static int ql_phys_id(struct net_device *ndev, u32 data) static int ql_set_phys_id(struct net_device *ndev,
enum ethtool_phys_id_state state)
{ {
struct ql_adapter *qdev = netdev_priv(ndev); struct ql_adapter *qdev = netdev_priv(ndev);
u32 led_reg, i;
int status;
/* Save the current LED settings */ switch (state) {
status = ql_mb_get_led_cfg(qdev); case ETHTOOL_ID_ACTIVE:
if (status) /* Save the current LED settings */
return status; if (ql_mb_get_led_cfg(qdev))
led_reg = qdev->led_config; return -EIO;
/* Start blinking the led */ /* Start blinking */
if (!data || data > 300)
data = 300;
for (i = 0; i < (data * 10); i++)
ql_mb_set_led_cfg(qdev, QL_LED_BLINK); ql_mb_set_led_cfg(qdev, QL_LED_BLINK);
return 0;
/* Restore LED settings */ case ETHTOOL_ID_INACTIVE:
status = ql_mb_set_led_cfg(qdev, led_reg); /* Restore LED settings */
if (status) if (ql_mb_set_led_cfg(qdev, qdev->led_config))
return status; return -EIO;
return 0;
return 0; default:
return -EINVAL;
}
} }
static int ql_start_loopback(struct ql_adapter *qdev) static int ql_start_loopback(struct ql_adapter *qdev)
...@@ -703,7 +703,7 @@ const struct ethtool_ops qlge_ethtool_ops = { ...@@ -703,7 +703,7 @@ const struct ethtool_ops qlge_ethtool_ops = {
.get_msglevel = ql_get_msglevel, .get_msglevel = ql_get_msglevel,
.set_msglevel = ql_set_msglevel, .set_msglevel = ql_set_msglevel,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.phys_id = ql_phys_id, .set_phys_id = ql_set_phys_id,
.self_test = ql_self_test, .self_test = ql_self_test,
.get_pauseparam = ql_get_pauseparam, .get_pauseparam = ql_get_pauseparam,
.set_pauseparam = ql_set_pauseparam, .set_pauseparam = ql_set_pauseparam,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment