~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/attribute_container.h

Version: ~ [ linux-5.3-rc5 ] ~ [ linux-5.2.9 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.67 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.139 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.189 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.189 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.72 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * attribute_container.h - a generic container for all classes
  3  *
  4  * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
  5  *
  6  * This file is licensed under GPLv2
  7  */
  8 
  9 #ifndef _ATTRIBUTE_CONTAINER_H_
 10 #define _ATTRIBUTE_CONTAINER_H_
 11 
 12 #include <linux/list.h>
 13 #include <linux/klist.h>
 14 
 15 struct device;
 16 
 17 struct attribute_container {
 18         struct list_head        node;
 19         struct klist            containers;
 20         struct class            *class;
 21         const struct attribute_group *grp;
 22         struct device_attribute **attrs;
 23         int (*match)(struct attribute_container *, struct device *);
 24 #define ATTRIBUTE_CONTAINER_NO_CLASSDEVS        0x01
 25         unsigned long           flags;
 26 };
 27 
 28 static inline int
 29 attribute_container_no_classdevs(struct attribute_container *atc)
 30 {
 31         return atc->flags & ATTRIBUTE_CONTAINER_NO_CLASSDEVS;
 32 }
 33 
 34 static inline void
 35 attribute_container_set_no_classdevs(struct attribute_container *atc)
 36 {
 37         atc->flags |= ATTRIBUTE_CONTAINER_NO_CLASSDEVS;
 38 }
 39 
 40 int attribute_container_register(struct attribute_container *cont);
 41 int __must_check attribute_container_unregister(struct attribute_container *cont);
 42 void attribute_container_create_device(struct device *dev,
 43                                        int (*fn)(struct attribute_container *,
 44                                                  struct device *,
 45                                                  struct device *));
 46 void attribute_container_add_device(struct device *dev,
 47                                     int (*fn)(struct attribute_container *,
 48                                               struct device *,
 49                                               struct device *));
 50 void attribute_container_remove_device(struct device *dev,
 51                                        void (*fn)(struct attribute_container *,
 52                                                   struct device *,
 53                                                   struct device *));
 54 void attribute_container_device_trigger(struct device *dev, 
 55                                         int (*fn)(struct attribute_container *,
 56                                                   struct device *,
 57                                                   struct device *));
 58 void attribute_container_trigger(struct device *dev, 
 59                                  int (*fn)(struct attribute_container *,
 60                                            struct device *));
 61 int attribute_container_add_attrs(struct device *classdev);
 62 int attribute_container_add_class_device(struct device *classdev);
 63 int attribute_container_add_class_device_adapter(struct attribute_container *cont,
 64                                                  struct device *dev,
 65                                                  struct device *classdev);
 66 void attribute_container_remove_attrs(struct device *classdev);
 67 void attribute_container_class_device_del(struct device *classdev);
 68 struct attribute_container *attribute_container_classdev_to_container(struct device *);
 69 struct device *attribute_container_find_class_device(struct attribute_container *, struct device *);
 70 struct device_attribute **attribute_container_classdev_to_attrs(const struct device *classdev);
 71 
 72 #endif
 73 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp