-
-
Save samm-git/e80104818c86d96252c4169706d94b4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN | |
{ | |
cmds[0] = "MFI_CMD_INIT"; | |
cmds[1] = "MFI_CMD_LD_READ"; | |
cmds[2] = "MFI_CMD_LD_WRITE"; | |
cmds[3] = "MFI_CMD_LD_SCSI_IO"; | |
cmds[4] = "MFI_CMD_PD_SCSI_IO"; | |
cmds[5] = "MFI_CMD_DCMD"; | |
cmds[6] = "MFI_CMD_ABORT"; | |
cmds[7] = "MFI_CMD_SMP"; | |
cmds[8] = "MFI_CMD_STP"; | |
} | |
struct mfi_frame_header { | |
uint8_t cmd; | |
uint8_t sense_len; | |
uint8_t cmd_status; | |
uint8_t scsi_status; | |
uint8_t target_id; | |
uint8_t lun_id; | |
uint8_t cdb_len; | |
uint8_t sg_count; | |
uint32_t context; | |
uint32_t pad0; | |
uint16_t flags; | |
uint16_t timeout; | |
uint32_t data_len; | |
}; | |
struct mfi_sense { | |
uint8_t data[128]; | |
}; | |
struct mfi_command { | |
struct { struct mfi_command *tqe_next; struct mfi_command **tqe_prev; } cm_link; | |
time_t cm_timestamp; | |
void *cm_sc; | |
union mfi_frame *cm_frame; | |
bus_addr_t cm_frame_busaddr; | |
struct mfi_sense *cm_sense; | |
bus_addr_t cm_sense_busaddr; | |
bus_dmamap_t cm_dmamap; | |
union mfi_sgl *cm_sg; | |
void *cm_data; | |
int cm_len; | |
int cm_stp_len; | |
int cm_total_frame_size; | |
int cm_extra_frames; | |
int cm_flags; | |
uint8_t retry_for_fw_reset; | |
void (* cm_complete)(struct mfi_command *cm); | |
void *cm_private; | |
int cm_index; | |
int cm_error; | |
}; | |
struct mfi_ioc_packet { | |
uint16_t mfi_adapter_no; | |
uint16_t mfi_pad1; | |
uint32_t mfi_sgl_off; | |
uint32_t mfi_sge_count; | |
uint32_t mfi_sense_off; | |
uint32_t mfi_sense_len; | |
union { | |
uint8_t raw[128]; | |
struct mfi_frame_header hdr; | |
} mfi_frame; | |
}; | |
struct mfi_dcmd_myframe { | |
struct mfi_frame_header header; | |
uint32_t opcode; | |
uint8_t mbox[40]; | |
union mfi_sgl sgl; | |
} __packed; | |
struct mfi_ioc_packet2 { | |
uint16_t mfi_adapter_no; | |
uint16_t mfi_pad1; | |
uint32_t mfi_sgl_off; | |
uint32_t mfi_sge_count; | |
uint32_t mfi_sense_off; | |
uint32_t mfi_sense_len; | |
struct mfi_dcmd_myframe frame; | |
}; | |
fbt::mfip_done:entry { | |
print( *(struct mfi_frame_header *) ((*((struct mfi_command*) arg0)).cm_frame )); | |
print(*(struct mfi_command*) arg0) | |
} | |
syscall::ioctl:entry | |
/ | |
/* execname=="storcli64" && */ | |
arg1==0xc1944d01 /* MFI_CMD */ && | |
(*(struct mfi_ioc_packet *)copyin(arg2,404)).mfi_frame.hdr.cmd==4 /* MFI_CMD_PD_SCSI_IO */ | |
/ | |
{ | |
/* print(arg1); */ | |
printf("CMD: %s", cmds[(*(struct mfi_ioc_packet *)copyin(arg2,404)).mfi_frame.hdr.cmd]); | |
} | |
syscall::ioctl:entry | |
/ | |
arg1==0xc1944d01 /* MFI_CMD */ && | |
(*(struct mfi_ioc_packet *)copyin(arg2,404)).mfi_frame.hdr.cmd==5 /* MFI_CMD_DCMD */ | |
/ | |
{ | |
printf("CMD: %s", cmds[(*(struct mfi_ioc_packet *)copyin(arg2,404)).mfi_frame.hdr.cmd]); | |
print( ((*(struct mfi_ioc_packet2 *) copyin(arg2,404)).frame) ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment