]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.32pre1 2.3.32pre1
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:29:07 +0000 (15:29 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:29:07 +0000 (15:29 -0500)
15 files changed:
Makefile
arch/i386/defconfig
drivers/net/pcmcia/ray_cs.c
drivers/pcmcia/bulkmem.c
drivers/pcmcia/cb_enabler.c
drivers/pcmcia/cistpl.c
drivers/pcmcia/cs.c
drivers/pcmcia/ds.c
drivers/pcmcia/i82365.c
drivers/pcmcia/rsrc_mgr.c
drivers/pcmcia/tcic.c
include/pcmcia/bulkmem.h
include/pcmcia/cistpl.h
include/pcmcia/cs.h
mm/memory.c

index 15c712d6daeea13958dbbc832d46d838e7c1f5a9..c6397bb8fa8b3c02db995048234837aa9156f3ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 3
-SUBLEVEL = 31
+SUBLEVEL = 32
 EXTRAVERSION =
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
index d7e19c7834be63a674b8d37cea338961e3b323c4..1779090aa96a599b60b6f6d5e69f2db0503cb613 100644 (file)
@@ -306,6 +306,7 @@ CONFIG_PCMCIA_PCNET=y
 # CONFIG_PCMCIA_NMCLAN is not set
 # CONFIG_PCMCIA_SMC91C92 is not set
 # CONFIG_PCMCIA_XIRC2PS is not set
+# CONFIG_AIRONET4500_CS is not set
 # CONFIG_PCMCIA_3C575 is not set
 # CONFIG_PCMCIA_TULIP is not set
 # CONFIG_PCMCIA_EPIC100 is not set
@@ -354,6 +355,11 @@ CONFIG_MOUSE=y
 CONFIG_PSMOUSE=y
 # CONFIG_82C710_MOUSE is not set
 # CONFIG_PC110_PAD is not set
+
+#
+# Joysticks
+#
+# CONFIG_JOYSTICK is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -367,11 +373,6 @@ CONFIG_PSMOUSE=y
 # Video For Linux
 #
 # CONFIG_VIDEO_DEV is not set
-
-#
-# Joystick support
-#
-# CONFIG_JOYSTICK is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -409,7 +410,6 @@ CONFIG_AUTOFS_FS=y
 # CONFIG_VFAT_FS is not set
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
-# CONFIG_UDF_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -418,6 +418,7 @@ CONFIG_DEVPTS_FS=y
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
 # CONFIG_UFS_FS is not set
 
 #
index ad7a7263a816bd60a143c92afff12dcbeb1e6db4..20d44ecc2b6232a929da602acb86ee963a237d24 100644 (file)
@@ -312,8 +312,9 @@ static char rcsid[] = "Raylink/WebGear wireless LAN - Corey <Thomas corey@world.
 static void cs_error(client_handle_t handle, int func, int ret)
 {
     error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
+    pcmcia_report_error(handle, &err);
 }
+
 /*=============================================================================
     ray_attach() creates an "instance" of the driver, allocating
     local data structures for one device.  The device is registered
@@ -409,7 +410,7 @@ static dev_link_t *ray_attach(void)
 
     init_timer(&local->timer);
 
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
         printk("ray_cs ray_attach RegisterClient unhappy - detaching\n");
         cs_error(link->handle, RegisterClient, ret);
@@ -462,7 +463,7 @@ static void ray_detach(dev_link_t *link)
 
     /* Break the link with Card Services */
     if (link->handle)
-        CardServices(DeregisterClient, link->handle);
+        pcmcia_deregister_client(link->handle);
     
     /* Unlink device structure, free pieces */
     *linkp = link->next;
@@ -482,14 +483,14 @@ static void ray_detach(dev_link_t *link)
     ethernet device available to the system.
 =============================================================================*/
 #define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed
+while ((last_ret=fn(args))!=0) goto cs_failed
 #define MAX_TUPLE_SIZE 128
 static void ray_config(dev_link_t *link)
 {
     client_handle_t handle = link->handle;
     tuple_t tuple;
     cisparse_t parse;
-    int last_fn, last_ret;
+    int last_fn = 0, last_ret = 0;
     int i;
     u_char buf[MAX_TUPLE_SIZE];
     win_req_t req;
@@ -501,23 +502,23 @@ static void ray_config(dev_link_t *link)
 
     /* This reads the card's CONFIG tuple to find its configuration regs */
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(pcmcia_get_first_tuple, handle, &tuple);
     tuple.TupleData = buf;
     tuple.TupleDataMax = MAX_TUPLE_SIZE;
     tuple.TupleOffset = 0;
-    CS_CHECK(GetTupleData, handle, &tuple);
-    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    CS_CHECK(pcmcia_get_tuple_data, handle, &tuple);
+    CS_CHECK(pcmcia_parse_tuple, handle, &tuple, &parse);
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
 
     /* Determine card type and firmware version */
     buf[0] = buf[MAX_TUPLE_SIZE - 1] = 0;
     tuple.DesiredTuple = CISTPL_VERS_1;
-    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(pcmcia_get_first_tuple, handle, &tuple);
     tuple.TupleData = buf;
     tuple.TupleDataMax = MAX_TUPLE_SIZE;
     tuple.TupleOffset = 2;
-    CS_CHECK(GetTupleData, handle, &tuple);
+    CS_CHECK(pcmcia_get_tuple_data, handle, &tuple);
 
     for (i=0; i<tuple.TupleDataLen - 4; i++) 
         if (buf[i] == 0) buf[i] = ' ';
@@ -529,13 +530,13 @@ static void ray_config(dev_link_t *link)
     /* Now allocate an interrupt line.  Note that this does not
        actually assign a handler to the interrupt.
     */
-    CS_CHECK(RequestIRQ, link->handle, &link->irq);
+    CS_CHECK(pcmcia_request_irq, link->handle, &link->irq);
     dev->irq = link->irq.AssignedIRQ;
     
     /* This actually configures the PCMCIA socket -- setting up
        the I/O windows and the interrupt mapping.
     */
-    CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+    CS_CHECK(pcmcia_request_configuration, link->handle, &link->conf);
 
 /*** Set up 32k window for shared memory (transmit and control) ************/
     req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT;
@@ -543,9 +544,9 @@ static void ray_config(dev_link_t *link)
     req.Size = 0x8000;
     req.AccessSpeed = ray_mem_speed;
     link->win = (window_handle_t)link->handle;
-    CS_CHECK(RequestWindow, &link->win, &req);
+    CS_CHECK(pcmcia_request_window, &link->win, &req);
     mem.CardOffset = 0x0000; mem.Page = 0;
-    CS_CHECK(MapMemPage, link->win, &mem);
+    CS_CHECK(pcmcia_map_mem_page, link->win, &mem);
     local->sram = (UCHAR *)(ioremap(req.Base,req.Size));
 
 /*** Set up 16k window for shared memory (receive buffer) ***************/
@@ -554,9 +555,9 @@ static void ray_config(dev_link_t *link)
     req.Size = 0x4000;
     req.AccessSpeed = ray_mem_speed;
     local->rmem_handle = (window_handle_t)link->handle;
-    CS_CHECK(RequestWindow, &local->rmem_handle, &req);
+    CS_CHECK(pcmcia_request_window, &local->rmem_handle, &req);
     mem.CardOffset = 0x8000; mem.Page = 0;
-    CS_CHECK(MapMemPage, local->rmem_handle, &mem);
+    CS_CHECK(pcmcia_map_mem_page, local->rmem_handle, &mem);
     local->rmem = (UCHAR *)(ioremap(req.Base,req.Size));
 
 /*** Set up window for attribute memory ***********************************/
@@ -565,9 +566,9 @@ static void ray_config(dev_link_t *link)
     req.Size = 0x1000;
     req.AccessSpeed = ray_mem_speed;
     local->amem_handle = (window_handle_t)link->handle;
-    CS_CHECK(RequestWindow, &local->amem_handle, &req);
+    CS_CHECK(pcmcia_request_window, &local->amem_handle, &req);
     mem.CardOffset = 0x0000; mem.Page = 0;
-    CS_CHECK(MapMemPage, local->amem_handle, &mem);
+    CS_CHECK(pcmcia_map_mem_page, local->amem_handle, &mem);
     local->amem = (UCHAR *)(ioremap(req.Base,req.Size));
 
     DEBUG(3,"ray_config sram=%p\n",local->sram);
@@ -893,15 +894,15 @@ static void ray_release(u_long arg)
     iounmap(local->rmem);
     iounmap(local->amem);
     /* Do bother checking to see if these succeed or not */
-    i = CardServices(ReleaseWindow, link->win);
+    i = pcmcia_release_window(link->win);
     if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(link->win) ret = %x\n",i);
-    i = CardServices(ReleaseWindow, local->amem_handle);
+    i = pcmcia_release_window(local->amem_handle);
     if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->amem) ret = %x\n",i);
-    i = CardServices(ReleaseWindow, local->rmem_handle);
+    i = pcmcia_release_window(local->rmem_handle);
     if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->rmem) ret = %x\n",i);
