Commit 7ea33fc9 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Russell King

[PCMCIA] 08-validate_cis.diff

Add a wrapper around pcmcia_validate_cis, and use
pccard_validate_cis in ds.c
parent 0eb4a605
......@@ -1437,20 +1437,15 @@ EXPORT_SYMBOL(pccard_read_tuple);
======================================================================*/
int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info)
int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info)
{
tuple_t *tuple;
cisparse_t *p;
int ret, reserved, dev_ok = 0, ident_ok = 0;
struct pcmcia_socket *s;
unsigned int function;
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
s = SOCKET(handle);
if (!s)
return CS_BAD_HANDLE;
function = handle->Function;
tuple = kmalloc(sizeof(*tuple), GFP_KERNEL);
if (tuple == NULL)
return CS_OUT_OF_RESOURCE;
......@@ -1486,7 +1481,7 @@ int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info)
goto done;
for (info->Chains = 1; info->Chains < MAX_TUPLES; info->Chains++) {
ret = pccard_get_next_tuple(handle->Socket, handle->Function, tuple);
ret = pccard_get_next_tuple(s, function, tuple);
if (ret != CS_SUCCESS) break;
if (((tuple->TupleCode > 0x23) && (tuple->TupleCode < 0x40)) ||
((tuple->TupleCode > 0x47) && (tuple->TupleCode < 0x80)) ||
......@@ -1502,6 +1497,7 @@ int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info)
kfree(p);
return CS_SUCCESS;
}
EXPORT_SYMBOL(pccard_validate_cis);
/*
* Compatibility layer.
......@@ -1542,3 +1538,13 @@ int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse
return pccard_parse_tuple(tuple, parse);
}
EXPORT_SYMBOL(pcmcia_parse_tuple);
int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info)
{
struct pcmcia_socket *s;
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
s = SOCKET(handle);
return pccard_validate_cis(s, handle->Function, info);
}
EXPORT_SYMBOL(pcmcia_validate_cis);
......@@ -2122,7 +2122,6 @@ EXPORT_SYMBOL(pcmcia_request_window);
EXPORT_SYMBOL(pcmcia_reset_card);
EXPORT_SYMBOL(pcmcia_resume_card);
EXPORT_SYMBOL(pcmcia_suspend_card);
EXPORT_SYMBOL(pcmcia_validate_cis);
EXPORT_SYMBOL(dead_socket);
EXPORT_SYMBOL(pcmcia_parse_events);
......
......@@ -966,7 +966,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
break;
case DS_VALIDATE_CIS:
pcmcia_validate_mem(s->parent);
ret = pcmcia_validate_cis(s->handle, &buf.cisinfo);
ret = pccard_validate_cis(s->parent, BIND_FN_ALL, &buf.cisinfo);
break;
case DS_SUSPEND_CARD:
ret = pcmcia_suspend_card(s->parent);
......
......@@ -307,7 +307,7 @@ static int readable(struct pcmcia_socket *s, struct resource *res, cisinfo_t *in
s->cis_mem.res = res;
s->cis_virt = ioremap(res->start, s->map_size);
if (s->cis_virt) {
ret = pcmcia_validate_cis(s->clients, info);
ret = pccard_validate_cis(s, BIND_FN_ALL, info);
/* invalidate mapping and CIS cache */
iounmap(s->cis_virt);
s->cis_virt = NULL;
......
......@@ -615,4 +615,6 @@ int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple
int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse);
int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info);
#endif /* LINUX_CISTPL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment