aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorNarender Kumar <narender.kumar@qlogic.com>2009-11-20 17:08:57 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-21 14:37:37 -0500
commit5d09e534bbb94e1fdc8e4783ac822bc172465a91 (patch)
treec7096c8b0d87dbad2d05d8d0d4362c52b681e6c0 /drivers/net
parenta7483b0afa63e851c4438ddda8934a296851f1de (diff)
netxen : fix BOND_MODE_TLB/ALB mode.
o Along with netdev->perm_addr, mac address will be maintained in device private structure. o Device limitation: We need to set mac address when ever interface comes up. In ALB/TAL mode, bonding driver calls set_mac for all slave with bond mac address. But bonding driver set netdev->dev_addr field to its original value, after enslaving interfaces. When ever active slave changes, it swap dev_addr of inactive slave with active. Yet it doesn't notify driver about change in netdev->dev_addr. As netxen driver need to set mac addr when ever interface comes up, it can't rely on netdev->dev_addr field. Specially in case of bonding mode ALB/TLB. Signed-off-by: Narender Kumar <narender.kumar@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/netxen/netxen_nic.h2
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c6
-rw-r--r--drivers/net/netxen/netxen_nic_main.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 7384f59df615..e1237b802872 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1163,6 +1163,8 @@ struct netxen_adapter {
1163 u32 int_vec_bit; 1163 u32 int_vec_bit;
1164 u32 heartbit; 1164 u32 heartbit;
1165 1165
1166 u8 mac_addr[ETH_ALEN];
1167
1166 struct netxen_adapter_stats stats; 1168 struct netxen_adapter_stats stats;
1167 1169
1168 struct netxen_recv_context recv_ctx; 1170 struct netxen_recv_context recv_ctx;
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index e2c4a0192ea1..52a3798d8d94 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -463,7 +463,7 @@ netxen_nic_enable_mcast_filter(struct netxen_adapter *adapter)
463{ 463{
464 u32 val = 0; 464 u32 val = 0;
465 u16 port = adapter->physical_port; 465 u16 port = adapter->physical_port;
466 u8 *addr = adapter->netdev->dev_addr; 466 u8 *addr = adapter->mac_addr;
467 467
468 if (adapter->mc_enabled) 468 if (adapter->mc_enabled)
469 return 0; 469 return 0;
@@ -492,7 +492,7 @@ netxen_nic_disable_mcast_filter(struct netxen_adapter *adapter)
492{ 492{
493 u32 val = 0; 493 u32 val = 0;
494 u16 port = adapter->physical_port; 494 u16 port = adapter->physical_port;
495 u8 *addr = adapter->netdev->dev_addr; 495 u8 *addr = adapter->mac_addr;
496 496
497 if (!adapter->mc_enabled) 497 if (!adapter->mc_enabled)
498 return 0; 498 return 0;
@@ -687,7 +687,7 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)
687 687
688 list_splice_tail_init(&adapter->mac_list, &del_list); 688 list_splice_tail_init(&adapter->mac_list, &del_list);
689 689
690 nx_p3_nic_add_mac(adapter, netdev->dev_addr, &del_list); 690 nx_p3_nic_add_mac(adapter, adapter->mac_addr, &del_list);
691 nx_p3_nic_add_mac(adapter, bcast_addr, &del_list); 691 nx_p3_nic_add_mac(adapter, bcast_addr, &del_list);
692 692
693 if (netdev->flags & IFF_PROMISC) { 693 if (netdev->flags & IFF_PROMISC) {
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 0b4a56a8c8d5..3bf78dbfbf0f 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -437,6 +437,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter)
437 netdev->dev_addr[i] = *(p + 5 - i); 437 netdev->dev_addr[i] = *(p + 5 - i);
438 438
439 memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); 439 memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
440 memcpy(adapter->mac_addr, netdev->dev_addr, netdev->addr_len);
440 441
441 /* set station address */ 442 /* set station address */
442 443
@@ -459,6 +460,7 @@ int netxen_nic_set_mac(struct net_device *netdev, void *p)
459 netxen_napi_disable(adapter); 460 netxen_napi_disable(adapter);
460 } 461 }
461 462
463 memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len);
462 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); 464 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
463 adapter->macaddr_set(adapter, addr->sa_data); 465 adapter->macaddr_set(adapter, addr->sa_data);
464 466
@@ -956,7 +958,7 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
956 return err; 958 return err;
957 } 959 }
958 if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) 960 if (NX_IS_REVISION_P2(adapter->ahw.revision_id))
959 adapter->macaddr_set(adapter, netdev->dev_addr); 961 adapter->macaddr_set(adapter, adapter->mac_addr);
960 962
961 adapter->set_multi(netdev); 963 adapter->set_multi(netdev);
962 adapter->set_mtu(adapter, netdev->mtu); 964 adapter->set_mtu(adapter, netdev->mtu);