1STRUCT CLASS(9)          Device drivers infrastructure         STRUCT CLASS(9)
2
3
4

NAME

6       struct_class - device classes
7

SYNOPSIS

9       struct class {
10         const char * name;
11         struct module * owner;
12         struct class_attribute * class_attrs;
13         struct device_attribute * dev_attrs;
14         const struct attribute_group ** dev_groups;
15         struct bin_attribute * dev_bin_attrs;
16         struct kobject * dev_kobj;
17         int (* dev_uevent) (struct device *dev, struct kobj_uevent_env *env);
18         char *(* devnode) (struct device *dev, umode_t *mode);
19         void (* class_release) (struct class *class);
20         void (* dev_release) (struct device *dev);
21         int (* suspend) (struct device *dev, pm_message_t state);
22         int (* resume) (struct device *dev);
23         const struct kobj_ns_type_operations * ns_type;
24         const void *(* namespace) (struct device *dev);
25         const struct dev_pm_ops * pm;
26         struct subsys_private * p;
27       };
28

MEMBERS

30       name
31           Name of the class.
32
33       owner
34           The module owner.
35
36       class_attrs
37           Default attributes of this class.
38
39       dev_attrs
40           Default attributes of the devices belong to the class.
41
42       dev_groups
43           Default attributes of the devices that belong to the class.
44
45       dev_bin_attrs
46           Default binary attributes of the devices belong to the class.
47
48       dev_kobj
49           The kobject that represents this class and links it into the
50           hierarchy.
51
52       dev_uevent
53           Called when a device is added, removed from this class, or a few
54           other things that generate uevents to add the environment
55           variables.
56
57       devnode
58           Callback to provide the devtmpfs.
59
60       class_release
61           Called to release this class.
62
63       dev_release
64           Called to release the device.
65
66       suspend
67           Used to put the device to sleep mode, usually to a low power state.
68
69       resume
70           Used to bring the device from the sleep mode.
71
72       ns_type
73           Callbacks so sysfs can detemine namespaces.
74
75       namespace
76           Namespace of the device belongs to this class.
77
78       pm
79           The default device power management operations of this class.
80
81       p
82           The private data of the driver core, no one other than the driver
83           core can touch this.
84

DESCRIPTION

86       A class is a higher-level view of a device that abstracts out low-level
87       implementation details. Drivers may see a SCSI disk or an ATA disk,
88       but, at the class level, they are all simply disks. Classes allow user
89       space to work with devices based on what they do, rather than how they
90       are connected or how they work.
91
93Kernel Hackers Manual 3.10         June 2019                   STRUCT CLASS(9)
Impressum