[PATCHSET] socket-sysfs (includes cardctl eject/insert replacement)
patchset re-diffed
Dominik Brodowski
linux at dominikbrodowski.de
Sun May 16 12:24:26 EDT 2004
This patchset's aim is to provide some socket-related output to sysfs,
and allow for "insert" and "eject" user request without having to load "ds".
It has been re-diffed to apply cleanly to 2.6.6-bk-current.
The patches are available in compressed form
at:
http://www.brodo.de/patches/2004-05-16/pcmcia-b100.tar.bz2
or
http://www.brodo.de/patches/2004-05-16/pcmcia-b100.tar.gz
or as single diff at:
http://www.brodo.de/patches/2004-05-16/pcmcia-b100-complete
and as single patches as follows:
http://www.brodo.de/patches/2004-05-16/01-check_register
Fail if registration of socket with driver core failed. This is necessary
so that socket-related sysfs entries will appear always if a socket thread
is up and running.
drivers/pcmcia/cs.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
http://www.brodo.de/patches/2004-05-16/02-core-and-card_type
Add a first socket-related sysfs entry; and to keep things ordered, do so in
a new file drivers/pcmcia/socket_sysfs.c. To keep things easy, all files
will be present all the time, even if no card is in the socket at a specific
moment -- however, accessing the file will result in -ENODEV then, so that
# cat /sys/class/pcmcia_socket/pcmcia_socket1/card_type
will cause an error message like
"cat: card_type: No such device"
which is quite self-explanatory.
The attribute "card_type" will return either
"16-bit" or "32-bit", depending on whether the PCCard is a 16-bit PCMCIA
card or a 32-bit CardBus card. The result "invalid" should not happen, and
if it happens, something strange is going on.
drivers/pcmcia/Makefile | 2 -
drivers/pcmcia/cs.c | 2 -
drivers/pcmcia/cs_internal.h | 3 +
drivers/pcmcia/socket_sysfs.c | 76 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 81 insertions(+), 2 deletions(-)
http://www.brodo.de/patches/2004-05-16/03-card_voltage
Add an attribute "card_voltage" which returns the card's voltage requirements:
"5.0V", "3.3V" or "X.XV".
drivers/pcmcia/socket_sysfs.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+)
http://www.brodo.de/patches/2004-05-16/04-card_vppvcc
Add attributes "card_vpp" and "card_vcc" which return these voltages, like
"3.3V"
drivers/pcmcia/socket_sysfs.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+)
http://www.brodo.de/patches/2004-05-16/05-card_inserteject
Add two further attributes, "card_insert" and "card_eject". Reading these
files will fail; but writing _anything_ non-empty to these files will execute
an user insert/ejection request -- equivalent to "cardctl insert",
"cardctl eject".
drivers/pcmcia/socket_sysfs.c | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+)
More information about the linux-pcmcia
mailing list