drivers/net/ipa/ipa_cmd.h
Source file repositories/reference/linux-study-clean/drivers/net/ipa/ipa_cmd.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ipa/ipa_cmd.h- Extension
.h- Size
- 5483 bytes
- Lines
- 164
- 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/types.h
Detected Declarations
struct gsi_channelstruct gsi_transstruct ipastruct ipa_memenum ipa_cmd_opcode
Annotated Snippet
#ifndef _IPA_CMD_H_
#define _IPA_CMD_H_
#include <linux/types.h>
struct gsi_channel;
struct gsi_trans;
struct ipa;
struct ipa_mem;
/**
* enum ipa_cmd_opcode: IPA immediate commands
*
* @IPA_CMD_IP_V4_FILTER_INIT: Initialize IPv4 filter table
* @IPA_CMD_IP_V6_FILTER_INIT: Initialize IPv6 filter table
* @IPA_CMD_IP_V4_ROUTING_INIT: Initialize IPv4 routing table
* @IPA_CMD_IP_V6_ROUTING_INIT: Initialize IPv6 routing table
* @IPA_CMD_HDR_INIT_LOCAL: Initialize IPA-local header memory
* @IPA_CMD_REGISTER_WRITE: Register write performed by IPA
* @IPA_CMD_IP_PACKET_INIT: Set up next packet's destination endpoint
* @IPA_CMD_DMA_SHARED_MEM: DMA command performed by IPA
* @IPA_CMD_IP_PACKET_TAG_STATUS: Have next packet generate tag * status
* @IPA_CMD_NONE: Special (invalid) "not a command" value
*
* All immediate commands are issued using the AP command TX endpoint.
*/
enum ipa_cmd_opcode {
IPA_CMD_NONE = 0x0,
IPA_CMD_IP_V4_FILTER_INIT = 0x3,
IPA_CMD_IP_V6_FILTER_INIT = 0x4,
IPA_CMD_IP_V4_ROUTING_INIT = 0x7,
IPA_CMD_IP_V6_ROUTING_INIT = 0x8,
IPA_CMD_HDR_INIT_LOCAL = 0x9,
IPA_CMD_REGISTER_WRITE = 0xc,
IPA_CMD_IP_PACKET_INIT = 0x10,
IPA_CMD_DMA_SHARED_MEM = 0x13,
IPA_CMD_IP_PACKET_TAG_STATUS = 0x14,
};
/**
* ipa_cmd_table_init_valid() - Validate a memory region holding a table
* @ipa: - IPA pointer
* @mem: - IPA memory region descriptor
* @route: - Whether the region holds a route or filter table
*
* Return: true if region is valid, false otherwise
*/
bool ipa_cmd_table_init_valid(struct ipa *ipa, const struct ipa_mem *mem,
bool route);
/**
* ipa_cmd_pool_init() - initialize command channel pools
* @channel: AP->IPA command TX GSI channel pointer
* @tre_count: Number of pool elements to allocate
*
* Return: 0 if successful, or a negative error code
*/
int ipa_cmd_pool_init(struct gsi_channel *channel, u32 tre_count);
/**
* ipa_cmd_pool_exit() - Inverse of ipa_cmd_pool_init()
* @channel: AP->IPA command TX GSI channel pointer
*/
void ipa_cmd_pool_exit(struct gsi_channel *channel);
/**
* ipa_cmd_table_init_add() - Add table init command to a transaction
* @trans: GSI transaction
* @opcode: IPA immediate command opcode
* @size: Size of non-hashed routing table memory
* @offset: Offset in IPA shared memory of non-hashed routing table memory
* @addr: DMA address of non-hashed table data to write
* @hash_size: Size of hashed routing table memory
* @hash_offset: Offset in IPA shared memory of hashed routing table memory
* @hash_addr: DMA address of hashed table data to write
*
* If hash_size is 0, hash_offset and hash_addr are ignored.
*/
void ipa_cmd_table_init_add(struct gsi_trans *trans, enum ipa_cmd_opcode opcode,
u16 size, u32 offset, dma_addr_t addr,
u16 hash_size, u32 hash_offset,
dma_addr_t hash_addr);
/**
* ipa_cmd_hdr_init_local_add() - Add a header init command to a transaction
* @trans: GSI transaction
* @offset: Offset of header memory in IPA local space
* @size: Size of header memory
* @addr: DMA address of buffer to be written from
*
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct gsi_channel`, `struct gsi_trans`, `struct ipa`, `struct ipa_mem`, `enum ipa_cmd_opcode`.
- 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.