aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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
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')
-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
-rw-r--r--drivers/net/wireless/airo_cs.c22
-rw-r--r--drivers/net/wireless/atmel_cs.c22
-rw-r--r--drivers/net/wireless/b43/pcmcia.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c28
-rw-r--r--drivers/net/wireless/libertas/if_cs.c8
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c24
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c24
-rw-r--r--drivers/net/wireless/ray_cs.c5
-rw-r--r--drivers/net/wireless/wl3501_cs.c12
19 files changed, 195 insertions, 205 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:
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index b7e7f5054e44..d241b4aed71e 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -175,25 +175,23 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
175 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 175 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
176 176
177 /* IO window settings */ 177 /* IO window settings */
178 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 178 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
179 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 179 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
180 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 180 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
181 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 181 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
182 if (!(io->flags & CISTPL_IO_8BIT)) 182 p_dev->resource[0]->flags |=
183 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 183 pcmcia_io_cfg_data_width(io->flags);
184 if (!(io->flags & CISTPL_IO_16BIT)) 184 p_dev->resource[0]->start = io->win[0].base;
185 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 185 p_dev->resource[0]->end = io->win[0].len;
186 p_dev->io.BasePort1 = io->win[0].base;
187 p_dev->io.NumPorts1 = io->win[0].len;
188 if (io->nwin > 1) { 186 if (io->nwin > 1) {
189 p_dev->io.Attributes2 = p_dev->io.Attributes1; 187 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
190 p_dev->io.BasePort2 = io->win[1].base; 188 p_dev->resource[1]->start = io->win[1].base;
191 p_dev->io.NumPorts2 = io->win[1].len; 189 p_dev->resource[1]->end = io->win[1].len;
192 } 190 }
193 } 191 }
194 192
195 /* This reserves IO space but doesn't actually enable it */ 193 /* This reserves IO space but doesn't actually enable it */
196 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 194 if (pcmcia_request_io(p_dev) != 0)
197 return -ENODEV; 195 return -ENODEV;
198 196
199 /* 197 /*
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 65b3aed49e58..3b632161c106 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -190,25 +190,23 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
190 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 190 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
191 191
192 /* IO window settings */ 192 /* IO window settings */
193 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 193 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
194 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 194 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
195 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 195 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
196 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 196 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
197 if (!(io->flags & CISTPL_IO_8BIT)) 197 p_dev->resource[0]->flags |=
198 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 198 pcmcia_io_cfg_data_width(io->flags);
199 if (!(io->flags & CISTPL_IO_16BIT)) 199 p_dev->resource[0]->start = io->win[0].base;
200 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 200 p_dev->resource[0]->end = io->win[0].len;
201 p_dev->io.BasePort1 = io->win[0].base;
202 p_dev->io.NumPorts1 = io->win[0].len;
203 if (io->nwin > 1) { 201 if (io->nwin > 1) {
204 p_dev->io.Attributes2 = p_dev->io.Attributes1; 202 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
205 p_dev->io.BasePort2 = io->win[1].base; 203 p_dev->resource[1]->start = io->win[1].base;
206 p_dev->io.NumPorts2 = io->win[1].len; 204 p_dev->resource[1]->end = io->win[1].len;
207 } 205 }
208 } 206 }
209 207
210 /* This reserves IO space but doesn't actually enable it */ 208 /* This reserves IO space but doesn't actually enable it */
211 return pcmcia_request_io(p_dev, &p_dev->io); 209 return pcmcia_request_io(p_dev);
212} 210}
213 211
214static int atmel_config(struct pcmcia_device *link) 212static int atmel_config(struct pcmcia_device *link)
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index f71bc7821378..7c9af82fcf7e 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -77,10 +77,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
77 dev->conf.Attributes = CONF_ENABLE_IRQ; 77 dev->conf.Attributes = CONF_ENABLE_IRQ;
78 dev->conf.IntType = INT_MEMORY_AND_IO; 78 dev->conf.IntType = INT_MEMORY_AND_IO;
79 79
80 dev->io.BasePort2 = 0;
81 dev->io.NumPorts2 = 0;
82 dev->io.Attributes2 = 0;
83
84 win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM | 80 win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM |
85 WIN_ENABLE | WIN_DATA_WIDTH_16 | 81 WIN_ENABLE | WIN_DATA_WIDTH_16 |
86 WIN_USE_WAIT; 82 WIN_USE_WAIT;
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 4e13cedb8235..ba54d1b04d22 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -519,30 +519,24 @@ static int prism2_config_check(struct pcmcia_device *p_dev,
519 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " 519 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d "
520 "dflt->io.nwin=%d\n", 520 "dflt->io.nwin=%d\n",
521 cfg->io.nwin, dflt->io.nwin); 521 cfg->io.nwin, dflt->io.nwin);
522 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 522 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
523 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 523 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
524 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 524 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
525 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 525 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
526 PDEBUG(DEBUG_EXTRA, "io->flags = 0x%04X, " 526 p_dev->resource[0]->flags |=
527 "io.base=0x%04x, len=%d\n", io->flags, 527 pcmcia_io_cfg_data_width(io->flags);
528 io->win[0].base, io->win[0].len); 528 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
529 if (!(io->flags & CISTPL_IO_8BIT)) 529 p_dev->resource[0]->start = io->win[0].base;
530 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 530 p_dev->resource[0]->end = io->win[0].len;
531 if (!(io->flags & CISTPL_IO_16BIT))
532 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
533 p_dev->io.IOAddrLines = io->flags &
534 CISTPL_IO_LINES_MASK;
535 p_dev->io.BasePort1 = io->win[0].base;
536 p_dev->io.NumPorts1 = io->win[0].len;
537 if (io->nwin > 1) { 531 if (io->nwin > 1) {
538 p_dev->io.Attributes2 = p_dev->io.Attributes1; 532 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
539 p_dev->io.BasePort2 = io->win[1].base; 533 p_dev->resource[1]->start = io->win[1].base;
540 p_dev->io.NumPorts2 = io->win[1].len; 534 p_dev->resource[1]->end = io->win[1].len;
541 } 535 }
542 } 536 }
543 537
544 /* This reserves IO space but doesn't actually enable it */ 538 /* This reserves IO space but doesn't actually enable it */
545 return pcmcia_request_io(p_dev, &p_dev->io); 539 return pcmcia_request_io(p_dev);
546} 540}
547 541
548static int prism2_config(struct pcmcia_device *link) 542static int prism2_config(struct pcmcia_device *link)
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index be4c47594b59..9c298396be50 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -801,9 +801,9 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
801 unsigned int vcc, 801 unsigned int vcc,
802 void *priv_data) 802 void *priv_data)
803{ 803{
804 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 804 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
805 p_dev->io.BasePort1 = cfg->io.win[0].base; 805 p_dev->resource[0]->start = cfg->io.win[0].base;
806 p_dev->io.NumPorts1 = cfg->io.win[0].len; 806 p_dev->resource[0]->end = cfg->io.win[0].len;
807 807
808 /* Do we need to allocate an interrupt? */ 808 /* Do we need to allocate an interrupt? */
809 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 809 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
@@ -815,7 +815,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
815 } 815 }
816 816
817 /* This reserves IO space but doesn't actually enable it */ 817 /* This reserves IO space but doesn't actually enable it */
818 return pcmcia_request_io(p_dev, &p_dev->io); 818 return pcmcia_request_io(p_dev);
819} 819}
820 820
821static int if_cs_probe(struct pcmcia_device *p_dev) 821static int if_cs_probe(struct pcmcia_device *p_dev)
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 6d514b5462fd..ef46a2d88539 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -191,25 +191,23 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
192 192
193 /* IO window settings */ 193 /* IO window settings */
194 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 194 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
195 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 195 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
196 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 196 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
197 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 197 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
198 if (!(io->flags & CISTPL_IO_8BIT)) 198 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
199 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 199 p_dev->resource[0]->flags |=
200 if (!(io->flags & CISTPL_IO_16BIT)) 200 pcmcia_io_cfg_data_width(io->flags);
201 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 201 p_dev->resource[0]->start = io->win[0].base;
202 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 202 p_dev->resource[0]->end = io->win[0].len;
203 p_dev->io.BasePort1 = io->win[0].base;
204 p_dev->io.NumPorts1 = io->win[0].len;
205 if (io->nwin > 1) { 203 if (io->nwin > 1) {
206 p_dev->io.Attributes2 = p_dev->io.Attributes1; 204 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
207 p_dev->io.BasePort2 = io->win[1].base; 205 p_dev->resource[1]->start = io->win[1].base;
208 p_dev->io.NumPorts2 = io->win[1].len; 206 p_dev->resource[1]->end = io->win[1].len;
209 } 207 }
210 208
211 /* This reserves IO space but doesn't actually enable it */ 209 /* This reserves IO space but doesn't actually enable it */
212 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 210 if (pcmcia_request_io(p_dev) != 0)
213 goto next_entry; 211 goto next_entry;
214 } 212 }
215 return 0; 213 return 0;
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 4f8f55eab955..873877e17e1b 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -253,25 +253,23 @@ static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
253 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 253 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
254 254
255 /* IO window settings */ 255 /* IO window settings */
256 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 256 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
257 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 257 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
258 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 258 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
259 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 259 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
260 if (!(io->flags & CISTPL_IO_8BIT)) 260 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
261 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 261 p_dev->resource[0]->flags |=
262 if (!(io->flags & CISTPL_IO_16BIT)) 262 pcmcia_io_cfg_data_width(io->flags);
263 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 263 p_dev->resource[0]->start = io->win[0].base;
264 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 264 p_dev->resource[0]->end = io->win[0].len;
265 p_dev->io.BasePort1 = io->win[0].base;
266 p_dev->io.NumPorts1 = io->win[0].len;
267 if (io->nwin > 1) { 265 if (io->nwin > 1) {
268 p_dev->io.Attributes2 = p_dev->io.Attributes1; 266 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
269 p_dev->io.BasePort2 = io->win[1].base; 267 p_dev->resource[1]->start = io->win[1].base;
270 p_dev->io.NumPorts2 = io->win[1].len; 268 p_dev->resource[1]->end = io->win[1].len;
271 } 269 }
272 270
273 /* This reserves IO space but doesn't actually enable it */ 271 /* This reserves IO space but doesn't actually enable it */
274 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 272 if (pcmcia_request_io(p_dev) != 0)
275 goto next_entry; 273 goto next_entry;
276 } 274 }
277 return 0; 275 return 0;
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 165beb6af849..b83d5ef1dffe 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -315,9 +315,8 @@ static int ray_probe(struct pcmcia_device *p_dev)
315 local->finder = p_dev; 315 local->finder = p_dev;
316 316
317 /* The io structure describes IO port mapping. None used here */ 317 /* The io structure describes IO port mapping. None used here */
318 p_dev->io.NumPorts1 = 0; 318 p_dev->resource[0]->end = 0;
319 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 319 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
320 p_dev->io.IOAddrLines = 5;
321 320
322 /* General socket configuration */ 321 /* General socket configuration */
323 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 322 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index a32f220648c0..a1cc2d498a1c 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1884,9 +1884,8 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1884 struct wl3501_card *this; 1884 struct wl3501_card *this;
1885 1885
1886 /* The io structure describes IO port mapping */ 1886 /* The io structure describes IO port mapping */
1887 p_dev->io.NumPorts1 = 16; 1887 p_dev->resource[0]->end = 16;
1888 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1888 p_dev->resource[0]->flags = IO_DATA_PATH_WIDTH_8;
1889 p_dev->io.IOAddrLines = 5;
1890 1889
1891 /* General socket configuration */ 1890 /* General socket configuration */
1892 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1891 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -1932,13 +1931,14 @@ static int wl3501_config(struct pcmcia_device *link)
1932 /* Try allocating IO ports. This tries a few fixed addresses. If you 1931 /* Try allocating IO ports. This tries a few fixed addresses. If you
1933 * want, you can also read the card's config table to pick addresses -- 1932 * want, you can also read the card's config table to pick addresses --
1934 * see the serial driver for an example. */ 1933 * see the serial driver for an example. */
1934 link->io_lines = 5;
1935 1935
1936 for (j = 0x280; j < 0x400; j += 0x20) { 1936 for (j = 0x280; j < 0x400; j += 0x20) {
1937 /* The '^0x300' is so that we probe 0x300-0x3ff first, then 1937 /* The '^0x300' is so that we probe 0x300-0x3ff first, then
1938 * 0x200-0x2ff, and so on, because this seems safer */ 1938 * 0x200-0x2ff, and so on, because this seems safer */
1939 link->io.BasePort1 = j; 1939 link->resource[0]->start = j;
1940 link->io.BasePort2 = link->io.BasePort1 + 0x10; 1940 link->resource[1]->start = link->resource[0]->start + 0x10;
1941 i = pcmcia_request_io(link, &link->io); 1941 i = pcmcia_request_io(link);
1942 if (i == 0) 1942 if (i == 0)
1943 break; 1943 break;
1944 } 1944 }