drivers/scsi/hisi_sas/hisi_sas.h
Source file repositories/reference/linux-study-clean/drivers/scsi/hisi_sas/hisi_sas.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/hisi_sas/hisi_sas.h- Extension
.h- Size
- 18582 bytes
- Lines
- 693
- Domain
- Driver Families
- Bucket
- drivers/scsi
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/blk-mq.hlinux/clk.hlinux/debugfs.hlinux/dmapool.hlinux/iopoll.hlinux/irq.hlinux/lcm.hlinux/libata.hlinux/mfd/syscon.hlinux/module.hlinux/of_address.hlinux/pci.hlinux/platform_device.hlinux/pm_runtime.hlinux/property.hlinux/regmap.hlinux/timer.hscsi/sas_ata.hscsi/libsas.h
Detected Declarations
struct hisi_hbastruct hisi_sas_hw_errorstruct hisi_sas_rststruct hisi_sas_debugfs_fifostruct hisi_sas_phystruct hisi_sas_portstruct hisi_sas_cqstruct hisi_sas_dqstruct hisi_sas_devicestruct hisi_sas_slotstruct hisi_sas_iost_itct_cachestruct hisi_sas_hwstruct hisi_sas_debugfs_cqstruct hisi_sas_debugfs_dqstruct hisi_sas_debugfs_regsstruct hisi_sas_debugfs_portstruct hisi_sas_debugfs_ioststruct hisi_sas_debugfs_itctstruct hisi_sas_debugfs_iost_cachestruct hisi_sas_debugfs_itct_cachestruct hisi_hbastruct hisi_sas_cmd_hdrstruct hisi_sas_itctstruct hisi_sas_ioststruct hisi_sas_err_recordstruct hisi_sas_initial_fisstruct hisi_sas_breakpointstruct hisi_sas_sata_breakpointstruct hisi_sas_sgestruct hisi_sas_command_table_smpstruct hisi_sas_command_table_stpstruct hisi_sas_sge_pagestruct hisi_sas_sge_dif_pagestruct hisi_sas_command_table_sspstruct hisi_sas_status_bufferstruct hisi_sas_slot_buf_tablestruct hisi_sas_slot_dif_buf_tableenum dev_statusenum hisi_sas_dev_typeenum hisi_sas_bit_err_typeenum hisi_sas_phy_eventenum hisi_sas_debugfs_reg_array_memberenum hisi_sas_debugfs_cache_typeenum hisi_sas_debugfs_bist_ffe_cfgenum hisi_sas_debugfs_bist_fixed_code
Annotated Snippet
struct hisi_sas_hw_error {
u32 irq_msk;
u32 msk;
int shift;
const char *msg;
int reg;
const struct hisi_sas_hw_error *sub;
};
struct hisi_sas_rst {
struct hisi_hba *hisi_hba;
struct completion *completion;
struct work_struct work;
bool done;
};
#define HISI_SAS_RST_WORK_INIT(r, c) \
{ .hisi_hba = hisi_hba, \
.completion = &c, \
.work = __WORK_INITIALIZER(r.work, \
hisi_sas_sync_rst_work_handler), \
.done = false, \
}
#define HISI_SAS_DECLARE_RST_WORK_ON_STACK(r) \
DECLARE_COMPLETION_ONSTACK(c); \
struct hisi_sas_rst r = HISI_SAS_RST_WORK_INIT(r, c)
enum hisi_sas_bit_err_type {
HISI_SAS_ERR_SINGLE_BIT_ECC = 0x0,
HISI_SAS_ERR_MULTI_BIT_ECC = 0x1,
};
enum hisi_sas_phy_event {
HISI_PHYE_PHY_UP = 0U,
HISI_PHYE_LINK_RESET,
HISI_PHYE_PHY_UP_PM,
HISI_PHYES_NUM,
};
struct hisi_sas_debugfs_fifo {
u32 signal_sel;
u32 dump_msk;
u32 dump_mode;
u32 trigger;
u32 trigger_msk;
u32 trigger_mode;
u32 rd_data[HISI_SAS_FIFO_DATA_DW_SIZE];
};
#define FRAME_RCVD_BUF 32
#define SAS_PHY_RESV_SIZE 2
struct hisi_sas_phy {
struct work_struct works[HISI_PHYES_NUM];
struct hisi_hba *hisi_hba;
struct hisi_sas_port *port;
struct asd_sas_phy sas_phy;
struct sas_identify identify;
struct completion *reset_completion;
struct timer_list timer;
spinlock_t lock;
u64 port_id; /* from hw */
u64 frame_rcvd_size;
u8 frame_rcvd[FRAME_RCVD_BUF];
u8 phy_attached;
u8 in_reset;
u8 reserved[SAS_PHY_RESV_SIZE];
u32 phy_type;
u32 code_violation_err_count;
enum sas_linkrate minimum_linkrate;
enum sas_linkrate maximum_linkrate;
int enable;
int wait_phyup_cnt;
atomic_t down_cnt;
/* Trace FIFO */
struct hisi_sas_debugfs_fifo fifo;
};
struct hisi_sas_port {
struct asd_sas_port sas_port;
u8 port_attached;
u8 id; /* from hw */
};
struct hisi_sas_cq {
struct hisi_hba *hisi_hba;
const struct cpumask *irq_mask;
int rd_point;
int id;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/blk-mq.h`, `linux/clk.h`, `linux/debugfs.h`, `linux/dmapool.h`, `linux/iopoll.h`, `linux/irq.h`, `linux/lcm.h`.
- Detected declarations: `struct hisi_hba`, `struct hisi_sas_hw_error`, `struct hisi_sas_rst`, `struct hisi_sas_debugfs_fifo`, `struct hisi_sas_phy`, `struct hisi_sas_port`, `struct hisi_sas_cq`, `struct hisi_sas_dq`, `struct hisi_sas_device`, `struct hisi_sas_slot`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.