aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2010-02-17 01:41:22 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 16:35:37 -0500
commit801e9096c566d40d2e7c9903dc902fa01a5a0b36 (patch)
treef50e1d9cce2ab903563e90d09007466c9e84d5db /drivers/net/qlge
parentc0c56955e7325ba2f910c760111457adc21ef0d4 (diff)
qlge: Fix bonding mac address bug.
Use local copy of current mac address when initializing. In bonding testing we saw cases where dev_addr was out of data causing failover errors. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r--drivers/net/qlge/qlge.h2
-rw-r--r--drivers/net/qlge/qlge_main.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index 57d135e3bfaf..8b742b639ceb 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -2139,6 +2139,8 @@ struct ql_adapter {
2139 u16 device_id; 2139 u16 device_id;
2140 struct timer_list timer; 2140 struct timer_list timer;
2141 atomic_t lb_count; 2141 atomic_t lb_count;
2142 /* Keep local copy of current mac address. */
2143 char current_mac_addr[6];
2142}; 2144};
2143 2145
2144/* 2146/*
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 0541e777694d..c170349717c5 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -463,7 +463,7 @@ static int ql_set_mac_addr(struct ql_adapter *qdev, int set)
463 char *addr; 463 char *addr;
464 464
465 if (set) { 465 if (set) {
466 addr = &qdev->ndev->dev_addr[0]; 466 addr = &qdev->current_mac_addr[0];
467 netif_printk(qdev, ifup, KERN_DEBUG, qdev->ndev, 467 netif_printk(qdev, ifup, KERN_DEBUG, qdev->ndev,
468 "Set Mac addr %pM\n", addr); 468 "Set Mac addr %pM\n", addr);
469 } else { 469 } else {
@@ -4301,6 +4301,8 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
4301 if (!is_valid_ether_addr(addr->sa_data)) 4301 if (!is_valid_ether_addr(addr->sa_data))
4302 return -EADDRNOTAVAIL; 4302 return -EADDRNOTAVAIL;
4303 memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len); 4303 memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
4304 /* Update local copy of current mac address. */
4305 memcpy(qdev->current_mac_addr, ndev->dev_addr, ndev->addr_len);
4304 4306
4305 status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); 4307 status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
4306 if (status) 4308 if (status)
@@ -4542,6 +4544,8 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
4542 } 4544 }
4543 4545
4544 memcpy(ndev->perm_addr, ndev->dev_addr, ndev->addr_len); 4546 memcpy(ndev->perm_addr, ndev->dev_addr, ndev->addr_len);
4547 /* Keep local copy of current mac address. */
4548 memcpy(qdev->current_mac_addr, ndev->dev_addr, ndev->addr_len);
4545 4549
4546 /* Set up the default ring sizes. */ 4550 /* Set up the default ring sizes. */
4547 qdev->tx_ring_size = NUM_TX_RING_ENTRIES; 4551 qdev->tx_ring_size = NUM_TX_RING_ENTRIES;