sys/dev/mfi/mfi_tbolt.c
/*
 * map_cmd_status -	Maps FW cmd status to OS cmd status
 * @cmd :		Pointer to cmd
 * @status :		status of cmd returned by FW
 * @ext_status :	ext status of cmd returned by FW
 */
Maps FW cmd status to OS cmd status
@cmd :               Pointer to cmd
@status :            status of cmd returned by FW
@ext_status :        ext status of cmd returned by FW
Maps FW cmd status to OS cmd status @cmd : Pointer to cmd @status : status of cmd returned by FW @ext_status : ext status of cmd returned by FW
void
map_tbolt_cmd_status(struct mfi_command *mfi_cmd, uint8_t status,
    uint8_t ext_status)
{
	switch (status) {
	case MFI_STAT_OK:
		mfi_cmd->cm_frame->header.cmd_status = MFI_STAT_OK;
		mfi_cmd->cm_frame->dcmd.header.cmd_status = MFI_STAT_OK;
		mfi_cmd->cm_error = MFI_STAT_OK;
		break;
	case MFI_STAT_SCSI_IO_FAILED:
	case MFI_STAT_LD_INIT_IN_PROGRESS:
		mfi_cmd->cm_frame->header.cmd_status = status;
		mfi_cmd->cm_frame->header.scsi_status = ext_status;
		mfi_cmd->cm_frame->dcmd.header.cmd_status = status;
		mfi_cmd->cm_frame->dcmd.header.scsi_status
		    = ext_status;
		break;
	case MFI_STAT_SCSI_DONE_WITH_ERROR:
		mfi_cmd->cm_frame->header.cmd_status = ext_status;
		mfi_cmd->cm_frame->dcmd.header.cmd_status = ext_status;
		break;
	case MFI_STAT_LD_OFFLINE:
	case MFI_STAT_DEVICE_NOT_FOUND:
		mfi_cmd->cm_frame->header.cmd_status = status;
		mfi_cmd->cm_frame->dcmd.header.cmd_status = status;
		break;
	default:
		mfi_cmd->cm_frame->header.cmd_status = status;
		mfi_cmd->cm_frame->dcmd.header.cmd_status = status;
		break;
	}
}
void map_tbolt_cmd_status ( struct mfi_command * mfi_cmd , uint8_t status , uint8_t ext_status ) { switch ( status ) { case MFI_STAT_OK : mfi_cmd -> cm_frame -> header . cmd_status = MFI_STAT_OK ; mfi_cmd -> cm_frame -> dcmd . header . cmd_status = MFI_STAT_OK ; mfi_cmd -> cm_error = MFI_STAT_OK ; break ; case MFI_STAT_SCSI_IO_FAILED : case MFI_STAT_LD_INIT_IN_PROGRESS : mfi_cmd -> cm_frame -> header . cmd_status = status ; mfi_cmd -> cm_frame -> header . scsi_status = ext_status ; mfi_cmd -> cm_frame -> dcmd . header . cmd_status = status ; mfi_cmd -> cm_frame -> dcmd . header . scsi_status = ext_status ; break ; case MFI_STAT_SCSI_DONE_WITH_ERROR : mfi_cmd -> cm_frame -> header . cmd_status = ext_status ; mfi_cmd -> cm_frame -> dcmd . header . cmd_status = ext_status ; break ; case MFI_STAT_LD_OFFLINE : case MFI_STAT_DEVICE_NOT_FOUND : mfi_cmd -> cm_frame -> header . cmd_status = status ; mfi_cmd -> cm_frame -> dcmd . header . cmd_status = status ; break ; default : mfi_cmd -> cm_frame -> header . cmd_status = status ; mfi_cmd -> cm_frame -> dcmd . header . cmd_status = status ; break ; } }
map_cmd_status -     Maps FW cmd status to OS cmd status
 @cmd :               Pointer to cmd
 @status :            status of cmd returned by FW
 @ext_status :        ext status of cmd returned by FW
map_cmd_status - Maps FW cmd status to OS cmd status @cmd : Pointer to cmd @status : status of cmd returned by FW @ext_status : ext status of cmd returned by FW