diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 15:25:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 15:25:06 -0400 |
commit | 1685e633b396b0f3dabbc9fa5d65dfefe6435250 (patch) | |
tree | ee83e26e2468ca1518a1b065c690159e12c8def9 /drivers/net | |
parent | 1cfd2bda8c486ae0e7a8005354758ebb68172bca (diff) | |
parent | 127c03cdbad9bd5af5d7f33bd31a1015a90cb77f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq
pcmcia: do not request windows if you don't need to
pcmcia: insert PCMCIA device resources into resource tree
pcmcia: export resource information to sysfs
pcmcia: use struct resource for PCMCIA devices, part 2
pcmcia: remove memreq_t
pcmcia: move local definitions out of include/pcmcia/cs.h
pcmcia: do not use io_req_t when calling pcmcia_request_io()
pcmcia: do not use io_req_t after call to pcmcia_request_io()
pcmcia: use struct resource for PCMCIA devices
pcmcia: clean up cs.h
pcmcia: use pcmica_{read,write}_config_byte
pcmcia: remove cs_types.h
pcmcia: remove unused flag, simplify headers
pcmcia: remove obsolete CS_EVENT_ definitions
pcmcia: split up central event handler
pcmcia: simplify event callback
pcmcia: remove obsolete ioctl
Conflicts in:
- drivers/staging/comedi/drivers/*
- drivers/staging/wlags49_h2/wl_cs.c
due to dev_info_t and whitespace changes
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 14 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 14 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 48 | ||||
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 22 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 48 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 29 | ||||
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 32 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 63 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 71 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 60 | ||||
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 74 | ||||
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/b43/pcmcia.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 136 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/if_cs.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_cs.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/spectrum_cs.c | 62 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 27 | ||||
-rw-r--r-- | drivers/net/wireless/wl3501_cs.c | 24 |
19 files changed, 311 insertions, 497 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 10ee106a1617..c683f77c6f42 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -87,7 +87,6 @@ earlier 3Com products. | |||
87 | #include <linux/bitops.h> | 87 | #include <linux/bitops.h> |
88 | #include <linux/mii.h> | 88 | #include <linux/mii.h> |
89 | 89 | ||
90 | #include <pcmcia/cs_types.h> | ||
91 | #include <pcmcia/cs.h> | 90 | #include <pcmcia/cs.h> |
92 | #include <pcmcia/cistpl.h> | 91 | #include <pcmcia/cistpl.h> |
93 | #include <pcmcia/cisreg.h> | 92 | #include <pcmcia/cisreg.h> |
@@ -279,8 +278,8 @@ static int tc574_probe(struct pcmcia_device *link) | |||
279 | lp->p_dev = link; | 278 | lp->p_dev = link; |
280 | 279 | ||
281 | spin_lock_init(&lp->window_lock); | 280 | spin_lock_init(&lp->window_lock); |
282 | link->io.NumPorts1 = 32; | 281 | link->resource[0]->end = 32; |
283 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 282 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; |
284 | link->conf.Attributes = CONF_ENABLE_IRQ; | 283 | link->conf.Attributes = CONF_ENABLE_IRQ; |
285 | link->conf.IntType = INT_MEMORY_AND_IO; | 284 | link->conf.IntType = INT_MEMORY_AND_IO; |
286 | link->conf.ConfigIndex = 1; | 285 | link->conf.ConfigIndex = 1; |
@@ -338,10 +337,11 @@ static int tc574_config(struct pcmcia_device *link) | |||
338 | 337 | ||
339 | dev_dbg(&link->dev, "3c574_config()\n"); | 338 | dev_dbg(&link->dev, "3c574_config()\n"); |
340 | 339 | ||
341 | link->io.IOAddrLines = 16; | 340 | link->io_lines = 16; |
341 | |||
342 | for (i = j = 0; j < 0x400; j += 0x20) { | 342 | for (i = j = 0; j < 0x400; j += 0x20) { |
343 | link->io.BasePort1 = j ^ 0x300; | 343 | link->resource[0]->start = j ^ 0x300; |
344 | i = pcmcia_request_io(link, &link->io); | 344 | i = pcmcia_request_io(link); |
345 | if (i == 0) | 345 | if (i == 0) |
346 | break; | 346 | break; |
347 | } | 347 | } |
@@ -357,7 +357,7 @@ static int tc574_config(struct pcmcia_device *link) | |||
357 | goto failed; | 357 | goto failed; |
358 | 358 | ||
359 | dev->irq = link->irq; | 359 | dev->irq = link->irq; |
360 | dev->base_addr = link->io.BasePort1; | 360 | dev->base_addr = link->resource[0]->start; |
361 | 361 | ||
362 | ioaddr = dev->base_addr; | 362 | ioaddr = dev->base_addr; |
363 | 363 | ||
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index ce63c3773b4c..61f9cf2100ff 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/bitops.h> | 41 | #include <linux/bitops.h> |
42 | #include <linux/jiffies.h> | 42 | #include <linux/jiffies.h> |
43 | 43 | ||
44 | #include <pcmcia/cs_types.h> | ||
45 | #include <pcmcia/cs.h> | 44 | #include <pcmcia/cs.h> |
46 | #include <pcmcia/cistpl.h> | 45 | #include <pcmcia/cistpl.h> |
47 | #include <pcmcia/cisreg.h> | 46 | #include <pcmcia/cisreg.h> |
@@ -214,8 +213,8 @@ static int tc589_probe(struct pcmcia_device *link) | |||
214 | lp->p_dev = link; | 213 | lp->p_dev = link; |
215 | 214 | ||
216 | spin_lock_init(&lp->lock); | 215 | spin_lock_init(&lp->lock); |
217 | link->io.NumPorts1 = 16; | 216 | link->resource[0]->end = 16; |
218 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 217 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; |
219 | 218 | ||
220 | link->conf.Attributes = CONF_ENABLE_IRQ; | 219 | link->conf.Attributes = CONF_ENABLE_IRQ; |
221 | link->conf.IntType = INT_MEMORY_AND_IO; | 220 | link->conf.IntType = INT_MEMORY_AND_IO; |
@@ -278,12 +277,13 @@ static int tc589_config(struct pcmcia_device *link) | |||
278 | "3Com card??\n"); | 277 | "3Com card??\n"); |
279 | multi = (link->card_id == PRODID_3COM_3C562); | 278 | multi = (link->card_id == PRODID_3COM_3C562); |
280 | 279 | ||
280 | link->io_lines = 16; | ||
281 | |||
281 | /* For the 3c562, the base address must be xx00-xx7f */ | 282 | /* For the 3c562, the base address must be xx00-xx7f */ |
282 | link->io.IOAddrLines = 16; | ||
283 | for (i = j = 0; j < 0x400; j += 0x10) { | 283 | for (i = j = 0; j < 0x400; j += 0x10) { |
284 | if (multi && (j & 0x80)) continue; | 284 | if (multi && (j & 0x80)) continue; |
285 | link->io.BasePort1 = j ^ 0x300; | 285 | link->resource[0]->start = j ^ 0x300; |
286 | i = pcmcia_request_io(link, &link->io); | 286 | i = pcmcia_request_io(link); |
287 | if (i == 0) | 287 | if (i == 0) |
288 | break; | 288 | break; |
289 | } | 289 | } |
@@ -299,7 +299,7 @@ static int tc589_config(struct pcmcia_device *link) | |||
299 | goto failed; | 299 | goto failed; |
300 | 300 | ||
301 | dev->irq = link->irq; | 301 | dev->irq = link->irq; |
302 | dev->base_addr = link->io.BasePort1; | 302 | dev->base_addr = link->resource[0]->start; |
303 | ioaddr = dev->base_addr; | 303 | ioaddr = dev->base_addr; |
304 | EL3WINDOW(0); | 304 | EL3WINDOW(0); |
305 | 305 | ||
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 33525bf2a3d3..5f05ffb240cc 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/mii.h> | 39 | #include <linux/mii.h> |
40 | #include "../8390.h" | 40 | #include "../8390.h" |
41 | 41 | ||
42 | #include <pcmcia/cs_types.h> | ||
43 | #include <pcmcia/cs.h> | 42 | #include <pcmcia/cs.h> |
44 | #include <pcmcia/cistpl.h> | 43 | #include <pcmcia/cistpl.h> |
45 | #include <pcmcia/ciscode.h> | 44 | #include <pcmcia/ciscode.h> |
@@ -260,28 +259,30 @@ static int get_prom(struct pcmcia_device *link) | |||
260 | static int try_io_port(struct pcmcia_device *link) | 259 | static int try_io_port(struct pcmcia_device *link) |
261 | { | 260 | { |
262 | int j, ret; | 261 | int j, ret; |
263 | if (link->io.NumPorts1 == 32) { | 262 | link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
264 | 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; | ||
265 | /* for master/slave multifunction cards */ | 266 | /* for master/slave multifunction cards */ |
266 | if (link->io.NumPorts2 > 0) | 267 | if (link->resource[1]->end > 0) |
267 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 268 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
268 | } else { | 269 | } else { |
269 | /* This should be two 16-port windows */ | 270 | /* This should be two 16-port windows */ |
270 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 271 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
271 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; | 272 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16; |
272 | } | 273 | } |
273 | if (link->io.BasePort1 == 0) { | 274 | if (link->resource[0]->start == 0) { |
274 | link->io.IOAddrLines = 16; | ||
275 | for (j = 0; j < 0x400; j += 0x20) { | 275 | for (j = 0; j < 0x400; j += 0x20) { |
276 | link->io.BasePort1 = j ^ 0x300; | 276 | link->resource[0]->start = j ^ 0x300; |
277 | link->io.BasePort2 = (j ^ 0x300) + 0x10; | 277 | link->resource[1]->start = (j ^ 0x300) + 0x10; |
278 | ret = pcmcia_request_io(link, &link->io); | 278 | link->io_lines = 16; |
279 | ret = pcmcia_request_io(link); | ||
279 | if (ret == 0) | 280 | if (ret == 0) |
280 | return ret; | 281 | return ret; |
281 | } | 282 | } |
282 | return ret; | 283 | return ret; |
283 | } else { | 284 | } else { |
284 | return pcmcia_request_io(link, &link->io); | 285 | return pcmcia_request_io(link); |
285 | } | 286 | } |
286 | } | 287 | } |
287 | 288 | ||
@@ -302,15 +303,15 @@ static int axnet_configcheck(struct pcmcia_device *p_dev, | |||
302 | network function with window 0, and serial with window 1 */ | 303 | network function with window 0, and serial with window 1 */ |
303 | if (io->nwin > 1) { | 304 | if (io->nwin > 1) { |
304 | i = (io->win[1].len > io->win[0].len); | 305 | i = (io->win[1].len > io->win[0].len); |
305 | p_dev->io.BasePort2 = io->win[1-i].base; | 306 | p_dev->resource[1]->start = io->win[1-i].base; |
306 | p_dev->io.NumPorts2 = io->win[1-i].len; | 307 | p_dev->resource[1]->end = io->win[1-i].len; |
307 | } else { | 308 | } else { |
308 | i = p_dev->io.NumPorts2 = 0; | 309 | i = p_dev->resource[1]->end = 0; |
309 | } | 310 | } |
310 | p_dev->io.BasePort1 = io->win[i].base; | 311 | p_dev->resource[0]->start = io->win[i].base; |
311 | p_dev->io.NumPorts1 = io->win[i].len; | 312 | p_dev->resource[0]->end = io->win[i].len; |
312 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 313 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
313 | if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32) | 314 | if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32) |
314 | return try_io_port(p_dev); | 315 | return try_io_port(p_dev); |
315 | 316 | ||
316 | return -ENODEV; | 317 | return -ENODEV; |
@@ -333,7 +334,7 @@ static int axnet_config(struct pcmcia_device *link) | |||
333 | if (!link->irq) | 334 | if (!link->irq) |
334 | goto failed; | 335 | goto failed; |
335 | 336 | ||
336 | if (link->io.NumPorts2 == 8) { | 337 | if (resource_size(link->resource[1]) == 8) { |
337 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 338 | link->conf.Attributes |= CONF_ENABLE_SPKR; |
338 | link->conf.Status = CCSR_AUDIO_ENA; | 339 | link->conf.Status = CCSR_AUDIO_ENA; |
339 | } | 340 | } |
@@ -343,7 +344,7 @@ static int axnet_config(struct pcmcia_device *link) | |||
343 | goto failed; | 344 | goto failed; |
344 | 345 | ||
345 | dev->irq = link->irq; | 346 | dev->irq = link->irq; |
346 | dev->base_addr = link->io.BasePort1; | 347 | dev->base_addr = link->resource[0]->start; |
347 | 348 | ||
348 | if (!get_prom(link)) { | 349 | if (!get_prom(link)) { |
349 | printk(KERN_NOTICE "axnet_cs: this is not an AX88190 card!\n"); | 350 | printk(KERN_NOTICE "axnet_cs: this is not an AX88190 card!\n"); |
@@ -379,8 +380,7 @@ static int axnet_config(struct pcmcia_device *link) | |||
379 | /* Maybe PHY is in power down mode. (PPD_SET = 1) | 380 | /* Maybe PHY is in power down mode. (PPD_SET = 1) |
380 | Bit 2 of CCSR is active low. */ | 381 | Bit 2 of CCSR is active low. */ |
381 | if (i == 32) { | 382 | if (i == 32) { |
382 | conf_reg_t reg = { 0, CS_WRITE, CISREG_CCSR, 0x04 }; | 383 | pcmcia_write_config_byte(link, CISREG_CCSR, 0x04); |
383 | pcmcia_access_configuration_register(link, ®); | ||
384 | for (i = 0; i < 32; i++) { | 384 | for (i = 0; i < 32; i++) { |
385 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); | 385 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); |
386 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); | 386 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); |
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index 5643f94541bc..3c400cfa82ae 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <linux/arcdevice.h> | 43 | #include <linux/arcdevice.h> |
44 | #include <linux/com20020.h> | 44 | #include <linux/com20020.h> |
45 | 45 | ||
46 | #include <pcmcia/cs_types.h> | ||
47 | #include <pcmcia/cs.h> | 46 | #include <pcmcia/cs.h> |
48 | #include <pcmcia/cistpl.h> | 47 | #include <pcmcia/cistpl.h> |
49 | #include <pcmcia/ds.h> | 48 | #include <pcmcia/ds.h> |
@@ -159,9 +158,8 @@ static int com20020_probe(struct pcmcia_device *p_dev) | |||
159 | /* fill in our module parameters as defaults */ | 158 | /* fill in our module parameters as defaults */ |
160 | dev->dev_addr[0] = node; | 159 | dev->dev_addr[0] = node; |
161 | 160 | ||
162 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 161 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
163 | p_dev->io.NumPorts1 = 16; | 162 | p_dev->resource[0]->end = 16; |
164 | p_dev->io.IOAddrLines = 16; | ||
165 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; | 163 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; |
166 | p_dev->conf.IntType = INT_MEMORY_AND_IO; | 164 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
167 | 165 | ||
@@ -246,20 +244,24 @@ static int com20020_config(struct pcmcia_device *link) | |||
246 | 244 | ||
247 | dev_dbg(&link->dev, "com20020_config\n"); | 245 | dev_dbg(&link->dev, "com20020_config\n"); |
248 | 246 | ||
249 | 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 | |||
250 | i = -ENODEV; | 250 | i = -ENODEV; |
251 | if (!link->io.BasePort1) | 251 | link->io_lines = 16; |
252 | |||
253 | if (!link->resource[0]->start) | ||
252 | { | 254 | { |
253 | for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) | 255 | for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) |
254 | { | 256 | { |
255 | link->io.BasePort1 = ioaddr; | 257 | link->resource[0]->start = ioaddr; |
256 | i = pcmcia_request_io(link, &link->io); | 258 | i = pcmcia_request_io(link); |
257 | if (i == 0) | 259 | if (i == 0) |
258 | break; | 260 | break; |
259 | } | 261 | } |
260 | } | 262 | } |
261 | else | 263 | else |
262 | i = pcmcia_request_io(link, &link->io); | 264 | i = pcmcia_request_io(link); |
263 | 265 | ||
264 | if (i != 0) | 266 | if (i != 0) |
265 | { | 267 | { |
@@ -267,7 +269,7 @@ static int com20020_config(struct pcmcia_device *link) | |||
267 | goto failed; | 269 | goto failed; |
268 | } | 270 | } |
269 | 271 | ||
270 | ioaddr = dev->base_addr = link->io.BasePort1; | 272 | ioaddr = dev->base_addr = link->resource[0]->start; |
271 | dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); | 273 | dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); |
272 | 274 | ||
273 | dev_dbg(&link->dev, "request IRQ %d\n", | 275 | dev_dbg(&link->dev, "request IRQ %d\n", |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 7c27c50211a5..98fffb03ecd7 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -49,7 +49,6 @@ | |||
49 | #include <linux/ioport.h> | 49 | #include <linux/ioport.h> |
50 | #include <linux/crc32.h> | 50 | #include <linux/crc32.h> |
51 | 51 | ||
52 | #include <pcmcia/cs_types.h> | ||
53 | #include <pcmcia/cs.h> | 52 | #include <pcmcia/cs.h> |
54 | #include <pcmcia/cistpl.h> | 53 | #include <pcmcia/cistpl.h> |
55 | #include <pcmcia/ciscode.h> | 54 | #include <pcmcia/ciscode.h> |
@@ -249,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link) | |||
249 | lp->base = NULL; | 248 | lp->base = NULL; |
250 | 249 | ||
251 | /* The io structure describes IO port mapping */ | 250 | /* The io structure describes IO port mapping */ |
252 | link->io.NumPorts1 = 32; | 251 | link->resource[0]->end = 32; |
253 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 252 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
254 | link->io.IOAddrLines = 5; | ||
255 | 253 | ||
256 | /* General socket configuration */ | 254 | /* General socket configuration */ |
257 | link->conf.Attributes = CONF_ENABLE_IRQ; | 255 | link->conf.Attributes = CONF_ENABLE_IRQ; |
@@ -289,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link) | |||
289 | { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 287 | { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
290 | 288 | ||
291 | for (i = 0; i < 5; i++) { | 289 | for (i = 0; i < 5; i++) { |
292 | link->io.BasePort2 = serial_base[i]; | 290 | link->resource[1]->start = serial_base[i]; |
293 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 291 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
294 | if (link->io.BasePort2 == 0) { | 292 | if (link->resource[1]->start == 0) { |
295 | link->io.NumPorts2 = 0; | 293 | link->resource[1]->end = 0; |
296 | printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); | 294 | printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); |
297 | } | 295 | } |
298 | ret = pcmcia_request_io(link, &link->io); | 296 | ret = pcmcia_request_io(link); |
299 | if (ret == 0) | 297 | if (ret == 0) |
300 | return ret; | 298 | return ret; |
301 | } | 299 | } |
@@ -311,12 +309,12 @@ static int ungermann_try_io_port(struct pcmcia_device *link) | |||
311 | 0x380,0x3c0 only for ioport. | 309 | 0x380,0x3c0 only for ioport. |
312 | */ | 310 | */ |
313 | for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { | 311 | for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { |
314 | link->io.BasePort1 = ioaddr; | 312 | link->resource[0]->start = ioaddr; |
315 | ret = pcmcia_request_io(link, &link->io); | 313 | ret = pcmcia_request_io(link); |
316 | if (ret == 0) { | 314 | if (ret == 0) { |
317 | /* calculate ConfigIndex value */ | 315 | /* calculate ConfigIndex value */ |
318 | link->conf.ConfigIndex = | 316 | link->conf.ConfigIndex = |
319 | ((link->io.BasePort1 & 0x0f0) >> 3) | 0x22; | 317 | ((link->resource[0]->start & 0x0f0) >> 3) | 0x22; |
320 | return ret; | 318 | return ret; |
321 | } | 319 | } |
322 | } | 320 | } |
@@ -346,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
346 | 344 | ||
347 | dev_dbg(&link->dev, "fmvj18x_config\n"); | 345 | dev_dbg(&link->dev, "fmvj18x_config\n"); |
348 | 346 | ||
347 | link->io_lines = 5; | ||
348 | |||
349 | len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); | 349 | len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); |
350 | kfree(buf); | 350 | kfree(buf); |
351 | 351 | ||
@@ -364,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
364 | /* MultiFunction Card */ | 364 | /* MultiFunction Card */ |
365 | link->conf.ConfigBase = 0x800; | 365 | link->conf.ConfigBase = 0x800; |
366 | link->conf.ConfigIndex = 0x47; | 366 | link->conf.ConfigIndex = 0x47; |
367 | link->io.NumPorts2 = 8; | 367 | link->resource[1]->end = 8; |
368 | } | 368 | } |
369 | break; | 369 | break; |
370 | case MANFID_NEC: | 370 | case MANFID_NEC: |
371 | cardtype = NEC; /* MultiFunction Card */ | 371 | cardtype = NEC; /* MultiFunction Card */ |
372 | link->conf.ConfigBase = 0x800; | 372 | link->conf.ConfigBase = 0x800; |
373 | link->conf.ConfigIndex = 0x47; | 373 | link->conf.ConfigIndex = 0x47; |
374 | link->io.NumPorts2 = 8; | 374 | link->resource[1]->end = 8; |
375 | break; | 375 | break; |
376 | case MANFID_KME: | 376 | case MANFID_KME: |
377 | cardtype = KME; /* MultiFunction Card */ | 377 | cardtype = KME; /* MultiFunction Card */ |
378 | link->conf.ConfigBase = 0x800; | 378 | link->conf.ConfigBase = 0x800; |
379 | link->conf.ConfigIndex = 0x47; | 379 | link->conf.ConfigIndex = 0x47; |
380 | link->io.NumPorts2 = 8; | 380 | link->resource[1]->end = 8; |
381 | break; | 381 | break; |
382 | case MANFID_CONTEC: | 382 | case MANFID_CONTEC: |
383 | cardtype = CONTEC; | 383 | cardtype = CONTEC; |
@@ -418,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||
421 | if (link->io.NumPorts2 != 0) { | 421 | if (link->resource[1]->end != 0) { |
422 | ret = mfc_try_io_port(link); | 422 | ret = mfc_try_io_port(link); |
423 | if (ret != 0) goto failed; | 423 | if (ret != 0) goto failed; |
424 | } else if (cardtype == UNGERMANN) { | 424 | } else if (cardtype == UNGERMANN) { |
425 | ret = ungermann_try_io_port(link); | 425 | ret = ungermann_try_io_port(link); |
426 | if (ret != 0) goto failed; | 426 | if (ret != 0) goto failed; |
427 | } else { | 427 | } else { |
428 | ret = pcmcia_request_io(link, &link->io); | 428 | ret = pcmcia_request_io(link); |
429 | if (ret) | 429 | if (ret) |
430 | goto failed; | 430 | goto failed; |
431 | } | 431 | } |
@@ -437,9 +437,9 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
437 | goto failed; | 437 | goto failed; |
438 | 438 | ||
439 | dev->irq = link->irq; | 439 | dev->irq = link->irq; |
440 | dev->base_addr = link->io.BasePort1; | 440 | dev->base_addr = link->resource[0]->start; |
441 | 441 | ||
442 | if (link->io.BasePort2 != 0) { | 442 | if (resource_size(link->resource[1]) != 0) { |
443 | ret = fmvj18x_setup_mfc(link); | 443 | ret = fmvj18x_setup_mfc(link); |
444 | if (ret != 0) goto failed; | 444 | if (ret != 0) goto failed; |
445 | } | 445 | } |
@@ -545,7 +545,6 @@ failed: | |||
545 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | 545 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) |
546 | { | 546 | { |
547 | win_req_t req; | 547 | win_req_t req; |
548 | memreq_t mem; | ||
549 | u_char __iomem *base; | 548 | u_char __iomem *base; |
550 | int i, j; | 549 | int i, j; |
551 | 550 | ||
@@ -558,9 +557,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
558 | return -1; | 557 | return -1; |
559 | 558 | ||
560 | base = ioremap(req.Base, req.Size); | 559 | base = ioremap(req.Base, req.Size); |
561 | mem.Page = 0; | 560 | pcmcia_map_mem_page(link, link->win, 0); |
562 | mem.CardOffset = 0; | ||
563 | pcmcia_map_mem_page(link, link->win, &mem); | ||
564 | 561 | ||
565 | /* | 562 | /* |
566 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format | 563 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format |
@@ -594,7 +591,6 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
594 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) | 591 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) |
595 | { | 592 | { |
596 | win_req_t req; | 593 | win_req_t req; |
597 | memreq_t mem; | ||
598 | int i; | 594 | int i; |
599 | struct net_device *dev = link->priv; | 595 | struct net_device *dev = link->priv; |
600 | unsigned int ioaddr; | 596 | unsigned int ioaddr; |
@@ -614,9 +610,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
614 | return -1; | 610 | return -1; |
615 | } | 611 | } |
616 | 612 | ||
617 | mem.Page = 0; | 613 | i = pcmcia_map_mem_page(link, link->win, 0); |
618 | mem.CardOffset = 0; | ||
619 | i = pcmcia_map_mem_page(link, link->win, &mem); | ||
620 | if (i != 0) { | 614 | if (i != 0) { |
621 | iounmap(lp->base); | 615 | iounmap(lp->base); |
622 | lp->base = NULL; | 616 | lp->base = NULL; |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 67ee9851a8ed..b0d06a3d962f 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -57,7 +57,6 @@ | |||
57 | #include <linux/trdevice.h> | 57 | #include <linux/trdevice.h> |
58 | #include <linux/ibmtr.h> | 58 | #include <linux/ibmtr.h> |
59 | 59 | ||
60 | #include <pcmcia/cs_types.h> | ||
61 | #include <pcmcia/cs.h> | 60 | #include <pcmcia/cs.h> |
62 | #include <pcmcia/cistpl.h> | 61 | #include <pcmcia/cistpl.h> |
63 | #include <pcmcia/ds.h> | 62 | #include <pcmcia/ds.h> |
@@ -152,9 +151,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) | |||
152 | link->priv = info; | 151 | link->priv = info; |
153 | info->ti = netdev_priv(dev); | 152 | info->ti = netdev_priv(dev); |
154 | 153 | ||
155 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 154 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
156 | link->io.NumPorts1 = 4; | 155 | link->resource[0]->end = 4; |
157 | link->io.IOAddrLines = 16; | ||
158 | link->conf.Attributes = CONF_ENABLE_IRQ; | 156 | link->conf.Attributes = CONF_ENABLE_IRQ; |
159 | link->conf.IntType = INT_MEMORY_AND_IO; | 157 | link->conf.IntType = INT_MEMORY_AND_IO; |
160 | link->conf.Present = PRESENT_OPTION; | 158 | link->conf.Present = PRESENT_OPTION; |
@@ -213,26 +211,26 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
213 | struct net_device *dev = info->dev; | 211 | struct net_device *dev = info->dev; |
214 | struct tok_info *ti = netdev_priv(dev); | 212 | struct tok_info *ti = netdev_priv(dev); |
215 | win_req_t req; | 213 | win_req_t req; |
216 | memreq_t mem; | ||
217 | int i, ret; | 214 | int i, ret; |
218 | 215 | ||
219 | dev_dbg(&link->dev, "ibmtr_config\n"); | 216 | dev_dbg(&link->dev, "ibmtr_config\n"); |
220 | 217 | ||
221 | link->conf.ConfigIndex = 0x61; | 218 | link->conf.ConfigIndex = 0x61; |
219 | link->io_lines = 16; | ||
222 | 220 | ||
223 | /* Determine if this is PRIMARY or ALTERNATE. */ | 221 | /* Determine if this is PRIMARY or ALTERNATE. */ |
224 | 222 | ||
225 | /* Try PRIMARY card at 0xA20-0xA23 */ | 223 | /* Try PRIMARY card at 0xA20-0xA23 */ |
226 | link->io.BasePort1 = 0xA20; | 224 | link->resource[0]->start = 0xA20; |
227 | i = pcmcia_request_io(link, &link->io); | 225 | i = pcmcia_request_io(link); |
228 | if (i != 0) { | 226 | if (i != 0) { |
229 | /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ | 227 | /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ |
230 | link->io.BasePort1 = 0xA24; | 228 | link->resource[0]->start = 0xA24; |
231 | ret = pcmcia_request_io(link, &link->io); | 229 | ret = pcmcia_request_io(link); |
232 | if (ret) | 230 | if (ret) |
233 | goto failed; | 231 | goto failed; |
234 | } | 232 | } |
235 | dev->base_addr = link->io.BasePort1; | 233 | dev->base_addr = link->resource[0]->start; |
236 | 234 | ||
237 | ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt); | 235 | ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt); |
238 | if (ret) | 236 | if (ret) |
@@ -251,9 +249,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
251 | if (ret) | 249 | if (ret) |
252 | goto failed; | 250 | goto failed; |
253 | 251 | ||
254 | mem.CardOffset = mmiobase; | 252 | ret = pcmcia_map_mem_page(link, link->win, mmiobase); |
255 | mem.Page = 0; | ||
256 | ret = pcmcia_map_mem_page(link, link->win, &mem); | ||
257 | if (ret) | 253 | if (ret) |
258 | goto failed; | 254 | goto failed; |
259 | ti->mmio = ioremap(req.Base, req.Size); | 255 | ti->mmio = ioremap(req.Base, req.Size); |
@@ -268,13 +264,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
268 | if (ret) | 264 | if (ret) |
269 | goto failed; | 265 | goto failed; |
270 | 266 | ||
271 | mem.CardOffset = srambase; | 267 | ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase); |
272 | mem.Page = 0; | ||
273 | ret = pcmcia_map_mem_page(link, info->sram_win_handle, &mem); | ||
274 | if (ret) | 268 | if (ret) |
275 | goto failed; | 269 | goto failed; |
276 | 270 | ||
277 | ti->sram_base = mem.CardOffset >> 12; | 271 | ti->sram_base = srambase >> 12; |
278 | ti->sram_virt = ioremap(req.Base, req.Size); | 272 | ti->sram_virt = ioremap(req.Base, req.Size); |
279 | ti->sram_phys = req.Base; | 273 | ti->sram_phys = req.Base; |
280 | 274 | ||
@@ -325,7 +319,6 @@ static void ibmtr_release(struct pcmcia_device *link) | |||
325 | if (link->win) { | 319 | if (link->win) { |
326 | struct tok_info *ti = netdev_priv(dev); | 320 | struct tok_info *ti = netdev_priv(dev); |
327 | iounmap(ti->mmio); | 321 | iounmap(ti->mmio); |
328 | pcmcia_release_window(link, info->sram_win_handle); | ||
329 | } | 322 | } |
330 | pcmcia_disable_device(link); | 323 | pcmcia_disable_device(link); |
331 | } | 324 | } |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 9b63dec549cb..68f2deeb3ade 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -146,7 +146,6 @@ Include Files | |||
146 | #include <linux/ioport.h> | 146 | #include <linux/ioport.h> |
147 | #include <linux/bitops.h> | 147 | #include <linux/bitops.h> |
148 | 148 | ||
149 | #include <pcmcia/cs_types.h> | ||
150 | #include <pcmcia/cs.h> | 149 | #include <pcmcia/cs.h> |
151 | #include <pcmcia/cisreg.h> | 150 | #include <pcmcia/cisreg.h> |
152 | #include <pcmcia/cistpl.h> | 151 | #include <pcmcia/cistpl.h> |
@@ -459,9 +458,8 @@ static int nmclan_probe(struct pcmcia_device *link) | |||
459 | link->priv = dev; | 458 | link->priv = dev; |
460 | 459 | ||
461 | spin_lock_init(&lp->bank_lock); | 460 | spin_lock_init(&lp->bank_lock); |
462 | link->io.NumPorts1 = 32; | 461 | link->resource[0]->end = 32; |
463 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 462 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
464 | link->io.IOAddrLines = 5; | ||
465 | link->conf.Attributes = CONF_ENABLE_IRQ; | 463 | link->conf.Attributes = CONF_ENABLE_IRQ; |
466 | link->conf.IntType = INT_MEMORY_AND_IO; | 464 | link->conf.IntType = INT_MEMORY_AND_IO; |
467 | link->conf.ConfigIndex = 1; | 465 | link->conf.ConfigIndex = 1; |
@@ -645,7 +643,8 @@ static int nmclan_config(struct pcmcia_device *link) | |||
645 | 643 | ||
646 | dev_dbg(&link->dev, "nmclan_config\n"); | 644 | dev_dbg(&link->dev, "nmclan_config\n"); |
647 | 645 | ||
648 | ret = pcmcia_request_io(link, &link->io); | 646 | link->io_lines = 5; |
647 | ret = pcmcia_request_io(link); | ||
649 | if (ret) | 648 | if (ret) |
650 | goto failed; | 649 | goto failed; |
651 | ret = pcmcia_request_exclusive_irq(link, mace_interrupt); | 650 | ret = pcmcia_request_exclusive_irq(link, mace_interrupt); |
@@ -656,7 +655,7 @@ static int nmclan_config(struct pcmcia_device *link) | |||
656 | goto failed; | 655 | goto failed; |
657 | 656 | ||
658 | dev->irq = link->irq; | 657 | dev->irq = link->irq; |
659 | dev->base_addr = link->io.BasePort1; | 658 | dev->base_addr = link->resource[0]->start; |
660 | 659 | ||
661 | ioaddr = dev->base_addr; | 660 | ioaddr = dev->base_addr; |
662 | 661 | ||
@@ -758,29 +757,20 @@ static void nmclan_reset(struct net_device *dev) | |||
758 | 757 | ||
759 | #if RESET_XILINX | 758 | #if RESET_XILINX |
760 | struct pcmcia_device *link = &lp->link; | 759 | struct pcmcia_device *link = &lp->link; |
761 | conf_reg_t reg; | 760 | u8 OrigCorValue; |
762 | u_long OrigCorValue; | ||
763 | 761 | ||
764 | /* Save original COR value */ | 762 | /* Save original COR value */ |
765 | reg.Function = 0; | 763 | pcmcia_read_config_byte(link, CISREG_COR, &OrigCorValue); |
766 | reg.Action = CS_READ; | ||
767 | reg.Offset = CISREG_COR; | ||
768 | reg.Value = 0; | ||
769 | pcmcia_access_configuration_register(link, ®); | ||
770 | OrigCorValue = reg.Value; | ||
771 | 764 | ||
772 | /* Reset Xilinx */ | 765 | /* Reset Xilinx */ |
773 | reg.Action = CS_WRITE; | 766 | dev_dbg(&link->dev, "nmclan_reset: OrigCorValue=0x%x, resetting...\n", |
774 | reg.Offset = CISREG_COR; | ||
775 | dev_dbg(&link->dev, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n", | ||
776 | OrigCorValue); | 767 | OrigCorValue); |
777 | reg.Value = COR_SOFT_RESET; | 768 | pcmcia_write_config_byte(link, CISREG_COR, COR_SOFT_RESET); |
778 | pcmcia_access_configuration_register(link, ®); | ||
779 | /* Need to wait for 20 ms for PCMCIA to finish reset. */ | 769 | /* Need to wait for 20 ms for PCMCIA to finish reset. */ |
780 | 770 | ||
781 | /* Restore original COR configuration index */ | 771 | /* Restore original COR configuration index */ |
782 | reg.Value = COR_LEVEL_REQ | (OrigCorValue & COR_CONFIG_MASK); | 772 | pcmcia_write_config_byte(link, CISREG_COR, |
783 | pcmcia_access_configuration_register(link, ®); | 773 | (COR_LEVEL_REQ | (OrigCorValue & COR_CONFIG_MASK))); |
784 | /* Xilinx is now completely reset along with the MACE chip. */ | 774 | /* Xilinx is now completely reset along with the MACE chip. */ |
785 | lp->tx_free_frames=AM2150_MAX_TX_FRAMES; | 775 | lp->tx_free_frames=AM2150_MAX_TX_FRAMES; |
786 | 776 | ||
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index bfdef72c5d5e..c3edfe4c2651 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <linux/mii.h> | 42 | #include <linux/mii.h> |
43 | #include "../8390.h" | 43 | #include "../8390.h" |
44 | 44 | ||
45 | #include <pcmcia/cs_types.h> | ||
46 | #include <pcmcia/cs.h> | 45 | #include <pcmcia/cs.h> |
47 | #include <pcmcia/cistpl.h> | 46 | #include <pcmcia/cistpl.h> |
48 | #include <pcmcia/ciscode.h> | 47 | #include <pcmcia/ciscode.h> |
@@ -113,8 +112,6 @@ static int setup_dma_config(struct pcmcia_device *link, int start_pg, | |||
113 | 112 | ||
114 | static void pcnet_detach(struct pcmcia_device *p_dev); | 113 | static void pcnet_detach(struct pcmcia_device *p_dev); |
115 | 114 | ||
116 | static dev_info_t dev_info = "pcnet_cs"; | ||
117 | |||
118 | /*====================================================================*/ | 115 | /*====================================================================*/ |
119 | 116 | ||
120 | typedef struct hw_info_t { | 117 | typedef struct hw_info_t { |
@@ -304,7 +301,6 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) | |||
304 | { | 301 | { |
305 | struct net_device *dev = link->priv; | 302 | struct net_device *dev = link->priv; |
306 | win_req_t req; | 303 | win_req_t req; |
307 | memreq_t mem; | ||
308 | u_char __iomem *base, *virt; | 304 | u_char __iomem *base, *virt; |
309 | int i, j; | 305 | int i, j; |
310 | 306 | ||
@@ -317,10 +313,8 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) | |||
317 | return NULL; | 313 | return NULL; |
318 | 314 | ||
319 | virt = ioremap(req.Base, req.Size); | 315 | virt = ioremap(req.Base, req.Size); |
320 | mem.Page = 0; | ||
321 | for (i = 0; i < NR_INFO; i++) { | 316 | for (i = 0; i < NR_INFO; i++) { |
322 | mem.CardOffset = hw_info[i].offset & ~(req.Size-1); | 317 | pcmcia_map_mem_page(link, link->win, hw_info[i].offset & ~(req.Size-1)); |
323 | pcmcia_map_mem_page(link, link->win, &mem); | ||
324 | base = &virt[hw_info[i].offset & (req.Size-1)]; | 318 | base = &virt[hw_info[i].offset & (req.Size-1)]; |
325 | if ((readb(base+0) == hw_info[i].a0) && | 319 | if ((readb(base+0) == hw_info[i].a0) && |
326 | (readb(base+2) == hw_info[i].a1) && | 320 | (readb(base+2) == hw_info[i].a1) && |
@@ -480,29 +474,31 @@ static hw_info_t *get_hwired(struct pcmcia_device *link) | |||
480 | static int try_io_port(struct pcmcia_device *link) | 474 | static int try_io_port(struct pcmcia_device *link) |
481 | { | 475 | { |
482 | int j, ret; | 476 | int j, ret; |
483 | if (link->io.NumPorts1 == 32) { | 477 | link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
484 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 478 | link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH; |
485 | if (link->io.NumPorts2 > 0) { | 479 | if (link->resource[0]->end == 32) { |
480 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; | ||
481 | if (link->resource[1]->end > 0) { | ||
486 | /* for master/slave multifunction cards */ | 482 | /* for master/slave multifunction cards */ |
487 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 483 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
488 | } | 484 | } |
489 | } else { | 485 | } else { |
490 | /* This should be two 16-port windows */ | 486 | /* This should be two 16-port windows */ |
491 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 487 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
492 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; | 488 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16; |
493 | } | 489 | } |
494 | if (link->io.BasePort1 == 0) { | 490 | if (link->resource[0]->start == 0) { |
495 | link->io.IOAddrLines = 16; | ||
496 | for (j = 0; j < 0x400; j += 0x20) { | 491 | for (j = 0; j < 0x400; j += 0x20) { |
497 | link->io.BasePort1 = j ^ 0x300; | 492 | link->resource[0]->start = j ^ 0x300; |
498 | link->io.BasePort2 = (j ^ 0x300) + 0x10; | 493 | link->resource[1]->start = (j ^ 0x300) + 0x10; |
499 | ret = pcmcia_request_io(link, &link->io); | 494 | link->io_lines = 16; |
495 | ret = pcmcia_request_io(link); | ||
500 | if (ret == 0) | 496 | if (ret == 0) |
501 | return ret; | 497 | return ret; |
502 | } | 498 | } |
503 | return ret; | 499 | return ret; |
504 | } else { | 500 | } else { |
505 | return pcmcia_request_io(link, &link->io); | 501 | return pcmcia_request_io(link); |
506 | } | 502 | } |
507 | } | 503 | } |
508 | 504 | ||
@@ -523,18 +519,18 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev, | |||
523 | network function with window 0, and serial with window 1 */ | 519 | network function with window 0, and serial with window 1 */ |
524 | if (io->nwin > 1) { | 520 | if (io->nwin > 1) { |
525 | i = (io->win[1].len > io->win[0].len); | 521 | i = (io->win[1].len > io->win[0].len); |
526 | p_dev->io.BasePort2 = io->win[1-i].base; | 522 | p_dev->resource[1]->start = io->win[1-i].base; |
527 | p_dev->io.NumPorts2 = io->win[1-i].len; | 523 | p_dev->resource[1]->end = io->win[1-i].len; |
528 | } else { | 524 | } else { |
529 | i = p_dev->io.NumPorts2 = 0; | 525 | i = p_dev->resource[1]->end = 0; |
530 | } | 526 | } |
531 | 527 | ||
532 | *has_shmem = ((cfg->mem.nwin == 1) && | 528 | *has_shmem = ((cfg->mem.nwin == 1) && |
533 | (cfg->mem.win[0].len >= 0x4000)); | 529 | (cfg->mem.win[0].len >= 0x4000)); |
534 | p_dev->io.BasePort1 = io->win[i].base; | 530 | p_dev->resource[0]->start = io->win[i].base; |
535 | p_dev->io.NumPorts1 = io->win[i].len; | 531 | p_dev->resource[0]->end = io->win[i].len; |
536 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 532 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
537 | if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32) | 533 | if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32) |
538 | return try_io_port(p_dev); | 534 | return try_io_port(p_dev); |
539 | 535 | ||
540 | return 0; | 536 | return 0; |
@@ -557,7 +553,7 @@ static int pcnet_config(struct pcmcia_device *link) | |||
557 | if (!link->irq) | 553 | if (!link->irq) |
558 | goto failed; | 554 | goto failed; |
559 | 555 | ||
560 | if (link->io.NumPorts2 == 8) { | 556 | if (resource_size(link->resource[1]) == 8) { |
561 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 557 | link->conf.Attributes |= CONF_ENABLE_SPKR; |
562 | link->conf.Status = CCSR_AUDIO_ENA; | 558 | link->conf.Status = CCSR_AUDIO_ENA; |
563 | } | 559 | } |
@@ -569,7 +565,7 @@ static int pcnet_config(struct pcmcia_device *link) | |||
569 | if (ret) | 565 | if (ret) |
570 | goto failed; | 566 | goto failed; |
571 | dev->irq = link->irq; | 567 | dev->irq = link->irq; |
572 | dev->base_addr = link->io.BasePort1; | 568 | dev->base_addr = link->resource[0]->start; |
573 | if (info->flags & HAS_MISC_REG) { | 569 | if (info->flags & HAS_MISC_REG) { |
574 | if ((if_port == 1) || (if_port == 2)) | 570 | if ((if_port == 1) || (if_port == 2)) |
575 | dev->if_port = if_port; | 571 | dev->if_port = if_port; |
@@ -956,7 +952,7 @@ static int pcnet_open(struct net_device *dev) | |||
956 | set_misc_reg(dev); | 952 | set_misc_reg(dev); |
957 | 953 | ||
958 | outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */ | 954 | outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */ |
959 | ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev); | 955 | ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev->name, dev); |
960 | if (ret) | 956 | if (ret) |
961 | return ret; | 957 | return ret; |
962 | 958 | ||
@@ -1464,7 +1460,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1464 | struct net_device *dev = link->priv; | 1460 | struct net_device *dev = link->priv; |
1465 | pcnet_dev_t *info = PRIV(dev); | 1461 | pcnet_dev_t *info = PRIV(dev); |
1466 | win_req_t req; | 1462 | win_req_t req; |
1467 | memreq_t mem; | ||
1468 | int i, window_size, offset, ret; | 1463 | int i, window_size, offset, ret; |
1469 | 1464 | ||
1470 | window_size = (stop_pg - start_pg) << 8; | 1465 | window_size = (stop_pg - start_pg) << 8; |
@@ -1483,11 +1478,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1483 | if (ret) | 1478 | if (ret) |
1484 | goto failed; | 1479 | goto failed; |
1485 | 1480 | ||
1486 | mem.CardOffset = (start_pg << 8) + cm_offset; | 1481 | offset = (start_pg << 8) + cm_offset; |
1487 | offset = mem.CardOffset % window_size; | 1482 | offset -= offset % window_size; |
1488 | mem.CardOffset -= offset; | 1483 | ret = pcmcia_map_mem_page(link, link->win, offset); |
1489 | mem.Page = 0; | ||
1490 | ret = pcmcia_map_mem_page(link, link->win, &mem); | ||
1491 | if (ret) | 1484 | if (ret) |
1492 | goto failed; | 1485 | goto failed; |
1493 | 1486 | ||
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 307cd1721e91..377367d03b41 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <linux/jiffies.h> | 44 | #include <linux/jiffies.h> |
45 | #include <linux/firmware.h> | 45 | #include <linux/firmware.h> |
46 | 46 | ||
47 | #include <pcmcia/cs_types.h> | ||
48 | #include <pcmcia/cs.h> | 47 | #include <pcmcia/cs.h> |
49 | #include <pcmcia/cistpl.h> | 48 | #include <pcmcia/cistpl.h> |
50 | #include <pcmcia/cisreg.h> | 49 | #include <pcmcia/cisreg.h> |
@@ -325,9 +324,8 @@ static int smc91c92_probe(struct pcmcia_device *link) | |||
325 | link->priv = dev; | 324 | link->priv = dev; |
326 | 325 | ||
327 | spin_lock_init(&smc->lock); | 326 | spin_lock_init(&smc->lock); |
328 | link->io.NumPorts1 = 16; | 327 | link->resource[0]->end = 16; |
329 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 328 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
330 | link->io.IOAddrLines = 4; | ||
331 | link->conf.Attributes = CONF_ENABLE_IRQ; | 329 | link->conf.Attributes = CONF_ENABLE_IRQ; |
332 | link->conf.IntType = INT_MEMORY_AND_IO; | 330 | link->conf.IntType = INT_MEMORY_AND_IO; |
333 | 331 | ||
@@ -428,12 +426,13 @@ static int mhz_mfc_config_check(struct pcmcia_device *p_dev, | |||
428 | void *priv_data) | 426 | void *priv_data) |
429 | { | 427 | { |
430 | int k; | 428 | int k; |
431 | p_dev->io.BasePort2 = cf->io.win[0].base; | 429 | p_dev->resource[1]->start = cf->io.win[0].base; |
432 | for (k = 0; k < 0x400; k += 0x10) { | 430 | for (k = 0; k < 0x400; k += 0x10) { |
433 | if (k & 0x80) | 431 | if (k & 0x80) |
434 | continue; | 432 | continue; |
435 | p_dev->io.BasePort1 = k ^ 0x300; | 433 | p_dev->resource[0]->start = k ^ 0x300; |
436 | if (!pcmcia_request_io(p_dev, &p_dev->io)) | 434 | p_dev->io_lines = 16; |
435 | if (!pcmcia_request_io(p_dev)) | ||
437 | return 0; | 436 | return 0; |
438 | } | 437 | } |
439 | return -ENODEV; | 438 | return -ENODEV; |
@@ -444,21 +443,20 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
444 | struct net_device *dev = link->priv; | 443 | struct net_device *dev = link->priv; |
445 | struct smc_private *smc = netdev_priv(dev); | 444 | struct smc_private *smc = netdev_priv(dev); |
446 | win_req_t req; | 445 | win_req_t req; |
447 | memreq_t mem; | 446 | unsigned int offset; |
448 | int i; | 447 | int i; |
449 | 448 | ||
450 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 449 | link->conf.Attributes |= CONF_ENABLE_SPKR; |
451 | link->conf.Status = CCSR_AUDIO_ENA; | 450 | link->conf.Status = CCSR_AUDIO_ENA; |
452 | link->io.IOAddrLines = 16; | 451 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
453 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 452 | link->resource[1]->end = 8; |
454 | link->io.NumPorts2 = 8; | ||
455 | 453 | ||
456 | /* The Megahertz combo cards have modem-like CIS entries, so | 454 | /* The Megahertz combo cards have modem-like CIS entries, so |
457 | we have to explicitly try a bunch of port combinations. */ | 455 | we have to explicitly try a bunch of port combinations. */ |
458 | if (pcmcia_loop_config(link, mhz_mfc_config_check, NULL)) | 456 | if (pcmcia_loop_config(link, mhz_mfc_config_check, NULL)) |
459 | return -ENODEV; | 457 | return -ENODEV; |
460 | 458 | ||
461 | dev->base_addr = link->io.BasePort1; | 459 | dev->base_addr = link->resource[0]->start; |
462 | 460 | ||
463 | /* Allocate a memory window, for accessing the ISR */ | 461 | /* Allocate a memory window, for accessing the ISR */ |
464 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 462 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
@@ -469,11 +467,8 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
469 | return -ENODEV; | 467 | return -ENODEV; |
470 | 468 | ||
471 | smc->base = ioremap(req.Base, req.Size); | 469 | smc->base = ioremap(req.Base, req.Size); |
472 | mem.CardOffset = mem.Page = 0; | 470 | offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; |
473 | if (smc->manfid == MANFID_MOTOROLA) | 471 | i = pcmcia_map_mem_page(link, link->win, offset); |
474 | mem.CardOffset = link->conf.ConfigBase; | ||
475 | i = pcmcia_map_mem_page(link, link->win, &mem); | ||
476 | |||
477 | if ((i == 0) && | 472 | if ((i == 0) && |
478 | (smc->manfid == MANFID_MEGAHERTZ) && | 473 | (smc->manfid == MANFID_MEGAHERTZ) && |
479 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) | 474 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) |
@@ -546,7 +541,7 @@ static void mot_config(struct pcmcia_device *link) | |||
546 | struct net_device *dev = link->priv; | 541 | struct net_device *dev = link->priv; |
547 | struct smc_private *smc = netdev_priv(dev); | 542 | struct smc_private *smc = netdev_priv(dev); |
548 | unsigned int ioaddr = dev->base_addr; | 543 | unsigned int ioaddr = dev->base_addr; |
549 | unsigned int iouart = link->io.BasePort2; | 544 | unsigned int iouart = link->resource[1]->start; |
550 | 545 | ||
551 | /* Set UART base address and force map with COR bit 1 */ | 546 | /* Set UART base address and force map with COR bit 1 */ |
552 | writeb(iouart & 0xff, smc->base + MOT_UART + CISREG_IOBASE_0); | 547 | writeb(iouart & 0xff, smc->base + MOT_UART + CISREG_IOBASE_0); |
@@ -602,9 +597,9 @@ static int smc_configcheck(struct pcmcia_device *p_dev, | |||
602 | unsigned int vcc, | 597 | unsigned int vcc, |
603 | void *priv_data) | 598 | void *priv_data) |
604 | { | 599 | { |
605 | p_dev->io.BasePort1 = cf->io.win[0].base; | 600 | p_dev->resource[0]->start = cf->io.win[0].base; |
606 | p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; | 601 | p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK; |
607 | return pcmcia_request_io(p_dev, &p_dev->io); | 602 | return pcmcia_request_io(p_dev); |
608 | } | 603 | } |
609 | 604 | ||
610 | static int smc_config(struct pcmcia_device *link) | 605 | static int smc_config(struct pcmcia_device *link) |
@@ -612,10 +607,10 @@ static int smc_config(struct pcmcia_device *link) | |||
612 | struct net_device *dev = link->priv; | 607 | struct net_device *dev = link->priv; |
613 | int i; | 608 | int i; |
614 | 609 | ||
615 | link->io.NumPorts1 = 16; | 610 | link->resource[0]->end = 16; |
616 | i = pcmcia_loop_config(link, smc_configcheck, NULL); | 611 | i = pcmcia_loop_config(link, smc_configcheck, NULL); |
617 | if (!i) | 612 | if (!i) |
618 | dev->base_addr = link->io.BasePort1; | 613 | dev->base_addr = link->resource[0]->start; |
619 | 614 | ||
620 | return i; | 615 | return i; |
621 | } | 616 | } |
@@ -647,27 +642,27 @@ static int osi_config(struct pcmcia_device *link) | |||
647 | 642 | ||
648 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 643 | link->conf.Attributes |= CONF_ENABLE_SPKR; |
649 | link->conf.Status = CCSR_AUDIO_ENA; | 644 | link->conf.Status = CCSR_AUDIO_ENA; |
650 | link->io.NumPorts1 = 64; | 645 | link->resource[0]->end = 64; |
651 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 646 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
652 | link->io.NumPorts2 = 8; | 647 | link->resource[1]->end = 8; |
653 | link->io.IOAddrLines = 16; | ||
654 | 648 | ||
655 | /* Enable Hard Decode, LAN, Modem */ | 649 | /* Enable Hard Decode, LAN, Modem */ |
656 | link->conf.ConfigIndex = 0x23; | 650 | link->conf.ConfigIndex = 0x23; |
651 | link->io_lines = 16; | ||
657 | 652 | ||
658 | for (i = j = 0; j < 4; j++) { | 653 | for (i = j = 0; j < 4; j++) { |
659 | link->io.BasePort2 = com[j]; | 654 | link->resource[1]->start = com[j]; |
660 | i = pcmcia_request_io(link, &link->io); | 655 | i = pcmcia_request_io(link); |
661 | if (i == 0) | 656 | if (i == 0) |
662 | break; | 657 | break; |
663 | } | 658 | } |
664 | if (i != 0) { | 659 | if (i != 0) { |
665 | /* Fallback: turn off hard decode */ | 660 | /* Fallback: turn off hard decode */ |
666 | link->conf.ConfigIndex = 0x03; | 661 | link->conf.ConfigIndex = 0x03; |
667 | link->io.NumPorts2 = 0; | 662 | link->resource[1]->end = 0; |
668 | i = pcmcia_request_io(link, &link->io); | 663 | i = pcmcia_request_io(link); |
669 | } | 664 | } |
670 | dev->base_addr = link->io.BasePort1 + 0x10; | 665 | dev->base_addr = link->resource[0]->start + 0x10; |
671 | return i; | 666 | return i; |
672 | } | 667 | } |
673 | 668 | ||
@@ -684,7 +679,7 @@ static int osi_load_firmware(struct pcmcia_device *link) | |||
684 | 679 | ||
685 | /* Download the Seven of Diamonds firmware */ | 680 | /* Download the Seven of Diamonds firmware */ |
686 | for (i = 0; i < fw->size; i++) { | 681 | for (i = 0; i < fw->size; i++) { |
687 | outb(fw->data[i], link->io.BasePort1 + 2); | 682 | outb(fw->data[i], link->resource[0]->start + 2); |
688 | udelay(50); | 683 | udelay(50); |
689 | } | 684 | } |
690 | release_firmware(fw); | 685 | release_firmware(fw); |
@@ -726,12 +721,12 @@ static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid) | |||
726 | return rc; | 721 | return rc; |
727 | } else if (manfid == MANFID_OSITECH) { | 722 | } else if (manfid == MANFID_OSITECH) { |
728 | /* Make sure both functions are powered up */ | 723 | /* Make sure both functions are powered up */ |
729 | set_bits(0x300, link->io.BasePort1 + OSITECH_AUI_PWR); | 724 | set_bits(0x300, link->resource[0]->start + OSITECH_AUI_PWR); |
730 | /* Now, turn on the interrupt for both card functions */ | 725 | /* Now, turn on the interrupt for both card functions */ |
731 | set_bits(0x300, link->io.BasePort1 + OSITECH_RESET_ISR); | 726 | set_bits(0x300, link->resource[0]->start + OSITECH_RESET_ISR); |
732 | dev_dbg(&link->dev, "AUI/PWR: %4.4x RESET/ISR: %4.4x\n", | 727 | dev_dbg(&link->dev, "AUI/PWR: %4.4x RESET/ISR: %4.4x\n", |
733 | inw(link->io.BasePort1 + OSITECH_AUI_PWR), | 728 | inw(link->resource[0]->start + OSITECH_AUI_PWR), |
734 | inw(link->io.BasePort1 + OSITECH_RESET_ISR)); | 729 | inw(link->resource[0]->start + OSITECH_RESET_ISR)); |
735 | } | 730 | } |
736 | return 0; | 731 | return 0; |
737 | } | 732 | } |
@@ -804,7 +799,7 @@ static int check_sig(struct pcmcia_device *link) | |||
804 | } | 799 | } |
805 | 800 | ||
806 | /* Try setting bus width */ | 801 | /* Try setting bus width */ |
807 | width = (link->io.Attributes1 == IO_DATA_PATH_WIDTH_AUTO); | 802 | width = (link->resource[0]->flags == IO_DATA_PATH_WIDTH_AUTO); |
808 | s = inb(ioaddr + CONFIG); | 803 | s = inb(ioaddr + CONFIG); |
809 | if (width) | 804 | if (width) |
810 | s |= CFG_16BIT; | 805 | s |= CFG_16BIT; |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index b6c3644888cd..4eb6f986703b 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -82,7 +82,6 @@ | |||
82 | #include <linux/bitops.h> | 82 | #include <linux/bitops.h> |
83 | #include <linux/mii.h> | 83 | #include <linux/mii.h> |
84 | 84 | ||
85 | #include <pcmcia/cs_types.h> | ||
86 | #include <pcmcia/cs.h> | 85 | #include <pcmcia/cs.h> |
87 | #include <pcmcia/cistpl.h> | 86 | #include <pcmcia/cistpl.h> |
88 | #include <pcmcia/cisreg.h> | 87 | #include <pcmcia/cisreg.h> |
@@ -678,9 +677,9 @@ xirc2ps_config_modem(struct pcmcia_device *p_dev, | |||
678 | 677 | ||
679 | 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) { |
680 | for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { | 679 | for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { |
681 | p_dev->io.BasePort2 = cf->io.win[0].base; | 680 | p_dev->resource[1]->start = cf->io.win[0].base; |
682 | p_dev->io.BasePort1 = ioaddr; | 681 | p_dev->resource[0]->start = ioaddr; |
683 | if (!pcmcia_request_io(p_dev, &p_dev->io)) | 682 | if (!pcmcia_request_io(p_dev)) |
684 | return 0; | 683 | return 0; |
685 | } | 684 | } |
686 | } | 685 | } |
@@ -697,11 +696,11 @@ xirc2ps_config_check(struct pcmcia_device *p_dev, | |||
697 | int *pass = priv_data; | 696 | int *pass = priv_data; |
698 | 697 | ||
699 | 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) { |
700 | p_dev->io.BasePort2 = cf->io.win[0].base; | 699 | p_dev->resource[1]->start = cf->io.win[0].base; |
701 | p_dev->io.BasePort1 = p_dev->io.BasePort2 | 700 | p_dev->resource[0]->start = p_dev->resource[1]->start |
702 | + (*pass ? (cf->index & 0x20 ? -24:8) | 701 | + (*pass ? (cf->index & 0x20 ? -24:8) |
703 | : (cf->index & 0x20 ? 8:-24)); | 702 | : (cf->index & 0x20 ? 8:-24)); |
704 | if (!pcmcia_request_io(p_dev, &p_dev->io)) | 703 | if (!pcmcia_request_io(p_dev)) |
705 | return 0; | 704 | return 0; |
706 | } | 705 | } |
707 | return -ENODEV; | 706 | return -ENODEV; |
@@ -808,8 +807,7 @@ xirc2ps_config(struct pcmcia_device * link) | |||
808 | goto failure; | 807 | goto failure; |
809 | } | 808 | } |
810 | 809 | ||
811 | link->io.IOAddrLines =10; | 810 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; |
812 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | ||
813 | if (local->modem) { | 811 | if (local->modem) { |
814 | int pass; | 812 | int pass; |
815 | 813 | ||
@@ -817,16 +815,16 @@ xirc2ps_config(struct pcmcia_device * link) | |||
817 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 815 | link->conf.Attributes |= CONF_ENABLE_SPKR; |
818 | link->conf.Status |= CCSR_AUDIO_ENA; | 816 | link->conf.Status |= CCSR_AUDIO_ENA; |
819 | } | 817 | } |
820 | link->io.NumPorts2 = 8; | 818 | link->resource[1]->end = 8; |
821 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 819 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
822 | if (local->dingo) { | 820 | if (local->dingo) { |
823 | /* 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 |
824 | * Ethernet port */ | 822 | * Ethernet port */ |
825 | link->io.NumPorts1 = 16; /* no Mako stuff anymore */ | 823 | link->resource[0]->end = 16; /* no Mako stuff anymore */ |
826 | if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL)) | 824 | if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL)) |
827 | goto port_found; | 825 | goto port_found; |
828 | } else { | 826 | } else { |
829 | link->io.NumPorts1 = 18; | 827 | link->resource[0]->end = 18; |
830 | /* 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 |
831 | * the second tries again, thereby considering that the 32 ports are | 829 | * the second tries again, thereby considering that the 32 ports are |
832 | * mirrored every 32 bytes. Actually we use a mirrored port for | 830 | * mirrored every 32 bytes. Actually we use a mirrored port for |
@@ -841,14 +839,15 @@ xirc2ps_config(struct pcmcia_device * link) | |||
841 | } | 839 | } |
842 | printk(KNOT_XIRC "no ports available\n"); | 840 | printk(KNOT_XIRC "no ports available\n"); |
843 | } else { | 841 | } else { |
844 | link->io.NumPorts1 = 16; | 842 | link->io_lines = 10; |
843 | link->resource[0]->end = 16; | ||
845 | for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { | 844 | for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { |
846 | link->io.BasePort1 = ioaddr; | 845 | link->resource[0]->start = ioaddr; |
847 | if (!(err=pcmcia_request_io(link, &link->io))) | 846 | if (!(err = pcmcia_request_io(link))) |
848 | goto port_found; | 847 | goto port_found; |
849 | } | 848 | } |
850 | link->io.BasePort1 = 0; /* let CS decide */ | 849 | link->resource[0]->start = 0; /* let CS decide */ |
851 | if ((err=pcmcia_request_io(link, &link->io))) | 850 | if ((err = pcmcia_request_io(link))) |
852 | goto config_error; | 851 | goto config_error; |
853 | } | 852 | } |
854 | port_found: | 853 | port_found: |
@@ -870,24 +869,21 @@ xirc2ps_config(struct pcmcia_device * link) | |||
870 | goto config_error; | 869 | goto config_error; |
871 | 870 | ||
872 | if (local->dingo) { | 871 | if (local->dingo) { |
873 | conf_reg_t reg; | ||
874 | win_req_t req; | 872 | win_req_t req; |
875 | memreq_t mem; | ||
876 | 873 | ||
877 | /* Reset the modem's BAR to the correct value | 874 | /* Reset the modem's BAR to the correct value |
878 | * This is necessary because in the RequestConfiguration call, | 875 | * This is necessary because in the RequestConfiguration call, |
879 | * the base address of the ethernet port (BasePort1) is written | 876 | * the base address of the ethernet port (BasePort1) is written |
880 | * to the BAR registers of the modem. | 877 | * to the BAR registers of the modem. |
881 | */ | 878 | */ |
882 | reg.Action = CS_WRITE; | 879 | err = pcmcia_write_config_byte(link, CISREG_IOBASE_0, (u8) |
883 | reg.Offset = CISREG_IOBASE_0; | 880 | link->resource[1]->start & 0xff); |
884 | reg.Value = link->io.BasePort2 & 0xff; | 881 | if (err) |
885 | if ((err = pcmcia_access_configuration_register(link, ®))) | ||
886 | goto config_error; | 882 | goto config_error; |
887 | reg.Action = CS_WRITE; | 883 | |
888 | reg.Offset = CISREG_IOBASE_1; | 884 | err = pcmcia_write_config_byte(link, CISREG_IOBASE_1, |
889 | reg.Value = (link->io.BasePort2 >> 8) & 0xff; | 885 | (link->resource[1]->start >> 8) & 0xff); |
890 | if ((err = pcmcia_access_configuration_register(link, ®))) | 886 | if (err) |
891 | goto config_error; | 887 | goto config_error; |
892 | 888 | ||
893 | /* There is no config entry for the Ethernet part which | 889 | /* There is no config entry for the Ethernet part which |
@@ -901,16 +897,14 @@ xirc2ps_config(struct pcmcia_device * link) | |||
901 | goto config_error; | 897 | goto config_error; |
902 | 898 | ||
903 | local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; | 899 | local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; |
904 | mem.CardOffset = 0x0; | 900 | if ((err = pcmcia_map_mem_page(link, link->win, 0))) |
905 | mem.Page = 0; | ||
906 | if ((err = pcmcia_map_mem_page(link, link->win, &mem))) | ||
907 | goto config_error; | 901 | goto config_error; |
908 | 902 | ||
909 | /* Setup the CCRs; there are no infos in the CIS about the Ethernet | 903 | /* Setup the CCRs; there are no infos in the CIS about the Ethernet |
910 | * part. | 904 | * part. |
911 | */ | 905 | */ |
912 | writeb(0x47, local->dingo_ccr + CISREG_COR); | 906 | writeb(0x47, local->dingo_ccr + CISREG_COR); |
913 | ioaddr = link->io.BasePort1; | 907 | ioaddr = link->resource[0]->start; |
914 | writeb(ioaddr & 0xff , local->dingo_ccr + CISREG_IOBASE_0); | 908 | writeb(ioaddr & 0xff , local->dingo_ccr + CISREG_IOBASE_0); |
915 | writeb((ioaddr >> 8)&0xff , local->dingo_ccr + CISREG_IOBASE_1); | 909 | writeb((ioaddr >> 8)&0xff , local->dingo_ccr + CISREG_IOBASE_1); |
916 | 910 | ||
@@ -957,7 +951,7 @@ xirc2ps_config(struct pcmcia_device * link) | |||
957 | 951 | ||
958 | /* we can now register the device with the net subsystem */ | 952 | /* we can now register the device with the net subsystem */ |
959 | dev->irq = link->irq; | 953 | dev->irq = link->irq; |
960 | dev->base_addr = link->io.BasePort1; | 954 | dev->base_addr = link->resource[0]->start; |
961 | 955 | ||
962 | if (local->dingo) | 956 | if (local->dingo) |
963 | do_reset(dev, 1); /* a kludge to make the cem56 work */ | 957 | do_reset(dev, 1); /* a kludge to make the cem56 work */ |
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 33bdc6a84e81..9a121a5b787c 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
33 | #include <linux/netdevice.h> | 33 | #include <linux/netdevice.h> |
34 | 34 | ||
35 | #include <pcmcia/cs_types.h> | ||
36 | #include <pcmcia/cs.h> | 35 | #include <pcmcia/cs.h> |
37 | #include <pcmcia/cistpl.h> | 36 | #include <pcmcia/cistpl.h> |
38 | #include <pcmcia/cisreg.h> | 37 | #include <pcmcia/cisreg.h> |
@@ -155,8 +154,6 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, | |||
155 | unsigned int vcc, | 154 | unsigned int vcc, |
156 | void *priv_data) | 155 | void *priv_data) |
157 | { | 156 | { |
158 | win_req_t *req = priv_data; | ||
159 | |||
160 | if (cfg->index == 0) | 157 | if (cfg->index == 0) |
161 | return -ENODEV; | 158 | return -ENODEV; |
162 | 159 | ||
@@ -176,52 +173,25 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, | |||
176 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 173 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
177 | 174 | ||
178 | /* IO window settings */ | 175 | /* IO window settings */ |
179 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 176 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
180 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 177 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
181 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 178 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
182 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 179 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
183 | if (!(io->flags & CISTPL_IO_8BIT)) | 180 | p_dev->resource[0]->flags |= |
184 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 181 | pcmcia_io_cfg_data_width(io->flags); |
185 | if (!(io->flags & CISTPL_IO_16BIT)) | 182 | p_dev->resource[0]->start = io->win[0].base; |
186 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 183 | p_dev->resource[0]->end = io->win[0].len; |
187 | p_dev->io.BasePort1 = io->win[0].base; | ||
188 | p_dev->io.NumPorts1 = io->win[0].len; | ||
189 | if (io->nwin > 1) { | 184 | if (io->nwin > 1) { |
190 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 185 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
191 | p_dev->io.BasePort2 = io->win[1].base; | 186 | p_dev->resource[1]->start = io->win[1].base; |
192 | p_dev->io.NumPorts2 = io->win[1].len; | 187 | p_dev->resource[1]->end = io->win[1].len; |
193 | } | 188 | } |
194 | } | 189 | } |
195 | 190 | ||
196 | /* This reserves IO space but doesn't actually enable it */ | 191 | /* This reserves IO space but doesn't actually enable it */ |
197 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) | 192 | if (pcmcia_request_io(p_dev) != 0) |
198 | return -ENODEV; | 193 | return -ENODEV; |
199 | 194 | ||
200 | /* | ||
201 | Now set up a common memory window, if needed. There is room | ||
202 | in the struct pcmcia_device structure for one memory window handle, | ||
203 | but if the base addresses need to be saved, or if multiple | ||
204 | windows are needed, the info should go in the private data | ||
205 | structure for this device. | ||
206 | |||
207 | Note that the memory window base is a physical address, and | ||
208 | needs to be mapped to virtual space with ioremap() before it | ||
209 | is used. | ||
210 | */ | ||
211 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
212 | cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
213 | memreq_t map; | ||
214 | req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; | ||
215 | req->Base = mem->win[0].host_addr; | ||
216 | req->Size = mem->win[0].len; | ||
217 | req->AccessSpeed = 0; | ||
218 | if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) | ||
219 | return -ENODEV; | ||
220 | map.Page = 0; | ||
221 | map.CardOffset = mem->win[0].card_addr; | ||
222 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) | ||
223 | return -ENODEV; | ||
224 | } | ||
225 | /* If we got this far, we're cool! */ | 195 | /* If we got this far, we're cool! */ |
226 | return 0; | 196 | return 0; |
227 | } | 197 | } |
@@ -230,17 +200,12 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, | |||
230 | static int airo_config(struct pcmcia_device *link) | 200 | static int airo_config(struct pcmcia_device *link) |
231 | { | 201 | { |
232 | local_info_t *dev; | 202 | local_info_t *dev; |
233 | win_req_t *req; | ||
234 | int ret; | 203 | int ret; |
235 | 204 | ||
236 | dev = link->priv; | 205 | dev = link->priv; |
237 | 206 | ||
238 | dev_dbg(&link->dev, "airo_config\n"); | 207 | dev_dbg(&link->dev, "airo_config\n"); |
239 | 208 | ||
240 | req = kzalloc(sizeof(win_req_t), GFP_KERNEL); | ||
241 | if (!req) | ||
242 | return -ENOMEM; | ||
243 | |||
244 | /* | 209 | /* |
245 | * In this loop, we scan the CIS for configuration table | 210 | * In this loop, we scan the CIS for configuration table |
246 | * entries, each of which describes a valid card | 211 | * entries, each of which describes a valid card |
@@ -255,7 +220,7 @@ static int airo_config(struct pcmcia_device *link) | |||
255 | * and most client drivers will only use the CIS to fill in | 220 | * and most client drivers will only use the CIS to fill in |
256 | * implementation-defined details. | 221 | * implementation-defined details. |
257 | */ | 222 | */ |
258 | ret = pcmcia_loop_config(link, airo_cs_config_check, req); | 223 | ret = pcmcia_loop_config(link, airo_cs_config_check, NULL); |
259 | if (ret) | 224 | if (ret) |
260 | goto failed; | 225 | goto failed; |
261 | 226 | ||
@@ -272,7 +237,7 @@ static int airo_config(struct pcmcia_device *link) | |||
272 | goto failed; | 237 | goto failed; |
273 | ((local_info_t *)link->priv)->eth_dev = | 238 | ((local_info_t *)link->priv)->eth_dev = |
274 | init_airo_card(link->irq, | 239 | init_airo_card(link->irq, |
275 | link->io.BasePort1, 1, &link->dev); | 240 | link->resource[0]->start, 1, &link->dev); |
276 | if (!((local_info_t *)link->priv)->eth_dev) | 241 | if (!((local_info_t *)link->priv)->eth_dev) |
277 | goto failed; | 242 | goto failed; |
278 | 243 | ||
@@ -282,22 +247,15 @@ static int airo_config(struct pcmcia_device *link) | |||
282 | if (link->conf.Vpp) | 247 | if (link->conf.Vpp) |
283 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); | 248 | printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); |
284 | printk(", irq %d", link->irq); | 249 | printk(", irq %d", link->irq); |
285 | if (link->io.NumPorts1) | 250 | if (link->resource[0]) |
286 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 251 | printk(" & %pR", link->resource[0]); |
287 | link->io.BasePort1+link->io.NumPorts1-1); | 252 | if (link->resource[1]) |
288 | if (link->io.NumPorts2) | 253 | printk(" & %pR", link->resource[1]); |
289 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
290 | link->io.BasePort2+link->io.NumPorts2-1); | ||
291 | if (link->win) | ||
292 | printk(", mem 0x%06lx-0x%06lx", req->Base, | ||
293 | req->Base+req->Size-1); | ||
294 | printk("\n"); | 254 | printk("\n"); |
295 | kfree(req); | ||
296 | return 0; | 255 | return 0; |
297 | 256 | ||
298 | failed: | 257 | failed: |
299 | airo_release(link); | 258 | airo_release(link); |
300 | kfree(req); | ||
301 | return -ENODEV; | 259 | return -ENODEV; |
302 | } /* airo_config */ | 260 | } /* airo_config */ |
303 | 261 | ||
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index c2746fc7f2be..3b632161c106 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <linux/moduleparam.h> | 42 | #include <linux/moduleparam.h> |
43 | #include <linux/device.h> | 43 | #include <linux/device.h> |
44 | 44 | ||
45 | #include <pcmcia/cs_types.h> | ||
46 | #include <pcmcia/cs.h> | 45 | #include <pcmcia/cs.h> |
47 | #include <pcmcia/cistpl.h> | 46 | #include <pcmcia/cistpl.h> |
48 | #include <pcmcia/cisreg.h> | 47 | #include <pcmcia/cisreg.h> |
@@ -191,25 +190,23 @@ static int atmel_config_check(struct pcmcia_device *p_dev, | |||
191 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 190 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
192 | 191 | ||
193 | /* IO window settings */ | 192 | /* IO window settings */ |
194 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 193 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
195 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 194 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
196 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 195 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
197 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 196 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
198 | if (!(io->flags & CISTPL_IO_8BIT)) | 197 | p_dev->resource[0]->flags |= |
199 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 198 | pcmcia_io_cfg_data_width(io->flags); |
200 | if (!(io->flags & CISTPL_IO_16BIT)) | 199 | p_dev->resource[0]->start = io->win[0].base; |
201 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 200 | p_dev->resource[0]->end = io->win[0].len; |
202 | p_dev->io.BasePort1 = io->win[0].base; | ||
203 | p_dev->io.NumPorts1 = io->win[0].len; | ||
204 | if (io->nwin > 1) { | 201 | if (io->nwin > 1) { |
205 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 202 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
206 | p_dev->io.BasePort2 = io->win[1].base; | 203 | p_dev->resource[1]->start = io->win[1].base; |
207 | p_dev->io.NumPorts2 = io->win[1].len; | 204 | p_dev->resource[1]->end = io->win[1].len; |
208 | } | 205 | } |
209 | } | 206 | } |
210 | 207 | ||
211 | /* This reserves IO space but doesn't actually enable it */ | 208 | /* This reserves IO space but doesn't actually enable it */ |
212 | return pcmcia_request_io(p_dev, &p_dev->io); | 209 | return pcmcia_request_io(p_dev); |
213 | } | 210 | } |
214 | 211 | ||
215 | static int atmel_config(struct pcmcia_device *link) | 212 | static int atmel_config(struct pcmcia_device *link) |
@@ -254,7 +251,7 @@ static int atmel_config(struct pcmcia_device *link) | |||
254 | 251 | ||
255 | ((local_info_t*)link->priv)->eth_dev = | 252 | ((local_info_t*)link->priv)->eth_dev = |
256 | init_atmel_card(link->irq, | 253 | init_atmel_card(link->irq, |
257 | link->io.BasePort1, | 254 | link->resource[0]->start, |
258 | did ? did->driver_info : ATMEL_FW_TYPE_NONE, | 255 | did ? did->driver_info : ATMEL_FW_TYPE_NONE, |
259 | &link->dev, | 256 | &link->dev, |
260 | card_present, | 257 | card_present, |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index 0e99b634267c..dfbc41d431ff 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/ssb/ssb.h> | 26 | #include <linux/ssb/ssb.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | 28 | ||
29 | #include <pcmcia/cs_types.h> | ||
30 | #include <pcmcia/cs.h> | 29 | #include <pcmcia/cs.h> |
31 | #include <pcmcia/cistpl.h> | 30 | #include <pcmcia/cistpl.h> |
32 | #include <pcmcia/ciscode.h> | 31 | #include <pcmcia/ciscode.h> |
@@ -65,7 +64,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
65 | { | 64 | { |
66 | struct ssb_bus *ssb; | 65 | struct ssb_bus *ssb; |
67 | win_req_t win; | 66 | win_req_t win; |
68 | memreq_t mem; | ||
69 | int err = -ENOMEM; | 67 | int err = -ENOMEM; |
70 | int res = 0; | 68 | int res = 0; |
71 | 69 | ||
@@ -78,12 +76,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
78 | dev->conf.Attributes = CONF_ENABLE_IRQ; | 76 | dev->conf.Attributes = CONF_ENABLE_IRQ; |
79 | dev->conf.IntType = INT_MEMORY_AND_IO; | 77 | dev->conf.IntType = INT_MEMORY_AND_IO; |
80 | 78 | ||
81 | dev->io.BasePort2 = 0; | 79 | win.Attributes = WIN_ENABLE | WIN_DATA_WIDTH_16 | |
82 | dev->io.NumPorts2 = 0; | ||
83 | dev->io.Attributes2 = 0; | ||
84 | |||
85 | win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM | | ||
86 | WIN_ENABLE | WIN_DATA_WIDTH_16 | | ||
87 | WIN_USE_WAIT; | 80 | WIN_USE_WAIT; |
88 | win.Base = 0; | 81 | win.Base = 0; |
89 | win.Size = SSB_CORE_SIZE; | 82 | win.Size = SSB_CORE_SIZE; |
@@ -92,9 +85,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
92 | if (res != 0) | 85 | if (res != 0) |
93 | goto err_kfree_ssb; | 86 | goto err_kfree_ssb; |
94 | 87 | ||
95 | mem.CardOffset = 0; | 88 | res = pcmcia_map_mem_page(dev, dev->win, 0); |
96 | mem.Page = 0; | ||
97 | res = pcmcia_map_mem_page(dev, dev->win, &mem); | ||
98 | if (res != 0) | 89 | if (res != 0) |
99 | goto err_disable; | 90 | goto err_disable; |
100 | 91 | ||
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 29b31a694b59..ba54d1b04d22 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/wireless.h> | 12 | #include <linux/wireless.h> |
13 | #include <net/iw_handler.h> | 13 | #include <net/iw_handler.h> |
14 | 14 | ||
15 | #include <pcmcia/cs_types.h> | ||
16 | #include <pcmcia/cs.h> | 15 | #include <pcmcia/cs.h> |
17 | #include <pcmcia/cistpl.h> | 16 | #include <pcmcia/cistpl.h> |
18 | #include <pcmcia/cisreg.h> | 17 | #include <pcmcia/cisreg.h> |
@@ -23,7 +22,7 @@ | |||
23 | #include "hostap_wlan.h" | 22 | #include "hostap_wlan.h" |
24 | 23 | ||
25 | 24 | ||
26 | static dev_info_t dev_info = "hostap_cs"; | 25 | static char *dev_info = "hostap_cs"; |
27 | 26 | ||
28 | MODULE_AUTHOR("Jouni Malinen"); | 27 | MODULE_AUTHOR("Jouni Malinen"); |
29 | MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN " | 28 | MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN " |
@@ -225,27 +224,18 @@ static int prism2_pccard_card_present(local_info_t *local) | |||
225 | static void sandisk_set_iobase(local_info_t *local) | 224 | static void sandisk_set_iobase(local_info_t *local) |
226 | { | 225 | { |
227 | int res; | 226 | int res; |
228 | conf_reg_t reg; | ||
229 | struct hostap_cs_priv *hw_priv = local->hw_priv; | 227 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
230 | 228 | ||
231 | reg.Function = 0; | 229 | res = pcmcia_write_config_byte(hw_priv->link, 0x10, |
232 | reg.Action = CS_WRITE; | 230 | hw_priv->link->resource[0]->start & 0x00ff); |
233 | reg.Offset = 0x10; /* 0x3f0 IO base 1 */ | ||
234 | reg.Value = hw_priv->link->io.BasePort1 & 0x00ff; | ||
235 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
236 | ®); | ||
237 | if (res != 0) { | 231 | if (res != 0) { |
238 | printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 0 -" | 232 | printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 0 -" |
239 | " res=%d\n", res); | 233 | " res=%d\n", res); |
240 | } | 234 | } |
241 | udelay(10); | 235 | udelay(10); |
242 | 236 | ||
243 | reg.Function = 0; | 237 | res = pcmcia_write_config_byte(hw_priv->link, 0x12, |
244 | reg.Action = CS_WRITE; | 238 | (hw_priv->link->resource[0]->start >> 8) & 0x00ff); |
245 | reg.Offset = 0x12; /* 0x3f2 IO base 2 */ | ||
246 | reg.Value = (hw_priv->link->io.BasePort1 & 0xff00) >> 8; | ||
247 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
248 | ®); | ||
249 | if (res != 0) { | 239 | if (res != 0) { |
250 | printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 1 -" | 240 | printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 1 -" |
251 | " res=%d\n", res); | 241 | " res=%d\n", res); |
@@ -271,12 +261,11 @@ static void sandisk_write_hcr(local_info_t *local, int hcr) | |||
271 | static int sandisk_enable_wireless(struct net_device *dev) | 261 | static int sandisk_enable_wireless(struct net_device *dev) |
272 | { | 262 | { |
273 | int res, ret = 0; | 263 | int res, ret = 0; |
274 | conf_reg_t reg; | ||
275 | struct hostap_interface *iface = netdev_priv(dev); | 264 | struct hostap_interface *iface = netdev_priv(dev); |
276 | local_info_t *local = iface->local; | 265 | local_info_t *local = iface->local; |
277 | struct hostap_cs_priv *hw_priv = local->hw_priv; | 266 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
278 | 267 | ||
279 | if (hw_priv->link->io.NumPorts1 < 0x42) { | 268 | if (resource_size(hw_priv->link->resource[0]) < 0x42) { |
280 | /* Not enough ports to be SanDisk multi-function card */ | 269 | /* Not enough ports to be SanDisk multi-function card */ |
281 | ret = -ENODEV; | 270 | ret = -ENODEV; |
282 | goto done; | 271 | goto done; |
@@ -298,12 +287,8 @@ static int sandisk_enable_wireless(struct net_device *dev) | |||
298 | " - using vendor-specific initialization\n", dev->name); | 287 | " - using vendor-specific initialization\n", dev->name); |
299 | hw_priv->sandisk_connectplus = 1; | 288 | hw_priv->sandisk_connectplus = 1; |
300 | 289 | ||
301 | reg.Function = 0; | 290 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
302 | reg.Action = CS_WRITE; | 291 | COR_SOFT_RESET); |
303 | reg.Offset = CISREG_COR; | ||
304 | reg.Value = COR_SOFT_RESET; | ||
305 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
306 | ®); | ||
307 | if (res != 0) { | 292 | if (res != 0) { |
308 | printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", | 293 | printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", |
309 | dev->name, res); | 294 | dev->name, res); |
@@ -311,16 +296,13 @@ static int sandisk_enable_wireless(struct net_device *dev) | |||
311 | } | 296 | } |
312 | mdelay(5); | 297 | mdelay(5); |
313 | 298 | ||
314 | reg.Function = 0; | ||
315 | reg.Action = CS_WRITE; | ||
316 | reg.Offset = CISREG_COR; | ||
317 | /* | 299 | /* |
318 | * Do not enable interrupts here to avoid some bogus events. Interrupts | 300 | * Do not enable interrupts here to avoid some bogus events. Interrupts |
319 | * will be enabled during the first cor_sreset call. | 301 | * will be enabled during the first cor_sreset call. |
320 | */ | 302 | */ |
321 | reg.Value = COR_LEVEL_REQ | 0x8 | COR_ADDR_DECODE | COR_FUNC_ENA; | 303 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
322 | res = pcmcia_access_configuration_register(hw_priv->link, | 304 | (COR_LEVEL_REQ | 0x8 | COR_ADDR_DECODE | |
323 | ®); | 305 | COR_FUNC_ENA)); |
324 | if (res != 0) { | 306 | if (res != 0) { |
325 | printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", | 307 | printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", |
326 | dev->name, res); | 308 | dev->name, res); |
@@ -343,30 +325,23 @@ done: | |||
343 | static void prism2_pccard_cor_sreset(local_info_t *local) | 325 | static void prism2_pccard_cor_sreset(local_info_t *local) |
344 | { | 326 | { |
345 | int res; | 327 | int res; |
346 | conf_reg_t reg; | 328 | u8 val; |
347 | struct hostap_cs_priv *hw_priv = local->hw_priv; | 329 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
348 | 330 | ||
349 | if (!prism2_pccard_card_present(local)) | 331 | if (!prism2_pccard_card_present(local)) |
350 | return; | 332 | return; |
351 | 333 | ||
352 | reg.Function = 0; | 334 | res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &val); |
353 | reg.Action = CS_READ; | ||
354 | reg.Offset = CISREG_COR; | ||
355 | reg.Value = 0; | ||
356 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
357 | ®); | ||
358 | if (res != 0) { | 335 | if (res != 0) { |
359 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 1 (%d)\n", | 336 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 1 (%d)\n", |
360 | res); | 337 | res); |
361 | return; | 338 | return; |
362 | } | 339 | } |
363 | printk(KERN_DEBUG "prism2_pccard_cor_sreset: original COR %02x\n", | 340 | printk(KERN_DEBUG "prism2_pccard_cor_sreset: original COR %02x\n", |
364 | reg.Value); | 341 | val); |
365 | 342 | ||
366 | reg.Action = CS_WRITE; | 343 | val |= COR_SOFT_RESET; |
367 | reg.Value |= COR_SOFT_RESET; | 344 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); |
368 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
369 | ®); | ||
370 | if (res != 0) { | 345 | if (res != 0) { |
371 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 2 (%d)\n", | 346 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 2 (%d)\n", |
372 | res); | 347 | res); |
@@ -375,11 +350,10 @@ static void prism2_pccard_cor_sreset(local_info_t *local) | |||
375 | 350 | ||
376 | mdelay(hw_priv->sandisk_connectplus ? 5 : 2); | 351 | mdelay(hw_priv->sandisk_connectplus ? 5 : 2); |
377 | 352 | ||
378 | reg.Value &= ~COR_SOFT_RESET; | 353 | val &= ~COR_SOFT_RESET; |
379 | if (hw_priv->sandisk_connectplus) | 354 | if (hw_priv->sandisk_connectplus) |
380 | reg.Value |= COR_IREQ_ENA; | 355 | val |= COR_IREQ_ENA; |
381 | res = pcmcia_access_configuration_register(hw_priv->link, | 356 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); |
382 | ®); | ||
383 | if (res != 0) { | 357 | if (res != 0) { |
384 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 3 (%d)\n", | 358 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 3 (%d)\n", |
385 | res); | 359 | res); |
@@ -396,8 +370,7 @@ static void prism2_pccard_cor_sreset(local_info_t *local) | |||
396 | static void prism2_pccard_genesis_reset(local_info_t *local, int hcr) | 370 | static void prism2_pccard_genesis_reset(local_info_t *local, int hcr) |
397 | { | 371 | { |
398 | int res; | 372 | int res; |
399 | conf_reg_t reg; | 373 | u8 old_cor; |
400 | int old_cor; | ||
401 | struct hostap_cs_priv *hw_priv = local->hw_priv; | 374 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
402 | 375 | ||
403 | if (!prism2_pccard_card_present(local)) | 376 | if (!prism2_pccard_card_present(local)) |
@@ -408,25 +381,17 @@ static void prism2_pccard_genesis_reset(local_info_t *local, int hcr) | |||
408 | return; | 381 | return; |
409 | } | 382 | } |
410 | 383 | ||
411 | reg.Function = 0; | 384 | res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &old_cor); |
412 | reg.Action = CS_READ; | ||
413 | reg.Offset = CISREG_COR; | ||
414 | reg.Value = 0; | ||
415 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
416 | ®); | ||
417 | if (res != 0) { | 385 | if (res != 0) { |
418 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 1 " | 386 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 1 " |
419 | "(%d)\n", res); | 387 | "(%d)\n", res); |
420 | return; | 388 | return; |
421 | } | 389 | } |
422 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset: original COR %02x\n", | 390 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset: original COR %02x\n", |
423 | reg.Value); | 391 | old_cor); |
424 | old_cor = reg.Value; | ||
425 | 392 | ||
426 | reg.Action = CS_WRITE; | 393 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
427 | reg.Value |= COR_SOFT_RESET; | 394 | old_cor | COR_SOFT_RESET); |
428 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
429 | ®); | ||
430 | if (res != 0) { | 395 | if (res != 0) { |
431 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 2 " | 396 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 2 " |
432 | "(%d)\n", res); | 397 | "(%d)\n", res); |
@@ -436,11 +401,7 @@ static void prism2_pccard_genesis_reset(local_info_t *local, int hcr) | |||
436 | mdelay(10); | 401 | mdelay(10); |
437 | 402 | ||
438 | /* Setup Genesis mode */ | 403 | /* Setup Genesis mode */ |
439 | reg.Action = CS_WRITE; | 404 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_CCSR, hcr); |
440 | reg.Value = hcr; | ||
441 | reg.Offset = CISREG_CCSR; | ||
442 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
443 | ®); | ||
444 | if (res != 0) { | 405 | if (res != 0) { |
445 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 3 " | 406 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 3 " |
446 | "(%d)\n", res); | 407 | "(%d)\n", res); |
@@ -448,11 +409,8 @@ static void prism2_pccard_genesis_reset(local_info_t *local, int hcr) | |||
448 | } | 409 | } |
449 | mdelay(10); | 410 | mdelay(10); |
450 | 411 | ||
451 | reg.Action = CS_WRITE; | 412 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
452 | reg.Offset = CISREG_COR; | 413 | old_cor & ~COR_SOFT_RESET); |
453 | reg.Value = old_cor & ~COR_SOFT_RESET; | ||
454 | res = pcmcia_access_configuration_register(hw_priv->link, | ||
455 | ®); | ||
456 | if (res != 0) { | 414 | if (res != 0) { |
457 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 4 " | 415 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 4 " |
458 | "(%d)\n", res); | 416 | "(%d)\n", res); |
@@ -561,30 +519,24 @@ static int prism2_config_check(struct pcmcia_device *p_dev, | |||
561 | PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " | 519 | PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " |
562 | "dflt->io.nwin=%d\n", | 520 | "dflt->io.nwin=%d\n", |
563 | cfg->io.nwin, dflt->io.nwin); | 521 | cfg->io.nwin, dflt->io.nwin); |
564 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 522 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
565 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 523 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
566 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 524 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
567 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 525 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
568 | PDEBUG(DEBUG_EXTRA, "io->flags = 0x%04X, " | 526 | p_dev->resource[0]->flags |= |
569 | "io.base=0x%04x, len=%d\n", io->flags, | 527 | pcmcia_io_cfg_data_width(io->flags); |
570 | io->win[0].base, io->win[0].len); | 528 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
571 | if (!(io->flags & CISTPL_IO_8BIT)) | 529 | p_dev->resource[0]->start = io->win[0].base; |
572 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 530 | p_dev->resource[0]->end = io->win[0].len; |
573 | if (!(io->flags & CISTPL_IO_16BIT)) | ||
574 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | ||
575 | p_dev->io.IOAddrLines = io->flags & | ||
576 | CISTPL_IO_LINES_MASK; | ||
577 | p_dev->io.BasePort1 = io->win[0].base; | ||
578 | p_dev->io.NumPorts1 = io->win[0].len; | ||
579 | if (io->nwin > 1) { | 531 | if (io->nwin > 1) { |
580 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 532 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
581 | p_dev->io.BasePort2 = io->win[1].base; | 533 | p_dev->resource[1]->start = io->win[1].base; |
582 | p_dev->io.NumPorts2 = io->win[1].len; | 534 | p_dev->resource[1]->end = io->win[1].len; |
583 | } | 535 | } |
584 | } | 536 | } |
585 | 537 | ||
586 | /* This reserves IO space but doesn't actually enable it */ | 538 | /* This reserves IO space but doesn't actually enable it */ |
587 | return pcmcia_request_io(p_dev, &p_dev->io); | 539 | return pcmcia_request_io(p_dev); |
588 | } | 540 | } |
589 | 541 | ||
590 | static int prism2_config(struct pcmcia_device *link) | 542 | static int prism2_config(struct pcmcia_device *link) |
@@ -646,7 +598,7 @@ static int prism2_config(struct pcmcia_device *link) | |||
646 | goto failed_unlock; | 598 | goto failed_unlock; |
647 | 599 | ||
648 | dev->irq = link->irq; | 600 | dev->irq = link->irq; |
649 | dev->base_addr = link->io.BasePort1; | 601 | dev->base_addr = link->resource[0]->start; |
650 | 602 | ||
651 | spin_unlock_irqrestore(&local->irq_init_lock, flags); | 603 | spin_unlock_irqrestore(&local->irq_init_lock, flags); |
652 | 604 | ||
@@ -658,12 +610,10 @@ static int prism2_config(struct pcmcia_device *link) | |||
658 | link->conf.Vpp % 10); | 610 | link->conf.Vpp % 10); |
659 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 611 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
660 | printk(", irq %d", link->irq); | 612 | printk(", irq %d", link->irq); |
661 | if (link->io.NumPorts1) | 613 | if (link->resource[0]) |
662 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 614 | printk(" & %pR", link->resource[0]); |
663 | link->io.BasePort1+link->io.NumPorts1-1); | 615 | if (link->resource[1]) |
664 | if (link->io.NumPorts2) | 616 | printk(" & %pR", link->resource[1]); |
665 | printk(" & 0x%04x-0x%04x", link->io.BasePort2, | ||
666 | link->io.BasePort2+link->io.NumPorts2-1); | ||
667 | printk("\n"); | 617 | printk("\n"); |
668 | 618 | ||
669 | local->shutdown = 0; | 619 | local->shutdown = 0; |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 08e4e3908003..9c298396be50 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/firmware.h> | 28 | #include <linux/firmware.h> |
29 | #include <linux/netdevice.h> | 29 | #include <linux/netdevice.h> |
30 | 30 | ||
31 | #include <pcmcia/cs_types.h> | ||
32 | #include <pcmcia/cs.h> | 31 | #include <pcmcia/cs.h> |
33 | #include <pcmcia/cistpl.h> | 32 | #include <pcmcia/cistpl.h> |
34 | #include <pcmcia/ds.h> | 33 | #include <pcmcia/ds.h> |
@@ -802,9 +801,9 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, | |||
802 | unsigned int vcc, | 801 | unsigned int vcc, |
803 | void *priv_data) | 802 | void *priv_data) |
804 | { | 803 | { |
805 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 804 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
806 | p_dev->io.BasePort1 = cfg->io.win[0].base; | 805 | p_dev->resource[0]->start = cfg->io.win[0].base; |
807 | p_dev->io.NumPorts1 = cfg->io.win[0].len; | 806 | p_dev->resource[0]->end = cfg->io.win[0].len; |
808 | 807 | ||
809 | /* Do we need to allocate an interrupt? */ | 808 | /* Do we need to allocate an interrupt? */ |
810 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 809 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
@@ -816,7 +815,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, | |||
816 | } | 815 | } |
817 | 816 | ||
818 | /* This reserves IO space but doesn't actually enable it */ | 817 | /* This reserves IO space but doesn't actually enable it */ |
819 | return pcmcia_request_io(p_dev, &p_dev->io); | 818 | return pcmcia_request_io(p_dev); |
820 | } | 819 | } |
821 | 820 | ||
822 | static int if_cs_probe(struct pcmcia_device *p_dev) | 821 | static int if_cs_probe(struct pcmcia_device *p_dev) |
@@ -854,7 +853,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
854 | goto out1; | 853 | goto out1; |
855 | 854 | ||
856 | /* Initialize io access */ | 855 | /* Initialize io access */ |
857 | card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1); | 856 | card->iobase = ioport_map(p_dev->resource[0]->start, |
857 | resource_size(p_dev->resource[0])); | ||
858 | if (!card->iobase) { | 858 | if (!card->iobase) { |
859 | lbs_pr_err("error in ioport_map\n"); | 859 | lbs_pr_err("error in ioport_map\n"); |
860 | ret = -EIO; | 860 | ret = -EIO; |
@@ -873,9 +873,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
873 | } | 873 | } |
874 | 874 | ||
875 | /* Finally, report what we've done */ | 875 | /* Finally, report what we've done */ |
876 | lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", | 876 | lbs_deb_cs("irq %d, io %pR", p_dev->irq, p_dev->resource[0]); |
877 | p_dev->irq, p_dev->io.BasePort1, | ||
878 | p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); | ||
879 | 877 | ||
880 | /* | 878 | /* |
881 | * Most of the libertas cards can do unaligned register access, but some | 879 | * Most of the libertas cards can do unaligned register access, but some |
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index b16d5db52a4d..ef46a2d88539 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <pcmcia/cs_types.h> | ||
21 | #include <pcmcia/cs.h> | 20 | #include <pcmcia/cs.h> |
22 | #include <pcmcia/cistpl.h> | 21 | #include <pcmcia/cistpl.h> |
23 | #include <pcmcia/cisreg.h> | 22 | #include <pcmcia/cisreg.h> |
@@ -192,25 +191,23 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev, | |||
192 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 191 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
193 | 192 | ||
194 | /* IO window settings */ | 193 | /* IO window settings */ |
195 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 194 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
196 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 195 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
197 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 196 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
198 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 197 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
199 | if (!(io->flags & CISTPL_IO_8BIT)) | 198 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
200 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 199 | p_dev->resource[0]->flags |= |
201 | if (!(io->flags & CISTPL_IO_16BIT)) | 200 | pcmcia_io_cfg_data_width(io->flags); |
202 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 201 | p_dev->resource[0]->start = io->win[0].base; |
203 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 202 | p_dev->resource[0]->end = io->win[0].len; |
204 | p_dev->io.BasePort1 = io->win[0].base; | ||
205 | p_dev->io.NumPorts1 = io->win[0].len; | ||
206 | if (io->nwin > 1) { | 203 | if (io->nwin > 1) { |
207 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 204 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
208 | p_dev->io.BasePort2 = io->win[1].base; | 205 | p_dev->resource[1]->start = io->win[1].base; |
209 | p_dev->io.NumPorts2 = io->win[1].len; | 206 | p_dev->resource[1]->end = io->win[1].len; |
210 | } | 207 | } |
211 | 208 | ||
212 | /* This reserves IO space but doesn't actually enable it */ | 209 | /* This reserves IO space but doesn't actually enable it */ |
213 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) | 210 | if (pcmcia_request_io(p_dev) != 0) |
214 | goto next_entry; | 211 | goto next_entry; |
215 | } | 212 | } |
216 | return 0; | 213 | return 0; |
@@ -258,7 +255,8 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
258 | /* We initialize the hermes structure before completing PCMCIA | 255 | /* We initialize the hermes structure before completing PCMCIA |
259 | * configuration just in case the interrupt handler gets | 256 | * configuration just in case the interrupt handler gets |
260 | * called. */ | 257 | * called. */ |
261 | mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); | 258 | mem = ioport_map(link->resource[0]->start, |
259 | resource_size(link->resource[0])); | ||
262 | if (!mem) | 260 | if (!mem) |
263 | goto failed; | 261 | goto failed; |
264 | 262 | ||
@@ -280,7 +278,7 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
280 | } | 278 | } |
281 | 279 | ||
282 | /* Register an interface with the stack */ | 280 | /* Register an interface with the stack */ |
283 | if (orinoco_if_add(priv, link->io.BasePort1, | 281 | if (orinoco_if_add(priv, link->resource[0]->start, |
284 | link->irq, NULL) != 0) { | 282 | link->irq, NULL) != 0) { |
285 | printk(KERN_ERR PFX "orinoco_if_add() failed\n"); | 283 | printk(KERN_ERR PFX "orinoco_if_add() failed\n"); |
286 | goto failed; | 284 | goto failed; |
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c index b51a9adc80f6..873877e17e1b 100644 --- a/drivers/net/wireless/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/orinoco/spectrum_cs.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <pcmcia/cs_types.h> | ||
29 | #include <pcmcia/cs.h> | 28 | #include <pcmcia/cs.h> |
30 | #include <pcmcia/cistpl.h> | 29 | #include <pcmcia/cistpl.h> |
31 | #include <pcmcia/cisreg.h> | 30 | #include <pcmcia/cisreg.h> |
@@ -80,35 +79,27 @@ static int | |||
80 | spectrum_reset(struct pcmcia_device *link, int idle) | 79 | spectrum_reset(struct pcmcia_device *link, int idle) |
81 | { | 80 | { |
82 | int ret; | 81 | int ret; |
83 | conf_reg_t reg; | 82 | u8 save_cor; |
84 | u_int save_cor; | 83 | u8 ccsr; |
85 | 84 | ||
86 | /* Doing it if hardware is gone is guaranteed crash */ | 85 | /* Doing it if hardware is gone is guaranteed crash */ |
87 | if (!pcmcia_dev_present(link)) | 86 | if (!pcmcia_dev_present(link)) |
88 | return -ENODEV; | 87 | return -ENODEV; |
89 | 88 | ||
90 | /* Save original COR value */ | 89 | /* Save original COR value */ |
91 | reg.Function = 0; | 90 | ret = pcmcia_read_config_byte(link, CISREG_COR, &save_cor); |
92 | reg.Action = CS_READ; | ||
93 | reg.Offset = CISREG_COR; | ||
94 | ret = pcmcia_access_configuration_register(link, ®); | ||
95 | if (ret) | 91 | if (ret) |
96 | goto failed; | 92 | goto failed; |
97 | save_cor = reg.Value; | ||
98 | 93 | ||
99 | /* Soft-Reset card */ | 94 | /* Soft-Reset card */ |
100 | reg.Action = CS_WRITE; | 95 | ret = pcmcia_write_config_byte(link, CISREG_COR, |
101 | reg.Offset = CISREG_COR; | 96 | (save_cor | COR_SOFT_RESET)); |
102 | reg.Value = (save_cor | COR_SOFT_RESET); | ||
103 | ret = pcmcia_access_configuration_register(link, ®); | ||
104 | if (ret) | 97 | if (ret) |
105 | goto failed; | 98 | goto failed; |
106 | udelay(1000); | 99 | udelay(1000); |
107 | 100 | ||
108 | /* Read CCSR */ | 101 | /* Read CCSR */ |
109 | reg.Action = CS_READ; | 102 | ret = pcmcia_read_config_byte(link, CISREG_CCSR, &ccsr); |
110 | reg.Offset = CISREG_CCSR; | ||
111 | ret = pcmcia_access_configuration_register(link, ®); | ||
112 | if (ret) | 103 | if (ret) |
113 | goto failed; | 104 | goto failed; |
114 | 105 | ||
@@ -116,19 +107,15 @@ spectrum_reset(struct pcmcia_device *link, int idle) | |||
116 | * Start or stop the firmware. Memory width bit should be | 107 | * Start or stop the firmware. Memory width bit should be |
117 | * preserved from the value we've just read. | 108 | * preserved from the value we've just read. |
118 | */ | 109 | */ |
119 | reg.Action = CS_WRITE; | 110 | ccsr = (idle ? HCR_IDLE : HCR_RUN) | (ccsr & HCR_MEM16); |
120 | reg.Offset = CISREG_CCSR; | 111 | ret = pcmcia_write_config_byte(link, CISREG_CCSR, ccsr); |
121 | reg.Value = (idle ? HCR_IDLE : HCR_RUN) | (reg.Value & HCR_MEM16); | ||
122 | ret = pcmcia_access_configuration_register(link, ®); | ||
123 | if (ret) | 112 | if (ret) |
124 | goto failed; | 113 | goto failed; |
125 | udelay(1000); | 114 | udelay(1000); |
126 | 115 | ||
127 | /* Restore original COR configuration index */ | 116 | /* Restore original COR configuration index */ |
128 | reg.Action = CS_WRITE; | 117 | ret = pcmcia_write_config_byte(link, CISREG_COR, |
129 | reg.Offset = CISREG_COR; | 118 | (save_cor & ~COR_SOFT_RESET)); |
130 | reg.Value = (save_cor & ~COR_SOFT_RESET); | ||
131 | ret = pcmcia_access_configuration_register(link, ®); | ||
132 | if (ret) | 119 | if (ret) |
133 | goto failed; | 120 | goto failed; |
134 | udelay(1000); | 121 | udelay(1000); |
@@ -266,25 +253,23 @@ static int spectrum_cs_config_check(struct pcmcia_device *p_dev, | |||
266 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | 253 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; |
267 | 254 | ||
268 | /* IO window settings */ | 255 | /* IO window settings */ |
269 | p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; | 256 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
270 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 257 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
271 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 258 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
272 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 259 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; |
273 | if (!(io->flags & CISTPL_IO_8BIT)) | 260 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
274 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | 261 | p_dev->resource[0]->flags |= |
275 | if (!(io->flags & CISTPL_IO_16BIT)) | 262 | pcmcia_io_cfg_data_width(io->flags); |
276 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 263 | p_dev->resource[0]->start = io->win[0].base; |
277 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 264 | p_dev->resource[0]->end = io->win[0].len; |
278 | p_dev->io.BasePort1 = io->win[0].base; | ||
279 | p_dev->io.NumPorts1 = io->win[0].len; | ||
280 | if (io->nwin > 1) { | 265 | if (io->nwin > 1) { |
281 | p_dev->io.Attributes2 = p_dev->io.Attributes1; | 266 | p_dev->resource[1]->flags = p_dev->resource[0]->flags; |
282 | p_dev->io.BasePort2 = io->win[1].base; | 267 | p_dev->resource[1]->start = io->win[1].base; |
283 | p_dev->io.NumPorts2 = io->win[1].len; | 268 | p_dev->resource[1]->end = io->win[1].len; |
284 | } | 269 | } |
285 | 270 | ||
286 | /* This reserves IO space but doesn't actually enable it */ | 271 | /* This reserves IO space but doesn't actually enable it */ |
287 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) | 272 | if (pcmcia_request_io(p_dev) != 0) |
288 | goto next_entry; | 273 | goto next_entry; |
289 | } | 274 | } |
290 | return 0; | 275 | return 0; |
@@ -332,7 +317,8 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
332 | /* We initialize the hermes structure before completing PCMCIA | 317 | /* We initialize the hermes structure before completing PCMCIA |
333 | * configuration just in case the interrupt handler gets | 318 | * configuration just in case the interrupt handler gets |
334 | * called. */ | 319 | * called. */ |
335 | mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); | 320 | mem = ioport_map(link->resource[0]->start, |
321 | resource_size(link->resource[0])); | ||
336 | if (!mem) | 322 | if (!mem) |
337 | goto failed; | 323 | goto failed; |
338 | 324 | ||
@@ -359,7 +345,7 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
359 | } | 345 | } |
360 | 346 | ||
361 | /* Register an interface with the stack */ | 347 | /* Register an interface with the stack */ |
362 | if (orinoco_if_add(priv, link->io.BasePort1, | 348 | if (orinoco_if_add(priv, link->resource[0]->start, |
363 | link->irq, NULL) != 0) { | 349 | link->irq, NULL) != 0) { |
364 | printk(KERN_ERR PFX "orinoco_if_add() failed\n"); | 350 | printk(KERN_ERR PFX "orinoco_if_add() failed\n"); |
365 | goto failed; | 351 | goto failed; |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 9c38fc331dca..88560d0ae50a 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <linux/ethtool.h> | 46 | #include <linux/ethtool.h> |
47 | #include <linux/ieee80211.h> | 47 | #include <linux/ieee80211.h> |
48 | 48 | ||
49 | #include <pcmcia/cs_types.h> | ||
50 | #include <pcmcia/cs.h> | 49 | #include <pcmcia/cs.h> |
51 | #include <pcmcia/cistpl.h> | 50 | #include <pcmcia/cistpl.h> |
52 | #include <pcmcia/cisreg.h> | 51 | #include <pcmcia/cisreg.h> |
@@ -315,9 +314,8 @@ static int ray_probe(struct pcmcia_device *p_dev) | |||
315 | local->finder = p_dev; | 314 | local->finder = p_dev; |
316 | 315 | ||
317 | /* The io structure describes IO port mapping. None used here */ | 316 | /* The io structure describes IO port mapping. None used here */ |
318 | p_dev->io.NumPorts1 = 0; | 317 | p_dev->resource[0]->end = 0; |
319 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 318 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
320 | p_dev->io.IOAddrLines = 5; | ||
321 | 319 | ||
322 | /* General socket configuration */ | 320 | /* General socket configuration */ |
323 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; | 321 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; |
@@ -394,7 +392,6 @@ static int ray_config(struct pcmcia_device *link) | |||
394 | int ret = 0; | 392 | int ret = 0; |
395 | int i; | 393 | int i; |
396 | win_req_t req; | 394 | win_req_t req; |
397 | memreq_t mem; | ||
398 | struct net_device *dev = (struct net_device *)link->priv; | 395 | struct net_device *dev = (struct net_device *)link->priv; |
399 | ray_dev_t *local = netdev_priv(dev); | 396 | ray_dev_t *local = netdev_priv(dev); |
400 | 397 | ||
@@ -431,9 +428,7 @@ static int ray_config(struct pcmcia_device *link) | |||
431 | ret = pcmcia_request_window(link, &req, &link->win); | 428 | ret = pcmcia_request_window(link, &req, &link->win); |
432 | if (ret) | 429 | if (ret) |
433 | goto failed; | 430 | goto failed; |
434 | mem.CardOffset = 0x0000; | 431 | ret = pcmcia_map_mem_page(link, link->win, 0); |
435 | mem.Page = 0; | ||
436 | ret = pcmcia_map_mem_page(link, link->win, &mem); | ||
437 | if (ret) | 432 | if (ret) |
438 | goto failed; | 433 | goto failed; |
439 | local->sram = ioremap(req.Base, req.Size); | 434 | local->sram = ioremap(req.Base, req.Size); |
@@ -447,9 +442,7 @@ static int ray_config(struct pcmcia_device *link) | |||
447 | ret = pcmcia_request_window(link, &req, &local->rmem_handle); | 442 | ret = pcmcia_request_window(link, &req, &local->rmem_handle); |
448 | if (ret) | 443 | if (ret) |
449 | goto failed; | 444 | goto failed; |
450 | mem.CardOffset = 0x8000; | 445 | ret = pcmcia_map_mem_page(link, local->rmem_handle, 0x8000); |
451 | mem.Page = 0; | ||
452 | ret = pcmcia_map_mem_page(link, local->rmem_handle, &mem); | ||
453 | if (ret) | 446 | if (ret) |
454 | goto failed; | 447 | goto failed; |
455 | local->rmem = ioremap(req.Base, req.Size); | 448 | local->rmem = ioremap(req.Base, req.Size); |
@@ -463,9 +456,7 @@ static int ray_config(struct pcmcia_device *link) | |||
463 | ret = pcmcia_request_window(link, &req, &local->amem_handle); | 456 | ret = pcmcia_request_window(link, &req, &local->amem_handle); |
464 | if (ret) | 457 | if (ret) |
465 | goto failed; | 458 | goto failed; |
466 | mem.CardOffset = 0x0000; | 459 | ret = pcmcia_map_mem_page(link, local->amem_handle, 0); |
467 | mem.Page = 0; | ||
468 | ret = pcmcia_map_mem_page(link, local->amem_handle, &mem); | ||
469 | if (ret) | 460 | if (ret) |
470 | goto failed; | 461 | goto failed; |
471 | local->amem = ioremap(req.Base, req.Size); | 462 | local->amem = ioremap(req.Base, req.Size); |
@@ -793,7 +784,6 @@ static void ray_release(struct pcmcia_device *link) | |||
793 | { | 784 | { |
794 | struct net_device *dev = link->priv; | 785 | struct net_device *dev = link->priv; |
795 | ray_dev_t *local = netdev_priv(dev); | 786 | ray_dev_t *local = netdev_priv(dev); |
796 | int i; | ||
797 | 787 | ||
798 | dev_dbg(&link->dev, "ray_release\n"); | 788 | dev_dbg(&link->dev, "ray_release\n"); |
799 | 789 | ||
@@ -802,13 +792,6 @@ static void ray_release(struct pcmcia_device *link) | |||
802 | iounmap(local->sram); | 792 | iounmap(local->sram); |
803 | iounmap(local->rmem); | 793 | iounmap(local->rmem); |
804 | iounmap(local->amem); | 794 | iounmap(local->amem); |
805 | /* Do bother checking to see if these succeed or not */ | ||
806 | i = pcmcia_release_window(link, local->amem_handle); | ||
807 | if (i != 0) | ||
808 | dev_dbg(&link->dev, "ReleaseWindow(local->amem) ret = %x\n", i); | ||
809 | i = pcmcia_release_window(link, local->rmem_handle); | ||
810 | if (i != 0) | ||
811 | dev_dbg(&link->dev, "ReleaseWindow(local->rmem) ret = %x\n", i); | ||
812 | pcmcia_disable_device(link); | 795 | pcmcia_disable_device(link); |
813 | 796 | ||
814 | dev_dbg(&link->dev, "ray_release ending\n"); | 797 | dev_dbg(&link->dev, "ray_release ending\n"); |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 376c6b964a9c..a1cc2d498a1c 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -48,7 +48,6 @@ | |||
48 | 48 | ||
49 | #include <net/iw_handler.h> | 49 | #include <net/iw_handler.h> |
50 | 50 | ||
51 | #include <pcmcia/cs_types.h> | ||
52 | #include <pcmcia/cs.h> | 51 | #include <pcmcia/cs.h> |
53 | #include <pcmcia/cistpl.h> | 52 | #include <pcmcia/cistpl.h> |
54 | #include <pcmcia/cisreg.h> | 53 | #include <pcmcia/cisreg.h> |
@@ -89,13 +88,6 @@ | |||
89 | static int wl3501_config(struct pcmcia_device *link); | 88 | static int wl3501_config(struct pcmcia_device *link); |
90 | static void wl3501_release(struct pcmcia_device *link); | 89 | static void wl3501_release(struct pcmcia_device *link); |
91 | 90 | ||
92 | /* | ||
93 | * The dev_info variable is the "key" that is used to match up this | ||
94 | * device driver with appropriate cards, through the card configuration | ||
95 | * database. | ||
96 | */ | ||
97 | static dev_info_t wl3501_dev_info = "wl3501_cs"; | ||
98 | |||
99 | static const struct { | 91 | static const struct { |
100 | int reg_domain; | 92 | int reg_domain; |
101 | int min, max, deflt; | 93 | int min, max, deflt; |
@@ -1421,7 +1413,7 @@ static struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev) | |||
1421 | 1413 | ||
1422 | static void wl3501_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | 1414 | static void wl3501_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) |
1423 | { | 1415 | { |
1424 | strlcpy(info->driver, wl3501_dev_info, sizeof(info->driver)); | 1416 | strlcpy(info->driver, "wl3501_cs", sizeof(info->driver)); |
1425 | } | 1417 | } |
1426 | 1418 | ||
1427 | static const struct ethtool_ops ops = { | 1419 | static const struct ethtool_ops ops = { |
@@ -1892,9 +1884,8 @@ static int wl3501_probe(struct pcmcia_device *p_dev) | |||
1892 | struct wl3501_card *this; | 1884 | struct wl3501_card *this; |
1893 | 1885 | ||
1894 | /* The io structure describes IO port mapping */ | 1886 | /* The io structure describes IO port mapping */ |
1895 | p_dev->io.NumPorts1 = 16; | 1887 | p_dev->resource[0]->end = 16; |
1896 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 1888 | p_dev->resource[0]->flags = IO_DATA_PATH_WIDTH_8; |
1897 | p_dev->io.IOAddrLines = 5; | ||
1898 | 1889 | ||
1899 | /* General socket configuration */ | 1890 | /* General socket configuration */ |
1900 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; | 1891 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; |
@@ -1940,13 +1931,14 @@ static int wl3501_config(struct pcmcia_device *link) | |||
1940 | /* 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 |
1941 | * 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 -- |
1942 | * see the serial driver for an example. */ | 1933 | * see the serial driver for an example. */ |
1934 | link->io_lines = 5; | ||
1943 | 1935 | ||
1944 | for (j = 0x280; j < 0x400; j += 0x20) { | 1936 | for (j = 0x280; j < 0x400; j += 0x20) { |
1945 | /* The '^0x300' is so that we probe 0x300-0x3ff first, then | 1937 | /* The '^0x300' is so that we probe 0x300-0x3ff first, then |
1946 | * 0x200-0x2ff, and so on, because this seems safer */ | 1938 | * 0x200-0x2ff, and so on, because this seems safer */ |
1947 | link->io.BasePort1 = j; | 1939 | link->resource[0]->start = j; |
1948 | link->io.BasePort2 = link->io.BasePort1 + 0x10; | 1940 | link->resource[1]->start = link->resource[0]->start + 0x10; |
1949 | i = pcmcia_request_io(link, &link->io); | 1941 | i = pcmcia_request_io(link); |
1950 | if (i == 0) | 1942 | if (i == 0) |
1951 | break; | 1943 | break; |
1952 | } | 1944 | } |
@@ -1968,7 +1960,7 @@ static int wl3501_config(struct pcmcia_device *link) | |||
1968 | goto failed; | 1960 | goto failed; |
1969 | 1961 | ||
1970 | dev->irq = link->irq; | 1962 | dev->irq = link->irq; |
1971 | dev->base_addr = link->io.BasePort1; | 1963 | dev->base_addr = link->resource[0]->start; |
1972 | SET_NETDEV_DEV(dev, &link->dev); | 1964 | SET_NETDEV_DEV(dev, &link->dev); |
1973 | if (register_netdev(dev)) { | 1965 | if (register_netdev(dev)) { |
1974 | printk(KERN_NOTICE "wl3501_cs: register_netdev() failed\n"); | 1966 | printk(KERN_NOTICE "wl3501_cs: register_netdev() failed\n"); |