include/linux/fwnode.h
Source file repositories/reference/linux-study-clean/include/linux/fwnode.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/fwnode.h- Extension
.h- Size
- 8933 bytes
- Lines
- 260
- 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/bits.hlinux/bitops.hlinux/err.hlinux/list.hlinux/types.h
Detected Declarations
struct fwnode_operationsstruct devicestruct fwnode_handlestruct fwnode_linkstruct fwnode_endpointstruct fwnode_reference_argsstruct fwnode_operationsenum dev_dma_attrfunction fwnode_initfunction fwnode_set_flagfunction fwnode_clear_flagfunction fwnode_assign_flagfunction fwnode_test_flagfunction fwnode_dev_initialized
Annotated Snippet
struct fwnode_handle {
struct fwnode_handle *secondary;
const struct fwnode_operations *ops;
/* The below is used solely by device links, don't use otherwise */
struct device *dev;
struct list_head suppliers;
struct list_head consumers;
unsigned long flags;
};
/*
* fwnode link flags
*
* CYCLE: The fwnode link is part of a cycle. Don't defer probe.
* IGNORE: Completely ignore this link, even during cycle detection.
*/
#define FWLINK_FLAG_CYCLE BIT(0)
#define FWLINK_FLAG_IGNORE BIT(1)
struct fwnode_link {
struct fwnode_handle *supplier;
struct list_head s_hook;
struct fwnode_handle *consumer;
struct list_head c_hook;
u8 flags;
};
/**
* struct fwnode_endpoint - Fwnode graph endpoint
* @port: Port number
* @id: Endpoint id
* @local_fwnode: reference to the related fwnode
*/
struct fwnode_endpoint {
unsigned int port;
unsigned int id;
const struct fwnode_handle *local_fwnode;
};
/*
* ports and endpoints defined as software_nodes should all follow a common
* naming scheme; use these macros to ensure commonality.
*/
#define SWNODE_GRAPH_PORT_NAME_FMT "port@%u"
#define SWNODE_GRAPH_ENDPOINT_NAME_FMT "endpoint@%u"
#define NR_FWNODE_REFERENCE_ARGS 16
/**
* struct fwnode_reference_args - Fwnode reference with additional arguments
* @fwnode:- A reference to the base fwnode
* @nargs: Number of elements in @args array
* @args: Integer arguments on the fwnode
*/
struct fwnode_reference_args {
struct fwnode_handle *fwnode;
unsigned int nargs;
u64 args[NR_FWNODE_REFERENCE_ARGS];
};
/**
* struct fwnode_operations - Operations for fwnode interface
* @get: Get a reference to an fwnode.
* @put: Put a reference to an fwnode.
* @device_is_available: Return true if the device is available.
* @device_get_match_data: Return the device driver match data.
* @property_present: Return true if a property is present.
* @property_read_bool: Return a boolean property value.
* @property_read_int_array: Read an array of integer properties. Return zero on
* success, a negative error code otherwise.
* @property_read_string_array: Read an array of string properties. Return zero
* on success, a negative error code otherwise.
* @get_name: Return the name of an fwnode.
* @get_name_prefix: Get a prefix for a node (for printing purposes).
* @get_parent: Return the parent of an fwnode.
* @get_next_child_node: Return the next child node in an iteration.
* @get_named_child_node: Return a child node with a given name.
* @get_reference_args: Return a reference pointed to by a property, with args
* @graph_get_next_endpoint: Return an endpoint node in an iteration.
* @graph_get_remote_endpoint: Return the remote endpoint node of a local
* endpoint node.
* @graph_get_port_parent: Return the parent node of a port node.
* @graph_parse_endpoint: Parse endpoint for port and endpoint id.
* @add_links: Create fwnode links to all the suppliers of the fwnode. Return
* zero on success, a negative error code otherwise.
*/
struct fwnode_operations {
struct fwnode_handle *(*get)(struct fwnode_handle *fwnode);
void (*put)(struct fwnode_handle *fwnode);
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitops.h`, `linux/err.h`, `linux/list.h`, `linux/types.h`.
- Detected declarations: `struct fwnode_operations`, `struct device`, `struct fwnode_handle`, `struct fwnode_link`, `struct fwnode_endpoint`, `struct fwnode_reference_args`, `struct fwnode_operations`, `enum dev_dma_attr`, `function fwnode_init`, `function fwnode_set_flag`.
- 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.