[PATCHSET b23] new sysfs-based resource interface for non-static sockets

Dominik Brodowski linux at dominikbrodowski.de
Thu Nov 11 09:39:13 EST 2004


all-in-one-patch: http://www.brodo.de/patches/2004-11-11/pcmcia-b23-complete

tarball: http://www.brodo.de/patches/2004-11-11/pcmcia-b23-rsrc_sysfs.tar.bz2

This patchset adds a new resource interface for non-static sockets.
User-space tools which either directly take /etc/pcmcia/pcmcia.opts as
input or which parse that into a shell-script [which can easily be put into 
initrd, for example] will follow in future, and before this code is submitted
for inclusion into Linus' tree.

http://www.brodo.de/patches/2004-11-11/pcmcia-b23-rsrc_sysfs/01-alloc-db-per-socket

Move the resource databases and the "mem_probe" flag into a struct
specific to rsrc_nostatic, as it is not needed for the SS_CAP_STATIC_MAP 
case. Saves a few bytes, and makes code clearer (in my opinion)


http://www.brodo.de/patches/2004-11-11/pcmcia-b23-rsrc_sysfs/02-remove-typedef

Remove the typedef'ing of struct resource_map.


http://www.brodo.de/patches/2004-11-11/pcmcia-b23-rsrc_sysfs/03-lock-in-release

Also lock the ->exit() function in rsrc_nostatic


http://www.brodo.de/patches/2004-11-11/pcmcia-b23-rsrc_sysfs/04-sysfs-resource-output

Add sysfs output to the non-static resource database. It'll reside in 
/sys/class/pcmcia_socket/pcmcia_socket%n/device_possible_resources_{io_mem}
and be of the format

"0x08%lx - 0x%08%lx\n"


http://www.brodo.de/patches/2004-11-11/pcmcia-b23-rsrc_sysfs/05-sysfs-resource-input

Add a sysfs input method for the non-static socket resource database. It
works by writing 
"+ 0x%[l]x - 0x%[l]x"
for adding resources, and by
"- 0x%[l]x - 0x%[l]x"
for removing resources to
/sys/class/pcmcia_socket/pcmcia_socket%n/device_possible_resources_{io_mem}


http://www.brodo.de/patches/2004-11-11/pcmcia-b23-rsrc_sysfs/06-sysfs-resource-done

PCMCIA device registration should only happen if we're quite confident
there are resources available to at least map the CIS space -- else we can't
determine manfid/cardid, whether it is a multifunction card, etc. So,
add a flag to struct pcmcia_socket which denotes that -- and also whether
resources were added the "old" adjust_resource_info way. On static sockets,
it is activated upon registration, on non-static sockets, it is set upon an
echo'ing of anything into 
/sys/class/pcmcia_socket/pcmcia_socket%n/device_possible_resources_setup_done
PCMCIA device registration should only happen if we're quite confident
there are resources available to at least map the CIS space -- else we can't
determine manfid/cardid, whether it is a multifunction card, etc. So,
add a flag to struct pcmcia_socket which denotes that -- and also whether
resources were added the "old" adjust_resource_info way. On static sockets,
it is activated upon registration, on non-static sockets, it is set upon an
echo'ing of anything into 
/sys/class/pcmcia_socket/pcmcia_socket%n/device_possible_resources_setup_done



More information about the linux-pcmcia mailing list