diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-28 04:59:06 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-09-29 11:20:21 -0400 |
commit | cdb138080b78146d1cdadba9f5dadbeb97445b91 (patch) | |
tree | fae26f709ed0f19648db79059234faf9fa028051 /drivers/net | |
parent | 899611ee7d373e5eeda08e9a8632684e1ebbbf00 (diff) |
pcmcia: do not use win_req_t when calling pcmcia_request_window()
Instead of win_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[2,3,4,5] for up to four iomem
ranges. After a call to pcmcia_request_window(), the windows found there
are reserved and may be used until pcmcia_release_window() is called.
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-mtd@lists.infradead.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 29 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 42 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 44 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 15 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/b43/pcmcia.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 44 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.h | 2 |
8 files changed, 95 insertions, 111 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 98fffb03ecd7..dfd32842412e 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -544,20 +544,18 @@ failed: | |||
544 | 544 | ||
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; | ||
548 | u_char __iomem *base; | 547 | u_char __iomem *base; |
549 | int i, j; | 548 | int i, j; |
550 | 549 | ||
551 | /* Allocate a small memory window */ | 550 | /* Allocate a small memory window */ |
552 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 551 | link->resource[2]->flags |= WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
553 | req.Base = 0; req.Size = 0; | 552 | link->resource[2]->start = 0; link->resource[2]->end = 0; |
554 | req.AccessSpeed = 0; | 553 | i = pcmcia_request_window(link, link->resource[2], 0); |
555 | i = pcmcia_request_window(link, &req, &link->win); | ||
556 | if (i != 0) | 554 | if (i != 0) |
557 | return -1; | 555 | return -1; |
558 | 556 | ||
559 | base = ioremap(req.Base, req.Size); | 557 | base = ioremap(link->resource[2]->start, resource_size(link->resource[2])); |
560 | pcmcia_map_mem_page(link, link->win, 0); | 558 | pcmcia_map_mem_page(link, link->resource[2], 0); |
561 | 559 | ||
562 | /* | 560 | /* |
563 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format | 561 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format |
@@ -582,7 +580,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
582 | } | 580 | } |
583 | 581 | ||
584 | iounmap(base); | 582 | iounmap(base); |
585 | j = pcmcia_release_window(link, link->win); | 583 | j = pcmcia_release_window(link, link->resource[2]); |
586 | return (i != 0x200) ? 0 : -1; | 584 | return (i != 0x200) ? 0 : -1; |
587 | 585 | ||
588 | } /* fmvj18x_get_hwinfo */ | 586 | } /* fmvj18x_get_hwinfo */ |
@@ -590,27 +588,26 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
590 | 588 | ||
591 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) | 589 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) |
592 | { | 590 | { |
593 | win_req_t req; | ||
594 | int i; | 591 | int i; |
595 | struct net_device *dev = link->priv; | 592 | struct net_device *dev = link->priv; |
596 | unsigned int ioaddr; | 593 | unsigned int ioaddr; |
597 | local_info_t *lp = netdev_priv(dev); | 594 | local_info_t *lp = netdev_priv(dev); |
598 | 595 | ||
599 | /* Allocate a small memory window */ | 596 | /* Allocate a small memory window */ |
600 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 597 | link->resource[3]->flags = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
601 | req.Base = 0; req.Size = 0; | 598 | link->resource[3]->start = link->resource[3]->end = 0; |
602 | req.AccessSpeed = 0; | 599 | i = pcmcia_request_window(link, link->resource[3], 0); |
603 | i = pcmcia_request_window(link, &req, &link->win); | ||
604 | if (i != 0) | 600 | if (i != 0) |
605 | return -1; | 601 | return -1; |
606 | 602 | ||
607 | lp->base = ioremap(req.Base, req.Size); | 603 | lp->base = ioremap(link->resource[3]->start, |
604 | resource_size(link->resource[3])); | ||
608 | if (lp->base == NULL) { | 605 | if (lp->base == NULL) { |
609 | printk(KERN_NOTICE "fmvj18x_cs: ioremap failed\n"); | 606 | printk(KERN_NOTICE "fmvj18x_cs: ioremap failed\n"); |
610 | return -1; | 607 | return -1; |
611 | } | 608 | } |
612 | 609 | ||
613 | i = pcmcia_map_mem_page(link, link->win, 0); | 610 | i = pcmcia_map_mem_page(link, link->resource[3], 0); |
614 | if (i != 0) { | 611 | if (i != 0) { |
615 | iounmap(lp->base); | 612 | iounmap(lp->base); |
616 | lp->base = NULL; | 613 | lp->base = NULL; |
@@ -638,7 +635,6 @@ static void fmvj18x_release(struct pcmcia_device *link) | |||
638 | struct net_device *dev = link->priv; | 635 | struct net_device *dev = link->priv; |
639 | local_info_t *lp = netdev_priv(dev); | 636 | local_info_t *lp = netdev_priv(dev); |
640 | u_char __iomem *tmp; | 637 | u_char __iomem *tmp; |
641 | int j; | ||
642 | 638 | ||
643 | dev_dbg(&link->dev, "fmvj18x_release\n"); | 639 | dev_dbg(&link->dev, "fmvj18x_release\n"); |
644 | 640 | ||
@@ -646,7 +642,6 @@ static void fmvj18x_release(struct pcmcia_device *link) | |||
646 | tmp = lp->base; | 642 | tmp = lp->base; |
647 | lp->base = NULL; /* set NULL before iounmap */ | 643 | lp->base = NULL; /* set NULL before iounmap */ |
648 | iounmap(tmp); | 644 | iounmap(tmp); |
649 | j = pcmcia_release_window(link, link->win); | ||
650 | } | 645 | } |
651 | 646 | ||
652 | pcmcia_disable_device(link); | 647 | pcmcia_disable_device(link); |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index b0d06a3d962f..dbdea7f5e423 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -102,9 +102,8 @@ static void ibmtr_detach(struct pcmcia_device *p_dev); | |||
102 | 102 | ||
103 | typedef struct ibmtr_dev_t { | 103 | typedef struct ibmtr_dev_t { |
104 | struct pcmcia_device *p_dev; | 104 | struct pcmcia_device *p_dev; |
105 | struct net_device *dev; | 105 | struct net_device *dev; |
106 | window_handle_t sram_win_handle; | 106 | struct tok_info *ti; |
107 | struct tok_info *ti; | ||
108 | } ibmtr_dev_t; | 107 | } ibmtr_dev_t; |
109 | 108 | ||
110 | static void netdev_get_drvinfo(struct net_device *dev, | 109 | static void netdev_get_drvinfo(struct net_device *dev, |
@@ -210,7 +209,6 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
210 | ibmtr_dev_t *info = link->priv; | 209 | ibmtr_dev_t *info = link->priv; |
211 | struct net_device *dev = info->dev; | 210 | struct net_device *dev = info->dev; |
212 | struct tok_info *ti = netdev_priv(dev); | 211 | struct tok_info *ti = netdev_priv(dev); |
213 | win_req_t req; | ||
214 | int i, ret; | 212 | int i, ret; |
215 | 213 | ||
216 | dev_dbg(&link->dev, "ibmtr_config\n"); | 214 | dev_dbg(&link->dev, "ibmtr_config\n"); |
@@ -240,37 +238,37 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
240 | ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); | 238 | ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); |
241 | 239 | ||
242 | /* Allocate the MMIO memory window */ | 240 | /* Allocate the MMIO memory window */ |
243 | req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; | 241 | link->resource[2]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; |
244 | req.Attributes |= WIN_USE_WAIT; | 242 | link->resource[2]->flags |= WIN_USE_WAIT; |
245 | req.Base = 0; | 243 | link->resource[2]->start = 0; |
246 | req.Size = 0x2000; | 244 | link->resource[2]->end = 0x2000; |
247 | req.AccessSpeed = 250; | 245 | ret = pcmcia_request_window(link, link->resource[2], 250); |
248 | ret = pcmcia_request_window(link, &req, &link->win); | ||
249 | if (ret) | 246 | if (ret) |
250 | goto failed; | 247 | goto failed; |
251 | 248 | ||
252 | ret = pcmcia_map_mem_page(link, link->win, mmiobase); | 249 | ret = pcmcia_map_mem_page(link, link->resource[2], mmiobase); |
253 | if (ret) | 250 | if (ret) |
254 | goto failed; | 251 | goto failed; |
255 | ti->mmio = ioremap(req.Base, req.Size); | 252 | ti->mmio = ioremap(link->resource[2]->start, |
253 | resource_size(link->resource[2])); | ||
256 | 254 | ||
257 | /* Allocate the SRAM memory window */ | 255 | /* Allocate the SRAM memory window */ |
258 | req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; | 256 | link->resource[3]->flags = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; |
259 | req.Attributes |= WIN_USE_WAIT; | 257 | link->resource[3]->flags |= WIN_USE_WAIT; |
260 | req.Base = 0; | 258 | link->resource[3]->start = 0; |
261 | req.Size = sramsize * 1024; | 259 | link->resource[3]->end = sramsize * 1024; |
262 | req.AccessSpeed = 250; | 260 | ret = pcmcia_request_window(link, link->resource[3], 250); |
263 | ret = pcmcia_request_window(link, &req, &info->sram_win_handle); | ||
264 | if (ret) | 261 | if (ret) |
265 | goto failed; | 262 | goto failed; |
266 | 263 | ||
267 | ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase); | 264 | ret = pcmcia_map_mem_page(link, link->resource[3], srambase); |
268 | if (ret) | 265 | if (ret) |
269 | goto failed; | 266 | goto failed; |
270 | 267 | ||
271 | ti->sram_base = srambase >> 12; | 268 | ti->sram_base = srambase >> 12; |
272 | ti->sram_virt = ioremap(req.Base, req.Size); | 269 | ti->sram_virt = ioremap(link->resource[3]->start, |
273 | ti->sram_phys = req.Base; | 270 | resource_size(link->resource[3])); |
271 | ti->sram_phys = link->resource[3]->start; | ||
274 | 272 | ||
275 | ret = pcmcia_request_configuration(link, &link->conf); | 273 | ret = pcmcia_request_configuration(link, &link->conf); |
276 | if (ret) | 274 | if (ret) |
@@ -316,7 +314,7 @@ static void ibmtr_release(struct pcmcia_device *link) | |||
316 | 314 | ||
317 | dev_dbg(&link->dev, "ibmtr_release\n"); | 315 | dev_dbg(&link->dev, "ibmtr_release\n"); |
318 | 316 | ||
319 | if (link->win) { | 317 | if (link->resource[2]->end) { |
320 | struct tok_info *ti = netdev_priv(dev); | 318 | struct tok_info *ti = netdev_priv(dev); |
321 | iounmap(ti->mmio); | 319 | iounmap(ti->mmio); |
322 | } | 320 | } |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index f9b509a6b09a..aa6ee6b264cd 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -300,22 +300,22 @@ static void pcnet_detach(struct pcmcia_device *link) | |||
300 | static hw_info_t *get_hwinfo(struct pcmcia_device *link) | 300 | static hw_info_t *get_hwinfo(struct pcmcia_device *link) |
301 | { | 301 | { |
302 | struct net_device *dev = link->priv; | 302 | struct net_device *dev = link->priv; |
303 | win_req_t req; | ||
304 | u_char __iomem *base, *virt; | 303 | u_char __iomem *base, *virt; |
305 | int i, j; | 304 | int i, j; |
306 | 305 | ||
307 | /* Allocate a small memory window */ | 306 | /* Allocate a small memory window */ |
308 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 307 | link->resource[2]->flags |= WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
309 | req.Base = 0; req.Size = 0; | 308 | link->resource[2]->start = 0; link->resource[2]->end = 0; |
310 | req.AccessSpeed = 0; | 309 | i = pcmcia_request_window(link, link->resource[2], 0); |
311 | i = pcmcia_request_window(link, &req, &link->win); | ||
312 | if (i != 0) | 310 | if (i != 0) |
313 | return NULL; | 311 | return NULL; |
314 | 312 | ||
315 | virt = ioremap(req.Base, req.Size); | 313 | virt = ioremap(link->resource[2]->start, |
314 | resource_size(link->resource[2])); | ||
316 | for (i = 0; i < NR_INFO; i++) { | 315 | for (i = 0; i < NR_INFO; i++) { |
317 | pcmcia_map_mem_page(link, link->win, hw_info[i].offset & ~(req.Size-1)); | 316 | pcmcia_map_mem_page(link, link->resource[2], |
318 | base = &virt[hw_info[i].offset & (req.Size-1)]; | 317 | hw_info[i].offset & ~(resource_size(link->resource[2])-1)); |
318 | base = &virt[hw_info[i].offset & (resource_size(link->resource[2])-1)]; | ||
319 | if ((readb(base+0) == hw_info[i].a0) && | 319 | if ((readb(base+0) == hw_info[i].a0) && |
320 | (readb(base+2) == hw_info[i].a1) && | 320 | (readb(base+2) == hw_info[i].a1) && |
321 | (readb(base+4) == hw_info[i].a2)) { | 321 | (readb(base+4) == hw_info[i].a2)) { |
@@ -326,7 +326,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) | |||
326 | } | 326 | } |
327 | 327 | ||
328 | iounmap(virt); | 328 | iounmap(virt); |
329 | j = pcmcia_release_window(link, link->win); | 329 | j = pcmcia_release_window(link, link->resource[2]); |
330 | return (i < NR_INFO) ? hw_info+i : NULL; | 330 | return (i < NR_INFO) ? hw_info+i : NULL; |
331 | } /* get_hwinfo */ | 331 | } /* get_hwinfo */ |
332 | 332 | ||
@@ -1486,7 +1486,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1486 | { | 1486 | { |
1487 | struct net_device *dev = link->priv; | 1487 | struct net_device *dev = link->priv; |
1488 | pcnet_dev_t *info = PRIV(dev); | 1488 | pcnet_dev_t *info = PRIV(dev); |
1489 | win_req_t req; | ||
1490 | int i, window_size, offset, ret; | 1489 | int i, window_size, offset, ret; |
1491 | 1490 | ||
1492 | window_size = (stop_pg - start_pg) << 8; | 1491 | window_size = (stop_pg - start_pg) << 8; |
@@ -1497,22 +1496,22 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1497 | window_size = roundup_pow_of_two(window_size); | 1496 | window_size = roundup_pow_of_two(window_size); |
1498 | 1497 | ||
1499 | /* Allocate a memory window */ | 1498 | /* Allocate a memory window */ |
1500 | req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; | 1499 | link->resource[3]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; |
1501 | req.Attributes |= WIN_USE_WAIT; | 1500 | link->resource[3]->flags |= WIN_USE_WAIT; |
1502 | req.Base = 0; req.Size = window_size; | 1501 | link->resource[3]->start = 0; link->resource[3]->end = window_size; |
1503 | req.AccessSpeed = mem_speed; | 1502 | ret = pcmcia_request_window(link, link->resource[3], mem_speed); |
1504 | ret = pcmcia_request_window(link, &req, &link->win); | ||
1505 | if (ret) | 1503 | if (ret) |
1506 | goto failed; | 1504 | goto failed; |
1507 | 1505 | ||
1508 | offset = (start_pg << 8) + cm_offset; | 1506 | offset = (start_pg << 8) + cm_offset; |
1509 | offset -= offset % window_size; | 1507 | offset -= offset % window_size; |
1510 | ret = pcmcia_map_mem_page(link, link->win, offset); | 1508 | ret = pcmcia_map_mem_page(link, link->resource[3], offset); |
1511 | if (ret) | 1509 | if (ret) |
1512 | goto failed; | 1510 | goto failed; |
1513 | 1511 | ||
1514 | /* Try scribbling on the buffer */ | 1512 | /* Try scribbling on the buffer */ |
1515 | info->base = ioremap(req.Base, window_size); | 1513 | info->base = ioremap(link->resource[3]->start, |
1514 | resource_size(link->resource[3])); | ||
1516 | for (i = 0; i < (TX_PAGES<<8); i += 2) | 1515 | for (i = 0; i < (TX_PAGES<<8); i += 2) |
1517 | __raw_writew((i>>1), info->base+offset+i); | 1516 | __raw_writew((i>>1), info->base+offset+i); |
1518 | udelay(100); | 1517 | udelay(100); |
@@ -1521,19 +1520,20 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1521 | pcnet_reset_8390(dev); | 1520 | pcnet_reset_8390(dev); |
1522 | if (i != (TX_PAGES<<8)) { | 1521 | if (i != (TX_PAGES<<8)) { |
1523 | iounmap(info->base); | 1522 | iounmap(info->base); |
1524 | pcmcia_release_window(link, link->win); | 1523 | pcmcia_release_window(link, link->resource[3]); |
1525 | info->base = NULL; link->win = 0; | 1524 | info->base = NULL; |
1526 | goto failed; | 1525 | goto failed; |
1527 | } | 1526 | } |
1528 | 1527 | ||
1529 | ei_status.mem = info->base + offset; | 1528 | ei_status.mem = info->base + offset; |
1530 | ei_status.priv = req.Size; | 1529 | ei_status.priv = resource_size(link->resource[3]); |
1531 | dev->mem_start = (u_long)ei_status.mem; | 1530 | dev->mem_start = (u_long)ei_status.mem; |
1532 | dev->mem_end = dev->mem_start + req.Size; | 1531 | dev->mem_end = dev->mem_start + resource_size(link->resource[3]); |
1533 | 1532 | ||
1534 | ei_status.tx_start_page = start_pg; | 1533 | ei_status.tx_start_page = start_pg; |
1535 | ei_status.rx_start_page = start_pg + TX_PAGES; | 1534 | ei_status.rx_start_page = start_pg + TX_PAGES; |
1536 | ei_status.stop_page = start_pg + ((req.Size - offset) >> 8); | 1535 | ei_status.stop_page = start_pg + ( |
1536 | (resource_size(link->resource[3]) - offset) >> 8); | ||
1537 | 1537 | ||
1538 | /* set up block i/o functions */ | 1538 | /* set up block i/o functions */ |
1539 | ei_status.get_8390_hdr = &shmem_get_8390_hdr; | 1539 | ei_status.get_8390_hdr = &shmem_get_8390_hdr; |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 377367d03b41..acc680739c89 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -442,7 +442,6 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
442 | { | 442 | { |
443 | struct net_device *dev = link->priv; | 443 | struct net_device *dev = link->priv; |
444 | struct smc_private *smc = netdev_priv(dev); | 444 | struct smc_private *smc = netdev_priv(dev); |
445 | win_req_t req; | ||
446 | unsigned int offset; | 445 | unsigned int offset; |
447 | int i; | 446 | int i; |
448 | 447 | ||
@@ -459,16 +458,16 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
459 | dev->base_addr = link->resource[0]->start; | 458 | dev->base_addr = link->resource[0]->start; |
460 | 459 | ||
461 | /* Allocate a memory window, for accessing the ISR */ | 460 | /* Allocate a memory window, for accessing the ISR */ |
462 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 461 | link->resource[2]->flags = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
463 | req.Base = req.Size = 0; | 462 | link->resource[2]->start = link->resource[2]->end = 0; |
464 | req.AccessSpeed = 0; | 463 | i = pcmcia_request_window(link, link->resource[2], 0); |
465 | i = pcmcia_request_window(link, &req, &link->win); | ||
466 | if (i != 0) | 464 | if (i != 0) |
467 | return -ENODEV; | 465 | return -ENODEV; |
468 | 466 | ||
469 | smc->base = ioremap(req.Base, req.Size); | 467 | smc->base = ioremap(link->resource[2]->start, |
468 | resource_size(link->resource[2])); | ||
470 | offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; | 469 | offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; |
471 | i = pcmcia_map_mem_page(link, link->win, offset); | 470 | i = pcmcia_map_mem_page(link, link->resource[2], offset); |
472 | if ((i == 0) && | 471 | if ((i == 0) && |
473 | (smc->manfid == MANFID_MEGAHERTZ) && | 472 | (smc->manfid == MANFID_MEGAHERTZ) && |
474 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) | 473 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) |
@@ -999,7 +998,7 @@ config_failed: | |||
999 | static void smc91c92_release(struct pcmcia_device *link) | 998 | static void smc91c92_release(struct pcmcia_device *link) |
1000 | { | 999 | { |
1001 | dev_dbg(&link->dev, "smc91c92_release\n"); | 1000 | dev_dbg(&link->dev, "smc91c92_release\n"); |
1002 | if (link->win) { | 1001 | if (link->resource[2]->end) { |
1003 | struct net_device *dev = link->priv; | 1002 | struct net_device *dev = link->priv; |
1004 | struct smc_private *smc = netdev_priv(dev); | 1003 | struct smc_private *smc = netdev_priv(dev); |
1005 | iounmap(smc->base); | 1004 | iounmap(smc->base); |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index f5819526b5ee..4308bda0e96d 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -869,8 +869,6 @@ xirc2ps_config(struct pcmcia_device * link) | |||
869 | goto config_error; | 869 | goto config_error; |
870 | 870 | ||
871 | if (local->dingo) { | 871 | if (local->dingo) { |
872 | win_req_t req; | ||
873 | |||
874 | /* Reset the modem's BAR to the correct value | 872 | /* Reset the modem's BAR to the correct value |
875 | * This is necessary because in the RequestConfiguration call, | 873 | * This is necessary because in the RequestConfiguration call, |
876 | * the base address of the ethernet port (BasePort1) is written | 874 | * the base address of the ethernet port (BasePort1) is written |
@@ -890,14 +888,14 @@ xirc2ps_config(struct pcmcia_device * link) | |||
890 | * is at 0x0800. So we allocate a window into the attribute | 888 | * is at 0x0800. So we allocate a window into the attribute |
891 | * memory and write direct to the CIS registers | 889 | * memory and write direct to the CIS registers |
892 | */ | 890 | */ |
893 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 891 | link->resource[2]->flags = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_AM | |
894 | req.Base = req.Size = 0; | 892 | WIN_ENABLE; |
895 | req.AccessSpeed = 0; | 893 | link->resource[2]->start = link->resource[2]->end = 0; |
896 | if ((err = pcmcia_request_window(link, &req, &link->win))) | 894 | if ((err = pcmcia_request_window(link, link->resource[2], 0))) |
897 | goto config_error; | 895 | goto config_error; |
898 | 896 | ||
899 | local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; | 897 | local->dingo_ccr = ioremap(link->resource[2]->start, 0x1000) + 0x0800; |
900 | if ((err = pcmcia_map_mem_page(link, link->win, 0))) | 898 | if ((err = pcmcia_map_mem_page(link, link->resource[2], 0))) |
901 | goto config_error; | 899 | goto config_error; |
902 | 900 | ||
903 | /* Setup the CCRs; there are no infos in the CIS about the Ethernet | 901 | /* Setup the CCRs; there are no infos in the CIS about the Ethernet |
@@ -988,7 +986,7 @@ xirc2ps_release(struct pcmcia_device *link) | |||
988 | { | 986 | { |
989 | dev_dbg(&link->dev, "release\n"); | 987 | dev_dbg(&link->dev, "release\n"); |
990 | 988 | ||
991 | if (link->win) { | 989 | if (link->resource[2]->end) { |
992 | struct net_device *dev = link->priv; | 990 | struct net_device *dev = link->priv; |
993 | local_info_t *local = netdev_priv(dev); | 991 | local_info_t *local = netdev_priv(dev); |
994 | if (local->dingo) | 992 | if (local->dingo) |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index dfbc41d431ff..618d9b5c1054 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -63,7 +63,6 @@ static int b43_pcmcia_resume(struct pcmcia_device *dev) | |||
63 | static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | 63 | static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) |
64 | { | 64 | { |
65 | struct ssb_bus *ssb; | 65 | struct ssb_bus *ssb; |
66 | win_req_t win; | ||
67 | int err = -ENOMEM; | 66 | int err = -ENOMEM; |
68 | int res = 0; | 67 | int res = 0; |
69 | 68 | ||
@@ -76,16 +75,15 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
76 | dev->conf.Attributes = CONF_ENABLE_IRQ; | 75 | dev->conf.Attributes = CONF_ENABLE_IRQ; |
77 | dev->conf.IntType = INT_MEMORY_AND_IO; | 76 | dev->conf.IntType = INT_MEMORY_AND_IO; |
78 | 77 | ||
79 | win.Attributes = WIN_ENABLE | WIN_DATA_WIDTH_16 | | 78 | dev->resource[2]->flags |= WIN_ENABLE | WIN_DATA_WIDTH_16 | |
80 | WIN_USE_WAIT; | 79 | WIN_USE_WAIT; |
81 | win.Base = 0; | 80 | dev->resource[2]->start = 0; |
82 | win.Size = SSB_CORE_SIZE; | 81 | dev->resource[2]->end = SSB_CORE_SIZE; |
83 | win.AccessSpeed = 250; | 82 | res = pcmcia_request_window(dev, dev->resource[2], 250); |
84 | res = pcmcia_request_window(dev, &win, &dev->win); | ||
85 | if (res != 0) | 83 | if (res != 0) |
86 | goto err_kfree_ssb; | 84 | goto err_kfree_ssb; |
87 | 85 | ||
88 | res = pcmcia_map_mem_page(dev, dev->win, 0); | 86 | res = pcmcia_map_mem_page(dev, dev->resource[2], 0); |
89 | if (res != 0) | 87 | if (res != 0) |
90 | goto err_disable; | 88 | goto err_disable; |
91 | 89 | ||
@@ -96,7 +94,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
96 | if (res != 0) | 94 | if (res != 0) |
97 | goto err_disable; | 95 | goto err_disable; |
98 | 96 | ||
99 | err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); | 97 | err = ssb_bus_pcmciabus_register(ssb, dev, dev->resource[2]->start); |
100 | if (err) | 98 | if (err) |
101 | goto err_disable; | 99 | goto err_disable; |
102 | dev->priv = ssb; | 100 | dev->priv = ssb; |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 88560d0ae50a..ab34cb8c56c7 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -391,7 +391,6 @@ static int ray_config(struct pcmcia_device *link) | |||
391 | { | 391 | { |
392 | int ret = 0; | 392 | int ret = 0; |
393 | int i; | 393 | int i; |
394 | win_req_t req; | ||
395 | struct net_device *dev = (struct net_device *)link->priv; | 394 | struct net_device *dev = (struct net_device *)link->priv; |
396 | ray_dev_t *local = netdev_priv(dev); | 395 | ray_dev_t *local = netdev_priv(dev); |
397 | 396 | ||
@@ -420,46 +419,45 @@ static int ray_config(struct pcmcia_device *link) | |||
420 | goto failed; | 419 | goto failed; |
421 | 420 | ||
422 | /*** Set up 32k window for shared memory (transmit and control) ************/ | 421 | /*** Set up 32k window for shared memory (transmit and control) ************/ |
423 | req.Attributes = | 422 | link->resource[2]->flags |= WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; |
424 | WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; | 423 | link->resource[2]->start = 0; |
425 | req.Base = 0; | 424 | link->resource[2]->end = 0x8000; |
426 | req.Size = 0x8000; | 425 | ret = pcmcia_request_window(link, link->resource[2], ray_mem_speed); |
427 | req.AccessSpeed = ray_mem_speed; | ||
428 | ret = pcmcia_request_window(link, &req, &link->win); | ||
429 | if (ret) | 426 | if (ret) |
430 | goto failed; | 427 | goto failed; |
431 | ret = pcmcia_map_mem_page(link, link->win, 0); | 428 | ret = pcmcia_map_mem_page(link, link->resource[2], 0); |
432 | if (ret) | 429 | if (ret) |
433 | goto failed; | 430 | goto failed; |
434 | local->sram = ioremap(req.Base, req.Size); | 431 | local->sram = ioremap(link->resource[2]->start, |
432 | resource_size(link->resource[2])); | ||
435 | 433 | ||
436 | /*** Set up 16k window for shared memory (receive buffer) ***************/ | 434 | /*** Set up 16k window for shared memory (receive buffer) ***************/ |
437 | req.Attributes = | 435 | link->resource[3]->flags |= |
438 | WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; | 436 | WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; |
439 | req.Base = 0; | 437 | link->resource[3]->start = 0; |
440 | req.Size = 0x4000; | 438 | link->resource[3]->end = 0x4000; |
441 | req.AccessSpeed = ray_mem_speed; | 439 | ret = pcmcia_request_window(link, link->resource[3], ray_mem_speed); |
442 | ret = pcmcia_request_window(link, &req, &local->rmem_handle); | ||
443 | if (ret) | 440 | if (ret) |
444 | goto failed; | 441 | goto failed; |
445 | ret = pcmcia_map_mem_page(link, local->rmem_handle, 0x8000); | 442 | ret = pcmcia_map_mem_page(link, link->resource[3], 0x8000); |
446 | if (ret) | 443 | if (ret) |
447 | goto failed; | 444 | goto failed; |
448 | local->rmem = ioremap(req.Base, req.Size); | 445 | local->rmem = ioremap(link->resource[3]->start, |
446 | resource_size(link->resource[3])); | ||
449 | 447 | ||
450 | /*** Set up window for attribute memory ***********************************/ | 448 | /*** Set up window for attribute memory ***********************************/ |
451 | req.Attributes = | 449 | link->resource[4]->flags |= |
452 | WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_AM | WIN_ENABLE | WIN_USE_WAIT; | 450 | WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_AM | WIN_ENABLE | WIN_USE_WAIT; |
453 | req.Base = 0; | 451 | link->resource[4]->start = 0; |
454 | req.Size = 0x1000; | 452 | link->resource[4]->end = 0x1000; |
455 | req.AccessSpeed = ray_mem_speed; | 453 | ret = pcmcia_request_window(link, link->resource[4], ray_mem_speed); |
456 | ret = pcmcia_request_window(link, &req, &local->amem_handle); | ||
457 | if (ret) | 454 | if (ret) |
458 | goto failed; | 455 | goto failed; |
459 | ret = pcmcia_map_mem_page(link, local->amem_handle, 0); | 456 | ret = pcmcia_map_mem_page(link, link->resource[4], 0); |
460 | if (ret) | 457 | if (ret) |
461 | goto failed; | 458 | goto failed; |
462 | local->amem = ioremap(req.Base, req.Size); | 459 | local->amem = ioremap(link->resource[4]->start, |
460 | resource_size(link->resource[4])); | ||
463 | 461 | ||
464 | dev_dbg(&link->dev, "ray_config sram=%p\n", local->sram); | 462 | dev_dbg(&link->dev, "ray_config sram=%p\n", local->sram); |
465 | dev_dbg(&link->dev, "ray_config rmem=%p\n", local->rmem); | 463 | dev_dbg(&link->dev, "ray_config rmem=%p\n", local->rmem); |
diff --git a/drivers/net/wireless/ray_cs.h b/drivers/net/wireless/ray_cs.h index 9f01ddb19748..e79848fbcca1 100644 --- a/drivers/net/wireless/ray_cs.h +++ b/drivers/net/wireless/ray_cs.h | |||
@@ -25,8 +25,6 @@ struct beacon_rx { | |||
25 | typedef struct ray_dev_t { | 25 | typedef struct ray_dev_t { |
26 | int card_status; | 26 | int card_status; |
27 | int authentication_state; | 27 | int authentication_state; |
28 | window_handle_t amem_handle; /* handle to window for attribute memory */ | ||
29 | window_handle_t rmem_handle; /* handle to window for rx buffer on card */ | ||
30 | void __iomem *sram; /* pointer to beginning of shared RAM */ | 28 | void __iomem *sram; /* pointer to beginning of shared RAM */ |
31 | void __iomem *amem; /* pointer to attribute mem window */ | 29 | void __iomem *amem; /* pointer to attribute mem window */ |
32 | void __iomem *rmem; /* pointer to receive buffer window */ | 30 | void __iomem *rmem; /* pointer to receive buffer window */ |