drivers/net/ipa/ipa_cmd.c
Source file repositories/reference/linux-study-clean/drivers/net/ipa/ipa_cmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ipa/ipa_cmd.c- Extension
.c- Size
- 21213 bytes
- Lines
- 649
- Domain
- Driver Families
- Bucket
- drivers/net
- 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
linux/bitfield.hlinux/bits.hlinux/device.hlinux/dma-direction.hlinux/types.hgsi.hgsi_trans.hipa.hipa_cmd.hipa_endpoint.hipa_mem.hipa_reg.hipa_table.h
Detected Declarations
struct ipa_cmd_hw_ip_fltrt_initstruct ipa_cmd_hw_hdr_init_localstruct ipa_cmd_register_writestruct ipa_cmd_ip_packet_initstruct ipa_cmd_hw_dma_mem_memstruct ipa_cmd_ip_packet_tag_statusenum pipeline_clear_optionsfunction ipa_cmd_validate_buildfunction ipa_cmd_table_init_validfunction ipa_cmd_header_init_local_validfunction ipa_cmd_register_write_offset_validfunction ipa_cmd_register_write_validfunction ipa_cmd_pool_initfunction ipa_cmd_pool_exitfunction ipa_cmd_payload_allocfunction ipa_cmd_table_init_addfunction ipa_cmd_hdr_init_local_addfunction ipa_cmd_register_write_addfunction ipa_cmd_ip_packet_init_addfunction ipa_cmd_dma_shared_mem_addfunction ipa_cmd_ip_tag_status_addfunction ipa_cmd_transfer_addfunction ipa_cmd_pipeline_clear_addfunction ipa_cmd_pipeline_clear_countfunction ipa_cmd_pipeline_clear_waitfunction ipa_cmd_init
Annotated Snippet
struct ipa_cmd_hw_ip_fltrt_init {
__le64 hash_rules_addr;
__le64 flags;
__le64 nhash_rules_addr;
};
/* Field masks for ipa_cmd_hw_ip_fltrt_init structure fields */
#define IP_FLTRT_FLAGS_HASH_SIZE_FMASK GENMASK_ULL(11, 0)
#define IP_FLTRT_FLAGS_HASH_ADDR_FMASK GENMASK_ULL(27, 12)
#define IP_FLTRT_FLAGS_NHASH_SIZE_FMASK GENMASK_ULL(39, 28)
#define IP_FLTRT_FLAGS_NHASH_ADDR_FMASK GENMASK_ULL(55, 40)
/* IPA_CMD_HDR_INIT_LOCAL */
struct ipa_cmd_hw_hdr_init_local {
__le64 hdr_table_addr;
__le32 flags;
__le32 reserved;
};
/* Field masks for ipa_cmd_hw_hdr_init_local structure fields */
#define HDR_INIT_LOCAL_FLAGS_TABLE_SIZE_FMASK GENMASK(11, 0)
#define HDR_INIT_LOCAL_FLAGS_HDR_ADDR_FMASK GENMASK(27, 12)
/* IPA_CMD_REGISTER_WRITE */
/* For IPA v4.0+, the pipeline clear options are encoded in the opcode */
#define REGISTER_WRITE_OPCODE_SKIP_CLEAR_FMASK GENMASK(8, 8)
#define REGISTER_WRITE_OPCODE_CLEAR_OPTION_FMASK GENMASK(10, 9)
struct ipa_cmd_register_write {
__le16 flags; /* Unused/reserved prior to IPA v4.0 */
__le16 offset;
__le32 value;
__le32 value_mask;
__le32 clear_options; /* Unused/reserved for IPA v4.0+ */
};
/* Field masks for ipa_cmd_register_write structure fields */
/* The next field is present for IPA v4.0+ */
#define REGISTER_WRITE_FLAGS_OFFSET_HIGH_FMASK GENMASK(14, 11)
/* The next field is not present for IPA v4.0+ */
#define REGISTER_WRITE_FLAGS_SKIP_CLEAR_FMASK GENMASK(15, 15)
/* The next field and its values are not present for IPA v4.0+ */
#define REGISTER_WRITE_CLEAR_OPTIONS_FMASK GENMASK(1, 0)
/* IPA_CMD_IP_PACKET_INIT */
struct ipa_cmd_ip_packet_init {
u8 dest_endpoint; /* Full 8 bits used for IPA v5.0+ */
u8 reserved[7];
};
/* Field mask for ipa_cmd_ip_packet_init dest_endpoint field (unused v5.0+) */
#define IPA_PACKET_INIT_DEST_ENDPOINT_FMASK GENMASK(4, 0)
/* IPA_CMD_DMA_SHARED_MEM */
/* For IPA v4.0+, this opcode gets modified with pipeline clear options */
#define DMA_SHARED_MEM_OPCODE_SKIP_CLEAR_FMASK GENMASK(8, 8)
#define DMA_SHARED_MEM_OPCODE_CLEAR_OPTION_FMASK GENMASK(10, 9)
struct ipa_cmd_hw_dma_mem_mem {
__le16 clear_after_read; /* 0 or DMA_SHARED_MEM_CLEAR_AFTER_READ */
__le16 size;
__le16 local_addr;
__le16 flags;
__le64 system_addr;
};
/* Flag allowing atomic clear of target region after reading data (v4.0+)*/
#define DMA_SHARED_MEM_CLEAR_AFTER_READ GENMASK(15, 15)
/* Field masks for ipa_cmd_hw_dma_mem_mem structure fields */
#define DMA_SHARED_MEM_FLAGS_DIRECTION_FMASK GENMASK(0, 0)
/* The next two fields are not present for IPA v4.0+ */
#define DMA_SHARED_MEM_FLAGS_SKIP_CLEAR_FMASK GENMASK(1, 1)
#define DMA_SHARED_MEM_FLAGS_CLEAR_OPTIONS_FMASK GENMASK(3, 2)
/* IPA_CMD_IP_PACKET_TAG_STATUS */
struct ipa_cmd_ip_packet_tag_status {
__le64 tag;
};
#define IP_PACKET_TAG_STATUS_TAG_FMASK GENMASK_ULL(63, 16)
/* Immediate command payload */
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/device.h`, `linux/dma-direction.h`, `linux/types.h`, `gsi.h`, `gsi_trans.h`, `ipa.h`.
- Detected declarations: `struct ipa_cmd_hw_ip_fltrt_init`, `struct ipa_cmd_hw_hdr_init_local`, `struct ipa_cmd_register_write`, `struct ipa_cmd_ip_packet_init`, `struct ipa_cmd_hw_dma_mem_mem`, `struct ipa_cmd_ip_packet_tag_status`, `enum pipeline_clear_options`, `function ipa_cmd_validate_build`, `function ipa_cmd_table_init_valid`, `function ipa_cmd_header_init_local_valid`.
- Atlas domain: Driver Families / drivers/net.
- 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.