drivers/firewire/packet-serdes-test.c
Source file repositories/reference/linux-study-clean/drivers/firewire/packet-serdes-test.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firewire/packet-serdes-test.c- Extension
.c- Size
- 32847 bytes
- Lines
- 918
- 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
kunit/test.hlinux/firewire-constants.hpacket-header-definitions.hphy-packet-definitions.h
Detected Declarations
function serialize_async_header_commonfunction serialize_async_header_requestfunction serialize_async_header_quadlet_requestfunction serialize_async_header_block_requestfunction serialize_async_header_responsefunction serialize_async_header_quadlet_responsefunction serialize_async_header_block_responsefunction deserialize_async_header_commonfunction deserialize_async_header_requestfunction deserialize_async_header_quadlet_requestfunction deserialize_async_header_block_requestfunction deserialize_async_header_responsefunction deserialize_async_header_quadlet_responsefunction deserialize_async_header_block_responsefunction serialize_isoc_headerfunction deserialize_isoc_headerfunction serialize_phy_packet_self_id_zerofunction deserialize_phy_packet_self_id_zerofunction serialize_phy_packet_self_id_extendedfunction deserialize_phy_packet_self_id_extendedfunction serialize_phy_packet_phy_configfunction deserialize_phy_packet_phy_configfunction test_async_header_write_quadlet_requestfunction test_async_header_write_block_requestfunction test_async_header_write_responsefunction test_async_header_read_quadlet_requestfunction test_async_header_read_quadlet_responsefunction test_async_header_read_block_requestfunction test_async_header_read_block_responsefunction test_async_header_lock_requestfunction test_async_header_lock_responsefunction test_isoc_headerfunction test_phy_packet_self_id_zero_case0function test_phy_packet_self_id_zero_case1function test_phy_packet_self_id_zero_and_onefunction test_phy_packet_phy_config_force_root_nodefunction test_phy_packet_phy_config_gap_count_optimization
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
//
// packet-serdes-test.c - An application of Kunit to check serialization/deserialization of packets
// defined by IEEE 1394.
//
// Copyright (c) 2024 Takashi Sakamoto
#include <kunit/test.h>
#include <linux/firewire-constants.h>
#include "packet-header-definitions.h"
#include "phy-packet-definitions.h"
static void serialize_async_header_common(u32 header[ASYNC_HEADER_QUADLET_COUNT],
unsigned int dst_id, unsigned int tlabel,
unsigned int retry, unsigned int tcode,
unsigned int priority, unsigned int src_id)
{
async_header_set_destination(header, dst_id);
async_header_set_tlabel(header, tlabel);
async_header_set_retry(header, retry);
async_header_set_tcode(header, tcode);
async_header_set_priority(header, priority);
async_header_set_source(header, src_id);
}
static void serialize_async_header_request(u32 header[ASYNC_HEADER_QUADLET_COUNT],
unsigned int dst_id, unsigned int tlabel,
unsigned int retry, unsigned int tcode,
unsigned int priority, unsigned int src_id, u64 offset)
{
serialize_async_header_common(header, dst_id, tlabel, retry, tcode, priority, src_id);
async_header_set_offset(header, offset);
}
static void serialize_async_header_quadlet_request(u32 header[ASYNC_HEADER_QUADLET_COUNT],
unsigned int dst_id, unsigned int tlabel,
unsigned int retry, unsigned int tcode,
unsigned int priority, unsigned int src_id,
u64 offset)
{
serialize_async_header_request(header, dst_id, tlabel, retry, tcode, priority, src_id,
offset);
}
static void serialize_async_header_block_request(u32 header[ASYNC_HEADER_QUADLET_COUNT],
unsigned int dst_id, unsigned int tlabel,
unsigned int retry, unsigned int tcode,
unsigned int priority, unsigned int src_id,
u64 offset, unsigned int data_length,
unsigned int extended_tcode)
{
serialize_async_header_request(header, dst_id, tlabel, retry, tcode, priority, src_id,
offset);
async_header_set_data_length(header, data_length);
async_header_set_extended_tcode(header, extended_tcode);
}
static void serialize_async_header_response(u32 header[ASYNC_HEADER_QUADLET_COUNT],
unsigned int dst_id, unsigned int tlabel,
unsigned int retry, unsigned int tcode,
unsigned int priority, unsigned int src_id,
unsigned int rcode)
{
serialize_async_header_common(header, dst_id, tlabel, retry, tcode, priority, src_id);
async_header_set_rcode(header, rcode);
}
static void serialize_async_header_quadlet_response(u32 header[ASYNC_HEADER_QUADLET_COUNT],
unsigned int dst_id, unsigned int tlabel,
unsigned int retry, unsigned int tcode,
unsigned int priority, unsigned int src_id,
unsigned int rcode)
{
serialize_async_header_response(header, dst_id, tlabel, retry, tcode, priority, src_id,
rcode);
}
static void serialize_async_header_block_response(u32 header[ASYNC_HEADER_QUADLET_COUNT],
unsigned int dst_id, unsigned int tlabel,
unsigned int retry, unsigned int tcode,
unsigned int priority, unsigned int src_id,
unsigned int rcode, unsigned int data_length,
unsigned int extended_tcode)
{
serialize_async_header_response(header, dst_id, tlabel, retry, tcode, priority, src_id,
rcode);
async_header_set_data_length(header, data_length);
async_header_set_extended_tcode(header, extended_tcode);
Annotation
- Immediate include surface: `kunit/test.h`, `linux/firewire-constants.h`, `packet-header-definitions.h`, `phy-packet-definitions.h`.
- Detected declarations: `function serialize_async_header_common`, `function serialize_async_header_request`, `function serialize_async_header_quadlet_request`, `function serialize_async_header_block_request`, `function serialize_async_header_response`, `function serialize_async_header_quadlet_response`, `function serialize_async_header_block_response`, `function deserialize_async_header_common`, `function deserialize_async_header_request`, `function deserialize_async_header_quadlet_request`.
- 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.