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/)
# 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
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
#
# 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
# 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
# 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
#
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
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);
/* 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;
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;
/* 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] = ' ';
/* 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;
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) ***************/
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 ***********************************/
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);
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;
dev->tbusy = 1;
dev->start = 0;
}
- CardServices(ReleaseConfiguration, link->handle);
+ pcmcia_release_configuration(link->handle);
}
break;
case CS_EVENT_PM_RESUME:
/* 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;
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
{
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:
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))
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;
======================================================================*/
-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;
======================================================================*/
-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;
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))
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))
======================================================================*/
-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;
======================================================================*/
-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))
======================================================================*/
-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))
======================================================================*/
-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))
======================================================================*/
-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;
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);
}
/*====================================================================*/
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);
}
if (link->handle)
- CardServices(DeregisterClient, link->handle);
+ pcmcia_deregister_client(link->handle);
*linkp = link->next;
kfree_s(link, sizeof(struct dev_link_t));
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? */
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;
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) {
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:
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);
{
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");
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))
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));
}
======================================================================*/
-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))
#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))
!(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)
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;
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;
}
#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;
/*====================================================================*/
-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;
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;
}
======================================================================*/
-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;
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;
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)) ||
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;
======================================================================*/
-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;
======================================================================*/
-static int bind_device(bind_req_t *req)
+int pcmcia_bind_device(bind_req_t *req)
{
client_t *client;
socket_info_t *s;
======================================================================*/
-static int bind_mtd(mtd_bind_t *req)
+int pcmcia_bind_mtd(mtd_bind_t *req)
{
socket_info_t *s;
memory_handle_t region;
/*====================================================================*/
-static int deregister_client(client_handle_t handle)
+int pcmcia_deregister_client(client_handle_t handle)
{
client_t **client;
socket_info_t *s;
/*====================================================================*/
-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;
======================================================================*/
-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';
======================================================================*/
-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)
/*====================================================================*/
-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))
/*====================================================================*/
-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;
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);
}
/*======================================================================
======================================================================*/
-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;
======================================================================*/
-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;
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))
======================================================================*/
-static int modify_configuration(client_handle_t handle,
+int pcmcia_modify_configuration(client_handle_t handle,
modconf_t *mod)
{
socket_info_t *s;
======================================================================*/
-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;
======================================================================*/
-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;
/*====================================================================*/
-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;
======================================================================*/
-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;
/*====================================================================*/
-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))
/*====================================================================*/
-static int release_window(window_handle_t win)
+int pcmcia_release_window(window_handle_t win)
{
socket_info_t *s;
/*====================================================================*/
-static int request_configuration(client_handle_t handle,
+int pcmcia_request_configuration(client_handle_t handle,
config_req_t *req)
{
int i;
======================================================================*/
-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;
======================================================================*/
-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;
======================================================================*/
-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;
======================================================================*/
-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;
======================================================================*/
-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;
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;
======================================================================*/
-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;
} /* 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;
======================================================================*/
-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))
/*====================================================================*/
-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;
#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;
}
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);
}
/*======================================================================
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"
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",
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;
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;
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);
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);
}
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");
/*====================================================================*/
-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;
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");
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 */
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 */
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 */
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 */