提交 b5cb259e 编写于 作者: D Dominik Brodowski

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: NDominik Brodowski <linux@dominikbrodowski.net>
上级 a3d0d4d8
...@@ -84,8 +84,6 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, ...@@ -84,8 +84,6 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
{ {
struct ipw_dev *ipw = priv_data; struct ipw_dev *ipw = priv_data;
struct resource *io_resource; struct resource *io_resource;
memreq_t memreq_attr_memory;
memreq_t memreq_common_memory;
int ret; int ret;
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
...@@ -121,11 +119,8 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, ...@@ -121,11 +119,8 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
if (ret != 0) if (ret != 0)
goto exit1; goto exit1;
memreq_common_memory.CardOffset = cfg->mem.win[0].card_addr;
memreq_common_memory.Page = 0;
ret = pcmcia_map_mem_page(p_dev, ipw->handle_common_memory, ret = pcmcia_map_mem_page(p_dev, ipw->handle_common_memory,
&memreq_common_memory); cfg->mem.win[0].card_addr);
if (ret != 0) if (ret != 0)
goto exit2; goto exit2;
...@@ -150,12 +145,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, ...@@ -150,12 +145,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
if (ret != 0) if (ret != 0)
goto exit2; goto exit2;
memreq_attr_memory.CardOffset = 0; ret = pcmcia_map_mem_page(p_dev, ipw->handle_attr_memory, 0);
memreq_attr_memory.Page = 0;
ret = pcmcia_map_mem_page(p_dev, ipw->handle_attr_memory,
&memreq_attr_memory);
if (ret != 0) if (ret != 0)
goto exit3; goto exit3;
......
...@@ -232,7 +232,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, ...@@ -232,7 +232,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
*/ */
if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
memreq_t map;
req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
req->Attributes |= WIN_ENABLE; req->Attributes |= WIN_ENABLE;
req->Base = mem->win[0].host_addr; req->Base = mem->win[0].host_addr;
...@@ -240,9 +239,9 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, ...@@ -240,9 +239,9 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0)
return -ENODEV; return -ENODEV;
map.Page = 0;
map.CardOffset = mem->win[0].card_addr; if (pcmcia_map_mem_page(p_dev, p_dev->win,
if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) mem->win[0].card_addr) != 0)
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
......
...@@ -102,7 +102,7 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) ...@@ -102,7 +102,7 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
{ {
struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1; struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
window_handle_t win = (window_handle_t)map->map_priv_2; window_handle_t win = (window_handle_t)map->map_priv_2;
memreq_t mrq; unsigned int offset;
int ret; int ret;
if (!pcmcia_dev_present(dev->p_dev)) { if (!pcmcia_dev_present(dev->p_dev)) {
...@@ -110,15 +110,14 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) ...@@ -110,15 +110,14 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
return 0; return 0;
} }
mrq.CardOffset = to & ~(dev->win_size-1); offset = to & ~(dev->win_size-1);
if(mrq.CardOffset != dev->offset) { if (offset != dev->offset) {
DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x",
dev->offset, mrq.CardOffset); dev->offset, offset);
mrq.Page = 0; ret = pcmcia_map_mem_page(dev->p_dev, win, offset);
ret = pcmcia_map_mem_page(dev->p_dev, win, &mrq);
if (ret != 0) if (ret != 0)
return NULL; return NULL;
dev->offset = mrq.CardOffset; dev->offset = offset;
} }
return dev->win_base + (to & (dev->win_size-1)); return dev->win_base + (to & (dev->win_size-1));
} }
......
...@@ -545,7 +545,6 @@ static int fmvj18x_config(struct pcmcia_device *link) ...@@ -545,7 +545,6 @@ static int fmvj18x_config(struct pcmcia_device *link)
static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
{ {
win_req_t req; win_req_t req;
memreq_t mem;
u_char __iomem *base; u_char __iomem *base;
int i, j; int i, j;
...@@ -558,9 +557,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) ...@@ -558,9 +557,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
return -1; return -1;
base = ioremap(req.Base, req.Size); base = ioremap(req.Base, req.Size);
mem.Page = 0; pcmcia_map_mem_page(link, link->win, 0);
mem.CardOffset = 0;
pcmcia_map_mem_page(link, link->win, &mem);
/* /*
* MBH10304 CISTPL_FUNCE_LAN_NODE_ID format * 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,7 +591,6 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
static int fmvj18x_setup_mfc(struct pcmcia_device *link) static int fmvj18x_setup_mfc(struct pcmcia_device *link)
{ {
win_req_t req; win_req_t req;
memreq_t mem;
int i; int i;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
unsigned int ioaddr; unsigned int ioaddr;
...@@ -614,9 +610,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) ...@@ -614,9 +610,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)
return -1; return -1;
} }
mem.Page = 0; i = pcmcia_map_mem_page(link, link->win, 0);
mem.CardOffset = 0;
i = pcmcia_map_mem_page(link, link->win, &mem);
if (i != 0) { if (i != 0) {
iounmap(lp->base); iounmap(lp->base);
lp->base = NULL; lp->base = NULL;
......
...@@ -211,7 +211,6 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) ...@@ -211,7 +211,6 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
struct net_device *dev = info->dev; struct net_device *dev = info->dev;
struct tok_info *ti = netdev_priv(dev); struct tok_info *ti = netdev_priv(dev);
win_req_t req; win_req_t req;
memreq_t mem;
int i, ret; int i, ret;
dev_dbg(&link->dev, "ibmtr_config\n"); dev_dbg(&link->dev, "ibmtr_config\n");
...@@ -250,9 +249,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) ...@@ -250,9 +249,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = mmiobase; ret = pcmcia_map_mem_page(link, link->win, mmiobase);
mem.Page = 0;
ret = pcmcia_map_mem_page(link, link->win, &mem);
if (ret) if (ret)
goto failed; goto failed;
ti->mmio = ioremap(req.Base, req.Size); ti->mmio = ioremap(req.Base, req.Size);
...@@ -267,13 +264,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) ...@@ -267,13 +264,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = srambase; ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase);
mem.Page = 0;
ret = pcmcia_map_mem_page(link, info->sram_win_handle, &mem);
if (ret) if (ret)
goto failed; goto failed;
ti->sram_base = mem.CardOffset >> 12; ti->sram_base = srambase >> 12;
ti->sram_virt = ioremap(req.Base, req.Size); ti->sram_virt = ioremap(req.Base, req.Size);
ti->sram_phys = req.Base; ti->sram_phys = req.Base;
......
...@@ -301,7 +301,6 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) ...@@ -301,7 +301,6 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
{ {
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
win_req_t req; win_req_t req;
memreq_t mem;
u_char __iomem *base, *virt; u_char __iomem *base, *virt;
int i, j; int i, j;
...@@ -314,10 +313,8 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) ...@@ -314,10 +313,8 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
return NULL; return NULL;
virt = ioremap(req.Base, req.Size); virt = ioremap(req.Base, req.Size);
mem.Page = 0;
for (i = 0; i < NR_INFO; i++) { for (i = 0; i < NR_INFO; i++) {
mem.CardOffset = hw_info[i].offset & ~(req.Size-1); pcmcia_map_mem_page(link, link->win, hw_info[i].offset & ~(req.Size-1));
pcmcia_map_mem_page(link, link->win, &mem);
base = &virt[hw_info[i].offset & (req.Size-1)]; base = &virt[hw_info[i].offset & (req.Size-1)];
if ((readb(base+0) == hw_info[i].a0) && if ((readb(base+0) == hw_info[i].a0) &&
(readb(base+2) == hw_info[i].a1) && (readb(base+2) == hw_info[i].a1) &&
...@@ -1463,7 +1460,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, ...@@ -1463,7 +1460,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
pcnet_dev_t *info = PRIV(dev); pcnet_dev_t *info = PRIV(dev);
win_req_t req; win_req_t req;
memreq_t mem;
int i, window_size, offset, ret; int i, window_size, offset, ret;
window_size = (stop_pg - start_pg) << 8; window_size = (stop_pg - start_pg) << 8;
...@@ -1482,11 +1478,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, ...@@ -1482,11 +1478,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = (start_pg << 8) + cm_offset; offset = (start_pg << 8) + cm_offset;
offset = mem.CardOffset % window_size; offset -= offset % window_size;
mem.CardOffset -= offset; ret = pcmcia_map_mem_page(link, link->win, offset);
mem.Page = 0;
ret = pcmcia_map_mem_page(link, link->win, &mem);
if (ret) if (ret)
goto failed; goto failed;
......
...@@ -443,7 +443,7 @@ static int mhz_mfc_config(struct pcmcia_device *link) ...@@ -443,7 +443,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
struct smc_private *smc = netdev_priv(dev); struct smc_private *smc = netdev_priv(dev);
win_req_t req; win_req_t req;
memreq_t mem; unsigned int offset;
int i; int i;
link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Attributes |= CONF_ENABLE_SPKR;
...@@ -467,11 +467,8 @@ static int mhz_mfc_config(struct pcmcia_device *link) ...@@ -467,11 +467,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)
return -ENODEV; return -ENODEV;
smc->base = ioremap(req.Base, req.Size); smc->base = ioremap(req.Base, req.Size);
mem.CardOffset = mem.Page = 0; offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0;
if (smc->manfid == MANFID_MOTOROLA) i = pcmcia_map_mem_page(link, link->win, offset);
mem.CardOffset = link->conf.ConfigBase;
i = pcmcia_map_mem_page(link, link->win, &mem);
if ((i == 0) && if ((i == 0) &&
(smc->manfid == MANFID_MEGAHERTZ) && (smc->manfid == MANFID_MEGAHERTZ) &&
(smc->cardid == PRODID_MEGAHERTZ_EM3288)) (smc->cardid == PRODID_MEGAHERTZ_EM3288))
......
...@@ -870,7 +870,6 @@ xirc2ps_config(struct pcmcia_device * link) ...@@ -870,7 +870,6 @@ xirc2ps_config(struct pcmcia_device * link)
if (local->dingo) { if (local->dingo) {
win_req_t req; win_req_t req;
memreq_t mem;
/* Reset the modem's BAR to the correct value /* Reset the modem's BAR to the correct value
* This is necessary because in the RequestConfiguration call, * This is necessary because in the RequestConfiguration call,
...@@ -898,9 +897,7 @@ xirc2ps_config(struct pcmcia_device * link) ...@@ -898,9 +897,7 @@ xirc2ps_config(struct pcmcia_device * link)
goto config_error; goto config_error;
local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;
mem.CardOffset = 0x0; if ((err = pcmcia_map_mem_page(link, link->win, 0)))
mem.Page = 0;
if ((err = pcmcia_map_mem_page(link, link->win, &mem)))
goto config_error; goto config_error;
/* Setup the CCRs; there are no infos in the CIS about the Ethernet /* Setup the CCRs; there are no infos in the CIS about the Ethernet
......
...@@ -207,16 +207,14 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, ...@@ -207,16 +207,14 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
*/ */
if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
memreq_t map;
req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
req->Base = mem->win[0].host_addr; req->Base = mem->win[0].host_addr;
req->Size = mem->win[0].len; req->Size = mem->win[0].len;
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0)
return -ENODEV; return -ENODEV;
map.Page = 0; if (pcmcia_map_mem_page(p_dev, p_dev->win,
map.CardOffset = mem->win[0].card_addr; mem->win[0].card_addr) != 0)
if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */
......
...@@ -64,7 +64,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) ...@@ -64,7 +64,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
{ {
struct ssb_bus *ssb; struct ssb_bus *ssb;
win_req_t win; win_req_t win;
memreq_t mem;
int err = -ENOMEM; int err = -ENOMEM;
int res = 0; int res = 0;
...@@ -87,9 +86,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) ...@@ -87,9 +86,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
if (res != 0) if (res != 0)
goto err_kfree_ssb; goto err_kfree_ssb;
mem.CardOffset = 0; res = pcmcia_map_mem_page(dev, dev->win, 0);
mem.Page = 0;
res = pcmcia_map_mem_page(dev, dev->win, &mem);
if (res != 0) if (res != 0)
goto err_disable; goto err_disable;
......
...@@ -393,7 +393,6 @@ static int ray_config(struct pcmcia_device *link) ...@@ -393,7 +393,6 @@ static int ray_config(struct pcmcia_device *link)
int ret = 0; int ret = 0;
int i; int i;
win_req_t req; win_req_t req;
memreq_t mem;
struct net_device *dev = (struct net_device *)link->priv; struct net_device *dev = (struct net_device *)link->priv;
ray_dev_t *local = netdev_priv(dev); ray_dev_t *local = netdev_priv(dev);
...@@ -430,9 +429,7 @@ static int ray_config(struct pcmcia_device *link) ...@@ -430,9 +429,7 @@ static int ray_config(struct pcmcia_device *link)
ret = pcmcia_request_window(link, &req, &link->win); ret = pcmcia_request_window(link, &req, &link->win);
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x0000; ret = pcmcia_map_mem_page(link, link->win, 0);
mem.Page = 0;
ret = pcmcia_map_mem_page(link, link->win, &mem);
if (ret) if (ret)
goto failed; goto failed;
local->sram = ioremap(req.Base, req.Size); local->sram = ioremap(req.Base, req.Size);
...@@ -446,9 +443,7 @@ static int ray_config(struct pcmcia_device *link) ...@@ -446,9 +443,7 @@ static int ray_config(struct pcmcia_device *link)
ret = pcmcia_request_window(link, &req, &local->rmem_handle); ret = pcmcia_request_window(link, &req, &local->rmem_handle);
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x8000; ret = pcmcia_map_mem_page(link, local->rmem_handle, 0x8000);
mem.Page = 0;
ret = pcmcia_map_mem_page(link, local->rmem_handle, &mem);
if (ret) if (ret)
goto failed; goto failed;
local->rmem = ioremap(req.Base, req.Size); local->rmem = ioremap(req.Base, req.Size);
...@@ -462,9 +457,7 @@ static int ray_config(struct pcmcia_device *link) ...@@ -462,9 +457,7 @@ static int ray_config(struct pcmcia_device *link)
ret = pcmcia_request_window(link, &req, &local->amem_handle); ret = pcmcia_request_window(link, &req, &local->amem_handle);
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x0000; ret = pcmcia_map_mem_page(link, local->amem_handle, 0);
mem.Page = 0;
ret = pcmcia_map_mem_page(link, local->amem_handle, &mem);
if (ret) if (ret)
goto failed; goto failed;
local->amem = ioremap(req.Base, req.Size); local->amem = ioremap(req.Base, req.Size);
......
...@@ -193,7 +193,7 @@ EXPORT_SYMBOL(pcmcia_write_config_byte); ...@@ -193,7 +193,7 @@ EXPORT_SYMBOL(pcmcia_write_config_byte);
int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh,
memreq_t *req) unsigned int offset)
{ {
struct pcmcia_socket *s = p_dev->socket; struct pcmcia_socket *s = p_dev->socket;
int ret; int ret;
...@@ -201,12 +201,9 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, ...@@ -201,12 +201,9 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh,
wh--; wh--;
if (wh >= MAX_WIN) if (wh >= MAX_WIN)
return -EINVAL; return -EINVAL;
if (req->Page != 0) {
dev_dbg(&s->dev, "failure: requested page is zero\n");
return -EINVAL;
}
mutex_lock(&s->ops_mutex); mutex_lock(&s->ops_mutex);
s->win[wh].card_start = req->CardOffset; s->win[wh].card_start = offset;
ret = s->ops->set_mem_map(s, &s->win[wh]); ret = s->ops->set_mem_map(s, &s->win[wh]);
if (ret) if (ret)
dev_warn(&s->dev, "failed to set_mem_map\n"); dev_warn(&s->dev, "failed to set_mem_map\n");
......
...@@ -1661,7 +1661,6 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, ...@@ -1661,7 +1661,6 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
} }
if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
memreq_t map;
cistpl_mem_t *mem = cistpl_mem_t *mem =
(cfg->mem.nwin) ? &cfg->mem : &dflt->mem; (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
cfg_mem->req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; cfg_mem->req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
...@@ -1673,8 +1672,8 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, ...@@ -1673,8 +1672,8 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
cfg_mem->req.AccessSpeed = 0; cfg_mem->req.AccessSpeed = 0;
if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0) if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0)
goto next_entry; goto next_entry;
map.Page = 0; map.CardOffset = mem->win[0].card_addr; if (pcmcia_map_mem_page(p_dev, p_dev->win,
if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) mem->win[0].card_addr) != 0)
goto next_entry; goto next_entry;
cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size);
......
...@@ -556,7 +556,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -556,7 +556,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
void *priv_data) void *priv_data)
{ {
win_req_t *req = priv_data; win_req_t *req = priv_data;
memreq_t map;
if (cfg->index == 0) if (cfg->index == 0)
return -ENODEV; return -ENODEV;
...@@ -602,9 +601,8 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -602,9 +601,8 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win)) if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV; return -ENODEV;
map.Page = 0; if (pcmcia_map_mem_page(p_dev, p_dev->win,
map.CardOffset = mem->win[0].card_addr; mem->win[0].card_addr))
if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */
......
...@@ -308,7 +308,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -308,7 +308,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
void *priv_data) void *priv_data)
{ {
win_req_t *req = priv_data; win_req_t *req = priv_data;
memreq_t map;
if (cfg->index == 0) if (cfg->index == 0)
return -ENODEV; return -ENODEV;
...@@ -354,9 +353,8 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -354,9 +353,8 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win)) if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV; return -ENODEV;
map.Page = 0; if (pcmcia_map_mem_page(p_dev, p_dev->win,
map.CardOffset = mem->win[0].card_addr; mem->win[0].card_addr))
if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */
......
...@@ -286,7 +286,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -286,7 +286,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
void *priv_data) void *priv_data)
{ {
win_req_t *req = priv_data; win_req_t *req = priv_data;
memreq_t map;
if (cfg->index == 0) if (cfg->index == 0)
return -ENODEV; return -ENODEV;
...@@ -332,9 +331,8 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -332,9 +331,8 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win)) if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV; return -ENODEV;
map.Page = 0; if (pcmcia_map_mem_page(p_dev, p_dev->win,
map.CardOffset = mem->win[0].card_addr; mem->win[0].card_addr))
if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */
......
...@@ -68,12 +68,6 @@ typedef struct config_req_t { ...@@ -68,12 +68,6 @@ typedef struct config_req_t {
#define PRESENT_IOBASE_3 0x100 #define PRESENT_IOBASE_3 0x100
#define PRESENT_IOSIZE 0x200 #define PRESENT_IOSIZE 0x200
/* For GetMemPage, MapMemPage */
typedef struct memreq_t {
u_int CardOffset;
u_short Page;
} memreq_t;
/* For RequestWindow */ /* For RequestWindow */
typedef struct win_req_t { typedef struct win_req_t {
u_int Attributes; u_int Attributes;
......
...@@ -202,7 +202,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, ...@@ -202,7 +202,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req,
window_handle_t *wh); window_handle_t *wh);
int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win);
int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
memreq_t *req); unsigned int offset);
int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
void pcmcia_disable_device(struct pcmcia_device *p_dev); void pcmcia_disable_device(struct pcmcia_device *p_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册