aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-24 11:23:51 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-08-03 03:04:11 -0400
commit90abdc3b973229bae98dd96649d9f7106cc177a4 (patch)
tree5c1a7a131b65560dd73b5103118d8c7631bd76a4 /drivers/net/pcmcia
parent9a017a910346afd88ec2e065989903bf211a7d37 (diff)
pcmcia: do not use io_req_t when calling pcmcia_request_io()
Instead of io_req_t, drivers are now requested to fill out struct pcmcia_device *p_dev->resource[0,1] for up to two ioport ranges. After a call to pcmcia_request_io(), the ports found there are reserved, after calling pcmcia_request_configuration(), they may be used. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/) Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c11
-rw-r--r--drivers/net/pcmcia/3c589_cs.c11
-rw-r--r--drivers/net/pcmcia/axnet_cs.c40
-rw-r--r--drivers/net/pcmcia/com20020_cs.c19
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c31
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c14
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c8
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c40
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c43
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c34
10 files changed, 130 insertions, 121 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index b5ea9b8cfd76..c683f77c6f42 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -278,8 +278,8 @@ static int tc574_probe(struct pcmcia_device *link)
278 lp->p_dev = link; 278 lp->p_dev = link;
279 279
280 spin_lock_init(&lp->window_lock); 280 spin_lock_init(&lp->window_lock);
281 link->io.NumPorts1 = 32; 281 link->resource[0]->end = 32;
282 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 282 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
283 link->conf.Attributes = CONF_ENABLE_IRQ; 283 link->conf.Attributes = CONF_ENABLE_IRQ;
284 link->conf.IntType = INT_MEMORY_AND_IO; 284 link->conf.IntType = INT_MEMORY_AND_IO;
285 link->conf.ConfigIndex = 1; 285 link->conf.ConfigIndex = 1;
@@ -337,10 +337,11 @@ static int tc574_config(struct pcmcia_device *link)
337 337
338 dev_dbg(&link->dev, "3c574_config()\n"); 338 dev_dbg(&link->dev, "3c574_config()\n");
339 339
340 link->io.IOAddrLines = 16; 340 link->io_lines = 16;
341
341 for (i = j = 0; j < 0x400; j += 0x20) { 342 for (i = j = 0; j < 0x400; j += 0x20) {
342 link->io.BasePort1 = j ^ 0x300; 343 link->resource[0]->start = j ^ 0x300;
343 i = pcmcia_request_io(link, &link->io); 344 i = pcmcia_request_io(link);
344 if (i == 0) 345 if (i == 0)
345 break; 346 break;
346 } 347 }
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 122ef4a9488c..61f9cf2100ff 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -213,8 +213,8 @@ static int tc589_probe(struct pcmcia_device *link)
213 lp->p_dev = link; 213 lp->p_dev = link;
214 214
215 spin_lock_init(&lp->lock); 215 spin_lock_init(&lp->lock);
216 link->io.NumPorts1 = 16; 216 link->resource[0]->end = 16;
217 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 217 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
218 218
219 link->conf.Attributes = CONF_ENABLE_IRQ; 219 link->conf.Attributes = CONF_ENABLE_IRQ;
220 link->conf.IntType = INT_MEMORY_AND_IO; 220 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -277,12 +277,13 @@ static int tc589_config(struct pcmcia_device *link)
277 "3Com card??\n"); 277 "3Com card??\n");
278 multi = (link->card_id == PRODID_3COM_3C562); 278 multi = (link->card_id == PRODID_3COM_3C562);
279 279
280 link->io_lines = 16;
281
280 /* For the 3c562, the base address must be xx00-xx7f */ 282 /* For the 3c562, the base address must be xx00-xx7f */
281 link->io.IOAddrLines = 16;
282 for (i = j = 0; j < 0x400; j += 0x10) { 283 for (i = j = 0; j < 0x400; j += 0x10) {
283 if (multi && (j & 0x80)) continue; 284 if (multi && (j & 0x80)) continue;
284 link->io.BasePort1 = j ^ 0x300; 285 link->resource[0]->start = j ^ 0x300;
285 i = pcmcia_request_io(link, &link->io); 286 i = pcmcia_request_io(link);
286 if (i == 0) 287 if (i == 0)
287 break; 288 break;
288 } 289 }
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index c52fdf31cbfe..5f05ffb240cc 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -259,28 +259,30 @@ static int get_prom(struct pcmcia_device *link)
259static int try_io_port(struct pcmcia_device *link) 259static int try_io_port(struct pcmcia_device *link)
260{ 260{
261 int j, ret; 261 int j, ret;
262 if (link->io.NumPorts1 == 32) { 262 link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
263 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 263 link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
264 if (link->resource[0]->end == 32) {
265 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
264 /* for master/slave multifunction cards */ 266 /* for master/slave multifunction cards */
265 if (link->io.NumPorts2 > 0) 267 if (link->resource[1]->end > 0)
266 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 268 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
267 } else { 269 } else {
268 /* This should be two 16-port windows */ 270 /* This should be two 16-port windows */
269 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 271 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
270 link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; 272 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
271 } 273 }
272 if (link->io.BasePort1 == 0) { 274 if (link->resource[0]->start == 0) {
273 link->io.IOAddrLines = 16;
274 for (j = 0; j < 0x400; j += 0x20) { 275 for (j = 0; j < 0x400; j += 0x20) {
275 link->io.BasePort1 = j ^ 0x300; 276 link->resource[0]->start = j ^ 0x300;
276 link->io.BasePort2 = (j ^ 0x300) + 0x10; 277 link->resource[1]->start = (j ^ 0x300) + 0x10;
277 ret = pcmcia_request_io(link, &link->io); 278 link->io_lines = 16;
279 ret = pcmcia_request_io(link);
278 if (ret == 0) 280 if (ret == 0)
279 return ret; 281 return ret;
280 } 282 }
281 return ret; 283 return ret;
282 } else { 284 } else {
283 return pcmcia_request_io(link, &link->io); 285 return pcmcia_request_io(link);
284 } 286 }
285} 287}
286 288
@@ -301,15 +303,15 @@ static int axnet_configcheck(struct pcmcia_device *p_dev,
301 network function with window 0, and serial with window 1 */ 303 network function with window 0, and serial with window 1 */
302 if (io->nwin > 1) { 304 if (io->nwin > 1) {
303 i = (io->win[1].len > io->win[0].len); 305 i = (io->win[1].len > io->win[0].len);
304 p_dev->io.BasePort2 = io->win[1-i].base; 306 p_dev->resource[1]->start = io->win[1-i].base;
305 p_dev->io.NumPorts2 = io->win[1-i].len; 307 p_dev->resource[1]->end = io->win[1-i].len;
306 } else { 308 } else {
307 i = p_dev->io.NumPorts2 = 0; 309 i = p_dev->resource[1]->end = 0;
308 } 310 }
309 p_dev->io.BasePort1 = io->win[i].base; 311 p_dev->resource[0]->start = io->win[i].base;
310 p_dev->io.NumPorts1 = io->win[i].len; 312 p_dev->resource[0]->end = io->win[i].len;
311 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 313 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
312 if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32) 314 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
313 return try_io_port(p_dev); 315 return try_io_port(p_dev);
314 316
315 return -ENODEV; 317 return -ENODEV;
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 3b53818e3eef..3c400cfa82ae 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -158,9 +158,8 @@ static int com20020_probe(struct pcmcia_device *p_dev)
158 /* fill in our module parameters as defaults */ 158 /* fill in our module parameters as defaults */
159 dev->dev_addr[0] = node; 159 dev->dev_addr[0] = node;
160 160
161 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 161 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
162 p_dev->io.NumPorts1 = 16; 162 p_dev->resource[0]->end = 16;
163 p_dev->io.IOAddrLines = 16;
164 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 163 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
165 p_dev->conf.IntType = INT_MEMORY_AND_IO; 164 p_dev->conf.IntType = INT_MEMORY_AND_IO;
166 165
@@ -245,20 +244,24 @@ static int com20020_config(struct pcmcia_device *link)
245 244
246 dev_dbg(&link->dev, "com20020_config\n"); 245 dev_dbg(&link->dev, "com20020_config\n");
247 246
248 dev_dbg(&link->dev, "baseport1 is %Xh\n", link->io.BasePort1); 247 dev_dbg(&link->dev, "baseport1 is %Xh\n",
248 (unsigned int) link->resource[0]->start);
249
249 i = -ENODEV; 250 i = -ENODEV;
250 if (!link->io.BasePort1) 251 link->io_lines = 16;
252
253 if (!link->resource[0]->start)
251 { 254 {
252 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) 255 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10)
253 { 256 {
254 link->io.BasePort1 = ioaddr; 257 link->resource[0]->start = ioaddr;
255 i = pcmcia_request_io(link, &link->io); 258 i = pcmcia_request_io(link);
256 if (i == 0) 259 if (i == 0)
257 break; 260 break;
258 } 261 }
259 } 262 }
260 else 263 else
261 i = pcmcia_request_io(link, &link->io); 264 i = pcmcia_request_io(link);
262 265
263 if (i != 0) 266 if (i != 0)
264 { 267 {
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index bba6369a028e..699304480aed 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -248,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link)
248 lp->base = NULL; 248 lp->base = NULL;
249 249
250 /* The io structure describes IO port mapping */ 250 /* The io structure describes IO port mapping */
251 link->io.NumPorts1 = 32; 251 link->resource[0]->end = 32;
252 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 252 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
253 link->io.IOAddrLines = 5;
254 253
255 /* General socket configuration */ 254 /* General socket configuration */
256 link->conf.Attributes = CONF_ENABLE_IRQ; 255 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -288,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link)
288 { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 287 { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
289 288
290 for (i = 0; i < 5; i++) { 289 for (i = 0; i < 5; i++) {
291 link->io.BasePort2 = serial_base[i]; 290 link->resource[1]->start = serial_base[i];
292 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 291 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
293 if (link->io.BasePort2 == 0) { 292 if (link->resource[1]->start == 0) {
294 link->io.NumPorts2 = 0; 293 link->resource[1]->end = 0;
295 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); 294 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n");
296 } 295 }
297 ret = pcmcia_request_io(link, &link->io); 296 ret = pcmcia_request_io(link);
298 if (ret == 0) 297 if (ret == 0)
299 return ret; 298 return ret;
300 } 299 }
@@ -310,8 +309,8 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
310 0x380,0x3c0 only for ioport. 309 0x380,0x3c0 only for ioport.
311 */ 310 */
312 for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { 311 for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) {
313 link->io.BasePort1 = ioaddr; 312 link->resource[0]->start = ioaddr;
314 ret = pcmcia_request_io(link, &link->io); 313 ret = pcmcia_request_io(link);
315 if (ret == 0) { 314 if (ret == 0) {
316 /* calculate ConfigIndex value */ 315 /* calculate ConfigIndex value */
317 link->conf.ConfigIndex = 316 link->conf.ConfigIndex =
@@ -345,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link)
345 344
346 dev_dbg(&link->dev, "fmvj18x_config\n"); 345 dev_dbg(&link->dev, "fmvj18x_config\n");
347 346
347 link->io_lines = 5;
348
348 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); 349 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf);
349 kfree(buf); 350 kfree(buf);
350 351
@@ -363,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link)
363 /* MultiFunction Card */ 364 /* MultiFunction Card */
364 link->conf.ConfigBase = 0x800; 365 link->conf.ConfigBase = 0x800;
365 link->conf.ConfigIndex = 0x47; 366 link->conf.ConfigIndex = 0x47;
366 link->io.NumPorts2 = 8; 367 link->resource[1]->end = 8;
367 } 368 }
368 break; 369 break;
369 case MANFID_NEC: 370 case MANFID_NEC:
370 cardtype = NEC; /* MultiFunction Card */ 371 cardtype = NEC; /* MultiFunction Card */
371 link->conf.ConfigBase = 0x800; 372 link->conf.ConfigBase = 0x800;
372 link->conf.ConfigIndex = 0x47; 373 link->conf.ConfigIndex = 0x47;
373 link->io.NumPorts2 = 8; 374 link->resource[1]->end = 8;
374 break; 375 break;
375 case MANFID_KME: 376 case MANFID_KME:
376 cardtype = KME; /* MultiFunction Card */ 377 cardtype = KME; /* MultiFunction Card */
377 link->conf.ConfigBase = 0x800; 378 link->conf.ConfigBase = 0x800;
378 link->conf.ConfigIndex = 0x47; 379 link->conf.ConfigIndex = 0x47;
379 link->io.NumPorts2 = 8; 380 link->resource[1]->end = 8;
380 break; 381 break;
381 case MANFID_CONTEC: 382 case MANFID_CONTEC:
382 cardtype = CONTEC; 383 cardtype = CONTEC;
@@ -417,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
417 } 418 }
418 } 419 }
419 420
420 if (link->io.NumPorts2 != 0) { 421 if (link->resource[1]->end != 0) {
421 ret = mfc_try_io_port(link); 422 ret = mfc_try_io_port(link);
422 if (ret != 0) goto failed; 423 if (ret != 0) goto failed;
423 } else if (cardtype == UNGERMANN) { 424 } else if (cardtype == UNGERMANN) {
424 ret = ungermann_try_io_port(link); 425 ret = ungermann_try_io_port(link);
425 if (ret != 0) goto failed; 426 if (ret != 0) goto failed;
426 } else { 427 } else {
427 ret = pcmcia_request_io(link, &link->io); 428 ret = pcmcia_request_io(link);
428 if (ret) 429 if (ret)
429 goto failed; 430 goto failed;
430 } 431 }
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index e99abaa92be5..3fd859570db3 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -151,9 +151,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
151 link->priv = info; 151 link->priv = info;
152 info->ti = netdev_priv(dev); 152 info->ti = netdev_priv(dev);
153 153
154 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 154 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
155 link->io.NumPorts1 = 4; 155 link->resource[0]->end = 4;
156 link->io.IOAddrLines = 16;
157 link->conf.Attributes = CONF_ENABLE_IRQ; 156 link->conf.Attributes = CONF_ENABLE_IRQ;
158 link->conf.IntType = INT_MEMORY_AND_IO; 157 link->conf.IntType = INT_MEMORY_AND_IO;
159 link->conf.Present = PRESENT_OPTION; 158 link->conf.Present = PRESENT_OPTION;
@@ -218,16 +217,17 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
218 dev_dbg(&link->dev, "ibmtr_config\n"); 217 dev_dbg(&link->dev, "ibmtr_config\n");
219 218
220 link->conf.ConfigIndex = 0x61; 219 link->conf.ConfigIndex = 0x61;
220 link->io_lines = 16;
221 221
222 /* Determine if this is PRIMARY or ALTERNATE. */ 222 /* Determine if this is PRIMARY or ALTERNATE. */
223 223
224 /* Try PRIMARY card at 0xA20-0xA23 */ 224 /* Try PRIMARY card at 0xA20-0xA23 */
225 link->io.BasePort1 = 0xA20; 225 link->resource[0]->start = 0xA20;
226 i = pcmcia_request_io(link, &link->io); 226 i = pcmcia_request_io(link);
227 if (i != 0) { 227 if (i != 0) {
228 /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ 228 /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */
229 link->io.BasePort1 = 0xA24; 229 link->resource[0]->start = 0xA24;
230 ret = pcmcia_request_io(link, &link->io); 230 ret = pcmcia_request_io(link);
231 if (ret) 231 if (ret)
232 goto failed; 232 goto failed;
233 } 233 }
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 9980cbb81d34..68f2deeb3ade 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -458,9 +458,8 @@ static int nmclan_probe(struct pcmcia_device *link)
458 link->priv = dev; 458 link->priv = dev;
459 459
460 spin_lock_init(&lp->bank_lock); 460 spin_lock_init(&lp->bank_lock);
461 link->io.NumPorts1 = 32; 461 link->resource[0]->end = 32;
462 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 462 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
463 link->io.IOAddrLines = 5;
464 link->conf.Attributes = CONF_ENABLE_IRQ; 463 link->conf.Attributes = CONF_ENABLE_IRQ;
465 link->conf.IntType = INT_MEMORY_AND_IO; 464 link->conf.IntType = INT_MEMORY_AND_IO;
466 link->conf.ConfigIndex = 1; 465 link->conf.ConfigIndex = 1;
@@ -644,7 +643,8 @@ static int nmclan_config(struct pcmcia_device *link)
644 643
645 dev_dbg(&link->dev, "nmclan_config\n"); 644 dev_dbg(&link->dev, "nmclan_config\n");
646 645
647 ret = pcmcia_request_io(link, &link->io); 646 link->io_lines = 5;
647 ret = pcmcia_request_io(link);
648 if (ret) 648 if (ret)
649 goto failed; 649 goto failed;
650 ret = pcmcia_request_exclusive_irq(link, mace_interrupt); 650 ret = pcmcia_request_exclusive_irq(link, mace_interrupt);
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index c9cd2377ef91..9c5fc9dfc55d 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -477,29 +477,31 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)
477static int try_io_port(struct pcmcia_device *link) 477static int try_io_port(struct pcmcia_device *link)
478{ 478{
479 int j, ret; 479 int j, ret;
480 if (link->io.NumPorts1 == 32) { 480 link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
481 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 481 link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
482 if (link->io.NumPorts2 > 0) { 482 if (link->resource[0]->end == 32) {
483 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
484 if (link->resource[1]->end > 0) {
483 /* for master/slave multifunction cards */ 485 /* for master/slave multifunction cards */
484 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 486 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
485 } 487 }
486 } else { 488 } else {
487 /* This should be two 16-port windows */ 489 /* This should be two 16-port windows */
488 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 490 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
489 link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; 491 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
490 } 492 }
491 if (link->io.BasePort1 == 0) { 493 if (link->resource[0]->start == 0) {
492 link->io.IOAddrLines = 16;
493 for (j = 0; j < 0x400; j += 0x20) { 494 for (j = 0; j < 0x400; j += 0x20) {
494 link->io.BasePort1 = j ^ 0x300; 495 link->resource[0]->start = j ^ 0x300;
495 link->io.BasePort2 = (j ^ 0x300) + 0x10; 496 link->resource[1]->start = (j ^ 0x300) + 0x10;
496 ret = pcmcia_request_io(link, &link->io); 497 link->io_lines = 16;
498 ret = pcmcia_request_io(link);
497 if (ret == 0) 499 if (ret == 0)
498 return ret; 500 return ret;
499 } 501 }
500 return ret; 502 return ret;
501 } else { 503 } else {
502 return pcmcia_request_io(link, &link->io); 504 return pcmcia_request_io(link);
503 } 505 }
504} 506}
505 507
@@ -520,18 +522,18 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev,
520 network function with window 0, and serial with window 1 */ 522 network function with window 0, and serial with window 1 */
521 if (io->nwin > 1) { 523 if (io->nwin > 1) {
522 i = (io->win[1].len > io->win[0].len); 524 i = (io->win[1].len > io->win[0].len);
523 p_dev->io.BasePort2 = io->win[1-i].base; 525 p_dev->resource[1]->start = io->win[1-i].base;
524 p_dev->io.NumPorts2 = io->win[1-i].len; 526 p_dev->resource[1]->end = io->win[1-i].len;
525 } else { 527 } else {
526 i = p_dev->io.NumPorts2 = 0; 528 i = p_dev->resource[1]->end = 0;
527 } 529 }
528 530
529 *has_shmem = ((cfg->mem.nwin == 1) && 531 *has_shmem = ((cfg->mem.nwin == 1) &&
530 (cfg->mem.win[0].len >= 0x4000)); 532 (cfg->mem.win[0].len >= 0x4000));
531 p_dev->io.BasePort1 = io->win[i].base; 533 p_dev->resource[0]->start = io->win[i].base;
532 p_dev->io.NumPorts1 = io->win[i].len; 534 p_dev->resource[0]->end = io->win[i].len;
533 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 535 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
534 if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32) 536 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
535 return try_io_port(p_dev); 537 return try_io_port(p_dev);
536 538
537 return 0; 539 return 0;
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 1b0b3230dd71..a5e47796f6ae 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -324,9 +324,8 @@ static int smc91c92_probe(struct pcmcia_device *link)
324 link->priv = dev; 324 link->priv = dev;
325 325
326 spin_lock_init(&smc->lock); 326 spin_lock_init(&smc->lock);
327 link->io.NumPorts1 = 16; 327 link->resource[0]->end = 16;
328 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 328 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
329 link->io.IOAddrLines = 4;
330 link->conf.Attributes = CONF_ENABLE_IRQ; 329 link->conf.Attributes = CONF_ENABLE_IRQ;
331 link->conf.IntType = INT_MEMORY_AND_IO; 330 link->conf.IntType = INT_MEMORY_AND_IO;
332 331
@@ -427,12 +426,13 @@ static int mhz_mfc_config_check(struct pcmcia_device *p_dev,
427 void *priv_data) 426 void *priv_data)
428{ 427{
429 int k; 428 int k;
430 p_dev->io.BasePort2 = cf->io.win[0].base; 429 p_dev->resource[1]->start = cf->io.win[0].base;
431 for (k = 0; k < 0x400; k += 0x10) { 430 for (k = 0; k < 0x400; k += 0x10) {
432 if (k & 0x80) 431 if (k & 0x80)
433 continue; 432 continue;
434 p_dev->io.BasePort1 = k ^ 0x300; 433 p_dev->resource[0]->start = k ^ 0x300;
435 if (!pcmcia_request_io(p_dev, &p_dev->io)) 434 p_dev->io_lines = 16;
435 if (!pcmcia_request_io(p_dev))
436 return 0; 436 return 0;
437 } 437 }
438 return -ENODEV; 438 return -ENODEV;
@@ -448,9 +448,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)
448 448
449 link->conf.Attributes |= CONF_ENABLE_SPKR; 449 link->conf.Attributes |= CONF_ENABLE_SPKR;
450 link->conf.Status = CCSR_AUDIO_ENA; 450 link->conf.Status = CCSR_AUDIO_ENA;
451 link->io.IOAddrLines = 16; 451 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
452 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 452 link->resource[1]->end = 8;
453 link->io.NumPorts2 = 8;
454 453
455 /* The Megahertz combo cards have modem-like CIS entries, so 454 /* The Megahertz combo cards have modem-like CIS entries, so
456 we have to explicitly try a bunch of port combinations. */ 455 we have to explicitly try a bunch of port combinations. */
@@ -601,9 +600,9 @@ static int smc_configcheck(struct pcmcia_device *p_dev,
601 unsigned int vcc, 600 unsigned int vcc,
602 void *priv_data) 601 void *priv_data)
603{ 602{
604 p_dev->io.BasePort1 = cf->io.win[0].base; 603 p_dev->resource[0]->start = cf->io.win[0].base;
605 p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 604 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
606 return pcmcia_request_io(p_dev, &p_dev->io); 605 return pcmcia_request_io(p_dev);
607} 606}
608 607
609static int smc_config(struct pcmcia_device *link) 608static int smc_config(struct pcmcia_device *link)
@@ -611,7 +610,7 @@ static int smc_config(struct pcmcia_device *link)
611 struct net_device *dev = link->priv; 610 struct net_device *dev = link->priv;
612 int i; 611 int i;
613 612
614 link->io.NumPorts1 = 16; 613 link->resource[0]->end = 16;
615 i = pcmcia_loop_config(link, smc_configcheck, NULL); 614 i = pcmcia_loop_config(link, smc_configcheck, NULL);
616 if (!i) 615 if (!i)
617 dev->base_addr = link->resource[0]->start; 616 dev->base_addr = link->resource[0]->start;
@@ -646,25 +645,25 @@ static int osi_config(struct pcmcia_device *link)
646 645
647 link->conf.Attributes |= CONF_ENABLE_SPKR; 646 link->conf.Attributes |= CONF_ENABLE_SPKR;
648 link->conf.Status = CCSR_AUDIO_ENA; 647 link->conf.Status = CCSR_AUDIO_ENA;
649 link->io.NumPorts1 = 64; 648 link->resource[0]->end = 64;
650 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 649 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
651 link->io.NumPorts2 = 8; 650 link->resource[1]->end = 8;
652 link->io.IOAddrLines = 16;
653 651
654 /* Enable Hard Decode, LAN, Modem */ 652 /* Enable Hard Decode, LAN, Modem */
655 link->conf.ConfigIndex = 0x23; 653 link->conf.ConfigIndex = 0x23;
654 link->io_lines = 16;
656 655
657 for (i = j = 0; j < 4; j++) { 656 for (i = j = 0; j < 4; j++) {
658 link->io.BasePort2 = com[j]; 657 link->resource[1]->start = com[j];
659 i = pcmcia_request_io(link, &link->io); 658 i = pcmcia_request_io(link);
660 if (i == 0) 659 if (i == 0)
661 break; 660 break;
662 } 661 }
663 if (i != 0) { 662 if (i != 0) {
664 /* Fallback: turn off hard decode */ 663 /* Fallback: turn off hard decode */
665 link->conf.ConfigIndex = 0x03; 664 link->conf.ConfigIndex = 0x03;
666 link->io.NumPorts2 = 0; 665 link->resource[1]->end = 0;
667 i = pcmcia_request_io(link, &link->io); 666 i = pcmcia_request_io(link);
668 } 667 }
669 dev->base_addr = link->resource[0]->start + 0x10; 668 dev->base_addr = link->resource[0]->start + 0x10;
670 return i; 669 return i;
@@ -803,7 +802,7 @@ static int check_sig(struct pcmcia_device *link)
803 } 802 }
804 803
805 /* Try setting bus width */ 804 /* Try setting bus width */
806 width = (link->io.Attributes1 == IO_DATA_PATH_WIDTH_AUTO); 805 width = (link->resource[0]->flags == IO_DATA_PATH_WIDTH_AUTO);
807 s = inb(ioaddr + CONFIG); 806 s = inb(ioaddr + CONFIG);
808 if (width) 807 if (width)
809 s |= CFG_16BIT; 808 s |= CFG_16BIT;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 034920b459d1..8fb0eb1dc341 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -677,9 +677,9 @@ xirc2ps_config_modem(struct pcmcia_device *p_dev,
677 677
678 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) { 678 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {
679 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 679 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
680 p_dev->io.BasePort2 = cf->io.win[0].base; 680 p_dev->resource[1]->start = cf->io.win[0].base;
681 p_dev->io.BasePort1 = ioaddr; 681 p_dev->resource[0]->start = ioaddr;
682 if (!pcmcia_request_io(p_dev, &p_dev->io)) 682 if (!pcmcia_request_io(p_dev))
683 return 0; 683 return 0;
684 } 684 }
685 } 685 }
@@ -696,11 +696,11 @@ xirc2ps_config_check(struct pcmcia_device *p_dev,
696 int *pass = priv_data; 696 int *pass = priv_data;
697 697
698 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) { 698 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {
699 p_dev->io.BasePort2 = cf->io.win[0].base; 699 p_dev->resource[1]->start = cf->io.win[0].base;
700 p_dev->io.BasePort1 = p_dev->io.BasePort2 700 p_dev->resource[0]->start = p_dev->resource[1]->start
701 + (*pass ? (cf->index & 0x20 ? -24:8) 701 + (*pass ? (cf->index & 0x20 ? -24:8)
702 : (cf->index & 0x20 ? 8:-24)); 702 : (cf->index & 0x20 ? 8:-24));
703 if (!pcmcia_request_io(p_dev, &p_dev->io)) 703 if (!pcmcia_request_io(p_dev))
704 return 0; 704 return 0;
705 } 705 }
706 return -ENODEV; 706 return -ENODEV;
@@ -807,8 +807,7 @@ xirc2ps_config(struct pcmcia_device * link)
807 goto failure; 807 goto failure;
808 } 808 }
809 809
810 link->io.IOAddrLines =10; 810 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
811 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
812 if (local->modem) { 811 if (local->modem) {
813 int pass; 812 int pass;
814 813
@@ -816,16 +815,16 @@ xirc2ps_config(struct pcmcia_device * link)
816 link->conf.Attributes |= CONF_ENABLE_SPKR; 815 link->conf.Attributes |= CONF_ENABLE_SPKR;
817 link->conf.Status |= CCSR_AUDIO_ENA; 816 link->conf.Status |= CCSR_AUDIO_ENA;
818 } 817 }
819 link->io.NumPorts2 = 8; 818 link->resource[1]->end = 8;
820 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 819 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
821 if (local->dingo) { 820 if (local->dingo) {
822 /* Take the Modem IO port from the CIS and scan for a free 821 /* Take the Modem IO port from the CIS and scan for a free
823 * Ethernet port */ 822 * Ethernet port */
824 link->io.NumPorts1 = 16; /* no Mako stuff anymore */ 823 link->resource[0]->end = 16; /* no Mako stuff anymore */
825 if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL)) 824 if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL))
826 goto port_found; 825 goto port_found;
827 } else { 826 } else {
828 link->io.NumPorts1 = 18; 827 link->resource[0]->end = 18;
829 /* We do 2 passes here: The first one uses the regular mapping and 828 /* We do 2 passes here: The first one uses the regular mapping and
830 * the second tries again, thereby considering that the 32 ports are 829 * the second tries again, thereby considering that the 32 ports are
831 * mirrored every 32 bytes. Actually we use a mirrored port for 830 * mirrored every 32 bytes. Actually we use a mirrored port for
@@ -840,14 +839,15 @@ xirc2ps_config(struct pcmcia_device * link)
840 } 839 }
841 printk(KNOT_XIRC "no ports available\n"); 840 printk(KNOT_XIRC "no ports available\n");
842 } else { 841 } else {
843 link->io.NumPorts1 = 16; 842 link->io_lines = 10;
843 link->resource[0]->end = 16;
844 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 844 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
845 link->io.BasePort1 = ioaddr; 845 link->resource[0]->start = ioaddr;
846 if (!(err=pcmcia_request_io(link, &link->io))) 846 if (!(err = pcmcia_request_io(link)))
847 goto port_found; 847 goto port_found;
848 } 848 }
849 link->io.BasePort1 = 0; /* let CS decide */ 849 link->resource[0]->start = 0; /* let CS decide */
850 if ((err=pcmcia_request_io(link, &link->io))) 850 if ((err = pcmcia_request_io(link)))
851 goto config_error; 851 goto config_error;
852 } 852 }
853 port_found: 853 port_found: