[PATCH 02/04] pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()

Magnus Damm damm at opensource.se
Wed Dec 13 05:46:43 EST 2006


pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()

No logic changes, just pass struct pcmcia_device to pcmcia_map_mem_page()

Signed-off-by: Magnus Damm <damm at opensource.se>
---

 Applies to 2.6.19-git19

 drivers/isdn/hisax/sedlbauer_cs.c |    2 +-
 drivers/mtd/maps/pcmciamtd.c      |    2 +-
 drivers/net/pcmcia/fmvj18x_cs.c   |    4 ++--
 drivers/net/pcmcia/ibmtr_cs.c     |    4 ++--
 drivers/net/pcmcia/pcnet_cs.c     |    4 ++--
 drivers/net/pcmcia/smc91c92_cs.c  |    2 +-
 drivers/net/pcmcia/xirc2ps_cs.c   |    2 +-
 drivers/net/wireless/airo_cs.c    |    2 +-
 drivers/net/wireless/netwave_cs.c |    2 +-
 drivers/net/wireless/ray_cs.c     |    6 +++---
 drivers/pcmcia/pcmcia_resource.c  |    5 ++++-
 drivers/scsi/pcmcia/nsp_cs.c      |    2 +-
 include/pcmcia/cs.h               |    2 +-
 13 files changed, 21 insertions(+), 18 deletions(-)

--- 0002/drivers/isdn/hisax/sedlbauer_cs.c
+++ work/drivers/isdn/hisax/sedlbauer_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -341,7 +341,7 @@ static int sedlbauer_config(struct pcmci
 	    if (pcmcia_request_window(&link, &req, &link->win) != 0)
 		goto next_entry;
 	    map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-	    if (pcmcia_map_mem_page(link->win, &map) != 0)
+	    if (pcmcia_map_mem_page(link, link->win, &map) != 0)
 		goto next_entry;
 	}
 	/* If we got this far, we're cool! */
--- 0006/drivers/mtd/maps/pcmciamtd.c
+++ work/drivers/mtd/maps/pcmciamtd.c	2006-12-13 12:59:50.000000000 +0900
@@ -121,7 +121,7 @@ static caddr_t remap_window(struct map_i
 		DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x",
 		      dev->offset, mrq.CardOffset);
 		mrq.Page = 0;
-		if( (ret = pcmcia_map_mem_page(win, &mrq)) != CS_SUCCESS) {
+		if( (ret = pcmcia_map_mem_page(dev->p_dev, win, &mrq)) != CS_SUCCESS) {
 			cs_error(dev->p_dev, MapMemPage, ret);
 			return NULL;
 		}
--- 0006/drivers/net/pcmcia/fmvj18x_cs.c
+++ work/drivers/net/pcmcia/fmvj18x_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -553,7 +553,7 @@ static int fmvj18x_get_hwinfo(struct pcm
     base = ioremap(req.Base, req.Size);
     mem.Page = 0;
     mem.CardOffset = 0;
-    pcmcia_map_mem_page(link->win, &mem);
+    pcmcia_map_mem_page(link, link->win, &mem);
 
     /*
      *  MBH10304 CISTPL_FUNCE_LAN_NODE_ID format
@@ -608,7 +608,7 @@ static int fmvj18x_setup_mfc(struct pcmc
     base = ioremap(req.Base, req.Size);
     mem.Page = 0;
     mem.CardOffset = 0;
-    pcmcia_map_mem_page(link->win, &mem);
+    pcmcia_map_mem_page(link, link->win, &mem);
 
     ioaddr = dev->base_addr;
     writeb(0x47, base+0x800);	/* Config Option Register of LAN */
--- 0006/drivers/net/pcmcia/ibmtr_cs.c
+++ work/drivers/net/pcmcia/ibmtr_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -257,7 +257,7 @@ static int ibmtr_config(struct pcmcia_de
 
     mem.CardOffset = mmiobase;
     mem.Page = 0;
-    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link, link->win, &mem));
     ti->mmio = ioremap(req.Base, req.Size);
 
     /* Allocate the SRAM memory window */
@@ -270,7 +270,7 @@ static int ibmtr_config(struct pcmcia_de
 
     mem.CardOffset = srambase;
     mem.Page = 0;
-    CS_CHECK(MapMemPage, pcmcia_map_mem_page(info->sram_win_handle, &mem));
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link, info->sram_win_handle, &mem));
 
     ti->sram_base = mem.CardOffset >> 12;
     ti->sram_virt = ioremap(req.Base, req.Size);
