#ifndef _CPQARY3_IOCTL_H
#define _CPQARY3_IOCTL_H
#ifdef __cplusplus
extern "C" {
#endif
#define CPQARY3_SCSI_IN 0
#define CPQARY3_SCSI_OUT 1
#define CPQARY3_NODATA_XFER 2
#define SUCCESS 0
#define FAILURE -1
#define HPSAS_ID_LOG_DRIVE 0x10
#define HPSAS_ID_CONTROLLER 0x11
#define HPSAS_SENSE_LOG_DRIVE 0x12
#define HPSAS_ID_PHYSICAL_DRIVE 0x15
#define HPSAS_READ 0x20
#define HPSAS_WRITE 0x30
#define HPSAS_WRITE_THROUGH 0x31
#define HPSAS_SENSE_CONFIG 0x50
#define HPSAS_SET_CONFIG 0x51
#define HPSAS_BYPASS_VOL_STATE 0x52
#define HPSAS_CHANGE_CONFIG 0x54
#define HPSAS_SENSE_ORIG_CONFIG 0x55
#define HPSAS_LABEL_LOG_DRIVE 0x57
#define HPSAS_SENSE_BUS_PARAMS 0x65
#define HPSAS_TAPE_INQUIRY 0x92
#define HPSAS_RESUME_BKGND_ACTIVITY 0x99
#define HPSAS_SENSE_MP_STAT 0xA0
#define HPSAS_SET_MP_THRESHOLD 0xA1
#define HPSAS_MP_PARAM_CONTROL 0xA4
#define HPSAS_SENSE_DRV_ERR_LOG 0xA6
#define HPSAS_FLUSH_CACHE 0xc2
#define HPSAS_REPORT_LOGICAL_LUN 0xC2
#define HPSAS_REPORT_PHYSICAL_LUN 0xC3
#define HPSAS_SET_MP_VALUE 0xF3
#define HPSAS_BMIC_CMD_LEN 16
#pragma pack(1)
typedef struct cpqary3_ioctl_request {
uint32_t len;
uint32_t reserved;
uint64_t argp;
} cpqary3_ioctl_request_t;
typedef struct cpqary3_drvrev {
uint8_t minor;
uint8_t major;
uint8_t mm;
uint8_t dd;
uint16_t yyyy;
} cpqary3_drvrev_t;
typedef struct cpqary3_driver_info {
int8_t name[16];
cpqary3_drvrev_t version;
uint32_t num_ctlr;
uint32_t max_num_ctlr;
int8_t reserved[98];
} cpqary3_driver_info_t;
typedef struct cpqary3_ctlr_info {
uint16_t state;
uint32_t board_id;
uint32_t subsystem_id;
uint8_t bus;
uint8_t dev : 5;
uint8_t fun : 3;
uint16_t slot_num;
uint8_t num_of_tgts;
uint32_t controller_instance;
int8_t reserved[109];
} cpqary3_ctlr_info_t;
typedef struct cpqary3_bmic_pass {
uint8_t lun_addr[8];
uint8_t cmd;
uint8_t cmd_len;
uint16_t unit_number;
uint32_t blk_number;
uint16_t bmic_index;
uint16_t timeout;
uint8_t io_direction;
uint8_t err_status;
ErrorInfo_t err_info;
uint16_t buf_len;
uint64_t buf;
} cpqary3_bmic_pass_t;
typedef struct cpqary3_scsi_pass {
uint8_t lun_addr[8];
uint8_t cdb[16];
uint8_t cdb_len;
uint16_t timeout;
uint8_t io_direction;
uint8_t err_status;
ErrorInfo_t err_info;
uint16_t buf_len;
uint64_t buf;
} cpqary3_scsi_pass_t;
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif