'\" t .\" Title: struct class .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: Device drivers infrastructure .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "STRUCT CLASS" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "Device drivers infrastructure" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" struct_class \- device classes .SH "SYNOPSIS" .sp .nf struct class { const char * name; struct module * owner; struct class_attribute * class_attrs; const struct attribute_group ** dev_groups; struct kobject * dev_kobj; int (* dev_uevent) (struct device *dev, struct kobj_uevent_env *env); char *(* devnode) (struct device *dev, umode_t *mode); void (* class_release) (struct class *class); void (* dev_release) (struct device *dev); int (* suspend) (struct device *dev, pm_message_t state); int (* resume) (struct device *dev); const struct kobj_ns_type_operations * ns_type; const void *(* namespace) (struct device *dev); const struct dev_pm_ops * pm; struct subsys_private * p; }; .fi .SH "MEMBERS" .PP name .RS 4 Name of the class\&. .RE .PP owner .RS 4 The module owner\&. .RE .PP class_attrs .RS 4 Default attributes of this class\&. .RE .PP dev_groups .RS 4 Default attributes of the devices that belong to the class\&. .RE .PP dev_kobj .RS 4 The kobject that represents this class and links it into the hierarchy\&. .RE .PP dev_uevent .RS 4 Called when a device is added, removed from this class, or a few other things that generate uevents to add the environment variables\&. .RE .PP devnode .RS 4 Callback to provide the devtmpfs\&. .RE .PP class_release .RS 4 Called to release this class\&. .RE .PP dev_release .RS 4 Called to release the device\&. .RE .PP suspend .RS 4 Used to put the device to sleep mode, usually to a low power state\&. .RE .PP resume .RS 4 Used to bring the device from the sleep mode\&. .RE .PP ns_type .RS 4 Callbacks so sysfs can detemine namespaces\&. .RE .PP namespace .RS 4 Namespace of the device belongs to this class\&. .RE .PP pm .RS 4 The default device power management operations of this class\&. .RE .PP p .RS 4 The private data of the driver core, no one other than the driver core can touch this\&. .RE .SH "DESCRIPTION" .PP A class is a higher\-level view of a device that abstracts out low\-level implementation details\&. Drivers may see a SCSI disk or an ATA disk, but, at the class level, they are all simply disks\&. Classes allow user space to work with devices based on what they do, rather than how they are connected or how they work\&. .SH "COPYRIGHT" .br