include/linux/greybus.h
Source file repositories/reference/linux-study-clean/include/linux/greybus.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/greybus.h- Extension
.h- Size
- 3655 bytes
- Lines
- 123
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/types.hlinux/list.hlinux/slab.hlinux/device.hlinux/module.hlinux/pm_runtime.hlinux/idr.hlinux/greybus/greybus_id.hlinux/greybus/greybus_manifest.hlinux/greybus/greybus_protocols.hlinux/greybus/manifest.hlinux/greybus/hd.hlinux/greybus/svc.hlinux/greybus/control.hlinux/greybus/module.hlinux/greybus/interface.hlinux/greybus/bundle.hlinux/greybus/connection.hlinux/greybus/operation.h
Detected Declarations
struct greybus_driverfunction greybus_set_drvdatafunction cport_id_valid
Annotated Snippet
struct device_driver driver;
};
#define to_greybus_driver(d) container_of_const(d, struct greybus_driver, driver)
static inline void greybus_set_drvdata(struct gb_bundle *bundle, void *data)
{
dev_set_drvdata(&bundle->dev, data);
}
static inline void *greybus_get_drvdata(struct gb_bundle *bundle)
{
return dev_get_drvdata(&bundle->dev);
}
/* Don't call these directly, use the module_greybus_driver() macro instead */
int greybus_register_driver(struct greybus_driver *driver,
struct module *module, const char *mod_name);
void greybus_deregister_driver(struct greybus_driver *driver);
/* define to get proper THIS_MODULE and KBUILD_MODNAME values */
#define greybus_register(driver) \
greybus_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
#define greybus_deregister(driver) \
greybus_deregister_driver(driver)
/**
* module_greybus_driver() - Helper macro for registering a Greybus driver
* @__greybus_driver: greybus_driver structure
*
* Helper macro for Greybus drivers to set up proper module init / exit
* functions. Replaces module_init() and module_exit() and keeps people from
* printing pointless things to the kernel log when their driver is loaded.
*/
#define module_greybus_driver(__greybus_driver) \
module_driver(__greybus_driver, greybus_register, greybus_deregister)
int greybus_disabled(void);
void gb_debugfs_init(void);
void gb_debugfs_cleanup(void);
struct dentry *gb_debugfs_get(void);
extern const struct bus_type greybus_bus_type;
extern const struct device_type greybus_hd_type;
extern const struct device_type greybus_module_type;
extern const struct device_type greybus_interface_type;
extern const struct device_type greybus_control_type;
extern const struct device_type greybus_bundle_type;
extern const struct device_type greybus_svc_type;
static inline bool cport_id_valid(struct gb_host_device *hd, u16 cport_id)
{
return cport_id != CPORT_ID_BAD && cport_id < hd->num_cports;
}
#endif /* __KERNEL__ */
#endif /* __LINUX_GREYBUS_H */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/list.h`, `linux/slab.h`, `linux/device.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/idr.h`.
- Detected declarations: `struct greybus_driver`, `function greybus_set_drvdata`, `function cport_id_valid`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern 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.