Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/s2io.c
This commit is contained in:
@@ -343,6 +343,12 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l
|
||||
void __iomem *ee_addr = tp->base_addr + CSR9;
|
||||
int read_cmd = location | (EE_READ_CMD << addr_len);
|
||||
|
||||
/* If location is past the end of what we can address, don't
|
||||
* read some other location (ie truncate). Just return zero.
|
||||
*/
|
||||
if (location > (1 << addr_len) - 1)
|
||||
return 0;
|
||||
|
||||
iowrite32(EE_ENB & ~EE_CS, ee_addr);
|
||||
iowrite32(EE_ENB, ee_addr);
|
||||
|
||||
|
@@ -1437,6 +1437,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
|
||||
EEPROM.
|
||||
*/
|
||||
ee_data = tp->eeprom;
|
||||
memset(ee_data, 0, sizeof(tp->eeprom));
|
||||
sum = 0;
|
||||
if (chip_idx == LC82C168) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -1458,8 +1459,12 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
|
||||
/* A serial EEPROM interface, we read now and sort it out later. */
|
||||
int sa_offset = 0;
|
||||
int ee_addr_size = tulip_read_eeprom(dev, 0xff, 8) & 0x40000 ? 8 : 6;
|
||||
int ee_max_addr = ((1 << ee_addr_size) - 1) * sizeof(u16);
|
||||
|
||||
for (i = 0; i < sizeof(tp->eeprom); i+=2) {
|
||||
if (ee_max_addr > sizeof(tp->eeprom))
|
||||
ee_max_addr = sizeof(tp->eeprom);
|
||||
|
||||
for (i = 0; i < ee_max_addr ; i += sizeof(u16)) {
|
||||
u16 data = tulip_read_eeprom(dev, i/2, ee_addr_size);
|
||||
ee_data[i] = data & 0xff;
|
||||
ee_data[i + 1] = data >> 8;
|
||||
|
Reference in New Issue
Block a user