📄 megaraid_sas.h
字号:
u32 reserved_1[2]; /*0038h*/ u32 inbound_queue_port; /*0040h*/ u32 outbound_queue_port; /*0044h*/ u32 reserved_2[22]; /*0048h*/ u32 outbound_doorbell_clear; /*00A0h*/ u32 reserved_3[3]; /*00A4h*/ u32 outbound_scratch_pad ; /*00B0h*/ u32 reserved_4[3]; /*00B4h*/ u32 inbound_low_queue_port ; /*00C0h*/ u32 inbound_high_queue_port ; /*00C4h*/ u32 reserved_5; /*00C8h*/ u32 index_registers[820]; /*00CCh*/} __attribute__ ((packed));struct megasas_sge32 { u32 phys_addr; u32 length;} __attribute__ ((packed));struct megasas_sge64 { u64 phys_addr; u32 length;} __attribute__ ((packed));union megasas_sgl { struct megasas_sge32 sge32[1]; struct megasas_sge64 sge64[1];} __attribute__ ((packed));struct megasas_header { u8 cmd; /*00h */ u8 sense_len; /*01h */ u8 cmd_status; /*02h */ u8 scsi_status; /*03h */ u8 target_id; /*04h */ u8 lun; /*05h */ u8 cdb_len; /*06h */ u8 sge_count; /*07h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 timeout; /*12h */ u32 data_xferlen; /*14h */} __attribute__ ((packed));union megasas_sgl_frame { struct megasas_sge32 sge32[8]; struct megasas_sge64 sge64[5];} __attribute__ ((packed));struct megasas_init_frame { u8 cmd; /*00h */ u8 reserved_0; /*01h */ u8 cmd_status; /*02h */ u8 reserved_1; /*03h */ u32 reserved_2; /*04h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 reserved_3; /*12h */ u32 data_xfer_len; /*14h */ u32 queue_info_new_phys_addr_lo; /*18h */ u32 queue_info_new_phys_addr_hi; /*1Ch */ u32 queue_info_old_phys_addr_lo; /*20h */ u32 queue_info_old_phys_addr_hi; /*24h */ u32 reserved_4[6]; /*28h */} __attribute__ ((packed));struct megasas_init_queue_info { u32 init_flags; /*00h */ u32 reply_queue_entries; /*04h */ u32 reply_queue_start_phys_addr_lo; /*08h */ u32 reply_queue_start_phys_addr_hi; /*0Ch */ u32 producer_index_phys_addr_lo; /*10h */ u32 producer_index_phys_addr_hi; /*14h */ u32 consumer_index_phys_addr_lo; /*18h */ u32 consumer_index_phys_addr_hi; /*1Ch */} __attribute__ ((packed));struct megasas_io_frame { u8 cmd; /*00h */ u8 sense_len; /*01h */ u8 cmd_status; /*02h */ u8 scsi_status; /*03h */ u8 target_id; /*04h */ u8 access_byte; /*05h */ u8 reserved_0; /*06h */ u8 sge_count; /*07h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 timeout; /*12h */ u32 lba_count; /*14h */ u32 sense_buf_phys_addr_lo; /*18h */ u32 sense_buf_phys_addr_hi; /*1Ch */ u32 start_lba_lo; /*20h */ u32 start_lba_hi; /*24h */ union megasas_sgl sgl; /*28h */} __attribute__ ((packed));struct megasas_pthru_frame { u8 cmd; /*00h */ u8 sense_len; /*01h */ u8 cmd_status; /*02h */ u8 scsi_status; /*03h */ u8 target_id; /*04h */ u8 lun; /*05h */ u8 cdb_len; /*06h */ u8 sge_count; /*07h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 timeout; /*12h */ u32 data_xfer_len; /*14h */ u32 sense_buf_phys_addr_lo; /*18h */ u32 sense_buf_phys_addr_hi; /*1Ch */ u8 cdb[16]; /*20h */ union megasas_sgl sgl; /*30h */} __attribute__ ((packed));struct megasas_dcmd_frame { u8 cmd; /*00h */ u8 reserved_0; /*01h */ u8 cmd_status; /*02h */ u8 reserved_1[4]; /*03h */ u8 sge_count; /*07h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 timeout; /*12h */ u32 data_xfer_len; /*14h */ u32 opcode; /*18h */ union { /*1Ch */ u8 b[12]; u16 s[6]; u32 w[3]; } mbox; union megasas_sgl sgl; /*28h */} __attribute__ ((packed));struct megasas_abort_frame { u8 cmd; /*00h */ u8 reserved_0; /*01h */ u8 cmd_status; /*02h */ u8 reserved_1; /*03h */ u32 reserved_2; /*04h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 reserved_3; /*12h */ u32 reserved_4; /*14h */ u32 abort_context; /*18h */ u32 pad_1; /*1Ch */ u32 abort_mfi_phys_addr_lo; /*20h */ u32 abort_mfi_phys_addr_hi; /*24h */ u32 reserved_5[6]; /*28h */} __attribute__ ((packed));struct megasas_smp_frame { u8 cmd; /*00h */ u8 reserved_1; /*01h */ u8 cmd_status; /*02h */ u8 connection_status; /*03h */ u8 reserved_2[3]; /*04h */ u8 sge_count; /*07h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 timeout; /*12h */ u32 data_xfer_len; /*14h */ u64 sas_addr; /*18h */ union { struct megasas_sge32 sge32[2]; /* [0]: resp [1]: req */ struct megasas_sge64 sge64[2]; /* [0]: resp [1]: req */ } sgl;} __attribute__ ((packed));struct megasas_stp_frame { u8 cmd; /*00h */ u8 reserved_1; /*01h */ u8 cmd_status; /*02h */ u8 reserved_2; /*03h */ u8 target_id; /*04h */ u8 reserved_3[2]; /*05h */ u8 sge_count; /*07h */ u32 context; /*08h */ u32 pad_0; /*0Ch */ u16 flags; /*10h */ u16 timeout; /*12h */ u32 data_xfer_len; /*14h */ u16 fis[10]; /*18h */ u32 stp_flags; union { struct megasas_sge32 sge32[2]; /* [0]: resp [1]: data */ struct megasas_sge64 sge64[2]; /* [0]: resp [1]: data */ } sgl;} __attribute__ ((packed));union megasas_frame { struct megasas_header hdr; struct megasas_init_frame init; struct megasas_io_frame io; struct megasas_pthru_frame pthru; struct megasas_dcmd_frame dcmd; struct megasas_abort_frame abort; struct megasas_smp_frame smp; struct megasas_stp_frame stp; u8 raw_bytes[64];};struct megasas_cmd;union megasas_evt_class_locale { struct { u16 locale; u8 reserved; s8 class; } __attribute__ ((packed)) members; u32 word;} __attribute__ ((packed));struct megasas_evt_log_info { u32 newest_seq_num; u32 oldest_seq_num; u32 clear_seq_num; u32 shutdown_seq_num; u32 boot_seq_num;} __attribute__ ((packed));struct megasas_progress { u16 progress; u16 elapsed_seconds;} __attribute__ ((packed));struct megasas_evtarg_ld { u16 target_id; u8 ld_index; u8 reserved;} __attribute__ ((packed));struct megasas_evtarg_pd { u16 device_id; u8 encl_index; u8 slot_number;} __attribute__ ((packed));struct megasas_evt_detail { u32 seq_num; u32 time_stamp; u32 code; union megasas_evt_class_locale cl; u8 arg_type; u8 reserved1[15]; union { struct { struct megasas_evtarg_pd pd; u8 cdb_length; u8 sense_length; u8 reserved[2]; u8 cdb[16]; u8 sense[64]; } __attribute__ ((packed)) cdbSense; struct megasas_evtarg_ld ld; struct { struct megasas_evtarg_ld ld; u64 count; } __attribute__ ((packed)) ld_count; struct { u64 lba; struct megasas_evtarg_ld ld; } __attribute__ ((packed)) ld_lba; struct { struct megasas_evtarg_ld ld; u32 prevOwner; u32 newOwner; } __attribute__ ((packed)) ld_owner; struct { u64 ld_lba; u64 pd_lba; struct megasas_evtarg_ld ld; struct megasas_evtarg_pd pd; } __attribute__ ((packed)) ld_lba_pd_lba; struct { struct megasas_evtarg_ld ld; struct megasas_progress prog; } __attribute__ ((packed)) ld_prog; struct { struct megasas_evtarg_ld ld; u32 prev_state; u32 new_state; } __attribute__ ((packed)) ld_state; struct { u64 strip; struct megasas_evtarg_ld ld; } __attribute__ ((packed)) ld_strip; struct megasas_evtarg_pd pd; struct { struct megasas_evtarg_pd pd; u32 err; } __attribute__ ((packed)) pd_err; struct { u64 lba; struct megasas_evtarg_pd pd; } __attribute__ ((packed)) pd_lba; struct { u64 lba; struct megasas_evtarg_pd pd; struct megasas_evtarg_ld ld; } __attribute__ ((packed)) pd_lba_ld; struct { struct megasas_evtarg_pd pd; struct megasas_progress prog; } __attribute__ ((packed)) pd_prog; struct { struct megasas_evtarg_pd pd; u32 prevState; u32 newState; } __attribute__ ((packed)) pd_state; struct { u16 vendorId; u16 deviceId; u16 subVendorId; u16 subDeviceId; } __attribute__ ((packed)) pci; u32 rate; char str[96]; struct { u32 rtc; u32 elapsedSeconds; } __attribute__ ((packed)) time; struct { u32 ecar; u32 elog; char str[64]; } __attribute__ ((packed)) ecc; u8 b[96]; u16 s[48]; u32 w[24]; u64 d[12]; } args; char description[128];} __attribute__ ((packed)); struct megasas_instance_template { void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *); void (*enable_intr)(struct megasas_register_set __iomem *) ; void (*disable_intr)(struct megasas_register_set __iomem *); int (*clear_intr)(struct megasas_register_set __iomem *); u32 (*read_fw_status_reg)(struct megasas_register_set __iomem *); };struct megasas_instance { u32 *producer; dma_addr_t producer_h; u32 *consumer; dma_addr_t consumer_h; u32 *reply_queue; dma_addr_t reply_queue_h; unsigned long base_addr; struct megasas_register_set __iomem *reg_set; s8 init_id; u16 max_num_sge; u16 max_fw_cmds; u32 max_sectors_per_req; u32 cmd_per_lun; struct megasas_cmd **cmd_list; struct list_head cmd_pool; spinlock_t cmd_pool_lock; spinlock_t completion_lock; struct dma_pool *frame_dma_pool; struct dma_pool *sense_dma_pool; struct megasas_evt_detail *evt_detail; dma_addr_t evt_detail_h; struct megasas_cmd *aen_cmd; struct semaphore aen_mutex; struct semaphore ioctl_sem; struct Scsi_Host *host; wait_queue_head_t int_cmd_wait_q; wait_queue_head_t abort_cmd_wait_q; struct pci_dev *pdev; u32 unique_id; atomic_t fw_outstanding; u32 hw_crit_error; struct megasas_instance_template *instancet; struct tasklet_struct isr_tasklet; u8 flag; unsigned long last_time;};#define MEGASAS_IS_LOGICAL(scp) \ (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1#define MEGASAS_DEV_INDEX(inst, scp) \ ((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + \ scp->device->idstruct megasas_cmd { union megasas_frame *frame; dma_addr_t frame_phys_addr; u8 *sense; dma_addr_t sense_phys_addr; u32 index; u8 sync_cmd; u8 cmd_status; u16 abort_aen; struct list_head list; struct scsi_cmnd *scmd; struct megasas_instance *instance; u32 frame_count;};#define MAX_MGMT_ADAPTERS 1024#define MAX_IOCTL_SGE 16struct megasas_iocpacket { u16 host_no; u16 __pad1; u32 sgl_off; u32 sge_count; u32 sense_off; u32 sense_len; union { u8 raw[128]; struct megasas_header hdr; } frame; struct iovec sgl[MAX_IOCTL_SGE];} __attribute__ ((packed));struct megasas_aen { u16 host_no; u16 __pad1; u32 seq_num; u32 class_locale_word;} __attribute__ ((packed));#ifdef CONFIG_COMPATstruct compat_megasas_iocpacket { u16 host_no; u16 __pad1; u32 sgl_off; u32 sge_count; u32 sense_off; u32 sense_len; union { u8 raw[128]; struct megasas_header hdr; } frame; struct compat_iovec sgl[MAX_IOCTL_SGE];} __attribute__ ((packed));#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket)#endif#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket)#define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen)struct megasas_mgmt_info { u16 count; struct megasas_instance *instance[MAX_MGMT_ADAPTERS]; int max_index;};#endif /*LSI_MEGARAID_SAS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -