drivers/dma/fsl-dpaa2-qdma/dpdmai.c
Source file repositories/reference/linux-study-clean/drivers/dma/fsl-dpaa2-qdma/dpdmai.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/fsl-dpaa2-qdma/dpdmai.c- Extension
.c- Size
- 10372 bytes
- Lines
- 367
- Domain
- Driver Families
- Bucket
- drivers/dma
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/module.hlinux/types.hlinux/io.hlinux/fsl/mc.hdpdmai.h
Detected Declarations
struct dpdmai_rsp_get_attributesstruct dpdmai_cmd_queuestruct dpdmai_rsp_get_tx_queuestruct dpdmai_cmd_openstruct dpdmai_cmd_destroyfunction dpdmai_openfunction dpdmai_closefunction dpdmai_destroyfunction dpdmai_enablefunction dpdmai_disablefunction dpdmai_resetfunction dpdmai_get_attributesfunction dpdmai_set_rx_queuefunction dpdmai_get_rx_queuefunction dpdmai_get_tx_queueexport dpdmai_openexport dpdmai_closeexport dpdmai_destroyexport dpdmai_enableexport dpdmai_disableexport dpdmai_resetexport dpdmai_get_attributesexport dpdmai_set_rx_queueexport dpdmai_get_rx_queueexport dpdmai_get_tx_queue
Annotated Snippet
struct dpdmai_rsp_get_attributes {
__le32 id;
u8 num_of_priorities;
u8 num_of_queues;
u8 pad0[2];
__le16 major;
__le16 minor;
};
struct dpdmai_cmd_queue {
__le32 dest_id;
u8 dest_priority;
union {
u8 queue;
u8 pri;
};
u8 dest_type;
u8 queue_idx;
__le64 user_ctx;
union {
__le32 options;
__le32 fqid;
};
} __packed;
struct dpdmai_rsp_get_tx_queue {
__le64 pad;
__le32 fqid;
};
struct dpdmai_cmd_open {
__le32 dpdmai_id;
} __packed;
struct dpdmai_cmd_destroy {
__le32 dpdmai_id;
} __packed;
/**
* dpdmai_open() - Open a control session for the specified object
* @mc_io: Pointer to MC portal's I/O object
* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @dpdmai_id: DPDMAI unique ID
* @token: Returned token; use in subsequent API calls
*
* This function can be used to open a control session for an
* already created object; an object may have been declared in
* the DPL or by calling the dpdmai_create() function.
* This function returns a unique authentication token,
* associated with the specific object ID and the specific MC
* portal; this token must be used in all subsequent commands for
* this specific object.
*
* Return: '0' on Success; Error code otherwise.
*/
int dpdmai_open(struct fsl_mc_io *mc_io, u32 cmd_flags,
int dpdmai_id, u16 *token)
{
struct dpdmai_cmd_open *cmd_params;
struct fsl_mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_OPEN,
cmd_flags, 0);
cmd_params = (struct dpdmai_cmd_open *)&cmd.params;
cmd_params->dpdmai_id = cpu_to_le32(dpdmai_id);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
if (err)
return err;
/* retrieve response parameters */
*token = mc_cmd_hdr_read_token(&cmd);
return 0;
}
EXPORT_SYMBOL_GPL(dpdmai_open);
/**
* dpdmai_close() - Close the control session of the object
* @mc_io: Pointer to MC portal's I/O object
* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPDMAI object
*
* After this function is called, no further operations are
* allowed on the object without opening a new control session.
*
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/module.h`, `linux/types.h`, `linux/io.h`, `linux/fsl/mc.h`, `dpdmai.h`.
- Detected declarations: `struct dpdmai_rsp_get_attributes`, `struct dpdmai_cmd_queue`, `struct dpdmai_rsp_get_tx_queue`, `struct dpdmai_cmd_open`, `struct dpdmai_cmd_destroy`, `function dpdmai_open`, `function dpdmai_close`, `function dpdmai_destroy`, `function dpdmai_enable`, `function dpdmai_disable`.
- Atlas domain: Driver Families / drivers/dma.
- Implementation status: integration 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.