[PATCH 0/5] basic socket sysfs in/output

Dominik Brodowski linux at dominikbrodowski.de
Tue May 11 22:28:21 BST 2004

In subsequent mails to this list an unnamed patchset will follow. Its aim
is to provide some socket-related output to sysfs, and allow for "insert"
and "eject" user request without having to load "ds".

These patches will break my "b12", "b13", "b14" and "b15" patchsets -- the
fixes are trivial, but I will only get to fix them later this week.


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", 
"cardctl eject".

 drivers/pcmcia/socket_sysfs.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+)

-------------- 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/20040511/e4fbc594/attachment.bin

More information about the linux-pcmcia mailing list