include/linux/enclosure.h
Source file repositories/reference/linux-study-clean/include/linux/enclosure.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/enclosure.h- Extension
.h- Size
- 4112 bytes
- Lines
- 136
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/list.h
Detected Declarations
struct enclosure_devicestruct enclosure_componentstruct enclosure_component_callbacksstruct enclosure_componentstruct enclosure_deviceenum enclosure_component_typeenum enclosure_statusenum enclosure_component_settingfunction to_enclosure_devicefunction to_enclosure_component
Annotated Snippet
struct enclosure_component_callbacks {
void (*get_status)(struct enclosure_device *,
struct enclosure_component *);
int (*set_status)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_status);
void (*get_fault)(struct enclosure_device *,
struct enclosure_component *);
int (*set_fault)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_component_setting);
void (*get_active)(struct enclosure_device *,
struct enclosure_component *);
int (*set_active)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_component_setting);
void (*get_locate)(struct enclosure_device *,
struct enclosure_component *);
int (*set_locate)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_component_setting);
void (*get_power_status)(struct enclosure_device *,
struct enclosure_component *);
int (*set_power_status)(struct enclosure_device *,
struct enclosure_component *,
int);
int (*show_id)(struct enclosure_device *, char *buf);
};
struct enclosure_component {
void *scratch;
struct device cdev;
struct device *dev;
enum enclosure_component_type type;
int number;
int fault;
int active;
int locate;
int slot;
enum enclosure_status status;
int power_status;
};
struct enclosure_device {
void *scratch;
struct list_head node;
struct device edev;
struct enclosure_component_callbacks *cb;
int components;
struct enclosure_component component[];
};
static inline struct enclosure_device *
to_enclosure_device(struct device *dev)
{
return container_of(dev, struct enclosure_device, edev);
}
static inline struct enclosure_component *
to_enclosure_component(struct device *dev)
{
return container_of(dev, struct enclosure_component, cdev);
}
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_alloc(struct enclosure_device *, unsigned int,
enum enclosure_component_type, const char *);
int enclosure_component_register(struct enclosure_component *);
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);
#endif /* _LINUX_ENCLOSURE_H_ */
Annotation
- Immediate include surface: `linux/device.h`, `linux/list.h`.
- Detected declarations: `struct enclosure_device`, `struct enclosure_component`, `struct enclosure_component_callbacks`, `struct enclosure_component`, `struct enclosure_device`, `enum enclosure_component_type`, `enum enclosure_status`, `enum enclosure_component_setting`, `function to_enclosure_device`, `function to_enclosure_component`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.