aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c574_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-10-25 21:49:27 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2006-12-04 20:12:02 -0500
commitaf2b3b503ad1b071b66e1531caae252b4b95c847 (patch)
tree600785af3af4a79978f688fa35e19ab900db264b /drivers/net/pcmcia/3c574_cs.c
parenta9606fd39083478bef313c0e3b77bc065e39e36e (diff)
[PATCH] pcmcia: conf.ConfigBase and conf.Present consolidation
struct pcmcia_device *p_dev->conf.ConfigBase and .Present are set in almost all PCMICA driver right at the beginning, using the same calls but slightly different implementations. Unfiy this in the PCMCIA core. Includes a small bugfix ("drivers/net/pcmcia/xirc2ps_cs.c: remove unused label") from and Signed-off-by Adrian Bunk <bunk@stusta.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/3c574_cs.c')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 420f70b6b88a..794cc61819dd 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -338,7 +338,6 @@ static int tc574_config(struct pcmcia_device *link)
338 struct net_device *dev = link->priv; 338 struct net_device *dev = link->priv;
339 struct el3_private *lp = netdev_priv(dev); 339 struct el3_private *lp = netdev_priv(dev);
340 tuple_t tuple; 340 tuple_t tuple;
341 cisparse_t parse;
342 unsigned short buf[32]; 341 unsigned short buf[32];
343 int last_fn, last_ret, i, j; 342 int last_fn, last_ret, i, j;
344 kio_addr_t ioaddr; 343 kio_addr_t ioaddr;
@@ -350,17 +349,6 @@ static int tc574_config(struct pcmcia_device *link)
350 349
351 DEBUG(0, "3c574_config(0x%p)\n", link); 350 DEBUG(0, "3c574_config(0x%p)\n", link);
352 351
353 tuple.Attributes = 0;
354 tuple.DesiredTuple = CISTPL_CONFIG;
355 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
356 tuple.TupleData = (cisdata_t *)buf;
357 tuple.TupleDataMax = 64;
358 tuple.TupleOffset = 0;
359 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
360 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
361 link->conf.ConfigBase = parse.config.base;
362 link->conf.Present = parse.config.rmask[0];
363
364 link->io.IOAddrLines = 16; 352 link->io.IOAddrLines = 16;
365 for (i = j = 0; j < 0x400; j += 0x20) { 353 for (i = j = 0; j < 0x400; j += 0x20) {
366 link->io.BasePort1 = j ^ 0x300; 354 link->io.BasePort1 = j ^ 0x300;
@@ -382,6 +370,10 @@ static int tc574_config(struct pcmcia_device *link)
382 /* The 3c574 normally uses an EEPROM for configuration info, including 370 /* The 3c574 normally uses an EEPROM for configuration info, including
383 the hardware address. The future products may include a modem chip 371 the hardware address. The future products may include a modem chip
384 and put the address in the CIS. */ 372 and put the address in the CIS. */
373 tuple.Attributes = 0;
374 tuple.TupleData = (cisdata_t *)buf;
375 tuple.TupleDataMax = 64;
376 tuple.TupleOffset = 0;
385 tuple.DesiredTuple = 0x88; 377 tuple.DesiredTuple = 0x88;
386 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { 378 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) {
387 pcmcia_get_tuple_data(link, &tuple); 379 pcmcia_get_tuple_data(link, &tuple);