diff options
author | Sarveshwar Bandi <sarveshwarb@serverengines.com> | 2009-10-12 07:23:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-12 16:26:38 -0400 |
commit | fad9ab2cefd3a3b4754f49eb41e2f43ea314cdce (patch) | |
tree | 9eb3a5729fdad7fe2c1746556c0f3328e8a07ee2 /drivers/net/benet/be_ethtool.c | |
parent | 3b885787ea4112eaa80945999ea0901bf742707f (diff) |
be2net: Implement ethtool get_phys_id function.
Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_ethtool.c')
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index 333729bd6d92..280471e18695 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -338,6 +338,35 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | static int | 340 | static int |
341 | be_phys_id(struct net_device *netdev, u32 data) | ||
342 | { | ||
343 | struct be_adapter *adapter = netdev_priv(netdev); | ||
344 | int status; | ||
345 | u32 cur; | ||
346 | |||
347 | if (!netif_running(netdev)) | ||
348 | return 0; | ||
349 | |||
350 | be_cmd_get_beacon_state(adapter, adapter->port_num, &cur); | ||
351 | |||
352 | if (cur == BEACON_STATE_ENABLED) | ||
353 | return 0; | ||
354 | |||
355 | if (data < 2) | ||
356 | data = 2; | ||
357 | |||
358 | status = be_cmd_set_beacon_state(adapter, adapter->port_num, 0, 0, | ||
359 | BEACON_STATE_ENABLED); | ||
360 | set_current_state(TASK_INTERRUPTIBLE); | ||
361 | schedule_timeout(data*HZ); | ||
362 | |||
363 | status = be_cmd_set_beacon_state(adapter, adapter->port_num, 0, 0, | ||
364 | BEACON_STATE_DISABLED); | ||
365 | |||
366 | return status; | ||
367 | } | ||
368 | |||
369 | static int | ||
341 | be_do_flash(struct net_device *netdev, struct ethtool_flash *efl) | 370 | be_do_flash(struct net_device *netdev, struct ethtool_flash *efl) |
342 | { | 371 | { |
343 | struct be_adapter *adapter = netdev_priv(netdev); | 372 | struct be_adapter *adapter = netdev_priv(netdev); |
@@ -369,6 +398,7 @@ const struct ethtool_ops be_ethtool_ops = { | |||
369 | .get_tso = ethtool_op_get_tso, | 398 | .get_tso = ethtool_op_get_tso, |
370 | .set_tso = ethtool_op_set_tso, | 399 | .set_tso = ethtool_op_set_tso, |
371 | .get_strings = be_get_stat_strings, | 400 | .get_strings = be_get_stat_strings, |
401 | .phys_id = be_phys_id, | ||
372 | .get_sset_count = be_get_sset_count, | 402 | .get_sset_count = be_get_sset_count, |
373 | .get_ethtool_stats = be_get_ethtool_stats, | 403 | .get_ethtool_stats = be_get_ethtool_stats, |
374 | .flash_device = be_do_flash, | 404 | .flash_device = be_do_flash, |