aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-04-04 07:06:40 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-06 17:35:22 -0400
commit1a64246913849b0cef0be88c23381468ce169ab6 (patch)
treec3d4f9d4a800e660cd343caa94915d66fba27b87 /drivers/net
parent32d3613475d8c7d2170313b9105499dece6a3735 (diff)
benet: convert to set_phys_id
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/benet/be.h1
-rw-r--r--drivers/net/benet/be_ethtool.c38
2 files changed, 22 insertions, 17 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index 3937bca3d431..0899d9122278 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -313,6 +313,7 @@ struct be_adapter {
313 char fw_ver[FW_VER_LEN]; 313 char fw_ver[FW_VER_LEN];
314 u32 if_handle; /* Used to configure filtering */ 314 u32 if_handle; /* Used to configure filtering */
315 u32 pmac_id; /* MAC addr handle used by BE card */ 315 u32 pmac_id; /* MAC addr handle used by BE card */
316 u32 beacon_state; /* for set_phys_id */
316 317
317 bool eeh_err; 318 bool eeh_err;
318 bool link_up; 319 bool link_up;
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
528static int 528static int
529be_phys_id(struct net_device *netdev, u32 data) 529be_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
554static bool 558static 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,