aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/cistpl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/cistpl.c')
-rw-r--r--drivers/pcmcia/cistpl.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index e29a6ddf2fd7..dd7651ff5b43 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -89,8 +89,10 @@ static void __iomem *
89set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags) 89set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags)
90{ 90{
91 pccard_mem_map *mem = &s->cis_mem; 91 pccard_mem_map *mem = &s->cis_mem;
92 int ret;
93
92 if (!(s->features & SS_CAP_STATIC_MAP) && mem->res == NULL) { 94 if (!(s->features & SS_CAP_STATIC_MAP) && mem->res == NULL) {
93 mem->res = find_mem_region(0, s->map_size, s->map_size, 0, s); 95 mem->res = pcmcia_find_mem_region(0, s->map_size, s->map_size, 0, s);
94 if (mem->res == NULL) { 96 if (mem->res == NULL) {
95 printk(KERN_NOTICE "cs: unable to map card memory!\n"); 97 printk(KERN_NOTICE "cs: unable to map card memory!\n");
96 return NULL; 98 return NULL;
@@ -99,7 +101,12 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
99 } 101 }
100 mem->card_start = card_offset; 102 mem->card_start = card_offset;
101 mem->flags = flags; 103 mem->flags = flags;
102 s->ops->set_mem_map(s, mem); 104 ret = s->ops->set_mem_map(s, mem);
105 if (ret) {
106 iounmap(s->cis_virt);
107 return NULL;
108 }
109
103 if (s->features & SS_CAP_STATIC_MAP) { 110 if (s->features & SS_CAP_STATIC_MAP) {
104 if (s->cis_virt) 111 if (s->cis_virt)
105 iounmap(s->cis_virt); 112 iounmap(s->cis_virt);
@@ -119,13 +126,13 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
119#define IS_ATTR 1 126#define IS_ATTR 1
120#define IS_INDIRECT 8 127#define IS_INDIRECT 8
121 128
122int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, 129int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
123 u_int len, void *ptr) 130 u_int len, void *ptr)
124{ 131{
125 void __iomem *sys, *end; 132 void __iomem *sys, *end;
126 unsigned char *buf = ptr; 133 unsigned char *buf = ptr;
127 134
128 cs_dbg(s, 3, "read_cis_mem(%d, %#x, %u)\n", attr, addr, len); 135 cs_dbg(s, 3, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
129 136
130 if (attr & IS_INDIRECT) { 137 if (attr & IS_INDIRECT) {
131 /* Indirect accesses use a bunch of special registers at fixed 138 /* Indirect accesses use a bunch of special registers at fixed
@@ -182,14 +189,16 @@ int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
182 *(u_char *)(ptr+2), *(u_char *)(ptr+3)); 189 *(u_char *)(ptr+2), *(u_char *)(ptr+3));
183 return 0; 190 return 0;
184} 191}
192EXPORT_SYMBOL(pcmcia_read_cis_mem);
193
185 194
186void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, 195void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
187 u_int len, void *ptr) 196 u_int len, void *ptr)
188{ 197{
189 void __iomem *sys, *end; 198 void __iomem *sys, *end;
190 unsigned char *buf = ptr; 199 unsigned char *buf = ptr;
191 200
192 cs_dbg(s, 3, "write_cis_mem(%d, %#x, %u)\n", attr, addr, len); 201 cs_dbg(s, 3, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
193 202
194 if (attr & IS_INDIRECT) { 203 if (attr & IS_INDIRECT) {
195 /* Indirect accesses use a bunch of special registers at fixed 204 /* Indirect accesses use a bunch of special registers at fixed
@@ -239,6 +248,8 @@ void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
239 } 248 }
240 } 249 }
241} 250}
251EXPORT_SYMBOL(pcmcia_write_cis_mem);
252
242 253
243/*====================================================================== 254/*======================================================================
244 255
@@ -274,7 +285,7 @@ static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
274 ret = read_cb_mem(s, attr, addr, len, ptr); 285 ret = read_cb_mem(s, attr, addr, len, ptr);
275 else 286 else
276#endif 287#endif
277 ret = read_cis_mem(s, attr, addr, len, ptr); 288 ret = pcmcia_read_cis_mem(s, attr, addr, len, ptr);
278 289
279 if (ret == 0) { 290 if (ret == 0) {
280 /* Copy data into the cache */ 291 /* Copy data into the cache */
@@ -348,7 +359,7 @@ int verify_cis_cache(struct pcmcia_socket *s)
348 read_cb_mem(s, cis->attr, cis->addr, len, buf); 359 read_cb_mem(s, cis->attr, cis->addr, len, buf);
349 else 360 else
350#endif 361#endif
351 read_cis_mem(s, cis->attr, cis->addr, len, buf); 362 pcmcia_read_cis_mem(s, cis->attr, cis->addr, len, buf);
352 363
353 if (memcmp(buf, cis->cache, len) != 0) { 364 if (memcmp(buf, cis->cache, len) != 0) {
354 kfree(buf); 365 kfree(buf);
@@ -381,6 +392,7 @@ int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis)
381 memcpy(s->fake_cis, cis->Data, cis->Length); 392 memcpy(s->fake_cis, cis->Data, cis->Length);
382 return CS_SUCCESS; 393 return CS_SUCCESS;
383} 394}
395EXPORT_SYMBOL(pcmcia_replace_cis);
384 396
385/*====================================================================== 397/*======================================================================
386 398