提交 47a31976 编写于 作者: D Daniel Ritz 提交者: Linus Torvalds

[PATCH] pcmcia: fix ioctl GET_CONFIGURATION_INFO for pcmcia_cards

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: NDaniel Ritz <daniel.ritz@gmx.ch>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 f47ad214
...@@ -245,10 +245,17 @@ int pccard_get_configuration_info(struct pcmcia_socket *s, ...@@ -245,10 +245,17 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
return CS_SUCCESS; return CS_SUCCESS;
} }
/* !!! This is a hack !!! */ config->Attributes = c->Attributes | CONF_VALID_CLIENT;
memcpy(&config->Attributes, &c->Attributes, sizeof(config_t)); config->Vcc = s->socket.Vcc;
config->Attributes |= CONF_VALID_CLIENT; config->Vpp1 = config->Vpp2 = s->socket.Vpp;
config->CardValues = c->CardValues; 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->IRQAttributes = c->irq.Attributes;
config->AssignedIRQ = s->irq.AssignedIRQ; config->AssignedIRQ = s->irq.AssignedIRQ;
config->BasePort1 = c->io.BasePort1; config->BasePort1 = c->io.BasePort1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册