aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSivakumar Subramani <Sivakumar.Subramani@neterion.com>2007-02-24 02:04:24 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-27 04:27:12 -0500
commitd8d70caf836e48c4c462435d38434f2901058884 (patch)
tree8384fb3b15f51b9f038c1c36b4e556fe1427c603 /drivers/net
parentfa1f0cb350989617281a98d30e6a3a4914c79b58 (diff)
S2IO: Restoring the mac address in s2io_reset
- Restore in s2io_reset, the mac address assigned during s2io_open. Earlier, it was getting overwritten to the factory default (read from the eeprom) and subsequently dropping received frames. - Fixed the typo in calling rtnl_unlock in s2io_set_link function. Signed-off-by: Sivakumar Subramani <sivakumar.subramani@neterion.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/s2io.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index b991fb2ff83f..44bb2395af84 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -84,7 +84,7 @@
84#include "s2io.h" 84#include "s2io.h"
85#include "s2io-regs.h" 85#include "s2io-regs.h"
86 86
87#define DRV_VERSION "2.0.16.1" 87#define DRV_VERSION "2.0.17.1"
88 88
89/* S2io Driver name & version. */ 89/* S2io Driver name & version. */
90static char s2io_driver_name[] = "Neterion"; 90static char s2io_driver_name[] = "Neterion";
@@ -3394,6 +3394,9 @@ new_way:
3394 writeq(val64, &bar0->pcc_err_reg); 3394 writeq(val64, &bar0->pcc_err_reg);
3395 } 3395 }
3396 3396
3397 /* restore the previously assigned mac address */
3398 s2io_set_mac_addr(sp->dev, (u8 *)&sp->def_mac_addr[0].mac_addr);
3399
3397 sp->device_enabled_once = FALSE; 3400 sp->device_enabled_once = FALSE;
3398} 3401}
3399 3402
@@ -4512,6 +4515,7 @@ static int s2io_set_mac_addr(struct net_device *dev, u8 * addr)
4512 struct XENA_dev_config __iomem *bar0 = sp->bar0; 4515 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4513 register u64 val64, mac_addr = 0; 4516 register u64 val64, mac_addr = 0;
4514 int i; 4517 int i;
4518 u64 old_mac_addr = 0;
4515 4519
4516 /* 4520 /*
4517 * Set the new MAC address as the new unicast filter and reflect this 4521 * Set the new MAC address as the new unicast filter and reflect this
@@ -4521,6 +4525,22 @@ static int s2io_set_mac_addr(struct net_device *dev, u8 * addr)
4521 for (i = 0; i < ETH_ALEN; i++) { 4525 for (i = 0; i < ETH_ALEN; i++) {
4522 mac_addr <<= 8; 4526 mac_addr <<= 8;
4523 mac_addr |= addr[i]; 4527 mac_addr |= addr[i];
4528 old_mac_addr <<= 8;
4529 old_mac_addr |= sp->def_mac_addr[0].mac_addr[i];
4530 }
4531
4532 if(0 == mac_addr)
4533 return SUCCESS;
4534
4535 /* Update the internal structure with this new mac address */
4536 if(mac_addr != old_mac_addr) {
4537 memset(sp->def_mac_addr[0].mac_addr, 0, sizeof(ETH_ALEN));
4538 sp->def_mac_addr[0].mac_addr[5] = (u8) (mac_addr);
4539 sp->def_mac_addr[0].mac_addr[4] = (u8) (mac_addr >> 8);
4540 sp->def_mac_addr[0].mac_addr[3] = (u8) (mac_addr >> 16);
4541 sp->def_mac_addr[0].mac_addr[2] = (u8) (mac_addr >> 24);
4542 sp->def_mac_addr[0].mac_addr[1] = (u8) (mac_addr >> 32);
4543 sp->def_mac_addr[0].mac_addr[0] = (u8) (mac_addr >> 40);
4524 } 4544 }
4525 4545
4526 writeq(RMAC_ADDR_DATA0_MEM_ADDR(mac_addr), 4546 writeq(RMAC_ADDR_DATA0_MEM_ADDR(mac_addr),
@@ -6022,7 +6042,7 @@ static void s2io_set_link(struct work_struct *work)
6022 clear_bit(0, &(nic->link_state)); 6042 clear_bit(0, &(nic->link_state));
6023 6043
6024out_unlock: 6044out_unlock:
6025 rtnl_lock(); 6045 rtnl_unlock();
6026} 6046}
6027 6047
6028static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, 6048static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
@@ -7182,8 +7202,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7182 mac_down = (u32) tmp64; 7202 mac_down = (u32) tmp64;
7183 mac_up = (u32) (tmp64 >> 32); 7203 mac_up = (u32) (tmp64 >> 32);
7184 7204
7185 memset(sp->def_mac_addr[0].mac_addr, 0, sizeof(ETH_ALEN));
7186
7187 sp->def_mac_addr[0].mac_addr[3] = (u8) (mac_up); 7205 sp->def_mac_addr[0].mac_addr[3] = (u8) (mac_up);
7188 sp->def_mac_addr[0].mac_addr[2] = (u8) (mac_up >> 8); 7206 sp->def_mac_addr[0].mac_addr[2] = (u8) (mac_up >> 8);
7189 sp->def_mac_addr[0].mac_addr[1] = (u8) (mac_up >> 16); 7207 sp->def_mac_addr[0].mac_addr[1] = (u8) (mac_up >> 16);