Linux Kernel
3.7.1
|
#include <linux/device.h>
#include <linux/list.h>
Go to the source code of this file.
Data Structures | |
struct | enclosure_component_callbacks |
struct | enclosure_component |
struct | enclosure_device |
Functions | |
struct enclosure_device * | enclosure_register (struct device *, const char *, int, struct enclosure_component_callbacks *) |
void | enclosure_unregister (struct enclosure_device *) |
struct enclosure_component * | enclosure_component_register (struct enclosure_device *, unsigned int, enum enclosure_component_type, const char *) |
int | enclosure_add_device (struct enclosure_device *enclosure, int component, struct device *dev) |
int | enclosure_remove_device (struct enclosure_device *, struct device *) |
struct enclosure_device * | enclosure_find (struct device *dev, struct enclosure_device *start) |
int | enclosure_for_each_device (int(*fn)(struct enclosure_device *, void *), void *data) |
ENCLOSURE_SETTING_DISABLED | |
ENCLOSURE_SETTING_ENABLED | |
ENCLOSURE_SETTING_BLINK_A_ON_OFF | |
ENCLOSURE_SETTING_BLINK_A_OFF_ON | |
ENCLOSURE_SETTING_BLINK_B_ON_OFF | |
ENCLOSURE_SETTING_BLINK_B_OFF_ON |
Definition at line 50 of file enclosure.h.
Definition at line 30 of file enclosure.h.
enum enclosure_status |
Definition at line 36 of file enclosure.h.
enclosure_add_device - add a device as being part of an enclosure : the enclosure device being added to. : the number of the component : the device being added
Declares a real device to reside in slot (or identifier) of an enclosure. This will cause the relevant sysfs links to appear. This function may also be used to change a device associated with an enclosure without having to call enclosure_remove_device() in between.
Returns zero on success or an error.
Definition at line 312 of file enclosure.c.
|
read |
Definition at line 258 of file enclosure.c.
|
read |
enclosure_find - find an enclosure given a parent device : the parent to match against : Optional enclosure device to start from (NULL if none)
Looks through the list of registered enclosures to find all those with as a parent. Returns NULL if no enclosure is found. can be used as a starting point to obtain multiple enclosures per parent (should begin with NULL and then be set to each returned enclosure device). Obtains a reference to the enclosure class device which must be released with device_put(). If is not NULL, a reference must be taken on it which is released before returning (this allows a loop through all enclosures to exit with only the reference on the enclosure of interest held). Note that the may correspond to the actual device housing the enclosure, in which case no iteration via is required.
Definition at line 54 of file enclosure.c.
Definition at line 95 of file enclosure.c.
|
read |
enclosure_register - register device as an enclosure
: device containing the enclosure : number of components in the enclosure
This sets up the device for being an enclosure. Note that does not have to be a dedicated enclosure device. It may be some other type of device that additionally responds to enclosure services
Definition at line 124 of file enclosure.c.
int enclosure_remove_device | ( | struct enclosure_device * | edev, |
struct device * | dev | ||
) |
enclosure_remove_device - remove a device from an enclosure : the enclosure device : the number of the component to remove
Returns zero on success or an error.
Definition at line 342 of file enclosure.c.
void enclosure_unregister | ( | struct enclosure_device * | edev | ) |
enclosure_unregister - remove an enclosure
: the registered enclosure to remove;
Definition at line 171 of file enclosure.c.