diff options
author | stephen hemminger <shemminger@vyatta.com> | 2011-04-06 09:47:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-11 16:22:34 -0400 |
commit | 1b3291241a658fb4d4bbdb41483e1f53c26445ec (patch) | |
tree | 481d91be6092a9af5065d708bf2f35cf6051a357 /drivers/net/qlge | |
parent | 127fe533ae56d7f4e7b5011869870982eba25723 (diff) |
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: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index 8149cc9de4ca..687754da2a9f 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c | |||
@@ -412,31 +412,31 @@ static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) | |||
412 | return 0; | 412 | return 0; |
413 | } | 413 | } |
414 | 414 | ||
415 | static int ql_phys_id(struct net_device *ndev, u32 data) | 415 | static int ql_set_phys_id(struct net_device *ndev, |
416 | enum ethtool_phys_id_state state) | ||
417 | |||
416 | { | 418 | { |
417 | struct ql_adapter *qdev = netdev_priv(ndev); | 419 | struct ql_adapter *qdev = netdev_priv(ndev); |
418 | u32 led_reg, i; | ||
419 | int status; | ||
420 | 420 | ||
421 | /* Save the current LED settings */ | 421 | switch (state) { |
422 | status = ql_mb_get_led_cfg(qdev); | 422 | case ETHTOOL_ID_ACTIVE: |
423 | if (status) | 423 | /* Save the current LED settings */ |
424 | return status; | 424 | if (ql_mb_get_led_cfg(qdev)) |
425 | led_reg = qdev->led_config; | 425 | return -EIO; |
426 | 426 | ||
427 | /* Start blinking the led */ | 427 | /* Start blinking */ |
428 | if (!data || data > 300) | ||
429 | data = 300; | ||
430 | |||
431 | for (i = 0; i < (data * 10); i++) | ||
432 | ql_mb_set_led_cfg(qdev, QL_LED_BLINK); | 428 | ql_mb_set_led_cfg(qdev, QL_LED_BLINK); |
429 | return 0; | ||
433 | 430 | ||
434 | /* Restore LED settings */ | 431 | case ETHTOOL_ID_INACTIVE: |
435 | status = ql_mb_set_led_cfg(qdev, led_reg); | 432 | /* Restore LED settings */ |
436 | if (status) | 433 | if (ql_mb_set_led_cfg(qdev, qdev->led_config)) |
437 | return status; | 434 | return -EIO; |
435 | return 0; | ||
438 | 436 | ||
439 | return 0; | 437 | default: |
438 | return -EINVAL; | ||
439 | } | ||
440 | } | 440 | } |
441 | 441 | ||
442 | static int ql_start_loopback(struct ql_adapter *qdev) | 442 | static int ql_start_loopback(struct ql_adapter *qdev) |
@@ -703,7 +703,7 @@ const struct ethtool_ops qlge_ethtool_ops = { | |||
703 | .get_msglevel = ql_get_msglevel, | 703 | .get_msglevel = ql_get_msglevel, |
704 | .set_msglevel = ql_set_msglevel, | 704 | .set_msglevel = ql_set_msglevel, |
705 | .get_link = ethtool_op_get_link, | 705 | .get_link = ethtool_op_get_link, |
706 | .phys_id = ql_phys_id, | 706 | .set_phys_id = ql_set_phys_id, |
707 | .self_test = ql_self_test, | 707 | .self_test = ql_self_test, |
708 | .get_pauseparam = ql_get_pauseparam, | 708 | .get_pauseparam = ql_get_pauseparam, |
709 | .set_pauseparam = ql_set_pauseparam, | 709 | .set_pauseparam = ql_set_pauseparam, |