aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c574_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/3c574_cs.c')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index b58965a2b3ae..6449290c62ff 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -344,13 +344,13 @@ static int tc574_config(struct pcmcia_device *link)
344{ 344{
345 struct net_device *dev = link->priv; 345 struct net_device *dev = link->priv;
346 struct el3_private *lp = netdev_priv(dev); 346 struct el3_private *lp = netdev_priv(dev);
347 tuple_t tuple;
348 __le16 buf[32];
349 int last_fn, last_ret, i, j; 347 int last_fn, last_ret, i, j;
350 unsigned int ioaddr; 348 unsigned int ioaddr;
351 __be16 *phys_addr; 349 __be16 *phys_addr;
352 char *cardname; 350 char *cardname;
353 __u32 config; 351 __u32 config;
352 u8 *buf;
353 size_t len;
354 354
355 phys_addr = (__be16 *)dev->dev_addr; 355 phys_addr = (__be16 *)dev->dev_addr;
356 356
@@ -378,16 +378,14 @@ static int tc574_config(struct pcmcia_device *link)
378 /* The 3c574 normally uses an EEPROM for configuration info, including 378 /* The 3c574 normally uses an EEPROM for configuration info, including
379 the hardware address. The future products may include a modem chip 379 the hardware address. The future products may include a modem chip
380 and put the address in the CIS. */ 380 and put the address in the CIS. */
381 tuple.Attributes = 0; 381
382 tuple.TupleData = (cisdata_t *)buf; 382 len = pcmcia_get_tuple(link, 0x88, &buf);
383 tuple.TupleDataMax = 64; 383 if (buf && len >= 6) {
384 tuple.TupleOffset = 0;
385 tuple.DesiredTuple = 0x88;
386 if (pcmcia_get_first_tuple(link, &tuple) == 0) {
387 pcmcia_get_tuple_data(link, &tuple);
388 for (i = 0; i < 3; i++) 384 for (i = 0; i < 3; i++)
389 phys_addr[i] = htons(le16_to_cpu(buf[i])); 385 phys_addr[i] = htons(le16_to_cpu(buf[i * 2]));
386 kfree(buf);
390 } else { 387 } else {
388 kfree(buf); /* 0 < len < 6 */
391 EL3WINDOW(0); 389 EL3WINDOW(0);
392 for (i = 0; i < 3; i++) 390 for (i = 0; i < 3; i++)
393 phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); 391 phys_addr[i] = htons(read_eeprom(ioaddr, i + 10));