Skip to content

Commit

Permalink
[PATCH] pcmcia: fix ioctl GET_CONFIGURATION_INFO for pcmcia_cards
Browse files Browse the repository at this point in the history
Values displayed when by cardctl config are horribly wrong for 16bit cards.
 this fixes it up by not using memcpy() since source and target struct are
very different.

Signed-off-by: Daniel Ritz <[email protected]>
Cc: Dominik Brodowski <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dr-itz authored and Linus Torvalds committed Jul 31, 2006
1 parent f47ad21 commit 47a3197
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/pcmcia/pcmcia_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,17 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
return CS_SUCCESS;
}

/* !!! This is a hack !!! */
memcpy(&config->Attributes, &c->Attributes, sizeof(config_t));
config->Attributes |= CONF_VALID_CLIENT;
config->CardValues = c->CardValues;
config->Attributes = c->Attributes | CONF_VALID_CLIENT;
config->Vcc = s->socket.Vcc;
config->Vpp1 = config->Vpp2 = s->socket.Vpp;
config->IntType = c->IntType;
config->ConfigBase = c->ConfigBase;
config->Status = c->Status;
config->Pin = c->Pin;
config->Copy = c->Copy;
config->Option = c->Option;
config->ExtStatus = c->ExtStatus;
config->Present = config->CardValues = c->CardValues;
config->IRQAttributes = c->irq.Attributes;
config->AssignedIRQ = s->irq.AssignedIRQ;
config->BasePort1 = c->io.BasePort1;
Expand Down

0 comments on commit 47a3197

Please sign in to comment.