drivers/firewire/core.h
Source file repositories/reference/linux-study-clean/drivers/firewire/core.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/firewire/core.h- Extension
.h- Size
- 9289 bytes
- Lines
- 326
- Domain
- Driver Families
- Bucket
- drivers/firewire
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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/compiler.hlinux/device.hlinux/dma-mapping.hlinux/fs.hlinux/list.hlinux/xarray.hlinux/mm_types.hlinux/rwsem.hlinux/slab.hlinux/types.hlinux/refcount.h
Detected Declarations
struct devicestruct fw_cardstruct fw_devicestruct fw_iso_bufferstruct fw_iso_contextstruct fw_iso_packetstruct fw_nodestruct fw_packetstruct fw_card_driverstruct fw_nodefunction fw_device_putfunction fw_iso_context_init_workfunction release_nodefunction fw_node_putfunction fw_node_set_devicefunction is_next_generationfunction tcode_is_read_requestfunction tcode_is_block_packetfunction tcode_is_link_internalfunction cycle_time_to_ohci_tstampfunction is_ping_packetfunction is_in_fcp_region
Annotated Snippet
extern const struct file_operations fw_device_ops;
void fw_device_cdev_update(struct fw_device *device);
void fw_device_cdev_remove(struct fw_device *device);
void fw_cdev_handle_phy_packet(struct fw_card *card, struct fw_packet *p);
/* -device */
extern struct rw_semaphore fw_device_rwsem;
extern struct xarray fw_device_xa;
extern int fw_cdev_major;
static inline struct fw_device *fw_device_get(struct fw_device *device)
{
get_device(&device->device);
return device;
}
static inline void fw_device_put(struct fw_device *device)
{
put_device(&device->device);
}
struct fw_device *fw_device_get_by_devt(dev_t devt);
int fw_device_set_broadcast_channel(struct device *dev, void *gen);
void fw_node_event(struct fw_card *card, struct fw_node *node, int event);
/* -iso */
int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count);
int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card,
enum dma_data_direction direction);
size_t fw_iso_buffer_lookup(struct fw_iso_buffer *buffer, dma_addr_t completed);
static inline void fw_iso_context_init_work(struct fw_iso_context *ctx, work_func_t func)
{
INIT_WORK(&ctx->work, func);
}
static inline struct fw_iso_context *fw_iso_mc_context_create(struct fw_card *card,
fw_iso_mc_callback_t callback, void *callback_data)
{
union fw_iso_callback cb = { .mc = callback };
return __fw_iso_context_create(card, FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL, 0, 0, 0, 0, cb,
callback_data);
}
/* -topology */
// The initial value of BUS_MANAGER_ID register, to express nothing registered.
#define BUS_MANAGER_ID_NOT_REGISTERED 0x3f
enum {
FW_NODE_CREATED,
FW_NODE_UPDATED,
FW_NODE_DESTROYED,
FW_NODE_LINK_ON,
FW_NODE_LINK_OFF,
FW_NODE_INITIATED_RESET,
};
struct fw_node {
u16 node_id;
u8 color;
u8 port_count;
u8 link_on:1;
u8 initiated_reset:1;
u8 b_path:1;
u8 phy_speed:2; /* As in the self ID packet. */
u8 max_speed:2; /* Minimum of all phy-speeds on the path from the
* local node to this node. */
u8 max_depth:4; /* Maximum depth to any leaf node */
u8 max_hops:4; /* Max hops in this sub tree */
struct kref kref;
/* For serializing node topology into a list. */
struct list_head link;
// The device when already associated, else NULL.
struct fw_device *device;
struct fw_node *ports[] __counted_by(port_count);
};
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/fs.h`, `linux/list.h`, `linux/xarray.h`, `linux/mm_types.h`, `linux/rwsem.h`.
- Detected declarations: `struct device`, `struct fw_card`, `struct fw_device`, `struct fw_iso_buffer`, `struct fw_iso_context`, `struct fw_iso_packet`, `struct fw_node`, `struct fw_packet`, `struct fw_card_driver`, `struct fw_node`.
- Atlas domain: Driver Families / drivers/firewire.
- 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.