diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-05-05 15:05:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-06 18:33:36 -0400 |
commit | 3d0a3cc9d72047e4baa76021c897f64fc84cc543 (patch) | |
tree | 121b07aa7e131380681659734d780042b9c776ca /drivers/net/netxen/netxen_nic_main.c | |
parent | 5cf4d323f8864dab818d500ec74f2fcb9ad5bf89 (diff) |
netxen: fix bonding support
o Pause traffic during mac addr change.
o Enable setting mac address for NX3031.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index a5577f8b6c0a..83dadfd78c3c 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -442,20 +442,38 @@ netxen_read_mac_addr(struct netxen_adapter *adapter) | |||
442 | 442 | ||
443 | if (!is_valid_ether_addr(netdev->perm_addr)) | 443 | if (!is_valid_ether_addr(netdev->perm_addr)) |
444 | dev_warn(&pdev->dev, "Bad MAC address %pM.\n", netdev->dev_addr); | 444 | dev_warn(&pdev->dev, "Bad MAC address %pM.\n", netdev->dev_addr); |
445 | else | ||
446 | adapter->macaddr_set(adapter, netdev->dev_addr); | ||
447 | 445 | ||
448 | return 0; | 446 | return 0; |
449 | } | 447 | } |
450 | 448 | ||
449 | int netxen_nic_set_mac(struct net_device *netdev, void *p) | ||
450 | { | ||
451 | struct netxen_adapter *adapter = netdev_priv(netdev); | ||
452 | struct sockaddr *addr = p; | ||
453 | |||
454 | if (!is_valid_ether_addr(addr->sa_data)) | ||
455 | return -EINVAL; | ||
456 | |||
457 | if (netif_running(netdev)) { | ||
458 | netif_device_detach(netdev); | ||
459 | netxen_napi_disable(adapter); | ||
460 | } | ||
461 | |||
462 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | ||
463 | adapter->macaddr_set(adapter, addr->sa_data); | ||
464 | |||
465 | if (netif_running(netdev)) { | ||
466 | netif_device_attach(netdev); | ||
467 | netxen_napi_enable(adapter); | ||
468 | } | ||
469 | return 0; | ||
470 | } | ||
471 | |||
451 | static void netxen_set_multicast_list(struct net_device *dev) | 472 | static void netxen_set_multicast_list(struct net_device *dev) |
452 | { | 473 | { |
453 | struct netxen_adapter *adapter = netdev_priv(dev); | 474 | struct netxen_adapter *adapter = netdev_priv(dev); |
454 | 475 | ||
455 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 476 | adapter->set_multi(dev); |
456 | netxen_p3_nic_set_multi(dev); | ||
457 | else | ||
458 | netxen_p2_nic_set_multi(dev); | ||
459 | } | 477 | } |
460 | 478 | ||
461 | static const struct net_device_ops netxen_netdev_ops = { | 479 | static const struct net_device_ops netxen_netdev_ops = { |
@@ -782,16 +800,13 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev) | |||
782 | netxen_nic_driver_name, adapter->portnum); | 800 | netxen_nic_driver_name, adapter->portnum); |
783 | return err; | 801 | return err; |
784 | } | 802 | } |
785 | adapter->macaddr_set(adapter, netdev->dev_addr); | 803 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) |
786 | 804 | adapter->macaddr_set(adapter, netdev->dev_addr); | |
787 | netxen_nic_set_link_parameters(adapter); | ||
788 | 805 | ||
789 | netxen_set_multicast_list(netdev); | 806 | adapter->set_multi(netdev); |
790 | if (adapter->set_mtu) | 807 | adapter->set_mtu(adapter, netdev->mtu); |
791 | adapter->set_mtu(adapter, netdev->mtu); | ||
792 | 808 | ||
793 | adapter->ahw.linkup = 0; | 809 | adapter->ahw.linkup = 0; |
794 | mod_timer(&adapter->watchdog_timer, jiffies); | ||
795 | 810 | ||
796 | netxen_napi_enable(adapter); | 811 | netxen_napi_enable(adapter); |
797 | 812 | ||
@@ -800,6 +815,10 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev) | |||
800 | 815 | ||
801 | if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION) | 816 | if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION) |
802 | netxen_linkevent_request(adapter, 1); | 817 | netxen_linkevent_request(adapter, 1); |
818 | else | ||
819 | netxen_nic_set_link_parameters(adapter); | ||
820 | |||
821 | mod_timer(&adapter->watchdog_timer, jiffies); | ||
803 | 822 | ||
804 | return 0; | 823 | return 0; |
805 | } | 824 | } |