class.c File Reference

Go to the source code of this file.

Defines

#define to_class_attr(_attr)   container_of(_attr, struct class_attribute, attr)

Functions

static ssize_t class_attr_show (struct kobject *kobj, struct attribute *attr, char *buf)
static ssize_t class_attr_store (struct kobject *kobj, struct attribute *attr, const char *buf, size_t count)
static void class_release (struct kobject *kobj)
int class_create_file (struct class *cls, const struct class_attribute *attr)
void class_remove_file (struct class *cls, const struct class_attribute *attr)
static struct class * class_get (struct class *cls)
static void class_put (struct class *cls)
static int add_class_attrs (struct class *cls)
static void remove_class_attrs (struct class *cls)
static void klist_class_dev_get (struct klist_node *n)
static void klist_class_dev_put (struct klist_node *n)
int __class_register (struct class *cls, struct lock_class_key *key)
 EXPORT_SYMBOL_GPL (__class_register)
void class_unregister (struct class *cls)
static void class_create_release (struct class *cls)
: pointer to a string for the name of this class.
class_create - create a struct class structure : pointer to the module that is to "own" this struct class

: the lock_class_key for this class; used by mutex lock debugging

This is used to create a struct class pointer that can then be used in calls to device_create().

Note, the pointer created here is to be destroyed when finished by making a call to class_destroy().

struct class * __class_create (struct module *owner, const char *name, struct lock_class_key *key)
 EXPORT_SYMBOL_GPL (__class_create)
void class_destroy (struct class *cls)
 class_destroy - destroys a struct class structure : pointer to the struct class that is to be destroyed
void class_dev_iter_init (struct class_dev_iter *iter, struct class *class, struct device *start, const struct device_type *type)
 EXPORT_SYMBOL_GPL (class_dev_iter_init)
struct device * class_dev_iter_next (struct class_dev_iter *iter)
 class_dev_iter_next - iterate to the next device : class iterator to proceed
 EXPORT_SYMBOL_GPL (class_dev_iter_next)
void class_dev_iter_exit (struct class_dev_iter *iter)
 class_dev_iter_exit - finish iteration : class iterator to finish
 EXPORT_SYMBOL_GPL (class_dev_iter_exit)
int class_for_each_device (struct class *class, struct device *start, void *data, int(*fn)(struct device *, void *))
 EXPORT_SYMBOL_GPL (class_for_each_device)
struct device * class_find_device (struct class *class, struct device *start, void *data, int(*match)(struct device *, void *))
 EXPORT_SYMBOL_GPL (class_find_device)
int class_interface_register (struct class_interface *class_intf)
void class_interface_unregister (struct class_interface *class_intf)
int __init classes_init (void)
 EXPORT_SYMBOL_GPL (class_create_file)
 EXPORT_SYMBOL_GPL (class_remove_file)
 EXPORT_SYMBOL_GPL (class_unregister)
 EXPORT_SYMBOL_GPL (class_destroy)
 EXPORT_SYMBOL_GPL (class_interface_register)
 EXPORT_SYMBOL_GPL (class_interface_unregister)

Variables

static struct sysfs_ops class_sysfs_ops
static struct kobj_type class_ktype
static struct kset * class_kset


Define Documentation

#define to_class_attr ( _attr   )     container_of(_attr, struct class_attribute, attr)

Definition at line 24 of file class.c.


Function Documentation

struct class* __class_create ( struct module *  owner,
const char *  name,
struct lock_class_key *  key 
) [read]

Definition at line 223 of file class.c.

int __class_register ( struct class *  cls,
struct lock_class_key *  key 
)

Definition at line 152 of file class.c.

static int add_class_attrs ( struct class *  cls  )  [static]

Definition at line 108 of file class.c.

static ssize_t class_attr_show ( struct kobject *  kobj,
struct attribute *  attr,
char *  buf 
) [static]

Definition at line 26 of file class.c.

static ssize_t class_attr_store ( struct kobject *  kobj,
struct attribute *  attr,
const char *  buf,
size_t  count 
) [static]

Definition at line 38 of file class.c.

int class_create_file ( struct class *  cls,
const struct class_attribute *  attr 
)

