drivers/accel/qaic/qaic_data.c
Source file repositories/reference/linux-study-clean/drivers/accel/qaic/qaic_data.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/qaic/qaic_data.c- Extension
.c- Size
- 52988 bytes
- Lines
- 2092
- Domain
- Driver Families
- Bucket
- drivers/accel
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/bits.hlinux/completion.hlinux/delay.hlinux/dma-buf.hlinux/dma-mapping.hlinux/interrupt.hlinux/kref.hlinux/list.hlinux/math64.hlinux/mm.hlinux/moduleparam.hlinux/scatterlist.hlinux/spinlock.hlinux/srcu.hlinux/string.hlinux/types.hlinux/uaccess.hlinux/wait.hdrm/drm_file.hdrm/drm_gem.hdrm/drm_prime.hdrm/drm_print.huapi/drm/qaic_accel.hqaic.h
Detected Declarations
struct dbc_reqstruct dbc_rspfunction bo_queuedfunction get_dbc_req_elem_sizefunction get_dbc_rsp_elem_sizefunction free_slicefunction clone_range_of_sgt_for_slicefunction encode_reqsfunction qaic_map_one_slicefunction create_sgtfunction invalid_semfunction qaic_validate_reqfunction qaic_free_sgtfunction qaic_gem_print_infofunction qaic_gem_object_mmapfunction qaic_free_objectfunction qaic_init_bofunction qaic_create_bo_ioctlfunction qaic_mmap_bo_ioctlfunction qaic_prepare_import_bofunction qaic_prepare_export_bofunction qaic_prepare_bofunction qaic_unprepare_import_bofunction qaic_unprepare_export_bofunction qaic_unprepare_bofunction qaic_free_slices_bofunction qaic_attach_slicing_bofunction qaic_attach_slice_bo_ioctlfunction fifo_space_availfunction copy_exec_reqsfunction copy_partial_exec_reqsfunction send_bo_list_to_devicefunction list_for_each_entryfunction update_profiling_datafunction __qaic_execute_bo_ioctlfunction qaic_execute_bo_ioctlfunction qaic_partial_execute_bo_ioctlfunction dbc_irq_handlerfunction qaic_irq_polling_workfunction dbc_irq_threaded_fnfunction list_for_each_entry_safefunction qaic_wait_bo_ioctlfunction qaic_perf_stats_bo_ioctlfunction detach_slice_bofunction qaic_detach_slice_bo_ioctlfunction empty_xfer_listfunction sync_empty_xfer_listfunction disable_dbc
Annotated Snippet
struct dbc_req {
/*
* A request ID is assigned to each memory handle going in DMA queue.
* As a single memory handle can enqueue multiple elements in DMA queue
* all of them will have the same request ID.
*/
__le16 req_id;
/* Future use */
__u8 seq_id;
/*
* Special encoded variable
* 7 0 - Do not force to generate MSI after DMA is completed
* 1 - Force to generate MSI after DMA is completed
* 6:5 Reserved
* 4 1 - Generate completion element in the response queue
* 0 - No Completion Code
* 3 0 - DMA request is a Link list transfer
* 1 - DMA request is a Bulk transfer
* 2 Reserved
* 1:0 00 - No DMA transfer involved
* 01 - DMA transfer is part of inbound transfer
* 10 - DMA transfer has outbound transfer
* 11 - NA
*/
__u8 cmd;
__le32 resv;
/* Source address for the transfer */
__le64 src_addr;
/* Destination address for the transfer */
__le64 dest_addr;
/* Length of transfer request */
__le32 len;
__le32 resv2;
/* Doorbell address */
__le64 db_addr;
/*
* Special encoded variable
* 7 1 - Doorbell(db) write
* 0 - No doorbell write
* 6:2 Reserved
* 1:0 00 - 32 bit access, db address must be aligned to 32bit-boundary
* 01 - 16 bit access, db address must be aligned to 16bit-boundary
* 10 - 8 bit access, db address must be aligned to 8bit-boundary
* 11 - Reserved
*/
__u8 db_len;
__u8 resv3;
__le16 resv4;
/* 32 bit data written to doorbell address */
__le32 db_data;
/*
* Special encoded variable
* All the fields of sem_cmdX are passed from user and all are ORed
* together to form sem_cmd.
* 0:11 Semaphore value
* 15:12 Reserved
* 20:16 Semaphore index
* 21 Reserved
* 22 Semaphore Sync
* 23 Reserved
* 26:24 Semaphore command
* 28:27 Reserved
* 29 Semaphore DMA out bound sync fence
* 30 Semaphore DMA in bound sync fence
* 31 Enable semaphore command
*/
__le32 sem_cmd0;
__le32 sem_cmd1;
__le32 sem_cmd2;
__le32 sem_cmd3;
} __packed;
struct dbc_rsp {
/* Request ID of the memory handle whose DMA transaction is completed */
__le16 req_id;
/* Status of the DMA transaction. 0 : Success otherwise failure */
__le16 status;
} __packed;
static inline bool bo_queued(struct qaic_bo *bo)
{
return !list_empty(&bo->xfer_list);
}
inline int get_dbc_req_elem_size(void)
{
return sizeof(struct dbc_req);
}
inline int get_dbc_rsp_elem_size(void)
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/completion.h`, `linux/delay.h`, `linux/dma-buf.h`, `linux/dma-mapping.h`, `linux/interrupt.h`, `linux/kref.h`.
- Detected declarations: `struct dbc_req`, `struct dbc_rsp`, `function bo_queued`, `function get_dbc_req_elem_size`, `function get_dbc_rsp_elem_size`, `function free_slice`, `function clone_range_of_sgt_for_slice`, `function encode_reqs`, `function qaic_map_one_slice`, `function create_sgt`.
- Atlas domain: Driver Families / drivers/accel.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.