drivers/firewire/phy-packet-definitions.h
Source file repositories/reference/linux-study-clean/drivers/firewire/phy-packet-definitions.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/firewire/phy-packet-definitions.h- Extension
.h- Size
- 10043 bytes
- Lines
- 303
- Domain
- Driver Families
- Bucket
- drivers/firewire
- Inferred role
- Driver Families: implementation source
- Status
- source 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct self_id_sequence_enumeratorenum phy_packet_self_id_port_statusfunction phy_packet_get_packet_identifierfunction phy_packet_set_packet_identifierfunction phy_packet_phy_config_get_root_idfunction phy_packet_phy_config_set_root_idfunction phy_packet_phy_config_get_force_root_nodefunction phy_packet_phy_config_set_force_root_nodefunction phy_packet_phy_config_get_gap_count_optimizationfunction phy_packet_phy_config_set_gap_count_optimizationfunction phy_packet_phy_config_get_gap_countfunction phy_packet_phy_config_set_gap_countfunction phy_packet_self_id_get_phy_idfunction phy_packet_self_id_set_phy_idfunction phy_packet_self_id_get_extendedfunction phy_packet_self_id_set_extendedfunction phy_packet_self_id_zero_get_link_activefunction phy_packet_self_id_zero_set_link_activefunction phy_packet_self_id_zero_get_gap_countfunction phy_packet_self_id_zero_set_gap_countfunction phy_packet_self_id_zero_get_scodefunction phy_packet_self_id_zero_set_scodefunction phy_packet_self_id_zero_get_contenderfunction phy_packet_self_id_zero_set_contenderfunction phy_packet_self_id_zero_get_power_classfunction phy_packet_self_id_zero_set_power_classfunction phy_packet_self_id_zero_get_initiated_resetfunction phy_packet_self_id_zero_set_initiated_resetfunction phy_packet_self_id_get_more_packetsfunction phy_packet_self_id_set_more_packetsfunction phy_packet_self_id_extended_get_sequencefunction phy_packet_self_id_extended_set_sequencefunction self_id_sequence_get_port_capacityfunction self_id_sequence_get_port_statusfunction self_id_sequence_set_port_status
Annotated Snippet
struct self_id_sequence_enumerator {
const u32 *cursor;
unsigned int quadlet_count;
};
static inline const u32 *self_id_sequence_enumerator_next(
struct self_id_sequence_enumerator *enumerator, unsigned int *quadlet_count)
{
const u32 *self_id_sequence, *cursor;
u32 quadlet;
unsigned int count;
unsigned int sequence;
if (enumerator->cursor == NULL || enumerator->quadlet_count == 0)
return ERR_PTR(-ENODATA);
cursor = enumerator->cursor;
count = 1;
quadlet = *cursor;
sequence = 0;
while (phy_packet_self_id_get_more_packets(quadlet)) {
if (count >= enumerator->quadlet_count ||
count >= SELF_ID_SEQUENCE_MAXIMUM_QUADLET_COUNT)
return ERR_PTR(-EPROTO);
++cursor;
++count;
quadlet = *cursor;
if (!phy_packet_self_id_get_extended(quadlet) ||
sequence != phy_packet_self_id_extended_get_sequence(quadlet))
return ERR_PTR(-EPROTO);
++sequence;
}
*quadlet_count = count;
self_id_sequence = enumerator->cursor;
enumerator->cursor += count;
enumerator->quadlet_count -= count;
return self_id_sequence;
}
enum phy_packet_self_id_port_status {
PHY_PACKET_SELF_ID_PORT_STATUS_NONE = 0,
PHY_PACKET_SELF_ID_PORT_STATUS_NCONN = 1,
PHY_PACKET_SELF_ID_PORT_STATUS_PARENT = 2,
PHY_PACKET_SELF_ID_PORT_STATUS_CHILD = 3,
};
static inline unsigned int self_id_sequence_get_port_capacity(unsigned int quadlet_count)
{
return quadlet_count * 8 - 5;
}
static inline enum phy_packet_self_id_port_status self_id_sequence_get_port_status(
const u32 *self_id_sequence, unsigned int quadlet_count, unsigned int port_index)
{
unsigned int index, shift;
index = (port_index + 5) / 8;
shift = 16 - ((port_index + 5) % 8) * 2;
if (index < quadlet_count && index < SELF_ID_SEQUENCE_MAXIMUM_QUADLET_COUNT)
return (self_id_sequence[index] >> shift) & SELF_ID_PORT_STATUS_MASK;
return PHY_PACKET_SELF_ID_PORT_STATUS_NONE;
}
static inline void self_id_sequence_set_port_status(u32 *self_id_sequence, unsigned int quadlet_count,
unsigned int port_index,
enum phy_packet_self_id_port_status status)
{
unsigned int index, shift;
index = (port_index + 5) / 8;
shift = 16 - ((port_index + 5) % 8) * 2;
if (index < quadlet_count) {
self_id_sequence[index] &= ~(SELF_ID_PORT_STATUS_MASK << shift);
self_id_sequence[index] |= status << shift;
}
}
#endif // _FIREWIRE_PHY_PACKET_DEFINITIONS_H
Annotation
- Detected declarations: `struct self_id_sequence_enumerator`, `enum phy_packet_self_id_port_status`, `function phy_packet_get_packet_identifier`, `function phy_packet_set_packet_identifier`, `function phy_packet_phy_config_get_root_id`, `function phy_packet_phy_config_set_root_id`, `function phy_packet_phy_config_get_force_root_node`, `function phy_packet_phy_config_set_force_root_node`, `function phy_packet_phy_config_get_gap_count_optimization`, `function phy_packet_phy_config_set_gap_count_optimization`.
- Atlas domain: Driver Families / drivers/firewire.
- 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.