aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-06-27 19:28:52 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 21:03:19 -0400
commite6ea0b9ec5131ac360581d6924fed536758bd024 (patch)
treea6d97d93480e578b95ac855855906bee423c099f
parent3b659fb862db02c77ea7e6db7e70b6e888681579 (diff)
[PATCH] pcmcia: rename some functions
Rename some functions in drivers/pcmcia/ to show they belong to the PCMCIA subsystem. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/pcmcia/cistpl.c14
-rw-r--r--drivers/pcmcia/cs.c32
-rw-r--r--drivers/pcmcia/cs_internal.h11
-rw-r--r--drivers/pcmcia/rsrc_mgr.c6
4 files changed, 31 insertions, 32 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index e29a6ddf2fd7..af4ff08d6dcd 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -90,7 +90,7 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
90{ 90{
91 pccard_mem_map *mem = &s->cis_mem; 91 pccard_mem_map *mem = &s->cis_mem;
92 if (!(s->features & SS_CAP_STATIC_MAP) && mem->res == NULL) { 92 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); 93 mem->res = pcmcia_find_mem_region(0, s->map_size, s->map_size, 0, s);
94 if (mem->res == NULL) { 94 if (mem->res == NULL) {
95 printk(KERN_NOTICE "cs: unable to map card memory!\n"); 95 printk(KERN_NOTICE "cs: unable to map card memory!\n");
96 return NULL; 96 return NULL;
@@ -119,13 +119,13 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
119#define IS_ATTR 1 119#define IS_ATTR 1
120#define IS_INDIRECT 8 120#define IS_INDIRECT 8
121 121
122int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, 122int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
123 u_int len, void *ptr) 123 u_int len, void *ptr)
124{ 124{
125 void __iomem *sys, *end; 125 void __iomem *sys, *end;
126 unsigned char *buf = ptr; 126 unsigned char *buf = ptr;
127 127
128 cs_dbg(s, 3, "read_cis_mem(%d, %#x, %u)\n", attr, addr, len); 128 cs_dbg(s, 3, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
129 129
130 if (attr & IS_INDIRECT) { 130 if (attr & IS_INDIRECT) {
131 /* Indirect accesses use a bunch of special registers at fixed 131 /* Indirect accesses use a bunch of special registers at fixed
@@ -183,13 +183,13 @@ int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
183 return 0; 183 return 0;
184} 184}
185 185
186void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, 186void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
187 u_int len, void *ptr) 187 u_int len, void *ptr)
188{ 188{
189 void __iomem *sys, *end; 189 void __iomem *sys, *end;
190 unsigned char *buf = ptr; 190 unsigned char *buf = ptr;
191 191
192 cs_dbg(s, 3, "write_cis_mem(%d, %#x, %u)\n", attr, addr, len); 192 cs_dbg(s, 3, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
193 193
194 if (attr & IS_INDIRECT) { 194 if (attr & IS_INDIRECT) {
195 /* Indirect accesses use a bunch of special registers at fixed 195 /* Indirect accesses use a bunch of special registers at fixed
@@ -274,7 +274,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); 274 ret = read_cb_mem(s, attr, addr, len, ptr);
275 else 275 else
276#endif 276#endif
277 ret = read_cis_mem(s, attr, addr, len, ptr); 277 ret = pcmcia_read_cis_mem(s, attr, addr, len, ptr);
278 278
279 if (ret == 0) { 279 if (ret == 0) {
280 /* Copy data into the cache */ 280 /* Copy data into the cache */
@@ -348,7 +348,7 @@ int verify_cis_cache(struct pcmcia_socket *s)
348 read_cb_mem(s, cis->attr, cis->addr, len, buf); 348 read_cb_mem(s, cis->attr, cis->addr, len, buf);
349 else 349 else
350#endif 350#endif
351 read_cis_mem(s, cis->attr, cis->addr, len, buf); 351 pcmcia_read_cis_mem(s, cis->attr, cis->addr, len, buf);
352 352
353 if (memcmp(buf, cis->cache, len) != 0) { 353 if (memcmp(buf, cis->cache, len) != 0) {
354 kfree(buf); 354 kfree(buf);
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index fec9e0304738..574706e74791 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -787,7 +787,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
787 return 1; 787 return 1;
788 for (i = 0; i < MAX_IO_WIN; i++) { 788 for (i = 0; i < MAX_IO_WIN; i++) {
789 if (s->io[i].NumPorts == 0) { 789 if (s->io[i].NumPorts == 0) {
790 s->io[i].res = find_io_region(*base, num, align, s); 790 s->io[i].res = pcmcia_find_io_region(*base, num, align, s);
791 if (s->io[i].res) { 791 if (s->io[i].res) {
792 s->io[i].Attributes = attr; 792 s->io[i].Attributes = attr;
793 s->io[i].BasePort = *base = s->io[i].res->start; 793 s->io[i].BasePort = *base = s->io[i].res->start;
@@ -800,7 +800,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
800 /* Try to extend top of window */ 800 /* Try to extend top of window */
801 try = s->io[i].BasePort + s->io[i].NumPorts; 801 try = s->io[i].BasePort + s->io[i].NumPorts;
802 if ((*base == 0) || (*base == try)) 802 if ((*base == 0) || (*base == try))
803 if (adjust_io_region(s->io[i].res, s->io[i].res->start, 803 if (pcmcia_adjust_io_region(s->io[i].res, s->io[i].res->start,
804 s->io[i].res->end + num, s) == 0) { 804 s->io[i].res->end + num, s) == 0) {
805 *base = try; 805 *base = try;
806 s->io[i].NumPorts += num; 806 s->io[i].NumPorts += num;
@@ -810,7 +810,7 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
810 /* Try to extend bottom of window */ 810 /* Try to extend bottom of window */
811 try = s->io[i].BasePort - num; 811 try = s->io[i].BasePort - num;
812 if ((*base == 0) || (*base == try)) 812 if ((*base == 0) || (*base == try))
813 if (adjust_io_region(s->io[i].res, s->io[i].res->start - num, 813 if (pcmcia_adjust_io_region(s->io[i].res, s->io[i].res->start - num,
814 s->io[i].res->end, s) == 0) { 814 s->io[i].res->end, s) == 0) {
815 s->io[i].BasePort = *base = try; 815 s->io[i].BasePort = *base = try;
816 s->io[i].NumPorts += num; 816 s->io[i].NumPorts += num;
@@ -872,12 +872,12 @@ int pccard_access_configuration_register(struct pcmcia_socket *s,
872 872
873 switch (reg->Action) { 873 switch (reg->Action) {
874 case CS_READ: 874 case CS_READ:
875 read_cis_mem(s, 1, addr, 1, &val); 875 pcmcia_read_cis_mem(s, 1, addr, 1, &val);
876 reg->Value = val; 876 reg->Value = val;
877 break; 877 break;
878 case CS_WRITE: 878 case CS_WRITE:
879 val = reg->Value; 879 val = reg->Value;
880 write_cis_mem(s, 1, addr, 1, &val); 880 pcmcia_write_cis_mem(s, 1, addr, 1, &val);
881 break; 881 break;
882 default: 882 default:
883 return CS_BAD_ARGS; 883 return CS_BAD_ARGS;
@@ -1050,7 +1050,7 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function, cs_status_
1050 (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) { 1050 (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) {
1051 u_char reg; 1051 u_char reg;
1052 if (c->Present & PRESENT_PIN_REPLACE) { 1052 if (c->Present & PRESENT_PIN_REPLACE) {
1053 read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg); 1053 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg);
1054 status->CardState |= 1054 status->CardState |=
1055 (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0; 1055 (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0;
1056 status->CardState |= 1056 status->CardState |=
@@ -1064,7 +1064,7 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function, cs_status_
1064 status->CardState |= CS_EVENT_READY_CHANGE; 1064 status->CardState |= CS_EVENT_READY_CHANGE;
1065 } 1065 }
1066 if (c->Present & PRESENT_EXT_STATUS) { 1066 if (c->Present & PRESENT_EXT_STATUS) {
1067 read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg); 1067 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg);
1068 status->CardState |= 1068 status->CardState |=
1069 (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0; 1069 (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0;
1070 } 1070 }
@@ -1401,7 +1401,7 @@ int pcmcia_request_configuration(client_handle_t handle,
1401 c->Present = c->CardValues = req->Present; 1401 c->Present = c->CardValues = req->Present;
1402 if (req->Present & PRESENT_COPY) { 1402 if (req->Present & PRESENT_COPY) {
1403 c->Copy = req->Copy; 1403 c->Copy = req->Copy;
1404 write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &c->Copy); 1404 pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &c->Copy);
1405 } 1405 }
1406 if (req->Present & PRESENT_OPTION) { 1406 if (req->Present & PRESENT_OPTION) {
1407 if (s->functions == 1) { 1407 if (s->functions == 1) {
@@ -1415,30 +1415,30 @@ int pcmcia_request_configuration(client_handle_t handle,
1415 if (c->state & CONFIG_IRQ_REQ) 1415 if (c->state & CONFIG_IRQ_REQ)
1416 if (!(c->irq.Attributes & IRQ_FORCED_PULSE)) 1416 if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
1417 c->Option |= COR_LEVEL_REQ; 1417 c->Option |= COR_LEVEL_REQ;
1418 write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option); 1418 pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
1419 mdelay(40); 1419 mdelay(40);
1420 } 1420 }
1421 if (req->Present & PRESENT_STATUS) { 1421 if (req->Present & PRESENT_STATUS) {
1422 c->Status = req->Status; 1422 c->Status = req->Status;
1423 write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &c->Status); 1423 pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &c->Status);
1424 } 1424 }
1425 if (req->Present & PRESENT_PIN_REPLACE) { 1425 if (req->Present & PRESENT_PIN_REPLACE) {
1426 c->Pin = req->Pin; 1426 c->Pin = req->Pin;
1427 write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &c->Pin); 1427 pcmcia_write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &c->Pin);
1428 } 1428 }
1429 if (req->Present & PRESENT_EXT_STATUS) { 1429 if (req->Present & PRESENT_EXT_STATUS) {
1430 c->ExtStatus = req->ExtStatus; 1430 c->ExtStatus = req->ExtStatus;
1431 write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, &c->ExtStatus); 1431 pcmcia_write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, &c->ExtStatus);
1432 } 1432 }
1433 if (req->Present & PRESENT_IOBASE_0) { 1433 if (req->Present & PRESENT_IOBASE_0) {
1434 u_char b = c->io.BasePort1 & 0xff; 1434 u_char b = c->io.BasePort1 & 0xff;
1435 write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b); 1435 pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b);
1436 b = (c->io.BasePort1 >> 8) & 0xff; 1436 b = (c->io.BasePort1 >> 8) & 0xff;
1437 write_cis_mem(s, 1, (base + CISREG_IOBASE_1)>>1, 1, &b); 1437 pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_1)>>1, 1, &b);
1438 } 1438 }
1439 if (req->Present & PRESENT_IOSIZE) { 1439 if (req->Present & PRESENT_IOSIZE) {
1440 u_char b = c->io.NumPorts1 + c->io.NumPorts2 - 1; 1440 u_char b = c->io.NumPorts1 + c->io.NumPorts2 - 1;
1441 write_cis_mem(s, 1, (base + CISREG_IOSIZE)>>1, 1, &b); 1441 pcmcia_write_cis_mem(s, 1, (base + CISREG_IOSIZE)>>1, 1, &b);
1442 } 1442 }
1443 1443
1444 /* Configure I/O windows */ 1444 /* Configure I/O windows */
@@ -1678,7 +1678,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
1678 win->sock = s; 1678 win->sock = s;
1679 1679
1680 if (!(s->features & SS_CAP_STATIC_MAP)) { 1680 if (!(s->features & SS_CAP_STATIC_MAP)) {
1681 win->ctl.res = find_mem_region(req->Base, req->Size, align, 1681 win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align,
1682 (req->Attributes & WIN_MAP_BELOW_1MB), s); 1682 (req->Attributes & WIN_MAP_BELOW_1MB), s);
1683 if (!win->ctl.res) 1683 if (!win->ctl.res)
1684 return CS_IN_USE; 1684 return CS_IN_USE;
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 7830d7e42ea0..0b4c18edfa49 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -123,9 +123,9 @@ void cb_free(struct pcmcia_socket *s);
123int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len, void *ptr); 123int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len, void *ptr);
124 124
125/* In cistpl.c */ 125/* In cistpl.c */
126int read_cis_mem(struct pcmcia_socket *s, int attr, 126int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr,
127 u_int addr, u_int len, void *ptr); 127 u_int addr, u_int len, void *ptr);
128void write_cis_mem(struct pcmcia_socket *s, int attr, 128void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr,
129 u_int addr, u_int len, void *ptr); 129 u_int addr, u_int len, void *ptr);
130void release_cis_mem(struct pcmcia_socket *s); 130void release_cis_mem(struct pcmcia_socket *s);
131void destroy_cis_cache(struct pcmcia_socket *s); 131void destroy_cis_cache(struct pcmcia_socket *s);
@@ -134,13 +134,12 @@ int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t
134 134
135/* In rsrc_mgr */ 135/* In rsrc_mgr */
136void pcmcia_validate_mem(struct pcmcia_socket *s); 136void pcmcia_validate_mem(struct pcmcia_socket *s);
137struct resource *find_io_region(unsigned long base, int num, unsigned long align, 137struct resource *pcmcia_find_io_region(unsigned long base, int num, unsigned long align,
138 struct pcmcia_socket *s); 138 struct pcmcia_socket *s);
139int adjust_io_region(struct resource *res, unsigned long r_start, 139int pcmcia_adjust_io_region(struct resource *res, unsigned long r_start,
140 unsigned long r_end, struct pcmcia_socket *s); 140 unsigned long r_end, struct pcmcia_socket *s);
141struct resource *find_mem_region(u_long base, u_long num, u_long align, 141struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align,
142 int low, struct pcmcia_socket *s); 142 int low, struct pcmcia_socket *s);
143int adjust_resource_info(client_handle_t handle, adjust_t *adj);
144void release_resource_db(struct pcmcia_socket *s); 143void release_resource_db(struct pcmcia_socket *s);
145 144
146/* In socket_sysfs.c */ 145/* In socket_sysfs.c */
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index b9269e66281a..fca10a1a56d0 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -105,7 +105,7 @@ void pcmcia_validate_mem(struct pcmcia_socket *s)
105} 105}
106EXPORT_SYMBOL(pcmcia_validate_mem); 106EXPORT_SYMBOL(pcmcia_validate_mem);
107 107
108int adjust_io_region(struct resource *res, unsigned long r_start, 108int pcmcia_adjust_io_region(struct resource *res, unsigned long r_start,
109 unsigned long r_end, struct pcmcia_socket *s) 109 unsigned long r_end, struct pcmcia_socket *s)
110{ 110{
111 if (s->resource_ops->adjust_io_region) 111 if (s->resource_ops->adjust_io_region)
@@ -113,7 +113,7 @@ int adjust_io_region(struct resource *res, unsigned long r_start,
113 return -ENOMEM; 113 return -ENOMEM;
114} 114}
115 115
116struct resource *find_io_region(unsigned long base, int num, 116struct resource *pcmcia_find_io_region(unsigned long base, int num,
117 unsigned long align, struct pcmcia_socket *s) 117 unsigned long align, struct pcmcia_socket *s)
118{ 118{
119 if (s->resource_ops->find_io) 119 if (s->resource_ops->find_io)
@@ -121,7 +121,7 @@ struct resource *find_io_region(unsigned long base, int num,
121 return NULL; 121 return NULL;
122} 122}
123 123
124struct resource *find_mem_region(u_long base, u_long num, u_long align, 124struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align,
125 int low, struct pcmcia_socket *s) 125 int low, struct pcmcia_socket *s)
126{ 126{
127 if (s->resource_ops->find_mem) 127 if (s->resource_ops->find_mem)