Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131699
b: refs/heads/master
c: 196b7e1
h: refs/heads/master
i:
  131697: 965f219
  131695: 5a3d700
v: v3
  • Loading branch information
Steve Glendinning authored and David S. Miller committed Feb 20, 2009
1 parent 47a455e commit e4b17eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62660e28084df3d8067ab855f326d3027808c569
refs/heads/master: 196b7e1b9cca9e187bb61fa7d60f04f4ab2c0592
4 changes: 4 additions & 0 deletions trunk/drivers/net/smsc9420.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ static int smsc9420_ethtool_get_eeprom(struct net_device *dev,
}

memcpy(data, &eeprom_data[eeprom->offset], len);
eeprom->magic = SMSC9420_EEPROM_MAGIC;
eeprom->len = len;
return 0;
}
Expand All @@ -423,6 +424,9 @@ static int smsc9420_ethtool_set_eeprom(struct net_device *dev,
struct smsc9420_pdata *pd = netdev_priv(dev);
int ret;

if (eeprom->magic != SMSC9420_EEPROM_MAGIC)
return -EINVAL;

smsc9420_eeprom_enable_access(pd);
smsc9420_eeprom_send_cmd(pd, E2P_CMD_EPC_CMD_EWEN_);
ret = smsc9420_eeprom_write_location(pd, eeprom->offset, *data);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/smsc9420.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#define LAN_REGISTER_EXTENT (0x400)

#define SMSC9420_EEPROM_SIZE ((u32)11)
#define SMSC9420_EEPROM_MAGIC (0x9420)

#define PKT_BUF_SZ (VLAN_ETH_FRAME_LEN + NET_IP_ALIGN + 4)

Expand Down

0 comments on commit e4b17eb

Please sign in to comment.