drivers/accel/qaic/sahara.c
Source file repositories/reference/linux-study-clean/drivers/accel/qaic/sahara.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/qaic/sahara.c- Extension
.c- Size
- 30373 bytes
- Lines
- 936
- 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.
- 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/devcoredump.hlinux/firmware.hlinux/limits.hlinux/mhi.hlinux/minmax.hlinux/mod_devicetable.hlinux/overflow.hlinux/types.hlinux/vmalloc.hlinux/workqueue.hsahara.h
Detected Declarations
struct sahara_packetstruct sahara_debug_table_entry64struct sahara_dump_table_entrystruct sahara_memory_dump_meta_v1struct sahara_contextfunction is_streamingfunction sahara_find_imagefunction sahara_release_imagefunction sahara_send_resetfunction sahara_hellofunction read_data_helperfunction sahara_read_datafunction release_imagefunction sahara_end_of_imagefunction sahara_memory_debug64function sahara_processingfunction sahara_parse_dump_tablefunction sahara_parse_dump_imagefunction sahara_dump_processingfunction sahara_read_data_processingfunction sahara_mhi_probefunction sahara_mhi_removefunction sahara_mhi_ul_xfer_cbfunction sahara_mhi_dl_xfer_cbfunction sahara_registerfunction sahara_unregister
Annotated Snippet
struct sahara_packet {
__le32 cmd;
__le32 length;
union {
struct {
__le32 version;
__le32 version_compat;
__le32 max_length;
__le32 mode;
} hello;
struct {
__le32 version;
__le32 version_compat;
__le32 status;
__le32 mode;
} hello_resp;
struct {
__le32 image;
__le32 offset;
__le32 length;
} read_data;
struct {
__le32 image;
__le32 status;
} end_of_image;
struct {
__le64 table_address;
__le64 table_length;
} memory_debug64;
struct {
__le64 memory_address;
__le64 memory_length;
} memory_read64;
};
};
struct sahara_debug_table_entry64 {
__le64 type;
__le64 address;
__le64 length;
char description[SAHARA_TABLE_ENTRY_STR_LEN];
char filename[SAHARA_TABLE_ENTRY_STR_LEN];
};
struct sahara_dump_table_entry {
u64 type;
u64 address;
u64 length;
char description[SAHARA_TABLE_ENTRY_STR_LEN];
char filename[SAHARA_TABLE_ENTRY_STR_LEN];
};
#define SAHARA_DUMP_V1_MAGIC 0x1234567890abcdef
#define SAHARA_DUMP_V1_VER 1
struct sahara_memory_dump_meta_v1 {
u64 magic;
u64 version;
u64 dump_size;
u64 table_size;
};
/*
* Layout of crashdump provided to user via devcoredump
* +------------------------------------------+
* | Crashdump Meta structure |
* | type: struct sahara_memory_dump_meta_v1 |
* +------------------------------------------+
* | Crashdump Table |
* | type: array of struct |
* | sahara_dump_table_entry |
* | |
* | |
* +------------------------------------------+
* | Crashdump |
* | |
* | |
* | |
* | |
* | |
* +------------------------------------------+
*
* First is the metadata header. Userspace can use the magic number to verify
* the content type, and then check the version for the rest of the format.
* New versions should keep the magic number location/value, and version
* location, but increment the version value.
*
* For v1, the metadata lists the size of the entire dump (header + table +
* dump) and the size of the table. Then the dump image table, which describes
* the contents of the dump. Finally all the images are listed in order, with
Annotation
- Immediate include surface: `linux/devcoredump.h`, `linux/firmware.h`, `linux/limits.h`, `linux/mhi.h`, `linux/minmax.h`, `linux/mod_devicetable.h`, `linux/overflow.h`, `linux/types.h`.
- Detected declarations: `struct sahara_packet`, `struct sahara_debug_table_entry64`, `struct sahara_dump_table_entry`, `struct sahara_memory_dump_meta_v1`, `struct sahara_context`, `function is_streaming`, `function sahara_find_image`, `function sahara_release_image`, `function sahara_send_reset`, `function sahara_hello`.
- Atlas domain: Driver Families / drivers/accel.
- 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.