diff options
Diffstat (limited to 'drivers/net/benet/be_ethtool.c')
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index 575ac659ceb4..a665697df824 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -526,29 +526,33 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd) | |||
526 | } | 526 | } |
527 | 527 | ||
528 | static int | 528 | static int |
529 | be_phys_id(struct net_device *netdev, u32 data) | 529 | be_set_phys_id(struct net_device *netdev, |
530 | enum ethtool_phys_id_state state) | ||
530 | { | 531 | { |
531 | struct be_adapter *adapter = netdev_priv(netdev); | 532 | struct be_adapter *adapter = netdev_priv(netdev); |
532 | int status; | ||
533 | u32 cur; | ||
534 | |||
535 | be_cmd_get_beacon_state(adapter, adapter->hba_port_num, &cur); | ||
536 | 533 | ||
537 | if (cur == BEACON_STATE_ENABLED) | 534 | switch (state) { |
538 | return 0; | 535 | case ETHTOOL_ID_ACTIVE: |
536 | be_cmd_get_beacon_state(adapter, adapter->hba_port_num, | ||
537 | &adapter->beacon_state); | ||
538 | return -EINVAL; | ||
539 | 539 | ||
540 | if (data < 2) | 540 | case ETHTOOL_ID_ON: |
541 | data = 2; | 541 | be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, |
542 | BEACON_STATE_ENABLED); | ||
543 | break; | ||
542 | 544 | ||
543 | status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, | 545 | case ETHTOOL_ID_OFF: |
544 | BEACON_STATE_ENABLED); | 546 | be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, |
545 | set_current_state(TASK_INTERRUPTIBLE); | 547 | BEACON_STATE_DISABLED); |
546 | schedule_timeout(data*HZ); | 548 | break; |
547 | 549 | ||
548 | status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, | 550 | case ETHTOOL_ID_INACTIVE: |
549 | BEACON_STATE_DISABLED); | 551 | be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, |
552 | adapter->beacon_state); | ||
553 | } | ||
550 | 554 | ||
551 | return status; | 555 | return 0; |
552 | } | 556 | } |
553 | 557 | ||
554 | static bool | 558 | static bool |
@@ -753,7 +757,7 @@ const struct ethtool_ops be_ethtool_ops = { | |||
753 | .get_tso = ethtool_op_get_tso, | 757 | .get_tso = ethtool_op_get_tso, |
754 | .set_tso = ethtool_op_set_tso, | 758 | .set_tso = ethtool_op_set_tso, |
755 | .get_strings = be_get_stat_strings, | 759 | .get_strings = be_get_stat_strings, |
756 | .phys_id = be_phys_id, | 760 | .set_phys_id = be_set_phys_id, |
757 | .get_sset_count = be_get_sset_count, | 761 | .get_sset_count = be_get_sset_count, |
758 | .get_ethtool_stats = be_get_ethtool_stats, | 762 | .get_ethtool_stats = be_get_ethtool_stats, |
759 | .get_regs_len = be_get_reg_len, | 763 | .get_regs_len = be_get_reg_len, |