aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-24 12:46:42 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-08-03 03:04:14 -0400
commitb5cb259e7fac5536c4ddf350af6a3d6cc950e47e (patch)
treefd752edd9a19ad9592fdabc87465ba17019465f6 /drivers/net/pcmcia
parenta3d0d4d8dd45779b6e174a8567ffb9b485e472af (diff)
pcmcia: remove memreq_t
Page already had to be set to 0; Offset can easily be passed as parameter to pcmcia_map_mem_page. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: linux-bluetooth@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c10
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c11
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c14
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c9
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c5
5 files changed, 13 insertions, 36 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 699304480aed..98fffb03ecd7 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -545,7 +545,6 @@ failed:
545static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) 545static 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)
594static int fmvj18x_setup_mfc(struct pcmcia_device *link) 591static 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 3fd859570db3..c0b3cdd49c6a 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -211,7 +211,6 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
211 struct net_device *dev = info->dev; 211 struct net_device *dev = info->dev;
212 struct tok_info *ti = netdev_priv(dev); 212 struct tok_info *ti = netdev_priv(dev);
213 win_req_t req; 213 win_req_t req;
214 memreq_t mem;
215 int i, ret; 214 int i, ret;
216 215
217 dev_dbg(&link->dev, "ibmtr_config\n"); 216 dev_dbg(&link->dev, "ibmtr_config\n");
@@ -250,9 +249,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
250 if (ret) 249 if (ret)
251 goto failed; 250 goto failed;
252 251
253 mem.CardOffset = mmiobase; 252 ret = pcmcia_map_mem_page(link, link->win, mmiobase);
254 mem.Page = 0;
255 ret = pcmcia_map_mem_page(link, link->win, &mem);
256 if (ret) 253 if (ret)
257 goto failed; 254 goto failed;
258 ti->mmio = ioremap(req.Base, req.Size); 255 ti->mmio = ioremap(req.Base, req.Size);
@@ -267,13 +264,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
267 if (ret) 264 if (ret)
268 goto failed; 265 goto failed;
269 266
270 mem.CardOffset = srambase; 267 ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase);
271 mem.Page = 0;
272 ret = pcmcia_map_mem_page(link, info->sram_win_handle, &mem);
273 if (ret) 268 if (ret)
274 goto failed; 269 goto failed;
275 270
276 ti->sram_base = mem.CardOffset >> 12; 271 ti->sram_base = srambase >> 12;
277 ti->sram_virt = ioremap(req.Base, req.Size); 272 ti->sram_virt = ioremap(req.Base, req.Size);
278 ti->sram_phys = req.Base; 273 ti->sram_phys = req.Base;
279 274
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 9c5fc9dfc55d..c3edfe4c2651 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -301,7 +301,6 @@ 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; 303 win_req_t req;
304 memreq_t mem;
305 u_char __iomem *base, *virt; 304 u_char __iomem *base, *virt;
306 int i, j; 305 int i, j;
307 306
@@ -314,10 +313,8 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
314 return NULL; 313 return NULL;
315 314
316 virt = ioremap(req.Base, req.Size); 315 virt = ioremap(req.Base, req.Size);
317 mem.Page = 0;
318 for (i = 0; i < NR_INFO; i++) { 316 for (i = 0; i < NR_INFO; i++) {
319 mem.CardOffset = hw_info[i].offset & ~(req.Size-1); 317 pcmcia_map_mem_page(link, link->win, hw_info[i].offset & ~(req.Size-1));
320 pcmcia_map_mem_page(link, link->win, &mem);
321 base = &virt[hw_info[i].offset & (req.Size-1)]; 318 base = &virt[hw_info[i].offset & (req.Size-1)];
322 if ((readb(base+0) == hw_info[i].a0) && 319 if ((readb(base+0) == hw_info[i].a0) &&
323 (readb(base+2) == hw_info[i].a1) && 320 (readb(base+2) == hw_info[i].a1) &&
@@ -1463,7 +1460,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1463 struct net_device *dev = link->priv; 1460 struct net_device *dev = link->priv;
1464 pcnet_dev_t *info = PRIV(dev); 1461 pcnet_dev_t *info = PRIV(dev);
1465 win_req_t req; 1462 win_req_t req;
1466 memreq_t mem;
1467 int i, window_size, offset, ret; 1463 int i, window_size, offset, ret;
1468 1464
1469 window_size = (stop_pg - start_pg) << 8; 1465 window_size = (stop_pg - start_pg) << 8;
@@ -1482,11 +1478,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1482 if (ret) 1478 if (ret)
1483 goto failed; 1479 goto failed;
1484 1480
1485 mem.CardOffset = (start_pg << 8) + cm_offset; 1481 offset = (start_pg << 8) + cm_offset;
1486 offset = mem.CardOffset % window_size; 1482 offset -= offset % window_size;
1487 mem.CardOffset -= offset; 1483 ret = pcmcia_map_mem_page(link, link->win, offset);
1488 mem.Page = 0;
1489 ret = pcmcia_map_mem_page(link, link->win, &mem);
1490 if (ret) 1484 if (ret)
1491 goto failed; 1485 goto failed;
1492 1486
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index a5e47796f6ae..377367d03b41 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -443,7 +443,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)
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; 445 win_req_t req;
446 memreq_t mem; 446 unsigned int offset;
447 int i; 447 int i;
448 448
449 link->conf.Attributes |= CONF_ENABLE_SPKR; 449 link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -467,11 +467,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)
467 return -ENODEV; 467 return -ENODEV;
468 468
469 smc->base = ioremap(req.Base, req.Size); 469 smc->base = ioremap(req.Base, req.Size);
470 mem.CardOffset = mem.Page = 0; 470 offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0;
471 if (smc->manfid == MANFID_MOTOROLA) 471 i = pcmcia_map_mem_page(link, link->win, offset);
472 mem.CardOffset = link->conf.ConfigBase;
473 i = pcmcia_map_mem_page(link, link->win, &mem);
474
475 if ((i == 0) && 472 if ((i == 0) &&
476 (smc->manfid == MANFID_MEGAHERTZ) && 473 (smc->manfid == MANFID_MEGAHERTZ) &&
477 (smc->cardid == PRODID_MEGAHERTZ_EM3288)) 474 (smc->cardid == PRODID_MEGAHERTZ_EM3288))
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 8fb0eb1dc341..4eb6f986703b 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -870,7 +870,6 @@ xirc2ps_config(struct pcmcia_device * link)
870 870
871 if (local->dingo) { 871 if (local->dingo) {
872 win_req_t req; 872 win_req_t req;
873 memreq_t mem;
874 873
875 /* Reset the modem's BAR to the correct value 874 /* Reset the modem's BAR to the correct value
876 * This is necessary because in the RequestConfiguration call, 875 * This is necessary because in the RequestConfiguration call,
@@ -898,9 +897,7 @@ xirc2ps_config(struct pcmcia_device * link)
898 goto config_error; 897 goto config_error;
899 898
900 local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; 899 local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;
901 mem.CardOffset = 0x0; 900 if ((err = pcmcia_map_mem_page(link, link->win, 0)))
902 mem.Page = 0;
903 if ((err = pcmcia_map_mem_page(link, link->win, &mem)))
904 goto config_error; 901 goto config_error;
905 902
906 /* 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