Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167823
b: refs/heads/master
c: 84897fc
h: refs/heads/master
i:
  167821: 3ce1ab7
  167819: a72bc89
  167815: 2f13294
  167807: b7a8ca3
v: v3
  • Loading branch information
Dominik Brodowski committed Oct 18, 2009
1 parent 8b47ede commit 7757e4c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30514ccfc5651b0b1eb27d5ac1cb580b152cd85f
refs/heads/master: 84897fc0524d7cbfc81d0bdf9f92ade6e3c3816b
20 changes: 11 additions & 9 deletions trunk/drivers/pcmcia/cistpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,9 @@ int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t
return -ENOMEM;
}
tuple.DesiredTuple = code;
tuple.Attributes = TUPLE_RETURN_COMMON;
tuple.Attributes = 0;
if (function == BIND_FN_ALL)
tuple.Attributes = TUPLE_RETURN_COMMON;
ret = pccard_get_first_tuple(s, function, &tuple);
if (ret != 0)
goto done;
Expand All @@ -1490,7 +1492,7 @@ EXPORT_SYMBOL(pccard_read_tuple);
======================================================================*/

int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned int *info)
int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info)
{
tuple_t *tuple;
cisparse_t *p;
Expand All @@ -1515,30 +1517,30 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned
count = reserved = 0;
tuple->DesiredTuple = RETURN_FIRST_TUPLE;
tuple->Attributes = TUPLE_RETURN_COMMON;
ret = pccard_get_first_tuple(s, function, tuple);
ret = pccard_get_first_tuple(s, BIND_FN_ALL, tuple);
if (ret != 0)
goto done;

/* First tuple should be DEVICE; we should really have either that
or a CFTABLE_ENTRY of some sort */
if ((tuple->TupleCode == CISTPL_DEVICE) ||
(pccard_read_tuple(s, function, CISTPL_CFTABLE_ENTRY, p) == 0) ||
(pccard_read_tuple(s, function, CISTPL_CFTABLE_ENTRY_CB, p) == 0))
(pccard_read_tuple(s, BIND_FN_ALL, CISTPL_CFTABLE_ENTRY, p) == 0) ||
(pccard_read_tuple(s, BIND_FN_ALL, CISTPL_CFTABLE_ENTRY_CB, p) == 0))
dev_ok++;

/* All cards should have a MANFID tuple, and/or a VERS_1 or VERS_2
tuple, for card identification. Certain old D-Link and Linksys
cards have only a broken VERS_2 tuple; hence the bogus test. */
if ((pccard_read_tuple(s, function, CISTPL_MANFID, p) == 0) ||
(pccard_read_tuple(s, function, CISTPL_VERS_1, p) == 0) ||
(pccard_read_tuple(s, function, CISTPL_VERS_2, p) != -ENOSPC))
if ((pccard_read_tuple(s, BIND_FN_ALL, CISTPL_MANFID, p) == 0) ||
(pccard_read_tuple(s, BIND_FN_ALL, CISTPL_VERS_1, p) == 0) ||
(pccard_read_tuple(s, BIND_FN_ALL, CISTPL_VERS_2, p) != -ENOSPC))
ident_ok++;

if (!dev_ok && !ident_ok)
goto done;

for (count = 1; count < MAX_TUPLES; count++) {
ret = pccard_get_next_tuple(s, function, tuple);
ret = pccard_get_next_tuple(s, BIND_FN_ALL, tuple);
if (ret != 0)
break;
if (((tuple->TupleCode > 0x23) && (tuple->TupleCode < 0x40)) ||
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/pcmcia/cs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
cisdata_t code, void *parse);
int pcmcia_replace_cis(struct pcmcia_socket *s,
const u8 *data, const size_t len);
int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function,
unsigned int *count);
int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *count);

/* rsrc_mgr.c */
int pcmcia_validate_mem(struct pcmcia_socket *s);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev)
if (!vers1)
return -ENOMEM;

if (!pccard_read_tuple(p_dev->socket, p_dev->func,
if (!pccard_read_tuple(p_dev->socket, BIND_FN_ALL,
CISTPL_MANFID, &manf_id)) {
p_dev->manf_id = manf_id.manf;
p_dev->card_id = manf_id.card;
Expand Down Expand Up @@ -581,7 +581,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev)
kfree(devgeo);
}

if (!pccard_read_tuple(p_dev->socket, p_dev->func, CISTPL_VERS_1,
if (!pccard_read_tuple(p_dev->socket, BIND_FN_ALL, CISTPL_VERS_1,
vers1)) {
for (i=0; i < vers1->ns; i++) {
char *tmp;
Expand Down Expand Up @@ -733,7 +733,7 @@ static int pcmcia_card_add(struct pcmcia_socket *s)
return -EAGAIN; /* try again, but later... */
}

ret = pccard_validate_cis(s, BIND_FN_ALL, &no_chains);
ret = pccard_validate_cis(s, &no_chains);
if (ret || !no_chains) {
ds_dev_dbg(0, &s->dev, "invalid CIS or invalid resources\n");
return -ENODEV;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pcmcia/pcmcia_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
mutex_lock(&s->skt_mutex);
pcmcia_validate_mem(s);
mutex_unlock(&s->skt_mutex);
ret = pccard_validate_cis(s, BIND_FN_ALL, &buf->cisinfo.Chains);
ret = pccard_validate_cis(s, &buf->cisinfo.Chains);
break;
case DS_SUSPEND_CARD:
ret = pcmcia_suspend_card(s);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pcmcia/rsrc_nonstatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static int readable(struct pcmcia_socket *s, struct resource *res,
s->cis_mem.res = res;
s->cis_virt = ioremap(res->start, s->map_size);
if (s->cis_virt) {
ret = pccard_validate_cis(s, BIND_FN_ALL, count);
ret = pccard_validate_cis(s, count);
/* invalidate mapping and CIS cache */
iounmap(s->cis_virt);
s->cis_virt = NULL;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pcmcia/socket_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static ssize_t pccard_show_cis(struct kobject *kobj,

if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
if (pccard_validate_cis(s, BIND_FN_ALL, &chains))
if (pccard_validate_cis(s, &chains))
return -EIO;
if (!chains)
return -ENODATA;
Expand Down

0 comments on commit 7757e4c

Please sign in to comment.