--- 0006/drivers/net/pcmcia/pcnet_cs.c
+++ work/drivers/net/pcmcia/pcnet_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -319,7 +319,7 @@ static hw_info_t *get_hwinfo(struct pcmc
     mem.Page = 0;
     for (i = 0; i < NR_INFO; i++) {
 	mem.CardOffset = hw_info[i].offset & ~(req.Size-1);
-	pcmcia_map_mem_page(link->win, &mem);
+	pcmcia_map_mem_page(link, link->win, &mem);
 	base = &virt[hw_info[i].offset & (req.Size-1)];
 	if ((readb(base+0) == hw_info[i].a0) &&
 	    (readb(base+2) == hw_info[i].a1) &&
@@ -1497,7 +1497,7 @@ static int setup_shmem_window(struct pcm
     offset = mem.CardOffset % window_size;
     mem.CardOffset -= offset;
     mem.Page = 0;
-    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link, link->win, &mem));
 
     /* Try scribbling on the buffer */
     info->base = ioremap(req.Base, window_size);
--- 0002/drivers/net/pcmcia/smc91c92_cs.c
+++ work/drivers/net/pcmcia/smc91c92_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -525,7 +525,7 @@ static int mhz_mfc_config(struct pcmcia_
     mem.CardOffset = mem.Page = 0;
     if (smc->manfid == MANFID_MOTOROLA)
 	mem.CardOffset = link->conf.ConfigBase;
-    i = pcmcia_map_mem_page(link->win, &mem);
+    i = pcmcia_map_mem_page(link, link->win, &mem);
 
     if ((i == CS_SUCCESS)
 	&& (smc->manfid == MANFID_MEGAHERTZ)
--- 0002/drivers/net/pcmcia/xirc2ps_cs.c
+++ work/drivers/net/pcmcia/xirc2ps_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -961,7 +961,7 @@ xirc2ps_config(struct pcmcia_device * li
 	local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;
 	mem.CardOffset = 0x0;
 	mem.Page = 0;
-	if ((err = pcmcia_map_mem_page(link->win, &mem))) {
+	if ((err = pcmcia_map_mem_page(link, link->win, &mem))) {
 	    cs_error(link, MapMemPage, err);
 	    goto config_error;
 	}
--- 0002/drivers/net/wireless/airo_cs.c
+++ work/drivers/net/wireless/airo_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -311,7 +311,7 @@ static int airo_config(struct pcmcia_dev
 			if (pcmcia_request_window(&link, &req, &link->win) != 0)
 				goto next_entry;
 			map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-			if (pcmcia_map_mem_page(link->win, &map) != 0)
+			if (pcmcia_map_mem_page(link, link->win, &map) != 0)
 				goto next_entry;
 		}
 		/* If we got this far, we're cool! */
--- 0002/drivers/net/wireless/netwave_cs.c
+++ work/drivers/net/wireless/netwave_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -782,7 +782,7 @@ static int netwave_pcmcia_config(struct 
     req.AccessSpeed = mem_speed;
     CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));
     mem.CardOffset = 0x20000; mem.Page = 0; 
-    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link, link->win, &mem));
 
     /* Store base address of the common window frame */
     ramBase = ioremap(req.Base, 0x8000);
--- 0006/drivers/net/wireless/ray_cs.c
+++ work/drivers/net/wireless/ray_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -442,7 +442,7 @@ static int ray_config(struct pcmcia_devi
     req.AccessSpeed = ray_mem_speed;
     CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));
     mem.CardOffset = 0x0000; mem.Page = 0;
-    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link, link->win, &mem));
     local->sram = ioremap(req.Base,req.Size);
 
 /*** Set up 16k window for shared memory (receive buffer) ***************/
@@ -452,7 +452,7 @@ static int ray_config(struct pcmcia_devi
     req.AccessSpeed = ray_mem_speed;
     CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &local->rmem_handle));
     mem.CardOffset = 0x8000; mem.Page = 0;
-    CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem));
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link, local->rmem_handle, &mem));
     local->rmem = ioremap(req.Base,req.Size);
 
 /*** Set up window for attribute memory ***********************************/
@@ -462,7 +462,7 @@ static int ray_config(struct pcmcia_devi
     req.AccessSpeed = ray_mem_speed;
     CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &local->amem_handle));
     mem.CardOffset = 0x0000; mem.Page = 0;
-    CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem));
+    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link, local->amem_handle, &mem));
     local->amem = ioremap(req.Base,req.Size);
 
     DEBUG(3,"ray_config sram=%p\n",local->sram);
--- 0006/drivers/pcmcia/pcmcia_resource.c
+++ work/drivers/pcmcia/pcmcia_resource.c	2006-12-13 12:59:50.000000000 +0900
@@ -394,9 +394,12 @@ int pcmcia_get_mem_page(window_handle_t 
 EXPORT_SYMBOL(pcmcia_get_mem_page);
 
 
-int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
+int pcmcia_map_mem_page(struct pcmcia_device *p_dev, 
+			window_handle_t wh, memreq_t *req)
 {
 	struct pcmcia_socket *s;
+	window_handle_t win = wh;
+
 	if ((win == NULL) || (win->magic != WINDOW_MAGIC))
 		return CS_BAD_HANDLE;
 	if (req->Page != 0)
--- 0002/drivers/scsi/pcmcia/nsp_cs.c
+++ work/drivers/scsi/pcmcia/nsp_cs.c	2006-12-13 12:59:50.000000000 +0900
@@ -1773,7 +1773,7 @@ static int nsp_cs_config(struct pcmcia_d
 			if (pcmcia_request_window(&link, &req, &link->win) != 0)
 				goto next_entry;
 			map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-			if (pcmcia_map_mem_page(link->win, &map) != 0)
+			if (pcmcia_map_mem_page(link, link->win, &map) != 0)
 				goto next_entry;
 
 			data->MmioAddress = (unsigned long)ioremap_nocache(req.Base, req.Size);
--- 0006/include/pcmcia/cs.h
+++ work/include/pcmcia/cs.h	2006-12-13 12:59:50.000000000 +0900
@@ -375,7 +375,7 @@ int pcmcia_access_configuration_register
 int pcmcia_get_configuration_info(struct pcmcia_device *p_dev, config_info_t *config);
 int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status);
 int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
-int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
+int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, memreq_t *req);
 int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
 int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
 int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);



More information about the linux-pcmcia mailing list