Lines Matching refs:struct
87 struct attribute {
89 struct module *owner;
94 int sysfs_create_file(struct kobject * kobj, const struct attribute * attr);
95 void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr);
103 struct device_attribute {
104 struct attribute attr;
105 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
107 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
111 int device_create_file(struct device *, const struct device_attribute *);
112 void device_remove_file(struct device *, const struct device_attribute *);
117 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
125 static struct device_attribute dev_attr_foo = {
141 struct sysfs_ops {
142 ssize_t (*show)(struct kobject *, struct attribute *, char *);
143 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
146 [子系统应已经定义了一个 struct kobj_type 结构体作为这个类型的
157 #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
159 static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
162 struct device_attribute *dev_attr = to_dev_attr(attr);
163 struct device *dev = kobj_to_dev(kobj);
183 ssize_t (*show)(struct device *dev, struct device_attribute *attr, char *buf);
184 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
234 static ssize_t show_name(struct device *dev, struct device_attribute *attr,
240 static ssize_t store_name(struct device *dev, struct device_attribute *attr,
308 struct device_attribute {
309 struct attribute attr;
310 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
312 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
322 int device_create_file(struct device *dev, const struct device_attribute * attr);
323 void device_remove_file(struct device *dev, const struct device_attribute * attr);
330 struct bus_attribute {
331 struct attribute attr;
332 ssize_t (*show)(const struct bus_type *, char * buf);
333 ssize_t (*store)(const struct bus_type *, const char * buf, size_t count);
342 int bus_create_file(struct bus_type *, struct bus_attribute *);
343 void bus_remove_file(struct bus_type *, struct bus_attribute *);
351 struct driver_attribute {
352 struct attribute attr;
353 ssize_t (*show)(struct device_driver *, char * buf);
354 ssize_t (*store)(struct device_driver *, const char * buf,
364 int driver_create_file(struct device_driver *, const struct driver_attribute *);
365 void driver_remove_file(struct device_driver *, const struct driver_attribute *);