Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/smartpqi/smartpqi_ioctl.h
/*- | /*- | ||||
* Copyright (c) 2018 Microsemi Corporation. | * Copyright 2016-2021 Microchip Technology, Inc. and/or its subsidiaries. | ||||
* All rights reserved. | |||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | ||||
* 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | ||||
* notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the | ||||
Show All 15 Lines | |||||
/* $FreeBSD$ */ | /* $FreeBSD$ */ | ||||
#ifndef _PQI_IOCTL_H_ | #ifndef _PQI_IOCTL_H_ | ||||
#define _PQI_IOCTL_H_ | #define _PQI_IOCTL_H_ | ||||
/* IOCTL passthrough macros and structures */ | /* IOCTL passthrough macros and structures */ | ||||
#define SENSEINFOBYTES 32 /* note that this value may vary | #define SENSEINFOBYTES 32 /* note that this value may vary | ||||
between host implementations */ | between host implementations */ | ||||
/* transfer direction */ | /* transfer direction */ | ||||
#define PQIIOCTL_NONE 0x00 | #define PQIIOCTL_NONE 0x00 | ||||
#define PQIIOCTL_WRITE 0x01 | #define PQIIOCTL_WRITE 0x01 | ||||
#define PQIIOCTL_READ 0x02 | #define PQIIOCTL_READ 0x02 | ||||
#define PQIIOCTL_BIDIRECTIONAL (PQIIOCTL_READ | PQIIOCTL_WRITE) | #define PQIIOCTL_BIDIRECTIONAL (PQIIOCTL_READ | PQIIOCTL_WRITE) | ||||
/* Type defs used in the following structs */ | /* Type defs used in the following structs */ | ||||
#define BYTE uint8_t | #define BYTE uint8_t | ||||
#define WORD uint16_t | #define WORD uint16_t | ||||
#define HWORD uint16_t | #define HWORD uint16_t | ||||
#define DWORD uint32_t | #define DWORD uint32_t | ||||
/* Command List Structure */ | /* Command List Structure */ | ||||
typedef union _SCSI3Addr_struct { | typedef union _SCSI3Addr_struct { | ||||
struct { | struct { | ||||
BYTE Dev; | BYTE Dev; | ||||
BYTE Bus:6; | BYTE Bus:6; | ||||
BYTE Mode:2; /* b00 */ | BYTE Mode:2; /* b00 */ | ||||
} PeripDev; | } PeripDev; | ||||
struct { | struct { | ||||
Show All 10 Lines | |||||
}OS_ATTRIBUTE_PACKED SCSI3Addr_struct; | }OS_ATTRIBUTE_PACKED SCSI3Addr_struct; | ||||
typedef struct _PhysDevAddr_struct { | typedef struct _PhysDevAddr_struct { | ||||
DWORD TargetId:24; | DWORD TargetId:24; | ||||
DWORD Bus:6; | DWORD Bus:6; | ||||
DWORD Mode:2; | DWORD Mode:2; | ||||
SCSI3Addr_struct Target[2]; /* 2 level target device addr */ | SCSI3Addr_struct Target[2]; /* 2 level target device addr */ | ||||
}OS_ATTRIBUTE_PACKED PhysDevAddr_struct; | }OS_ATTRIBUTE_PACKED PhysDevAddr_struct; | ||||
typedef struct _LogDevAddr_struct { | typedef struct _LogDevAddr_struct { | ||||
DWORD VolId:30; | DWORD VolId:30; | ||||
DWORD Mode:2; | DWORD Mode:2; | ||||
BYTE reserved[4]; | BYTE reserved[4]; | ||||
}OS_ATTRIBUTE_PACKED LogDevAddr_struct; | }OS_ATTRIBUTE_PACKED LogDevAddr_struct; | ||||
typedef union _LUNAddr_struct { | typedef union _LUNAddr_struct { | ||||
BYTE LunAddrBytes[8]; | BYTE LunAddrBytes[8]; | ||||
SCSI3Addr_struct SCSI3Lun[4]; | SCSI3Addr_struct SCSI3Lun[4]; | ||||
PhysDevAddr_struct PhysDev; | PhysDevAddr_struct PhysDev; | ||||
LogDevAddr_struct LogDev; | LogDevAddr_struct LogDev; | ||||
}OS_ATTRIBUTE_PACKED LUNAddr_struct; | }OS_ATTRIBUTE_PACKED LUNAddr_struct; | ||||
typedef struct _RequestBlock_struct { | typedef struct _RequestBlock_struct { | ||||
BYTE CDBLen; | BYTE CDBLen; | ||||
struct { | struct { | ||||
BYTE Type:3; | BYTE Type:3; | ||||
BYTE Attribute:3; | BYTE Attribute:3; | ||||
BYTE Direction:2; | BYTE Direction:2; | ||||
} Type; | } Type; | ||||
HWORD Timeout; | HWORD Timeout; | ||||
BYTE CDB[16]; | BYTE CDB[16]; | ||||
}OS_ATTRIBUTE_PACKED RequestBlock_struct; | }OS_ATTRIBUTE_PACKED RequestBlock_struct; | ||||
typedef union _MoreErrInfo_struct{ | typedef union _MoreErrInfo_struct{ | ||||
struct { | struct { | ||||
BYTE Reserved[3]; | BYTE Reserved[3]; | ||||
BYTE Type; | BYTE Type; | ||||
DWORD ErrorInfo; | DWORD ErrorInfo; | ||||
} Common_Info; | } Common_Info; | ||||
struct{ | struct{ | ||||
BYTE Reserved[2]; | BYTE Reserved[2]; | ||||
BYTE offense_size; /* size of offending entry */ | BYTE offense_size; /* size of offending entry */ | ||||
BYTE offense_num; /* byte # of offense 0-base */ | BYTE offense_num; /* byte # of offense 0-base */ | ||||
DWORD offense_value; | DWORD offense_value; | ||||
} Invalid_Cmd; | } Invalid_Cmd; | ||||
}OS_ATTRIBUTE_PACKED MoreErrInfo_struct; | }OS_ATTRIBUTE_PACKED MoreErrInfo_struct; | ||||
typedef struct _ErrorInfo_struct { | typedef struct _ErrorInfo_struct { | ||||
BYTE ScsiStatus; | BYTE ScsiStatus; | ||||
BYTE SenseLen; | BYTE SenseLen; | ||||
HWORD CommandStatus; | HWORD CommandStatus; | ||||
DWORD ResidualCnt; | DWORD ResidualCnt; | ||||
MoreErrInfo_struct MoreErrInfo; | MoreErrInfo_struct MoreErrInfo; | ||||
BYTE SenseInfo[SENSEINFOBYTES]; | BYTE SenseInfo[SENSEINFOBYTES]; | ||||
}OS_ATTRIBUTE_PACKED ErrorInfo_struct; | }OS_ATTRIBUTE_PACKED ErrorInfo_struct; | ||||
typedef struct pqi_ioctl_passthruCmd_struct { | typedef struct pqi_ioctl_passthruCmd_struct { | ||||
LUNAddr_struct LUN_info; | LUNAddr_struct LUN_info; | ||||
RequestBlock_struct Request; | RequestBlock_struct Request; | ||||
ErrorInfo_struct error_info; | ErrorInfo_struct error_info; | ||||
WORD buf_size; /* size in bytes of the buf */ | WORD buf_size; /* size in bytes of the buf */ | ||||
passthru_buf_type_t buf; | passthru_buf_type_t buf; | ||||
}OS_ATTRIBUTE_PACKED IOCTL_Command_struct; | }OS_ATTRIBUTE_PACKED IOCTL_Command_struct; | ||||
#endif /* _PQI_IOCTL_H_ */ | #endif /* _PQI_IOCTL_H_ */ |