X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fsysfs.h;h=23f7838725a7ad83e9c9c33c0ef4491f5832c286;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=4cb54379e85a2368ddbd87e0abb792cd2c0e5ba5;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 4cb54379e..23f783872 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -9,6 +9,8 @@ #ifndef _SYSFS_H_ #define _SYSFS_H_ +#define SYSFS_SUPER_MAGIC 0x62656572 + struct kobject; struct module; @@ -24,6 +26,27 @@ struct attribute_group { }; + +/** + * Use these macros to make defining attributes easier. See include/linux/device.h + * for examples.. + */ + +#define __ATTR(_name,_mode,_show,_store) { \ + .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \ + .show = _show, \ + .store = _store, \ +} + +#define __ATTR_RO(_name) { \ + .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \ + .show = _name##_show, \ +} + +#define __ATTR_NULL { .attr = { .name = NULL } } + +#define attr_name(_attr) (_attr).attr.name + struct bin_attribute { struct attribute attr; size_t size;