follow-up-patches [9/10] get_configuration_info by socket and
function
Dominik Brodowski
linux at brodo.de
Sat Nov 22 14:10:07 GMT 2003
pcmcia_get_configuration_info doesn't need to know about the handle, as
long as it knows about the socket and the device number.
drivers/pcmcia/cs.c | 14 ++++++--------
drivers/pcmcia/ds.c | 7 +++++--
include/pcmcia/cs.h | 2 +-
3 files changed, 12 insertions(+), 11 deletions(-)
diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c 2003-11-22 12:50:09.347163248 +0100
+++ linux/drivers/pcmcia/cs.c 2003-11-22 13:06:43.886970216 +0100
@@ -937,24 +937,22 @@
/*====================================================================*/
-int pcmcia_get_configuration_info(client_handle_t handle,
+int pcmcia_get_configuration_info(struct pcmcia_socket *s,
+ unsigned int func,
config_info_t *config)
{
- struct pcmcia_socket *s;
config_t *c;
- if (CHECK_HANDLE(handle))
- return CS_BAD_HANDLE;
- s = SOCKET(handle);
if (!(s->state & SOCKET_PRESENT))
return CS_NO_CARD;
- if (handle->Function == BIND_FN_ALL) {
+ if (func == BIND_FN_ALL) {
if (config->Function && (config->Function >= s->functions))
return CS_BAD_ARGS;
} else
- config->Function = handle->Function;
-
+ config->Function = func;
+
+ /* FIXME: who needs CARDBUS info? If nobody, move to ds */
#ifdef CONFIG_CARDBUS
if (s->state & SOCKET_CARDBUS) {
u_char fn = config->Function;
diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c 2003-11-22 12:50:09.348163096 +0100
+++ linux/drivers/pcmcia/ds.c 2003-11-22 13:06:43.868972952 +0100
@@ -374,7 +374,10 @@
case GetCardServicesInfo:
return pcmcia_get_card_services_info(a1); break;
case GetConfigurationInfo:
- return pcmcia_get_configuration_info(a1, a2); break;
+ {
+ client_handle_t h = a1;
+ return pcmcia_get_configuration_info(h->Socket, h->Function, a2); break;
+ }
case GetNextClient:
return pcmcia_get_next_client(a1, a2); break;
case GetFirstRegion:
@@ -1049,7 +1052,7 @@
ret = pcmcia_get_card_services_info(&buf.servinfo);
break;
case DS_GET_CONFIGURATION_INFO:
- ret = pcmcia_get_configuration_info(s->handle, &buf.config);
+ ret = pcmcia_get_configuration_info(s->parent, BIND_FN_ALL, &buf.config);
break;
case DS_GET_FIRST_TUPLE:
ret = pcmcia_get_first_tuple(s->handle, &buf.tuple);
diff -ruN linux-original/include/pcmcia/cs.h linux/include/pcmcia/cs.h
--- linux-original/include/pcmcia/cs.h 2003-11-22 12:50:09.349162944 +0100
+++ linux/include/pcmcia/cs.h 2003-11-22 13:06:43.888969912 +0100
@@ -429,7 +429,7 @@
int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg);
int pcmcia_deregister_client(client_handle_t handle);
-int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config);
+int pcmcia_get_configuration_info(struct pcmcia_socket *s, unsigned int func, 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);
More information about the linux-pcmcia
mailing list