Definition at line 78 of file class.c.

static void class_create_release ( struct class *  cls  )  [static]

Definition at line 205 of file class.c.

void class_destroy ( struct class *  cls  ) 

class_destroy - destroys a struct class structure : pointer to the struct class that is to be destroyed

Note, the pointer to be destroyed must have been created with a call to class_create().

Definition at line 258 of file class.c.

void class_dev_iter_exit ( struct class_dev_iter *  iter  ) 

class_dev_iter_exit - finish iteration : class iterator to finish

Finish an iteration. Always call this function after iteration is complete whether the iteration ran till the end or not.

Definition at line 344 of file class.c.

void class_dev_iter_init ( struct class_dev_iter *  iter,
struct class *  class,
struct device *  start,
const struct device_type *  type 
)

Definition at line 297 of file class.c.

struct device* class_dev_iter_next ( struct class_dev_iter *  iter  )  [read]

class_dev_iter_next - iterate to the next device : class iterator to proceed

Proceed to the next device and return it. Returns NULL if iteration is complete.

The returned device is referenced and won't be released till iterator is proceed to the next device or exited. The caller is free to do whatever it wants to do with the device including calling back into class code.

Definition at line 321 of file class.c.

struct device* class_find_device ( struct class *  class,
struct device *  start,
void *  data,
int(*)(struct device *, void *)  match 
) [read]

Definition at line 415 of file class.c.

int class_for_each_device ( struct class *  class,
struct device *  start,
void *  data,
int(*)(struct device *, void *)  fn 
)

Definition at line 368 of file class.c.

static struct class* class_get ( struct class *  cls  )  [static, read]

Definition at line 95 of file class.c.

int class_interface_register ( struct class_interface *  class_intf  ) 

Definition at line 443 of file class.c.

void class_interface_unregister ( struct class_interface *  class_intf  ) 

Definition at line 469 of file class.c.

static void class_put ( struct class *  cls  )  [static]

Definition at line 102 of file class.c.

static void class_release ( struct kobject *  kobj  )  [static]

Definition at line 50 of file class.c.

void class_remove_file ( struct class *  cls,
const struct class_attribute *  attr 
)

Definition at line 89 of file class.c.

void class_unregister ( struct class *  cls  ) 

Definition at line 198 of file class.c.

int __init classes_init ( void   ) 

Definition at line 491 of file class.c.

EXPORT_SYMBOL_GPL ( class_interface_unregister   ) 

EXPORT_SYMBOL_GPL ( class_interface_register   ) 

EXPORT_SYMBOL_GPL ( class_destroy   ) 

EXPORT_SYMBOL_GPL ( class_unregister   ) 

EXPORT_SYMBOL_GPL ( class_remove_file   ) 

EXPORT_SYMBOL_GPL ( class_create_file   ) 

EXPORT_SYMBOL_GPL ( class_find_device   ) 

EXPORT_SYMBOL_GPL ( class_for_each_device   ) 

EXPORT_SYMBOL_GPL ( class_dev_iter_exit   ) 

EXPORT_SYMBOL_GPL ( class_dev_iter_next   ) 

EXPORT_SYMBOL_GPL ( class_dev_iter_init   ) 

EXPORT_SYMBOL_GPL ( __class_create   ) 

EXPORT_SYMBOL_GPL ( __class_register   ) 

static void klist_class_dev_get ( struct klist_node *  n  )  [static]

Definition at line 138 of file class.c.

static void klist_class_dev_put ( struct klist_node *  n  )  [static]

Definition at line 145 of file class.c.

static void remove_class_attrs ( struct class *  cls  )  [static]

Definition at line 128 of file class.c.


Variable Documentation

struct kset* class_kset [static]

Definition at line 75 of file class.c.

struct kobj_type class_ktype [static]

Initial value:

 {
        .sysfs_ops      = &class_sysfs_ops,
        .release        = class_release,
}

Definition at line 69 of file class.c.

struct sysfs_ops class_sysfs_ops [static]

Initial value:

 {
        .show   = class_attr_show,
        .store  = class_attr_store,
}

Definition at line 64 of file class.c.


Generated on Wed Apr 11 06:39:15 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6