[PATCHSET] socket-sysfs (includes cardctl eject/insert replacement)
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
or as single diff at:
and as single patches as follows:
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(-)
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(-)
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(+)
Add attributes "card_vpp" and "card_vcc" which return these voltages, like
drivers/pcmcia/socket_sysfs.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+)
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",
drivers/pcmcia/socket_sysfs.c | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+)
More information about the linux-pcmcia