pcmcia-b13 patchset suggestion updated
Dominik Brodowski
linux at dominikbrodowski.de
Tue Apr 20 00:49:08 BST 2004
I've just re-diffed my proposal for a patchset named "13-pcmcia". It is
built on top of 2.6.-bk-current which has most of 11-pcmciaresource included,
and my pcmcia-b12 patchset (available at http://www.brodo.de/patches/2004-04-19/pcmcia-b12.tar.bz2).
Changes to previous implementation sent to list
- re-diffed
The aim of this patchset is to remove almost all
usages of the MASTER_INFO_CLIENT handle of ds.c
This way we can soon remove the registration of ds
as a "client" in order to equalize "client == pcmcia card function",
adding it into the device model, merge reference counting, and so on.
In most cases, this is done utilizing a "compatibility wrapper" for
default access by PCMCIA drivers, which still pass a "handle" as first
argument, and updated functions, which now take the struct pcmcia_socket
as argument as well as a "function" parameter which denotes the sub-function
to be accessed on the PCMICA device. Please note that these pccard_* functions
should not (yet) be used in any PCMCIA device drivers, as their calling
conventions are likely to change soon in future.
The patches are available in compressed form
at:
http://www.brodo.de/patches/2004-04-19/pcmcia-b13.tar.bz2
or
http://www.brodo.de/patches/2004-04-19/pcmcia-b13.tar.gz
as single diff at:
http://www.brodo.de/patches/2004-04-19/pcmcia-b13-complete
and as single patches as follows:
http://www.brodo.de/patches/2004-04-19/01-lookup_bus
pcmcia_lookup_bus is only called from ds.c, and doesn't need to know
about a handle -- just about the struct pcmcia_socket.
drivers/pcmcia/cs.c | 9 ++-------
drivers/pcmcia/ds.c | 4 +++-
include/pcmcia/cs.h | 1 -
3 files changed, 5 insertions(+), 9 deletions(-)
http://www.brodo.de/patches/2004-04-19/02-adjust_resource_info
drivers/pcmcia/cs.c | 1 -
drivers/pcmcia/ds.c | 4 +++-
drivers/pcmcia/rsrc_mgr.c | 6 ++----
include/pcmcia/cs.h | 3 ---
4 files changed, 5 insertions(+), 9 deletions(-)
http://www.brodo.de/patches/2004-04-19/03-replace_cis
pcmcia_replace_cis doesn't need to know about the handle or a sub-function,
as the cis can only be replaced as a whole. Also, remove bogus entries in
cs_internal.h
drivers/pcmcia/cistpl.c | 6 +-----
drivers/pcmcia/cs_internal.h | 7 -------
drivers/pcmcia/ds.c | 2 +-
include/pcmcia/cistpl.h | 2 +-
4 files changed, 3 insertions(+), 14 deletions(-)
http://www.brodo.de/patches/2004-04-19/04-get_firstnext_tuple
Add wrappings around pcmcia_get_{first,next}_tuple, and use the new
pccard_get_first,next_tuple calls wherever possible.
drivers/pcmcia/cistpl.c | 57 ++++++++++++++++++++++++++++++++----------------
drivers/pcmcia/cs.c | 2 -
drivers/pcmcia/ds.c | 4 +--
include/pcmcia/cistpl.h | 3 ++
4 files changed, 44 insertions(+), 22 deletions(-)
http://www.brodo.de/patches/2004-04-19/05-get_tuple_data
Add a wrapping around pcmcia_get_tuple_data, and use
pccard_get_tuple_data wherever possible.
drivers/pcmcia/cistpl.c | 22 ++++++++++++++++------
drivers/pcmcia/cs.c | 1 -
drivers/pcmcia/ds.c | 2 +-
include/pcmcia/cistpl.h | 2 ++
4 files changed, 19 insertions(+), 8 deletions(-)
http://www.brodo.de/patches/2004-04-19/06-parse_tuple
Add a wrapper around pcmcia_parse_tuple, and use pccard_parse_tuple in ds.c
drivers/pcmcia/cistpl.c | 8 +++++++-
drivers/pcmcia/cs.c | 1 -
drivers/pcmcia/ds.c | 2 +-
include/pcmcia/cistpl.h | 1 +
4 files changed, 9 insertions(+), 3 deletions(-)
http://www.brodo.de/patches/2004-04-19/07-read_tuple
rename the "internal" read_tuple to pccard_read_tuple, and
update it to better calling conventions.
drivers/pcmcia/bulkmem.c | 6 +++---
drivers/pcmcia/cistpl.c | 28 +++++++++++++++++-----------
drivers/pcmcia/cs.c | 2 +-
drivers/pcmcia/cs_internal.h | 2 +-
4 files changed, 22 insertions(+), 16 deletions(-)
http://www.brodo.de/patches/2004-04-19/08-validate_cis
Add a wrapper around pcmcia_validate_cis, and use pccard_validate_cis in
ds.c
drivers/pcmcia/cistpl.c | 22 ++++++++++++++--------
drivers/pcmcia/cs.c | 1 -
drivers/pcmcia/ds.c | 2 +-
drivers/pcmcia/rsrc_mgr.c | 2 +-
include/pcmcia/cistpl.h | 2 ++
5 files changed, 18 insertions(+), 11 deletions(-)
http://www.brodo.de/patches/2004-04-19/09-pcmcia_compat
Move the compatibility pcmcia_* functions which take a "handle" as argument
to a new file, pcmcia_compat.c, which is built into "ds" a.k.a. "pcmcia.ko".
This makes sense as only 16-bit PCMCIA drivers have a valid handle.
drivers/pcmcia/Makefile | 2 -
drivers/pcmcia/cistpl.c | 50 ---------------------------
drivers/pcmcia/pcmcia_compat.c | 75 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 51 deletions(-)
http://www.brodo.de/patches/2004-04-19/10-get_window
Change calling conventions to pcmcia_get_window, and use this function
directly in ds.c, but keep the existing wrappers pcmcia_get_{first,next}_window
in pcmcia_compat.c
drivers/pcmcia/cs.c | 26 +++-----------------------
drivers/pcmcia/cs_internal.h | 1 +
drivers/pcmcia/ds.c | 5 ++---
drivers/pcmcia/pcmcia_compat.c | 21 +++++++++++++++++++++
4 files changed, 27 insertions(+), 26 deletions(-)
http://www.brodo.de/patches/2004-04-19/11-configuration_info
drivers/pcmcia/cs.c | 21 ++++++---------------
drivers/pcmcia/cs_internal.h | 1 +
drivers/pcmcia/ds.c | 6 +++++-
drivers/pcmcia/pcmcia_compat.c | 14 ++++++++++++++
4 files changed, 26 insertions(+), 16 deletions(-)
http://www.brodo.de/patches/2004-04-19/12-reset_card
pcmcia_reset_card doesn't need to know about the handle,
but add a wrapper for backwards compatibility anyways.
drivers/pcmcia/cs.c | 11 ++---------
drivers/pcmcia/cs_internal.h | 1 +
drivers/pcmcia/ds.c | 2 +-
drivers/pcmcia/pcmcia_compat.c | 14 ++++++++++++++
include/pcmcia/cs.h | 1 -
5 files changed, 18 insertions(+), 11 deletions(-)
http://www.brodo.de/patches/2004-04-19/13-get_status
Add a wrapper around pcmcia_get_status, and use
pccard_get_status in ds.c
drivers/pcmcia/cs.c | 16 +++-------------
drivers/pcmcia/cs_internal.h | 1 +
drivers/pcmcia/ds.c | 6 +++++-
drivers/pcmcia/pcmcia_compat.c | 10 ++++++++++
4 files changed, 19 insertions(+), 14 deletions(-)
http://www.brodo.de/patches/2004-04-19/14-access_configuration
Add a wrapper around pcmcia_access_configuration_register, and use
pccard_access_configuration_register in ds.c
drivers/pcmcia/cs.c | 22 ++++++++--------------
drivers/pcmcia/cs_internal.h | 1 +
drivers/pcmcia/ds.c | 6 +++++-
drivers/pcmcia/pcmcia_compat.c | 11 +++++++++++
4 files changed, 25 insertions(+), 15 deletions(-)
http://www.brodo.de/patches/2004-04-19/15-get_firstnext_region
pcmcia_get_{first,next}_region are tricky: they're used
only by ds.c, but to keep backwards compatibility proper
wrappers are needed (for the moment). However, match_region()
doesn't work without knowing about ds.c's handle, it seems...
but wait:
while (list != NULL) {
if (!(handle->Attributes & INFO_MTD_CLIENT) ||
(strcmp(handle->dev_info, list->dev_info) == 0)) {
*match = list->info;
return CS_SUCCESS;
}
list = list->info.next;
}
as ds.c's handle doesn't have INFO_MTD_CLIENT, the if always
succeeds -- allowing is to simplify it for ds.c. However, this
means we need special functions for ds.c. It's not too large,
fortunately:
drivers/pcmcia/bulkmem.c | 55 ++++++++++++++++++++++++++++++++++---------
drivers/pcmcia/cs_internal.h | 4 ---
drivers/pcmcia/ds.c | 6 +++-
3 files changed, 48 insertions(+), 17 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20040419/b09c050a/attachment.bin
More information about the linux-pcmcia
mailing list