diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-10-25 21:49:27 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-12-04 20:12:02 -0500 |
commit | af2b3b503ad1b071b66e1531caae252b4b95c847 (patch) | |
tree | 600785af3af4a79978f688fa35e19ab900db264b /drivers/net | |
parent | a9606fd39083478bef313c0e3b77bc065e39e36e (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')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 16 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 7 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 6 | ||||
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 13 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 14 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 12 | ||||
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 12 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 24 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/netwave_cs.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_cs.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/spectrum_cs.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 33 | ||||
-rw-r--r-- | drivers/net/wireless/wl3501_cs.c | 15 |
19 files changed, 19 insertions, 257 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); |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index eb5783294489..1e73ff7d5d8e 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -253,7 +253,6 @@ static int tc589_config(struct pcmcia_device *link) | |||
253 | struct net_device *dev = link->priv; | 253 | struct net_device *dev = link->priv; |
254 | struct el3_private *lp = netdev_priv(dev); | 254 | struct el3_private *lp = netdev_priv(dev); |
255 | tuple_t tuple; | 255 | tuple_t tuple; |
256 | cisparse_t parse; | ||
257 | u16 buf[32], *phys_addr; | 256 | u16 buf[32], *phys_addr; |
258 | int last_fn, last_ret, i, j, multi = 0, fifo; | 257 | int last_fn, last_ret, i, j, multi = 0, fifo; |
259 | kio_addr_t ioaddr; | 258 | kio_addr_t ioaddr; |
@@ -263,15 +262,9 @@ static int tc589_config(struct pcmcia_device *link) | |||
263 | 262 | ||
264 | phys_addr = (u16 *)dev->dev_addr; | 263 | phys_addr = (u16 *)dev->dev_addr; |
265 | tuple.Attributes = 0; | 264 | tuple.Attributes = 0; |
266 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
267 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
268 | tuple.TupleData = (cisdata_t *)buf; | 265 | tuple.TupleData = (cisdata_t *)buf; |
269 | tuple.TupleDataMax = sizeof(buf); | 266 | tuple.TupleDataMax = sizeof(buf); |
270 | tuple.TupleOffset = 0; | 267 | tuple.TupleOffset = 0; |
271 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
272 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
273 | link->conf.ConfigBase = parse.config.base; | ||
274 | link->conf.Present = parse.config.rmask[0]; | ||
275 | tuple.Attributes = TUPLE_RETURN_COMMON; | 268 | tuple.Attributes = TUPLE_RETURN_COMMON; |
276 | 269 | ||
277 | /* Is this a 3c562? */ | 270 | /* Is this a 3c562? */ |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 5ddd5742f779..6139048f8117 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -299,11 +299,7 @@ static int axnet_config(struct pcmcia_device *link) | |||
299 | tuple.TupleData = (cisdata_t *)buf; | 299 | tuple.TupleData = (cisdata_t *)buf; |
300 | tuple.TupleDataMax = sizeof(buf); | 300 | tuple.TupleDataMax = sizeof(buf); |
301 | tuple.TupleOffset = 0; | 301 | tuple.TupleOffset = 0; |
302 | tuple.DesiredTuple = CISTPL_CONFIG; | 302 | |
303 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
304 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
305 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
306 | link->conf.ConfigBase = parse.config.base; | ||
307 | /* don't trust the CIS on this; Linksys got it wrong */ | 303 | /* don't trust the CIS on this; Linksys got it wrong */ |
308 | link->conf.Present = 0x63; | 304 | link->conf.Present = 0x63; |
309 | 305 | ||
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index 48434d7924eb..91f65e91cd5f 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
@@ -249,12 +249,9 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
249 | static int com20020_config(struct pcmcia_device *link) | 249 | static int com20020_config(struct pcmcia_device *link) |
250 | { | 250 | { |
251 | struct arcnet_local *lp; | 251 | struct arcnet_local *lp; |
252 | tuple_t tuple; | ||
253 | cisparse_t parse; | ||
254 | com20020_dev_t *info; | 252 | com20020_dev_t *info; |
255 | struct net_device *dev; | 253 | struct net_device *dev; |
256 | int i, last_ret, last_fn; | 254 | int i, last_ret, last_fn; |
257 | u_char buf[64]; | ||
258 | int ioaddr; | 255 | int ioaddr; |
259 | 256 | ||
260 | info = link->priv; | 257 | info = link->priv; |
@@ -264,16 +261,6 @@ static int com20020_config(struct pcmcia_device *link) | |||
264 | 261 | ||
265 | DEBUG(0, "com20020_config(0x%p)\n", link); | 262 | DEBUG(0, "com20020_config(0x%p)\n", link); |
266 | 263 | ||
267 | tuple.Attributes = 0; | ||
268 | tuple.TupleData = buf; | ||
269 | tuple.TupleDataMax = 64; | ||
270 | tuple.TupleOffset = 0; | ||
271 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
272 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
273 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
274 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
275 | link->conf.ConfigBase = parse.config.base; | ||
276 | |||
277 | DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1); | 264 | DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1); |
278 | i = !CS_SUCCESS; | 265 | i = !CS_SUCCESS; |
279 | if (!link->io.BasePort1) | 266 | if (!link->io.BasePort1) |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index e3731fd15606..0d7de617e535 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -342,7 +342,7 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
342 | tuple_t tuple; | 342 | tuple_t tuple; |
343 | cisparse_t parse; | 343 | cisparse_t parse; |
344 | u_short buf[32]; | 344 | u_short buf[32]; |
345 | int i, last_fn, last_ret, ret; | 345 | int i, last_fn = 0, last_ret = 0, ret; |
346 | kio_addr_t ioaddr; | 346 | kio_addr_t ioaddr; |
347 | cardtype_t cardtype; | 347 | cardtype_t cardtype; |
348 | char *card_name = "unknown"; | 348 | char *card_name = "unknown"; |
@@ -350,21 +350,9 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
350 | 350 | ||
351 | DEBUG(0, "fmvj18x_config(0x%p)\n", link); | 351 | DEBUG(0, "fmvj18x_config(0x%p)\n", link); |
352 | 352 | ||
353 | /* | ||
354 | This reads the card's CONFIG tuple to find its configuration | ||
355 | registers. | ||
356 | */ | ||
357 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
358 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
359 | tuple.TupleData = (u_char *)buf; | 353 | tuple.TupleData = (u_char *)buf; |
360 | tuple.TupleDataMax = 64; | 354 | tuple.TupleDataMax = 64; |
361 | tuple.TupleOffset = 0; | 355 | tuple.TupleOffset = 0; |
362 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
363 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
364 | |||
365 | link->conf.ConfigBase = parse.config.base; | ||
366 | link->conf.Present = parse.config.rmask[0]; | ||
367 | |||
368 | tuple.DesiredTuple = CISTPL_FUNCE; | 356 | tuple.DesiredTuple = CISTPL_FUNCE; |
369 | tuple.TupleOffset = 0; | 357 | tuple.TupleOffset = 0; |
370 | if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { | 358 | if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index bc0ca41a0542..a956a51d284f 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -222,24 +222,12 @@ static int ibmtr_config(struct pcmcia_device *link) | |||
222 | ibmtr_dev_t *info = link->priv; | 222 | ibmtr_dev_t *info = link->priv; |
223 | struct net_device *dev = info->dev; | 223 | struct net_device *dev = info->dev; |
224 | struct tok_info *ti = netdev_priv(dev); | 224 | struct tok_info *ti = netdev_priv(dev); |
225 | tuple_t tuple; | ||
226 | cisparse_t parse; | ||
227 | win_req_t req; | 225 | win_req_t req; |
228 | memreq_t mem; | 226 | memreq_t mem; |
229 | int i, last_ret, last_fn; | 227 | int i, last_ret, last_fn; |
230 | u_char buf[64]; | ||
231 | 228 | ||
232 | DEBUG(0, "ibmtr_config(0x%p)\n", link); | 229 | DEBUG(0, "ibmtr_config(0x%p)\n", link); |
233 | 230 | ||
234 | tuple.Attributes = 0; | ||
235 | tuple.TupleData = buf; | ||
236 | tuple.TupleDataMax = 64; | ||
237 | tuple.TupleOffset = 0; | ||
238 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
239 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
240 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
241 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
242 | link->conf.ConfigBase = parse.config.base; | ||
243 | link->conf.ConfigIndex = 0x61; | 231 | link->conf.ConfigIndex = 0x61; |
244 | 232 | ||
245 | /* Determine if this is PRIMARY or ALTERNATE. */ | 233 | /* Determine if this is PRIMARY or ALTERNATE. */ |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index e77110e4c288..3b707747a811 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -656,23 +656,12 @@ static int nmclan_config(struct pcmcia_device *link) | |||
656 | struct net_device *dev = link->priv; | 656 | struct net_device *dev = link->priv; |
657 | mace_private *lp = netdev_priv(dev); | 657 | mace_private *lp = netdev_priv(dev); |
658 | tuple_t tuple; | 658 | tuple_t tuple; |
659 | cisparse_t parse; | ||
660 | u_char buf[64]; | 659 | u_char buf[64]; |
661 | int i, last_ret, last_fn; | 660 | int i, last_ret, last_fn; |
662 | kio_addr_t ioaddr; | 661 | kio_addr_t ioaddr; |
663 | 662 | ||
664 | DEBUG(0, "nmclan_config(0x%p)\n", link); | 663 | DEBUG(0, "nmclan_config(0x%p)\n", link); |
665 | 664 | ||
666 | tuple.Attributes = 0; | ||
667 | tuple.TupleData = buf; | ||
668 | tuple.TupleDataMax = 64; | ||
669 | tuple.TupleOffset = 0; | ||
670 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
671 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
672 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
673 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
674 | link->conf.ConfigBase = parse.config.base; | ||
675 | |||
676 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | 665 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); |
677 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 666 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
678 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 667 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
@@ -686,6 +675,7 @@ static int nmclan_config(struct pcmcia_device *link) | |||
686 | tuple.TupleData = buf; | 675 | tuple.TupleData = buf; |
687 | tuple.TupleDataMax = 64; | 676 | tuple.TupleDataMax = 64; |
688 | tuple.TupleOffset = 0; | 677 | tuple.TupleOffset = 0; |
678 | tuple.Attributes = 0; | ||
689 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 679 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
690 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | 680 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); |
691 | memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN); | 681 | memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN); |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 430a41e7b686..2b1238e2dbdb 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -525,17 +525,9 @@ static int pcnet_config(struct pcmcia_device *link) | |||
525 | 525 | ||
526 | DEBUG(0, "pcnet_config(0x%p)\n", link); | 526 | DEBUG(0, "pcnet_config(0x%p)\n", link); |
527 | 527 | ||
528 | tuple.Attributes = 0; | ||
529 | tuple.TupleData = (cisdata_t *)buf; | 528 | tuple.TupleData = (cisdata_t *)buf; |
530 | tuple.TupleDataMax = sizeof(buf); | 529 | tuple.TupleDataMax = sizeof(buf); |
531 | tuple.TupleOffset = 0; | 530 | tuple.TupleOffset = 0; |
532 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
533 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
534 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
535 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
536 | link->conf.ConfigBase = parse.config.base; | ||
537 | link->conf.Present = parse.config.rmask[0]; | ||
538 | |||
539 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 531 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
540 | tuple.Attributes = 0; | 532 | tuple.Attributes = 0; |
541 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 533 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index bf408482443e..530df8883fe5 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -959,10 +959,6 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
959 | { | 959 | { |
960 | struct net_device *dev = link->priv; | 960 | struct net_device *dev = link->priv; |
961 | struct smc_private *smc = netdev_priv(dev); | 961 | struct smc_private *smc = netdev_priv(dev); |
962 | struct smc_cfg_mem *cfg_mem; | ||
963 | tuple_t *tuple; | ||
964 | cisparse_t *parse; | ||
965 | u_char *buf; | ||
966 | char *name; | 962 | char *name; |
967 | int i, j, rev; | 963 | int i, j, rev; |
968 | kio_addr_t ioaddr; | 964 | kio_addr_t ioaddr; |
@@ -970,24 +966,6 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
970 | 966 | ||
971 | DEBUG(0, "smc91c92_config(0x%p)\n", link); | 967 | DEBUG(0, "smc91c92_config(0x%p)\n", link); |
972 | 968 | ||
973 | cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL); | ||
974 | if (!cfg_mem) | ||
975 | goto config_failed; | ||
976 | |||
977 | tuple = &cfg_mem->tuple; | ||
978 | parse = &cfg_mem->parse; | ||
979 | buf = cfg_mem->buf; | ||
980 | |||
981 | tuple->Attributes = tuple->TupleOffset = 0; | ||
982 | tuple->TupleData = (cisdata_t *)buf; | ||
983 | tuple->TupleDataMax = 64; | ||
984 | |||
985 | tuple->DesiredTuple = CISTPL_CONFIG; | ||
986 | i = first_tuple(link, tuple, parse); | ||
987 | CS_EXIT_TEST(i, ParseTuple, config_failed); | ||
988 | link->conf.ConfigBase = parse->config.base; | ||
989 | link->conf.Present = parse->config.rmask[0]; | ||
990 | |||
991 | smc->manfid = link->manf_id; | 969 | smc->manfid = link->manf_id; |
992 | smc->cardid = link->card_id; | 970 | smc->cardid = link->card_id; |
993 | 971 | ||
@@ -1119,14 +1097,12 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
1119 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 1097 | printk(KERN_NOTICE " No MII transceivers found!\n"); |
1120 | } | 1098 | } |
1121 | } | 1099 | } |
1122 | kfree(cfg_mem); | ||
1123 | return 0; | 1100 | return 0; |
1124 | 1101 | ||
1125 | config_undo: | 1102 | config_undo: |
1126 | unregister_netdev(dev); | 1103 | unregister_netdev(dev); |
1127 | config_failed: /* CS_EXIT_TEST() calls jump to here... */ | 1104 | config_failed: /* CS_EXIT_TEST() calls jump to here... */ |
1128 | smc91c92_release(link); | 1105 | smc91c92_release(link); |
1129 | kfree(cfg_mem); | ||
1130 | return -ENODEV; | 1106 | return -ENODEV; |
1131 | } /* smc91c92_config */ | 1107 | } /* smc91c92_config */ |
1132 | 1108 | ||
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index d6273619686a..69813406782d 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -781,13 +781,6 @@ xirc2ps_config(struct pcmcia_device * link) | |||
781 | goto failure; | 781 | goto failure; |
782 | } | 782 | } |
783 | 783 | ||
784 | /* get configuration stuff */ | ||
785 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
786 | if ((err=first_tuple(link, &tuple, &parse))) | ||
787 | goto cis_error; | ||
788 | link->conf.ConfigBase = parse.config.base; | ||
789 | link->conf.Present = parse.config.rmask[0]; | ||
790 | |||
791 | /* get the ethernet address from the CIS */ | 784 | /* get the ethernet address from the CIS */ |
792 | tuple.DesiredTuple = CISTPL_FUNCE; | 785 | tuple.DesiredTuple = CISTPL_FUNCE; |
793 | for (err = first_tuple(link, &tuple, &parse); !err; | 786 | for (err = first_tuple(link, &tuple, &parse); !err; |
@@ -1051,8 +1044,6 @@ xirc2ps_config(struct pcmcia_device * link) | |||
1051 | xirc2ps_release(link); | 1044 | xirc2ps_release(link); |
1052 | return -ENODEV; | 1045 | return -ENODEV; |
1053 | 1046 | ||
1054 | cis_error: | ||
1055 | printk(KNOT_XIRC "unable to parse CIS\n"); | ||
1056 | failure: | 1047 | failure: |
1057 | return -ENODEV; | 1048 | return -ENODEV; |
1058 | } /* xirc2ps_config */ | 1049 | } /* xirc2ps_config */ |
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index ac9437d497f0..f12355398fe7 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -219,21 +219,6 @@ static int airo_config(struct pcmcia_device *link) | |||
219 | dev = link->priv; | 219 | dev = link->priv; |
220 | 220 | ||
221 | DEBUG(0, "airo_config(0x%p)\n", link); | 221 | DEBUG(0, "airo_config(0x%p)\n", link); |
222 | |||
223 | /* | ||
224 | This reads the card's CONFIG tuple to find its configuration | ||
225 | registers. | ||
226 | */ | ||
227 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
228 | tuple.Attributes = 0; | ||
229 | tuple.TupleData = buf; | ||
230 | tuple.TupleDataMax = sizeof(buf); | ||
231 | tuple.TupleOffset = 0; | ||
232 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
233 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
234 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
235 | link->conf.ConfigBase = parse.config.base; | ||
236 | link->conf.Present = parse.config.rmask[0]; | ||
237 | 222 | ||
238 | /* | 223 | /* |
239 | In this loop, we scan the CIS for configuration table entries, | 224 | In this loop, we scan the CIS for configuration table entries, |
@@ -247,6 +232,10 @@ static int airo_config(struct pcmcia_device *link) | |||
247 | these things without consulting the CIS, and most client drivers | 232 | these things without consulting the CIS, and most client drivers |
248 | will only use the CIS to fill in implementation-defined details. | 233 | will only use the CIS to fill in implementation-defined details. |
249 | */ | 234 | */ |
235 | tuple.Attributes = 0; | ||
236 | tuple.TupleData = buf; | ||
237 | tuple.TupleDataMax = sizeof(buf); | ||
238 | tuple.TupleOffset = 0; | ||
250 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 239 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
251 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 240 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
252 | while (1) { | 241 | while (1) { |
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 5c410989c4d7..12617cd0b78e 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -244,17 +244,6 @@ static int atmel_config(struct pcmcia_device *link) | |||
244 | tuple.TupleOffset = 0; | 244 | tuple.TupleOffset = 0; |
245 | 245 | ||
246 | /* | 246 | /* |
247 | This reads the card's CONFIG tuple to find its configuration | ||
248 | registers. | ||
249 | */ | ||
250 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
251 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
252 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
253 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
254 | link->conf.ConfigBase = parse.config.base; | ||
255 | link->conf.Present = parse.config.rmask[0]; | ||
256 | |||
257 | /* | ||
258 | In this loop, we scan the CIS for configuration table entries, | 247 | In this loop, we scan the CIS for configuration table entries, |
259 | each of which describes a valid card configuration, including | 248 | each of which describes a valid card configuration, including |
260 | voltage, IO window, memory window, and interrupt settings. | 249 | voltage, IO window, memory window, and interrupt settings. |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 8a7984bc8afc..ee542ec6d6a8 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -570,16 +570,10 @@ static int prism2_config(struct pcmcia_device *link) | |||
570 | } | 570 | } |
571 | memset(hw_priv, 0, sizeof(*hw_priv)); | 571 | memset(hw_priv, 0, sizeof(*hw_priv)); |
572 | 572 | ||
573 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
574 | tuple.Attributes = 0; | 573 | tuple.Attributes = 0; |
575 | tuple.TupleData = buf; | 574 | tuple.TupleData = buf; |
576 | tuple.TupleDataMax = sizeof(buf); | 575 | tuple.TupleDataMax = sizeof(buf); |
577 | tuple.TupleOffset = 0; | 576 | tuple.TupleOffset = 0; |
578 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
579 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
580 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); | ||
581 | link->conf.ConfigBase = parse->config.base; | ||
582 | link->conf.Present = parse->config.rmask[0]; | ||
583 | 577 | ||
584 | CS_CHECK(GetConfigurationInfo, | 578 | CS_CHECK(GetConfigurationInfo, |
585 | pcmcia_get_configuration_info(link, &conf)); | 579 | pcmcia_get_configuration_info(link, &conf)); |
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c index 6714e0dfa8d6..644b4741ef74 100644 --- a/drivers/net/wireless/netwave_cs.c +++ b/drivers/net/wireless/netwave_cs.c | |||
@@ -735,10 +735,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
735 | static int netwave_pcmcia_config(struct pcmcia_device *link) { | 735 | static int netwave_pcmcia_config(struct pcmcia_device *link) { |
736 | struct net_device *dev = link->priv; | 736 | struct net_device *dev = link->priv; |
737 | netwave_private *priv = netdev_priv(dev); | 737 | netwave_private *priv = netdev_priv(dev); |
738 | tuple_t tuple; | ||
739 | cisparse_t parse; | ||
740 | int i, j, last_ret, last_fn; | 738 | int i, j, last_ret, last_fn; |
741 | u_char buf[64]; | ||
742 | win_req_t req; | 739 | win_req_t req; |
743 | memreq_t mem; | 740 | memreq_t mem; |
744 | u_char __iomem *ramBase = NULL; | 741 | u_char __iomem *ramBase = NULL; |
@@ -746,21 +743,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) { | |||
746 | DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link); | 743 | DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link); |
747 | 744 | ||
748 | /* | 745 | /* |
749 | This reads the card's CONFIG tuple to find its configuration | ||
750 | registers. | ||
751 | */ | ||
752 | tuple.Attributes = 0; | ||
753 | tuple.TupleData = (cisdata_t *) buf; | ||
754 | tuple.TupleDataMax = 64; | ||
755 | tuple.TupleOffset = 0; | ||
756 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
757 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
758 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
759 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
760 | link->conf.ConfigBase = parse.config.base; | ||
761 | link->conf.Present = parse.config.rmask[0]; | ||
762 | |||
763 | /* | ||
764 | * Try allocating IO ports. This tries a few fixed addresses. | 746 | * Try allocating IO ports. This tries a few fixed addresses. |
765 | * If you want, you can also read the card's config table to | 747 | * If you want, you can also read the card's config table to |
766 | * pick addresses -- see the serial driver for an example. | 748 | * pick addresses -- see the serial driver for an example. |
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index bc14689cbf24..d08ae8d2726c 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c | |||
@@ -178,21 +178,6 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
178 | cisparse_t parse; | 178 | cisparse_t parse; |
179 | void __iomem *mem; | 179 | void __iomem *mem; |
180 | 180 | ||
181 | /* | ||
182 | * This reads the card's CONFIG tuple to find its | ||
183 | * configuration registers. | ||
184 | */ | ||
185 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
186 | tuple.Attributes = 0; | ||
187 | tuple.TupleData = buf; | ||
188 | tuple.TupleDataMax = sizeof(buf); | ||
189 | tuple.TupleOffset = 0; | ||
190 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
191 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
192 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
193 | link->conf.ConfigBase = parse.config.base; | ||
194 | link->conf.Present = parse.config.rmask[0]; | ||
195 | |||
196 | /* Look up the current Vcc */ | 181 | /* Look up the current Vcc */ |
197 | CS_CHECK(GetConfigurationInfo, | 182 | CS_CHECK(GetConfigurationInfo, |
198 | pcmcia_get_configuration_info(link, &conf)); | 183 | pcmcia_get_configuration_info(link, &conf)); |
@@ -211,6 +196,10 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
211 | * and most client drivers will only use the CIS to fill in | 196 | * and most client drivers will only use the CIS to fill in |
212 | * implementation-defined details. | 197 | * implementation-defined details. |
213 | */ | 198 | */ |
199 | tuple.Attributes = 0; | ||
200 | tuple.TupleData = buf; | ||
201 | tuple.TupleDataMax = sizeof(buf); | ||
202 | tuple.TupleOffset = 0; | ||
214 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 203 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
215 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 204 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
216 | while (1) { | 205 | while (1) { |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 75cdc3e5852a..88e10c9bc4ac 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -408,11 +408,8 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
408 | #define MAX_TUPLE_SIZE 128 | 408 | #define MAX_TUPLE_SIZE 128 |
409 | static int ray_config(struct pcmcia_device *link) | 409 | static int ray_config(struct pcmcia_device *link) |
410 | { | 410 | { |
411 | tuple_t tuple; | ||
412 | cisparse_t parse; | ||
413 | int last_fn = 0, last_ret = 0; | 411 | int last_fn = 0, last_ret = 0; |
414 | int i; | 412 | int i; |
415 | u_char buf[MAX_TUPLE_SIZE]; | ||
416 | win_req_t req; | 413 | win_req_t req; |
417 | memreq_t mem; | 414 | memreq_t mem; |
418 | struct net_device *dev = (struct net_device *)link->priv; | 415 | struct net_device *dev = (struct net_device *)link->priv; |
@@ -420,19 +417,7 @@ static int ray_config(struct pcmcia_device *link) | |||
420 | 417 | ||
421 | DEBUG(1, "ray_config(0x%p)\n", link); | 418 | DEBUG(1, "ray_config(0x%p)\n", link); |
422 | 419 | ||
423 | /* This reads the card's CONFIG tuple to find its configuration regs */ | ||
424 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
425 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
426 | tuple.TupleData = buf; | ||
427 | tuple.TupleDataMax = MAX_TUPLE_SIZE; | ||
428 | tuple.TupleOffset = 0; | ||
429 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
430 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
431 | link->conf.ConfigBase = parse.config.base; | ||
432 | link->conf.Present = parse.config.rmask[0]; | ||
433 | |||
434 | /* Determine card type and firmware version */ | 420 | /* Determine card type and firmware version */ |
435 | buf[0] = buf[MAX_TUPLE_SIZE - 1] = 0; | ||
436 | printk(KERN_INFO "ray_cs Detected: %s%s%s%s\n", | 421 | printk(KERN_INFO "ray_cs Detected: %s%s%s%s\n", |
437 | link->prod_id[0] ? link->prod_id[0] : " ", | 422 | link->prod_id[0] ? link->prod_id[0] : " ", |
438 | link->prod_id[1] ? link->prod_id[1] : " ", | 423 | link->prod_id[1] ? link->prod_id[1] : " ", |
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c index bcc7038130f6..cf2d1486b01d 100644 --- a/drivers/net/wireless/spectrum_cs.c +++ b/drivers/net/wireless/spectrum_cs.c | |||
@@ -647,21 +647,6 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
647 | cisparse_t parse; | 647 | cisparse_t parse; |
648 | void __iomem *mem; | 648 | void __iomem *mem; |
649 | 649 | ||
650 | /* | ||
651 | * This reads the card's CONFIG tuple to find its | ||
652 | * configuration registers. | ||
653 | */ | ||
654 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
655 | tuple.Attributes = 0; | ||
656 | tuple.TupleData = buf; | ||
657 | tuple.TupleDataMax = sizeof(buf); | ||
658 | tuple.TupleOffset = 0; | ||
659 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
660 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
661 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
662 | link->conf.ConfigBase = parse.config.base; | ||
663 | link->conf.Present = parse.config.rmask[0]; | ||
664 | |||
665 | /* Look up the current Vcc */ | 650 | /* Look up the current Vcc */ |
666 | CS_CHECK(GetConfigurationInfo, | 651 | CS_CHECK(GetConfigurationInfo, |
667 | pcmcia_get_configuration_info(link, &conf)); | 652 | pcmcia_get_configuration_info(link, &conf)); |
@@ -681,6 +666,10 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
681 | * implementation-defined details. | 666 | * implementation-defined details. |
682 | */ | 667 | */ |
683 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 668 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
669 | tuple.Attributes = 0; | ||
670 | tuple.TupleData = buf; | ||
671 | tuple.TupleDataMax = sizeof(buf); | ||
672 | tuple.TupleOffset = 0; | ||
684 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 673 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
685 | while (1) { | 674 | while (1) { |
686 | cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); | 675 | cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index aafb301041b1..233d906c08f0 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -3939,11 +3939,8 @@ wv_hw_reset(struct net_device * dev) | |||
3939 | static inline int | 3939 | static inline int |
3940 | wv_pcmcia_config(struct pcmcia_device * link) | 3940 | wv_pcmcia_config(struct pcmcia_device * link) |
3941 | { | 3941 | { |
3942 | tuple_t tuple; | ||
3943 | cisparse_t parse; | ||
3944 | struct net_device * dev = (struct net_device *) link->priv; | 3942 | struct net_device * dev = (struct net_device *) link->priv; |
3945 | int i; | 3943 | int i; |
3946 | u_char buf[64]; | ||
3947 | win_req_t req; | 3944 | win_req_t req; |
3948 | memreq_t mem; | 3945 | memreq_t mem; |
3949 | net_local * lp = netdev_priv(dev); | 3946 | net_local * lp = netdev_priv(dev); |
@@ -3953,36 +3950,6 @@ wv_pcmcia_config(struct pcmcia_device * link) | |||
3953 | printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link); | 3950 | printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link); |
3954 | #endif | 3951 | #endif |
3955 | 3952 | ||
3956 | /* | ||
3957 | * This reads the card's CONFIG tuple to find its configuration | ||
3958 | * registers. | ||
3959 | */ | ||
3960 | do | ||
3961 | { | ||
3962 | tuple.Attributes = 0; | ||
3963 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
3964 | i = pcmcia_get_first_tuple(link, &tuple); | ||
3965 | if(i != CS_SUCCESS) | ||
3966 | break; | ||
3967 | tuple.TupleData = (cisdata_t *)buf; | ||
3968 | tuple.TupleDataMax = 64; | ||
3969 | tuple.TupleOffset = 0; | ||
3970 | i = pcmcia_get_tuple_data(link, &tuple); | ||
3971 | if(i != CS_SUCCESS) | ||
3972 | break; | ||
3973 | i = pcmcia_parse_tuple(link, &tuple, &parse); | ||
3974 | if(i != CS_SUCCESS) | ||
3975 | break; | ||
3976 | link->conf.ConfigBase = parse.config.base; | ||
3977 | link->conf.Present = parse.config.rmask[0]; | ||
3978 | } | ||
3979 | while(0); | ||
3980 | if(i != CS_SUCCESS) | ||
3981 | { | ||
3982 | cs_error(link, ParseTuple, i); | ||
3983 | return FALSE; | ||
3984 | } | ||
3985 | |||
3986 | do | 3953 | do |
3987 | { | 3954 | { |
3988 | i = pcmcia_request_io(link, &link->io); | 3955 | i = pcmcia_request_io(link, &link->io); |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 5b98a7876982..583e0d655a98 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -1966,25 +1966,10 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
1966 | */ | 1966 | */ |
1967 | static int wl3501_config(struct pcmcia_device *link) | 1967 | static int wl3501_config(struct pcmcia_device *link) |
1968 | { | 1968 | { |
1969 | tuple_t tuple; | ||
1970 | cisparse_t parse; | ||
1971 | struct net_device *dev = link->priv; | 1969 | struct net_device *dev = link->priv; |
1972 | int i = 0, j, last_fn, last_ret; | 1970 | int i = 0, j, last_fn, last_ret; |
1973 | unsigned char bf[64]; | ||
1974 | struct wl3501_card *this; | 1971 | struct wl3501_card *this; |
1975 | 1972 | ||
1976 | /* This reads the card's CONFIG tuple to find its config registers. */ | ||
1977 | tuple.Attributes = 0; | ||
1978 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
1979 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
1980 | tuple.TupleData = bf; | ||
1981 | tuple.TupleDataMax = sizeof(bf); | ||
1982 | tuple.TupleOffset = 0; | ||
1983 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
1984 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
1985 | link->conf.ConfigBase = parse.config.base; | ||
1986 | link->conf.Present = parse.config.rmask[0]; | ||
1987 | |||
1988 | /* Try allocating IO ports. This tries a few fixed addresses. If you | 1973 | /* Try allocating IO ports. This tries a few fixed addresses. If you |
1989 | * want, you can also read the card's config table to pick addresses -- | 1974 | * want, you can also read the card's config table to pick addresses -- |
1990 | * see the serial driver for an example. */ | 1975 | * see the serial driver for an example. */ |