-    i = CardServices(ReleaseConfiguration, link->handle);
+    i = pcmcia_release_configuration(link->handle);
     if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseConfiguration ret = %x\n",i);
-    i = CardServices(ReleaseIRQ, link->handle, &link->irq);
+    i = pcmcia_release_irq(link->handle, &link->irq);
     if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseIRQ ret = %x\n",i);
 
     link->state &= ~DEV_CONFIG;
@@ -950,7 +951,7 @@ static int ray_event(event_t event, int priority,
                 dev->tbusy = 1;
                 dev->start = 0;
             }
-            CardServices(ReleaseConfiguration, link->handle);
+            pcmcia_release_configuration(link->handle);
         }
         break;
     case CS_EVENT_PM_RESUME:
@@ -958,7 +959,7 @@ static int ray_event(event_t event, int priority,
         /* Fall through... */
     case CS_EVENT_CARD_RESET:
         if (link->state & DEV_CONFIG) {
-            CardServices(RequestConfiguration, link->handle, &link->conf);
+            pcmcia_request_configuration(link->handle, &link->conf);
             if (link->open) {
                 ray_reset(dev);
                 dev->tbusy = 0;
@@ -2671,14 +2672,8 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
 static int __init init_ray_cs(void)
 {
     int rc;
-    servinfo_t serv;
     
     DEBUG(1, "%s\n", rcsid);
-    CardServices(GetCardServicesInfo, &serv);
-    if (serv.Revision != CS_RELEASE_CODE) {
-        printk(KERN_NOTICE "ray: Card Services release does not match!\n");
-        return -1;
-    }
     rc = register_pcmcia_driver(&dev_info, &ray_attach, &ray_detach);
     DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n",rc);
 #ifdef CONFIG_PROC_FS    
index 60d22749478928556804ef608b2bdcd53f8a239f..e3c602cd4c6dd4f74a097d1f2ec66d796ef27989 100644 (file)
@@ -294,9 +294,9 @@ int MTDHelperEntry(int func, void *a1, void *a2)
 {
     switch (func) {
     case MTDRequestWindow:
-       return CardServices(RequestWindow, a1, a2, NULL);
+       return pcmcia_request_window(a1, a2);
     case MTDReleaseWindow:
-       return CardServices(ReleaseWindow, a1, NULL, NULL);
+       return pcmcia_release_window(a1);
     case MTDModifyWindow:
        return mtd_modify_window(a1, a2); break;
     case MTDSetVpp:
@@ -403,7 +403,7 @@ static int match_region(client_handle_t handle, memory_handle_t list,
     return CS_NO_MORE_ITEMS;
 } /* match_region */
 
-int get_first_region(client_handle_t handle, region_info_t *rgn)
+int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn)
 {
     socket_info_t *s = SOCKET(handle);
     if (CHECK_HANDLE(handle))
@@ -422,7 +422,7 @@ int get_first_region(client_handle_t handle, region_info_t *rgn)
        return match_region(handle, s->c_region, rgn);
 } /* get_first_region */
 
-int get_next_region(client_handle_t handle, region_info_t *rgn)
+int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn)
 {
     if (CHECK_HANDLE(handle))
        return CS_BAD_HANDLE;
@@ -435,7 +435,7 @@ int get_next_region(client_handle_t handle, region_info_t *rgn)
     
 ======================================================================*/
 
-int register_mtd(client_handle_t handle, mtd_reg_t *reg)
+int pcmcia_register_mtd(client_handle_t handle, mtd_reg_t *reg)
 {
     memory_handle_t list;
     socket_info_t *s;
@@ -470,7 +470,7 @@ int register_mtd(client_handle_t handle, mtd_reg_t *reg)
     
 ======================================================================*/
 
-int register_erase_queue(client_handle_t *handle, eraseq_hdr_t *header)
+int pcmcia_register_erase_queue(client_handle_t *handle, eraseq_hdr_t *header)
 {
     eraseq_t *queue;
 
@@ -485,7 +485,7 @@ int register_erase_queue(client_handle_t *handle, eraseq_hdr_t *header)
     return CS_SUCCESS;
 } /* register_erase_queue */
 
-int deregister_erase_queue(eraseq_handle_t eraseq)
+int pcmcia_deregister_erase_queue(eraseq_handle_t eraseq)
 {
     int i;
     if (CHECK_ERASEQ(eraseq))
@@ -499,7 +499,7 @@ int deregister_erase_queue(eraseq_handle_t eraseq)
     return CS_SUCCESS;
 } /* deregister_erase_queue */
 
-int check_erase_queue(eraseq_handle_t eraseq)
+int pcmcia_check_erase_queue(eraseq_handle_t eraseq)
 {
     int i;
     if (CHECK_ERASEQ(eraseq))
@@ -517,7 +517,7 @@ int check_erase_queue(eraseq_handle_t eraseq)
     
 ======================================================================*/
 
-int open_memory(client_handle_t *handle, open_mem_t *open)
+int pcmcia_open_memory(client_handle_t *handle, open_mem_t *open)
 {
     socket_info_t *s;
     memory_handle_t region;
@@ -550,7 +550,7 @@ int open_memory(client_handle_t *handle, open_mem_t *open)
     
 ======================================================================*/
 
-int close_memory(memory_handle_t handle)
+int pcmcia_close_memory(memory_handle_t handle)
 {
     DEBUG(1, "cs: close_memory(0x%p)\n", handle);
     if (CHECK_REGION(handle))
@@ -565,7 +565,7 @@ int close_memory(memory_handle_t handle)
     
 ======================================================================*/
 
-int read_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf)
+int pcmcia_read_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf)
 {
     mtd_request_t mtd;
     if (CHECK_REGION(handle))
@@ -591,7 +591,7 @@ int read_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf)
     
 ======================================================================*/
 
-int write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf)
+int pcmcia_write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf)
 {
     mtd_request_t mtd;
     if (CHECK_REGION(handle))
@@ -616,7 +616,7 @@ int write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf)
     
 ======================================================================*/
 
-int copy_memory(memory_handle_t handle, copy_op_t *req)
+int pcmcia_copy_memory(memory_handle_t handle, copy_op_t *req)
 {
     if (CHECK_REGION(handle))
        return CS_BAD_HANDLE;
index f8fef22ed963b2392afd9e96f7cbff0d480ea9eb..bb8fe17b2bbff3dbaab53c0281a0c6a149980208 100644 (file)
@@ -113,7 +113,7 @@ static bus_info_t bus_table[MAX_DRIVER];
 static void cs_error(client_handle_t handle, int func, int ret)
 {
     error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
+    pcmcia_report_error(handle, &err);
 }
 
 /*====================================================================*/
@@ -148,7 +148,7 @@ struct dev_link_t *cb_attach(int n)
        CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
-    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != 0) {
        cs_error(link->handle, RegisterClient, ret);
        cb_detach(link);
@@ -183,7 +183,7 @@ static void cb_detach(dev_link_t *link)
     }
     
     if (link->handle)
-       CardServices(DeregisterClient, link->handle);
+       pcmcia_deregister_client(link->handle);
     
     *linkp = link->next;
     kfree_s(link, sizeof(struct dev_link_t));
@@ -206,7 +206,7 @@ static void cb_config(dev_link_t *link)
     link->state |= DEV_CONFIG;
 
     /* Get PCI bus info */
-    CardServices(GetConfigurationInfo, handle, &config);
+    pcmcia_get_configuration_info(handle, &config);
     bus = config.Option; devfn = config.Function;
 
     /* Is this a new bus? */
@@ -221,14 +221,14 @@ static void cb_config(dev_link_t *link)
        b->ncfg = b->nuse = 1;
 
        /* Special hook: CS know what to do... */
-       i = CardServices(RequestIO, handle, NULL);
+       i = pcmcia_request_io(handle, NULL);
        if (i != CS_SUCCESS) {
            cs_error(handle, RequestIO, i);
            return;
        }
        b->flags |= DID_REQUEST;
        b->owner = link;
-       i = CardServices(RequestConfiguration, handle, &link->conf);
+       i = pcmcia_request_configuration(handle, &link->conf);
        if (i != CS_SUCCESS) {
            cs_error(handle, RequestConfiguration, i);
            return;
@@ -267,12 +267,11 @@ static void cb_release(u_long arg)
        if (link->state & DEV_SUSPEND)
            b->flags &= ~DID_CONFIG;
        else if ((b->flags & DID_CONFIG) && (--b->ncfg == 0)) {
-           CardServices(ReleaseConfiguration, b->owner->handle,
-                        &b->owner->conf);
+           pcmcia_release_configuration(b->owner->handle);
            b->flags &= ~DID_CONFIG;
        }
        if ((b->flags & DID_REQUEST) && (--b->nuse == 0)) {
-           CardServices(ReleaseIO, b->owner->handle, NULL);
+           pcmcia_release_io(b->owner->handle, NULL);
            b->flags &= ~DID_REQUEST;
        }
        if (b->flags == 0) {
@@ -314,8 +313,7 @@ static int cb_event(event_t event, int priority,
                drv->ops->suspend(link->dev);
            b->ncfg--;
            if (b->ncfg == 0)
-               CardServices(ReleaseConfiguration, link->handle,
-                            &link->conf);
+               pcmcia_release_configuration(link->handle);
        }
        break;
     case CS_EVENT_PM_RESUME:
@@ -325,7 +323,7 @@ static int cb_event(event_t event, int priority,
        if (link->state & DEV_CONFIG) {
            b->ncfg++;
            if (b->ncfg == 1)
-               CardServices(RequestConfiguration, link->handle,
+               pcmcia_request_configuration(link->handle,
                             &link->conf);
            if (drv->ops->resume != NULL)
                drv->ops->resume(link->dev);
@@ -379,7 +377,7 @@ static int __init init_cb_enabler(void)
 {
     servinfo_t serv;
     DEBUG(0, "%s\n", version);
-    CardServices(GetCardServicesInfo, &serv);
+    pcmcia_get_card_services_info(&serv);
     if (serv.Revision != CS_RELEASE_CODE) {
        printk(KERN_NOTICE "cb_enabler: Card Services release "
               "does not match!\n");
index ad568bcddcf390ce64ef30b2096fe9caf368f3aa..c2cd8e7855139d62936bc5d8aa55f51a9d1a2aa8 100644 (file)
@@ -158,7 +158,7 @@ static int cis_readable(u_long base)
     vs->cis_mem.sys_start = base;
     vs->cis_mem.sys_stop = base+vs->cap.map_size-1;
     vs->cis_virt = bus_ioremap(vs->cap.bus, base, vs->cap.map_size);
-    ret = validate_cis(vs->clients, &info1);
+    ret = pcmcia_validate_cis(vs->clients, &info1);
     /* invalidate mapping and CIS cache */
     bus_iounmap(vs->cap.bus, vs->cis_virt); vs->cis_used = 0;
     if ((ret != 0) || (info1.Chains == 0))
@@ -167,7 +167,7 @@ static int cis_readable(u_long base)
     vs->cis_mem.sys_stop = base+2*vs->cap.map_size-1;
     vs->cis_virt = bus_ioremap(vs->cap.bus, base+vs->cap.map_size,
                               vs->cap.map_size);
-    ret = validate_cis(vs->clients, &info2);
+    ret = pcmcia_validate_cis(vs->clients, &info2);
     bus_iounmap(vs->cap.bus, vs->cis_virt); vs->cis_used = 0;
     return ((ret == 0) && (info1.Chains == info2.Chains));
 }
@@ -315,7 +315,7 @@ int verify_cis_cache(socket_info_t *s)
     
 ======================================================================*/
 
-int replace_cis(client_handle_t handle, cisdump_t *cis)
+int pcmcia_replace_cis(client_handle_t handle, cisdump_t *cis)
 {
     socket_info_t *s;
     if (CHECK_HANDLE(handle))
@@ -353,9 +353,9 @@ typedef struct tuple_flags {
 #define MFC_FN(f)      (((tuple_flags *)(&(f)))->mfc_fn)
 #define SPACE(f)       (((tuple_flags *)(&(f)))->space)
 
-int get_next_tuple(client_handle_t handle, tuple_t *tuple);
+int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple);
 
-int get_first_tuple(client_handle_t handle, tuple_t *tuple)
+int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
 {
     socket_info_t *s;
     if (CHECK_HANDLE(handle))
@@ -381,15 +381,15 @@ int get_first_tuple(client_handle_t handle, tuple_t *tuple)
        !(tuple->Attributes & TUPLE_RETURN_COMMON)) {
        cisdata_t req = tuple->DesiredTuple;
        tuple->DesiredTuple = CISTPL_LONGLINK_MFC;
-       if (get_next_tuple(handle, tuple) == CS_SUCCESS) {
+       if (pcmcia_get_next_tuple(handle, tuple) == CS_SUCCESS) {
            tuple->DesiredTuple = CISTPL_LINKTARGET;
-           if (get_next_tuple(handle, tuple) != CS_SUCCESS)
+           if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS)
                return CS_NO_MORE_ITEMS;
        } else
            tuple->CISOffset = tuple->TupleLink = 0;
        tuple->DesiredTuple = req;
     }
-    return get_next_tuple(handle, tuple);
+    return pcmcia_get_next_tuple(handle, tuple);
 }
 
 static int follow_link(socket_info_t *s, tuple_t *tuple)
@@ -430,7 +430,7 @@ static int follow_link(socket_info_t *s, tuple_t *tuple)
     return ofs;
 }
 
-int get_next_tuple(client_handle_t handle, tuple_t *tuple)
+int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple)
 {
     socket_info_t *s;
     u_char link[2], tmp;
@@ -510,7 +510,7 @@ int get_next_tuple(client_handle_t handle, tuple_t *tuple)
        ofs += link[1] + 2;
     }
     if (i == MAX_TUPLES) {
-       DEBUG(1, "cs: overrun in get_next_tuple for socket %d\n",
+       DEBUG(1, "cs: overrun in pcmcia_get_next_tuple for socket %d\n",
              handle->Socket);
        return CS_NO_MORE_ITEMS;
     }
@@ -525,7 +525,7 @@ int get_next_tuple(client_handle_t handle, tuple_t *tuple)
 
 #define _MIN(a, b)             (((a) < (b)) ? (a) : (b))
 
-int get_tuple_data(client_handle_t handle, tuple_t *tuple)
+int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple)
 {
     socket_info_t *s;
     u_int len;
@@ -1234,7 +1234,7 @@ static int parse_org(tuple_t *tuple, cistpl_org_t *org)
 
 /*====================================================================*/
 
-int parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
 {
     int ret = CS_SUCCESS;
     
@@ -1326,14 +1326,14 @@ int read_tuple(client_handle_t handle, cisdata_t code, void *parse)
     
     tuple.DesiredTuple = code;
     tuple.Attributes = TUPLE_RETURN_COMMON;
-    ret = CardServices(GetFirstTuple, handle, &tuple, NULL);
+    ret = pcmcia_get_first_tuple(handle, &tuple);
     if (ret != CS_SUCCESS) return ret;
     tuple.TupleData = buf;
     tuple.TupleOffset = 0;
     tuple.TupleDataMax = sizeof(buf);
-    ret = CardServices(GetTupleData, handle, &tuple, NULL);
+    ret = pcmcia_get_tuple_data(handle, &tuple);
     if (ret != CS_SUCCESS) return ret;
-    ret = CardServices(ParseTuple, handle, &tuple, parse);
+    ret = pcmcia_parse_tuple(handle, &tuple, parse);
     return ret;
 }
 
@@ -1347,7 +1347,7 @@ int read_tuple(client_handle_t handle, cisdata_t code, void *parse)
     
 ======================================================================*/
 
-int validate_cis(client_handle_t handle, cisinfo_t *info)
+int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info)
 {
     tuple_t tuple;
     cisparse_t p;
@@ -1359,7 +1359,7 @@ int validate_cis(client_handle_t handle, cisinfo_t *info)
     info->Chains = reserved = errors = 0;
     tuple.DesiredTuple = RETURN_FIRST_TUPLE;
     tuple.Attributes = TUPLE_RETURN_COMMON;
-    ret = get_first_tuple(handle, &tuple);
+    ret = pcmcia_get_first_tuple(handle, &tuple);
     if (ret != CS_SUCCESS)
        return CS_SUCCESS;
 
@@ -1380,7 +1380,7 @@ int validate_cis(client_handle_t handle, cisinfo_t *info)
        return CS_SUCCESS;
     
     for (info->Chains = 1; info->Chains < MAX_TUPLES; info->Chains++) {
-       ret = get_next_tuple(handle, &tuple);
+       ret = pcmcia_get_next_tuple(handle, &tuple);
        if (ret != CS_SUCCESS) break;
        if (((tuple.TupleCode > 0x23) && (tuple.TupleCode < 0x40)) ||
            ((tuple.TupleCode > 0x47) && (tuple.TupleCode < 0x80)) ||
index 46058ca12c71de929625df63a82ed9aa439168b0..3b74627a26c98055fb1c369917bdbba33202530a 100644 (file)
@@ -316,6 +316,7 @@ int register_ss_entry(int nsock, ss_entry_t ss_entry)
        s->cis_mem.flags = 0;
        s->cis_mem.speed = cis_speed;
        s->erase_busy.next = s->erase_busy.prev = &s->erase_busy;
+       spin_lock_init(&s->lock);
        
        for (i = 0; i < sockets; i++)
            if (socket_table[i] == NULL) break;
@@ -779,7 +780,7 @@ static void release_io_space(socket_info_t *s, ioaddr_t base,
     
 ======================================================================*/
 
-static int access_configuration_register(client_handle_t handle,
+int pcmcia_access_configuration_register(client_handle_t handle,
                                         conf_reg_t *reg)
 {
     socket_info_t *s;
@@ -826,7 +827,7 @@ static int access_configuration_register(client_handle_t handle,
     
 ======================================================================*/
 
-static int bind_device(bind_req_t *req)
+int pcmcia_bind_device(bind_req_t *req)
 {
     client_t *client;
     socket_info_t *s;
@@ -861,7 +862,7 @@ static int bind_device(bind_req_t *req)
     
 ======================================================================*/
 
-static int bind_mtd(mtd_bind_t *req)
+int pcmcia_bind_mtd(mtd_bind_t *req)
 {
     socket_info_t *s;
     memory_handle_t region;
@@ -890,7 +891,7 @@ static int bind_mtd(mtd_bind_t *req)
 
 /*====================================================================*/
 
-static int deregister_client(client_handle_t handle)
+int pcmcia_deregister_client(client_handle_t handle)
 {
     client_t **client;
     socket_info_t *s;
@@ -945,7 +946,7 @@ static int deregister_client(client_handle_t handle)
 
 /*====================================================================*/
 
-static int get_configuration_info(client_handle_t handle,
+int pcmcia_get_configuration_info(client_handle_t handle,
                                  config_info_t *config)
 {
     socket_info_t *s;
@@ -1016,7 +1017,7 @@ static int get_configuration_info(client_handle_t handle,
     
 ======================================================================*/
 
-static int get_card_services_info(servinfo_t *info)
+int pcmcia_get_card_services_info(servinfo_t *info)
 {
     info->Signature[0] = 'C';
     info->Signature[1] = 'S';
@@ -1034,7 +1035,7 @@ static int get_card_services_info(servinfo_t *info)
     
 ======================================================================*/
 
-static int get_first_client(client_handle_t *handle, client_req_t *req)
+int pcmcia_get_first_client(client_handle_t *handle, client_req_t *req)
 {
     socket_t s;
     if (req->Attributes & CLIENT_THIS_SOCKET)
@@ -1051,7 +1052,7 @@ static int get_first_client(client_handle_t *handle, client_req_t *req)
 
 /*====================================================================*/
 
-static int get_next_client(client_handle_t *handle, client_req_t *req)
+int pcmcia_get_next_client(client_handle_t *handle, client_req_t *req)
 {
     socket_info_t *s;
     if ((handle == NULL) || CHECK_HANDLE(*handle))
@@ -1070,7 +1071,7 @@ static int get_next_client(client_handle_t *handle, client_req_t *req)
 
 /*====================================================================*/
 
-static int get_window(window_handle_t *handle, int idx, win_req_t *req)
+int pcmcia_get_window(window_handle_t *handle, int idx, win_req_t *req)
 {
     socket_info_t *s;
     window_t *win;
@@ -1103,18 +1104,18 @@ static int get_window(window_handle_t *handle, int idx, win_req_t *req)
     return CS_SUCCESS;
 } /* get_window */
 
-static int get_first_window(client_handle_t *handle, win_req_t *req)
+int pcmcia_get_first_window(client_handle_t *handle, win_req_t *req)
 {
     if ((handle == NULL) || CHECK_HANDLE(*handle))
        return CS_BAD_HANDLE;
-    return get_window((window_handle_t *)handle, 0, req);
+    return pcmcia_get_window((window_handle_t *)handle, 0, req);
 }
 
-static int get_next_window(window_handle_t *win, win_req_t *req)
+int pcmcia_get_next_window(window_handle_t *win, win_req_t *req)
 {
     if ((win == NULL) || ((*win)->magic != WINDOW_MAGIC))
        return CS_BAD_HANDLE;
-    return get_window(win, (*win)->index+1, req);
+    return pcmcia_get_window(win, (*win)->index+1, req);
 }
 
 /*======================================================================
@@ -1124,7 +1125,7 @@ static int get_next_window(window_handle_t *win, win_req_t *req)
     
 ======================================================================*/
 
-static int get_status(client_handle_t handle, cs_status_t *status)
+int pcmcia_get_status(client_handle_t handle, cs_status_t *status)
 {
     socket_info_t *s;
     config_t *c;
@@ -1194,7 +1195,7 @@ static int get_status(client_handle_t handle, cs_status_t *status)
     
 ======================================================================*/
 
-static int get_mem_page(window_handle_t win, memreq_t *req)
+int pcmcia_get_mem_page(window_handle_t win, memreq_t *req)
 {
     if ((win == NULL) || (win->magic != WINDOW_MAGIC))
        return CS_BAD_HANDLE;
@@ -1203,7 +1204,7 @@ static int get_mem_page(window_handle_t win, memreq_t *req)
     return CS_SUCCESS;
 } /* get_mem_page */
 
-static int map_mem_page(window_handle_t win, memreq_t *req)
+int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
 {
     socket_info_t *s;
     if ((win == NULL) || (win->magic != WINDOW_MAGIC))
@@ -1223,7 +1224,7 @@ static int map_mem_page(window_handle_t win, memreq_t *req)
     
 ======================================================================*/
 
-static int modify_configuration(client_handle_t handle,
+int pcmcia_modify_configuration(client_handle_t handle,
                                modconf_t *mod)
 {
     socket_info_t *s;
@@ -1272,7 +1273,7 @@ static int modify_configuration(client_handle_t handle,
 
 ======================================================================*/
 
-static int modify_window(window_handle_t win, modwin_t *req)
+int pcmcia_modify_window(window_handle_t win, modwin_t *req)
 {
     if ((win == NULL) || (win->magic != WINDOW_MAGIC))
        return CS_BAD_HANDLE;
@@ -1301,7 +1302,7 @@ static int modify_window(window_handle_t win, modwin_t *req)
     
 ======================================================================*/
 
-static int register_client(client_handle_t *handle, client_reg_t *req)
+int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
 {
     client_t *client;
     socket_info_t *s;
@@ -1378,8 +1379,7 @@ static int register_client(client_handle_t *handle, client_reg_t *req)
 
 /*====================================================================*/
 
-static int release_configuration(client_handle_t handle,
-                                socket_t *Socket)
+int pcmcia_release_configuration(client_handle_t handle)
 {
     pccard_io_map io;
     socket_info_t *s;
@@ -1435,7 +1435,7 @@ static int release_configuration(client_handle_t handle,
     
 ======================================================================*/
 
-static int release_io(client_handle_t handle, io_req_t *req)
+int pcmcia_release_io(client_handle_t handle, io_req_t *req)
 {
     socket_info_t *s;
     
@@ -1472,7 +1472,7 @@ static int release_io(client_handle_t handle, io_req_t *req)
 
 /*====================================================================*/
 
-static int cs_release_irq(client_handle_t handle, irq_req_t *req)
+int pcmcia_release_irq(client_handle_t handle, irq_req_t *req)
 {
     socket_info_t *s;
     if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IRQ_REQ))
@@ -1508,7 +1508,7 @@ static int cs_release_irq(client_handle_t handle, irq_req_t *req)
 
 /*====================================================================*/
 
-static int release_window(window_handle_t win)
+int pcmcia_release_window(window_handle_t win)
 {
     socket_info_t *s;
     
@@ -1534,7 +1534,7 @@ static int release_window(window_handle_t win)
 
 /*====================================================================*/
 
-static int request_configuration(client_handle_t handle,
+int pcmcia_request_configuration(client_handle_t handle,
                                 config_req_t *req)
 {
     int i;
@@ -1672,7 +1672,7 @@ static int request_configuration(client_handle_t handle,
     
 ======================================================================*/
 
-static int request_io(client_handle_t handle, io_req_t *req)
+int pcmcia_request_io(client_handle_t handle, io_req_t *req)
 {
     socket_info_t *s;
     config_t *c;
@@ -1738,7 +1738,7 @@ static int request_io(client_handle_t handle, io_req_t *req)
     
 ======================================================================*/
 
-static int cs_request_irq(client_handle_t handle, irq_req_t *req)
+int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
 {
     socket_info_t *s;
     config_t *c;
@@ -1814,7 +1814,7 @@ static int cs_request_irq(client_handle_t handle, irq_req_t *req)
 
 ======================================================================*/
 
-static int request_window(client_handle_t *handle, win_req_t *req)
+int pcmcia_request_window(client_handle_t *handle, win_req_t *req)
 {
     socket_info_t *s;
     window_t *win;
@@ -1889,7 +1889,7 @@ static int request_window(client_handle_t *handle, win_req_t *req)
     
 ======================================================================*/
 
-static int reset_card(client_handle_t handle, client_req_t *req)
+int pcmcia_reset_card(client_handle_t handle, client_req_t *req)
 {
     int i, ret;
     socket_info_t *s;
@@ -1924,7 +1924,7 @@ static int reset_card(client_handle_t handle, client_req_t *req)
     
 ======================================================================*/
 
-static int suspend_card(client_handle_t handle, client_req_t *req)
+int pcmcia_suspend_card(client_handle_t handle, client_req_t *req)
 {
     int i;
     socket_info_t *s;
@@ -1945,7 +1945,7 @@ static int suspend_card(client_handle_t handle, client_req_t *req)
     return CS_SUCCESS;
 } /* suspend_card */
 
-static int resume_card(client_handle_t handle, client_req_t *req)
+int pcmcia_resume_card(client_handle_t handle, client_req_t *req)
 {
     int i;
     socket_info_t *s;
@@ -1970,7 +1970,7 @@ static int resume_card(client_handle_t handle, client_req_t *req)
     
 ======================================================================*/
 
-static int eject_card(client_handle_t handle, client_req_t *req)
+int pcmcia_eject_card(client_handle_t handle, client_req_t *req)
 {
     int i, ret;
     socket_info_t *s;
@@ -1996,7 +1996,7 @@ static int eject_card(client_handle_t handle, client_req_t *req)
     
 } /* eject_card */
 
-static int insert_card(client_handle_t handle, client_req_t *req)
+int pcmcia_insert_card(client_handle_t handle, client_req_t *req)
 {
     int i, status;
     socket_info_t *s;
@@ -2034,7 +2034,7 @@ static int insert_card(client_handle_t handle, client_req_t *req)
     
 ======================================================================*/
 
-static int set_event_mask(client_handle_t handle, eventmask_t *mask)
+int pcmcia_set_event_mask(client_handle_t handle, eventmask_t *mask)
 {
     u_int events, bit;
     if (CHECK_HANDLE(handle))
@@ -2054,7 +2054,7 @@ static int set_event_mask(client_handle_t handle, eventmask_t *mask)
 
 /*====================================================================*/
 
-static int report_error(client_handle_t handle, error_info_t *err)
+int pcmcia_report_error(client_handle_t handle, error_info_t *err)
 {
     int i;
     char *serv;
@@ -2101,103 +2101,103 @@ int CardServices(int func, void *a1, void *a2, void *a3)
 #endif
     switch (func) {
     case AccessConfigurationRegister:
-       return access_configuration_register(a1, a2); break;
+       return pcmcia_access_configuration_register(a1, a2); break;
     case AdjustResourceInfo:
-       return adjust_resource_info(a1, a2); break;
+       return pcmcia_adjust_resource_info(a1, a2); break;
     case CheckEraseQueue:
-       return check_erase_queue(a1); break;
+       return pcmcia_check_erase_queue(a1); break;
     case CloseMemory:
-       return close_memory(a1); break;
+       return pcmcia_close_memory(a1); break;
     case CopyMemory:
-       return copy_memory(a1, a2); break;
+       return pcmcia_copy_memory(a1, a2); break;
     case DeregisterClient:
-       return deregister_client(a1); break;
+       return pcmcia_deregister_client(a1); break;
     case DeregisterEraseQueue:
-       return deregister_erase_queue(a1); break;
+       return pcmcia_deregister_erase_queue(a1); break;
     case GetFirstClient:
-       return get_first_client(a1, a2); break;
+       return pcmcia_get_first_client(a1, a2); break;
     case GetCardServicesInfo:
-       return get_card_services_info(a1); break;
+       return pcmcia_get_card_services_info(a1); break;
     case GetConfigurationInfo:
-       return get_configuration_info(a1, a2); break;
+       return pcmcia_get_configuration_info(a1, a2); break;
     case GetNextClient:
-       return get_next_client(a1, a2); break;
+       return pcmcia_get_next_client(a1, a2); break;
     case GetFirstRegion:
-       return get_first_region(a1, a2); break;
+       return pcmcia_get_first_region(a1, a2); break;
     case GetFirstTuple:
-       return get_first_tuple(a1, a2); break;
+       return pcmcia_get_first_tuple(a1, a2); break;
     case GetNextRegion:
-       return get_next_region(a1, a2); break;
+       return pcmcia_get_next_region(a1, a2); break;
     case GetNextTuple:
-       return get_next_tuple(a1, a2); break;
+       return pcmcia_get_next_tuple(a1, a2); break;
     case GetStatus:
-       return get_status(a1, a2); break;
+       return pcmcia_get_status(a1, a2); break;
     case GetTupleData:
-       return get_tuple_data(a1, a2); break;
+       return pcmcia_get_tuple_data(a1, a2); break;
     case MapMemPage:
-       return map_mem_page(a1, a2); break;
+       return pcmcia_map_mem_page(a1, a2); break;
     case ModifyConfiguration:
-       return modify_configuration(a1, a2); break;
+       return pcmcia_modify_configuration(a1, a2); break;
     case ModifyWindow:
-       return modify_window(a1, a2); break;
+       return pcmcia_modify_window(a1, a2); break;
     case OpenMemory:
-       return open_memory(a1, a2);
+       return pcmcia_open_memory(a1, a2);
     case ParseTuple:
-       return parse_tuple(a1, a2, a3); break;
+       return pcmcia_parse_tuple(a1, a2, a3); break;
     case ReadMemory:
-       return read_memory(a1, a2, a3); break;
+       return pcmcia_read_memory(a1, a2, a3); break;
     case RegisterClient:
-       return register_client(a1, a2); break;
+       return pcmcia_register_client(a1, a2); break;
     case RegisterEraseQueue:
-       return register_erase_queue(a1, a2); break;
+       return pcmcia_register_erase_queue(a1, a2); break;
     case RegisterMTD:
-       return register_mtd(a1, a2); break;
+       return pcmcia_register_mtd(a1, a2); break;
     case ReleaseConfiguration:
-       return release_configuration(a1, a2); break;
+       return pcmcia_release_configuration(a1); break;
     case ReleaseIO:
-       return release_io(a1, a2); break;
+       return pcmcia_release_io(a1, a2); break;
     case ReleaseIRQ:
-       return cs_release_irq(a1, a2); break;
+       return pcmcia_release_irq(a1, a2); break;
     case ReleaseWindow:
-       return release_window(a1); break;
+       return pcmcia_release_window(a1); break;
     case RequestConfiguration:
-       return request_configuration(a1, a2); break;
+       return pcmcia_request_configuration(a1, a2); break;
     case RequestIO:
-       return request_io(a1, a2); break;
+       return pcmcia_request_io(a1, a2); break;
     case RequestIRQ:
-       return cs_request_irq(a1, a2); break;
+       return pcmcia_request_irq(a1, a2); break;
     case RequestWindow:
-       return request_window(a1, a2); break;
+       return pcmcia_request_window(a1, a2); break;
     case ResetCard:
-       return reset_card(a1, a2); break;
+       return pcmcia_reset_card(a1, a2); break;
     case SetEventMask:
-       return set_event_mask(a1, a2); break;
+       return pcmcia_set_event_mask(a1, a2); break;
     case ValidateCIS:
-       return validate_cis(a1, a2); break;
+       return pcmcia_validate_cis(a1, a2); break;
     case WriteMemory:
-       return write_memory(a1, a2, a3); break;
+       return pcmcia_write_memory(a1, a2, a3); break;
     case BindDevice:
-       return bind_device(a1); break;
+       return pcmcia_bind_device(a1); break;
     case BindMTD:
-       return bind_mtd(a1); break;
+       return pcmcia_bind_mtd(a1); break;
     case ReportError:
-       return report_error(a1, a2); break;
+       return pcmcia_report_error(a1, a2); break;
     case SuspendCard:
-       return suspend_card(a1, a2); break;
+       return pcmcia_suspend_card(a1, a2); break;
     case ResumeCard:
-       return resume_card(a1, a2); break;
+       return pcmcia_resume_card(a1, a2); break;
     case EjectCard:
-       return eject_card(a1, a2); break;
+       return pcmcia_eject_card(a1, a2); break;
     case InsertCard:
-       return insert_card(a1, a2); break;
+       return pcmcia_insert_card(a1, a2); break;
     case ReplaceCIS:
-       return replace_cis(a1, a2); break;
+       return pcmcia_replace_cis(a1, a2); break;
     case GetFirstWindow:
-       return get_first_window(a1, a2); break;
+       return pcmcia_get_first_window(a1, a2); break;
     case GetNextWindow:
-       return get_next_window(a1, a2); break;
+       return pcmcia_get_next_window(a1, a2); break;
     case GetMemPage:
-       return get_mem_page(a1, a2); break;
+       return pcmcia_get_mem_page(a1, a2); break;
     default:
        return CS_UNSUPPORTED_FUNCTION; break;
     }
index ef50b2b1870a0253748957667bdc6a688ae05886..5a9b1a4e7390396cf556d62c73f69a2cdc943c3e 100644 (file)
@@ -128,7 +128,7 @@ static int init_status = 1;
 static void cs_error(client_handle_t handle, int func, int ret)
 {
     error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
+    pcmcia_report_error(handle, &err);
 }
 
 /*======================================================================
@@ -340,7 +340,7 @@ static int bind_mtd(int i, mtd_info_t *mtd_info)
     bind_req.Attributes = mtd_info->Attributes;
     bind_req.Socket = i;
     bind_req.CardOffset = mtd_info->CardOffset;
-    ret = CardServices(BindMTD, &bind_req);
+    ret = pcmcia_bind_mtd(&bind_req);
     if (ret != CS_SUCCESS) {
        cs_error(NULL, BindMTD, ret);
        printk(KERN_NOTICE "ds: unable to bind MTD '%s' to socket %d"
@@ -394,7 +394,7 @@ static int bind_request(int i, bind_info_t *bind_info)
     bind_req.Socket = i;
     bind_req.Function = bind_info->function;
     bind_req.dev_info = &driver->dev_info;
-    ret = CardServices(BindDevice, &bind_req);
+    ret = pcmcia_bind_device(&bind_req);
     if (ret != CS_SUCCESS) {
        cs_error(NULL, BindDevice, ret);
        printk(KERN_NOTICE "ds: unable to bind '%s' to socket %d\n",
@@ -687,78 +687,74 @@ static int ds_ioctl(struct inode * inode, struct file * file,
     
     switch (cmd) {
     case DS_ADJUST_RESOURCE_INFO:
-       ret = CardServices(AdjustResourceInfo, s->handle, &buf.adjust);
+       ret = pcmcia_adjust_resource_info(s->handle, &buf.adjust);
        break;
     case DS_GET_CARD_SERVICES_INFO:
-       ret = CardServices(GetCardServicesInfo, &buf.servinfo);
+       ret = pcmcia_get_card_services_info(&buf.servinfo);
        break;
     case DS_GET_CONFIGURATION_INFO:
-       ret = CardServices(GetConfigurationInfo, s->handle, &buf.config);
+       ret = pcmcia_get_configuration_info(s->handle, &buf.config);
        break;
     case DS_GET_FIRST_TUPLE:
-       ret = CardServices(GetFirstTuple, s->handle, &buf.tuple);
+       ret = pcmcia_get_first_tuple(s->handle, &buf.tuple);
        break;
     case DS_GET_NEXT_TUPLE:
-       ret = CardServices(GetNextTuple, s->handle, &buf.tuple);
+       ret = pcmcia_get_next_tuple(s->handle, &buf.tuple);
        break;
     case DS_GET_TUPLE_DATA:
        buf.tuple.TupleData = buf.tuple_parse.data;
        buf.tuple.TupleDataMax = sizeof(buf.tuple_parse.data);
-       ret = CardServices(GetTupleData, s->handle, &buf.tuple);
+       ret = pcmcia_get_tuple_data(s->handle, &buf.tuple);
        break;
     case DS_PARSE_TUPLE:
        buf.tuple.TupleData = buf.tuple_parse.data;
-       ret = CardServices(ParseTuple, s->handle, &buf.tuple,
-                          &buf.tuple_parse.parse);
+       ret = pcmcia_parse_tuple(s->handle, &buf.tuple, &buf.tuple_parse.parse);
        break;
     case DS_RESET_CARD:
-       ret = CardServices(ResetCard, s->handle, NULL);
+       ret = pcmcia_reset_card(s->handle, NULL);
        break;
     case DS_GET_STATUS:
-       ret = CardServices(GetStatus, s->handle, &buf.status);
+       ret = pcmcia_get_status(s->handle, &buf.status);
        break;
     case DS_VALIDATE_CIS:
-       ret = CardServices(ValidateCIS, s->handle, &buf.cisinfo);
+       ret = pcmcia_validate_cis(s->handle, &buf.cisinfo);
        break;
     case DS_SUSPEND_CARD:
-       ret = CardServices(SuspendCard, s->handle, NULL);
+       ret = pcmcia_suspend_card(s->handle, NULL);
        break;
     case DS_RESUME_CARD:
-       ret = CardServices(ResumeCard, s->handle, NULL);
+       ret = pcmcia_resume_card(s->handle, NULL);
        break;
     case DS_EJECT_CARD:
-       ret = CardServices(EjectCard, s->handle, NULL);
+       ret = pcmcia_eject_card(s->handle, NULL);
        break;
     case DS_INSERT_CARD:
-       ret = CardServices(InsertCard, s->handle, NULL);
+       ret = pcmcia_insert_card(s->handle, NULL);
        break;
     case DS_ACCESS_CONFIGURATION_REGISTER:
        if ((buf.conf_reg.Action == CS_WRITE) && !suser())
            return -EPERM;
-       ret = CardServices(AccessConfigurationRegister, s->handle,
-                          &buf.conf_reg);
+       ret = pcmcia_access_configuration_register(s->handle, &buf.conf_reg);
        break;
     case DS_GET_FIRST_REGION:
-        ret = CardServices(GetFirstRegion, s->handle, &buf.region);
+        ret = pcmcia_get_first_region(s->handle, &buf.region);
        break;
     case DS_GET_NEXT_REGION:
-       ret = CardServices(GetNextRegion, s->handle, &buf.region);
+       ret = pcmcia_get_next_region(s->handle, &buf.region);
        break;
     case DS_GET_FIRST_WINDOW:
        buf.win_info.handle = (window_handle_t)s->handle;
-       ret = CardServices(GetFirstWindow, &buf.win_info.handle,
-                          &buf.win_info.window);
+       ret = pcmcia_get_first_window(&buf.win_info.handle, &buf.win_info.window);
        break;
     case DS_GET_NEXT_WINDOW:
-       ret = CardServices(GetNextWindow, &buf.win_info.handle,
-                          &buf.win_info.window);
+       ret = pcmcia_get_next_window(&buf.win_info.handle, &buf.win_info.window);
        break;
     case DS_GET_MEM_PAGE:
-       ret = CardServices(GetMemPage, buf.win_info.handle,
+       ret = pcmcia_get_mem_page(buf.win_info.handle,
                           &buf.win_info.map);
        break;
     case DS_REPLACE_CIS:
-       ret = CardServices(ReplaceCIS, s->handle, &buf.cisdump);
+       ret = pcmcia_replace_cis(s->handle, &buf.cisdump);
        break;
     case DS_BIND_REQUEST:
        if (!suser()) return -EPERM;
@@ -838,7 +834,7 @@ int __init init_pcmcia_ds(void)
     
     DEBUG(0, "%s\n", version);
     
-    CardServices(GetCardServicesInfo, &serv);
+    pcmcia_get_card_services_info(&serv);
     if (serv.Revision != CS_RELEASE_CODE) {
        printk(KERN_NOTICE "ds: Card Services release does not match!\n");
        return -1;
@@ -876,13 +872,13 @@ int __init init_pcmcia_ds(void)
     for (i = 0; i < sockets; i++) {
        bind.Socket = i;
        bind.Function = BIND_FN_ALL;
-       ret = CardServices(BindDevice, &bind);
+       ret = pcmcia_bind_device(&bind);
        if (ret != CS_SUCCESS) {
            cs_error(NULL, BindDevice, ret);
            break;
        }
        client_reg.event_callback_args.client_data = &socket_table[i];
-       ret = CardServices(RegisterClient, &socket_table[i].handle,
+       ret = pcmcia_register_client(&socket_table[i].handle,
                           &client_reg);
        if (ret != CS_SUCCESS) {
            cs_error(NULL, RegisterClient, ret);
@@ -923,7 +919,7 @@ void __exit cleanup_module(void)
     if (major_dev != -1)
        unregister_chrdev(major_dev, "pcmcia");
     for (i = 0; i < sockets; i++)
-       CardServices(DeregisterClient, socket_table[i].handle);
+       pcmcia_deregister_client(socket_table[i].handle);
     sockets = 0;
     kfree(socket_table);
 }
index 2014633341431a7790a2ce7f80761d3d183b8336..8a97cd541dc6acc1f83e2ea052fbebb73e1313a6 100644 (file)
@@ -2703,7 +2703,7 @@ static int pcic_service(u_int sock, u_int cmd, void *arg)
 static int __init init_i82365(void)
 {
     servinfo_t serv;
-    CardServices(GetCardServicesInfo, &serv);
+    pcmcia_get_card_services_info(&serv);
     if (serv.Revision != CS_RELEASE_CODE) {
        printk(KERN_NOTICE "i82365: Card Services release "
               "does not match!\n");
index cf7d8bc7a39685513b388be9d0ecbdae331bbee8..569ff867828403aa3dc7e803b911da8677c95025 100644 (file)
@@ -629,7 +629,7 @@ static int adjust_irq(adjust_t *adj)
 
 /*====================================================================*/
 
-int adjust_resource_info(client_handle_t handle, adjust_t *adj)
+int pcmcia_adjust_resource_info(client_handle_t handle, adjust_t *adj)
 {
     if (CHECK_HANDLE(handle))
        return CS_BAD_HANDLE;
index 2fba494343410810b417dc10d48ee600db22097e..5ea8e95e4ce3c4da7c50979010f189568483703c 100644 (file)
@@ -379,7 +379,7 @@ static int __init init_tcic(void)
     servinfo_t serv;
 
     DEBUG(0, "%s\n", version);
-    CardServices(GetCardServicesInfo, &serv);
+    pcmcia_get_card_services_info(&serv);
     if (serv.Revision != CS_RELEASE_CODE) {
        printk(KERN_NOTICE "tcic: Card Services release "
               "does not match!\n");
index 09f0a4ddd284764ff91325e083e2fa677a8df8df..dcc84bf04b94e8521c844e2acc853c28c4298fcc 100644 (file)
@@ -192,4 +192,16 @@ extern int MTDHelperEntry(int func, void *a1, void *a2);
 extern int MTDHelperEntry(int func, ...);
 #endif
 
+int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn);
+int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn);
+int pcmcia_register_mtd(client_handle_t handle, mtd_reg_t *reg);
+int pcmcia_register_erase_queue(client_handle_t *handle, eraseq_hdr_t *header);
+int pcmcia_deregister_erase_queue(eraseq_handle_t eraseq);
+int pcmcia_check_erase_queue(eraseq_handle_t eraseq);
+int pcmcia_open_memory(client_handle_t *handle, open_mem_t *open);
+int pcmcia_close_memory(memory_handle_t handle);
+int pcmcia_read_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf);
+int pcmcia_write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf);
+int pcmcia_copy_memory(memory_handle_t handle, copy_op_t *req);
+
 #endif /* _LINUX_BULKMEM_H */
index 9ab70257c9fb03f11e6ef27b3f17c8799c423a96..00412858e8b32b23520df8e57a1d97e6991f4c1f 100644 (file)
@@ -580,4 +580,12 @@ typedef struct cisdump_t {
     cisdata_t  Data[CISTPL_MAX_CIS_SIZE];
 } cisdump_t;
 
+int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple);
+int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple);
+int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple);
+int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse);
+
+int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info);
+int pcmcia_replace_cis(client_handle_t handle, cisdump_t *cis);
+
 #endif /* LINUX_CISTPL_H */
index bd99686304b1554f8dc40b8e1e6b0a86a3400111..8a67a6f98eb570afb8c2c1cd061555c9d150efbe 100644 (file)
@@ -440,6 +440,42 @@ extern int CardServices(int func, void *a1, void *a2, void *a3);
 extern int CardServices(int func, ...);
 #endif
 
+int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg);
+int pcmcia_bind_device(bind_req_t *req);
+int pcmcia_bind_mtd(mtd_bind_t *req);
+int pcmcia_deregister_client(client_handle_t handle);
+int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config);
+int pcmcia_get_card_services_info(servinfo_t *info);
+int pcmcia_get_first_client(client_handle_t *handle, client_req_t *req);
+int pcmcia_get_next_client(client_handle_t *handle, client_req_t *req);
+int pcmcia_get_window(window_handle_t *handle, int idx, win_req_t *req);
+int pcmcia_get_first_window(client_handle_t *handle, win_req_t *req);
+int pcmcia_get_next_window(window_handle_t *win, win_req_t *req);
+int pcmcia_get_status(client_handle_t handle, 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_modify_configuration(client_handle_t handle, modconf_t *mod);
+int pcmcia_modify_window(window_handle_t win, modwin_t *req);
+int pcmcia_register_client(client_handle_t *handle, client_reg_t *req);
+int pcmcia_release_configuration(client_handle_t handle);
+int pcmcia_release_io(client_handle_t handle, io_req_t *req);
+int pcmcia_release_irq(client_handle_t handle, irq_req_t *req);
+int pcmcia_release_window(window_handle_t win);
+int pcmcia_request_configuration(client_handle_t handle, config_req_t *req);
+int pcmcia_request_io(client_handle_t handle, io_req_t *req);
+int pcmcia_request_irq(client_handle_t handle, irq_req_t *req);
+int pcmcia_request_window(client_handle_t *handle, win_req_t *req);
+int pcmcia_reset_card(client_handle_t handle, client_req_t *req);
+int pcmcia_suspend_card(client_handle_t handle, client_req_t *req);
+int pcmcia_resume_card(client_handle_t handle, client_req_t *req);
+int pcmcia_eject_card(client_handle_t handle, client_req_t *req);
+int pcmcia_insert_card(client_handle_t handle, client_req_t *req);
+int pcmcia_set_event_mask(client_handle_t handle, eventmask_t *mask);
+int pcmcia_report_error(client_handle_t handle, error_info_t *err);
+
+/* rsrc_mgr.c */
+int pcmcia_adjust_resource_info(client_handle_t handle, adjust_t *adj);
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_CS_H */
index c8321290f12f13bc8e92c29329bbaf601e49bca2..744221c4043d6124f3192683fedb9ae71808dcda 100644 (file)
@@ -1012,11 +1012,12 @@ static int do_swap_page(struct task_struct * tsk,
        swap_free(entry);
        if (write_access && !is_page_shared(page)) {
                delete_from_swap_cache_nolock(page);
+               UnlockPage(page);
                page = replace_with_highmem(page);
                pte = mk_pte(page, vma->vm_page_prot);
                pte = pte_mkwrite(pte_mkdirty(pte));
-       }
-       UnlockPage(page);
+       } else
+               UnlockPage(page);
 
        set_pte(page_table, pte);
        /* No need to invalidate - it was non-present before */