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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php