18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/***************************************************************************
38c2ecf20Sopenharmony_ci                          dpti_ioctl.h  -  description
48c2ecf20Sopenharmony_ci                             -------------------
58c2ecf20Sopenharmony_ci    begin                : Thu Sep 7 2000
68c2ecf20Sopenharmony_ci    copyright            : (C) 2001 by Adaptec
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci    See Documentation/scsi/dpti.rst for history, notes, license info
98c2ecf20Sopenharmony_ci    and credits
108c2ecf20Sopenharmony_ci ***************************************************************************/
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/***************************************************************************
138c2ecf20Sopenharmony_ci *                                                                         *
148c2ecf20Sopenharmony_ci *                                                                         *
158c2ecf20Sopenharmony_ci ***************************************************************************/
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/***************************************************************************
188c2ecf20Sopenharmony_ci * This file is generated from  osd_unix.h                                 *
198c2ecf20Sopenharmony_ci * *************************************************************************/
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#ifndef _dpti_ioctl_h
228c2ecf20Sopenharmony_ci#define _dpti_ioctl_h
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci// IOCTL interface commands
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#ifndef _IOWR
278c2ecf20Sopenharmony_ci# define _IOWR(x,y,z)	(((x)<<8)|y)
288c2ecf20Sopenharmony_ci#endif
298c2ecf20Sopenharmony_ci#ifndef _IOW
308c2ecf20Sopenharmony_ci# define _IOW(x,y,z)	(((x)<<8)|y)
318c2ecf20Sopenharmony_ci#endif
328c2ecf20Sopenharmony_ci#ifndef _IOR
338c2ecf20Sopenharmony_ci# define _IOR(x,y,z)	(((x)<<8)|y)
348c2ecf20Sopenharmony_ci#endif
358c2ecf20Sopenharmony_ci#ifndef _IO
368c2ecf20Sopenharmony_ci# define _IO(x,y)	(((x)<<8)|y)
378c2ecf20Sopenharmony_ci#endif
388c2ecf20Sopenharmony_ci/* EATA PassThrough Command	*/
398c2ecf20Sopenharmony_ci#define EATAUSRCMD      _IOWR('D',65,EATA_CP)
408c2ecf20Sopenharmony_ci/* Set Debug Level If Enabled	*/
418c2ecf20Sopenharmony_ci#define DPT_DEBUG       _IOW('D',66,int)
428c2ecf20Sopenharmony_ci/* Get Signature Structure	*/
438c2ecf20Sopenharmony_ci#define DPT_SIGNATURE   _IOR('D',67,dpt_sig_S)
448c2ecf20Sopenharmony_ci#if defined __bsdi__
458c2ecf20Sopenharmony_ci#define DPT_SIGNATURE_PACKED   _IOR('D',67,dpt_sig_S_Packed)
468c2ecf20Sopenharmony_ci#endif
478c2ecf20Sopenharmony_ci/* Get Number Of DPT Adapters	*/
488c2ecf20Sopenharmony_ci#define DPT_NUMCTRLS    _IOR('D',68,int)
498c2ecf20Sopenharmony_ci/* Get Adapter Info Structure	*/
508c2ecf20Sopenharmony_ci#define DPT_CTRLINFO    _IOR('D',69,CtrlInfo)
518c2ecf20Sopenharmony_ci/* Get Statistics If Enabled	*/
528c2ecf20Sopenharmony_ci#define DPT_STATINFO    _IO('D',70)
538c2ecf20Sopenharmony_ci/* Clear Stats If Enabled	*/
548c2ecf20Sopenharmony_ci#define DPT_CLRSTAT     _IO('D',71)
558c2ecf20Sopenharmony_ci/* Get System Info Structure	*/
568c2ecf20Sopenharmony_ci#define DPT_SYSINFO     _IOR('D',72,sysInfo_S)
578c2ecf20Sopenharmony_ci/* Set Timeout Value		*/
588c2ecf20Sopenharmony_ci#define DPT_TIMEOUT     _IO('D',73)
598c2ecf20Sopenharmony_ci/* Get config Data  		*/
608c2ecf20Sopenharmony_ci#define DPT_CONFIG      _IO('D',74)
618c2ecf20Sopenharmony_ci/* Get Blink LED Code	        */
628c2ecf20Sopenharmony_ci#define DPT_BLINKLED    _IOR('D',75,int)
638c2ecf20Sopenharmony_ci/* Get Statistical information (if available) */
648c2ecf20Sopenharmony_ci#define DPT_STATS_INFO        _IOR('D',80,STATS_DATA)
658c2ecf20Sopenharmony_ci/* Clear the statistical information          */
668c2ecf20Sopenharmony_ci#define DPT_STATS_CLEAR       _IO('D',81)
678c2ecf20Sopenharmony_ci/* Get Performance metrics */
688c2ecf20Sopenharmony_ci#define DPT_PERF_INFO        _IOR('D',82,dpt_perf_t)
698c2ecf20Sopenharmony_ci/* Send an I2O command */
708c2ecf20Sopenharmony_ci#define I2OUSRCMD	_IO('D',76)
718c2ecf20Sopenharmony_ci/* Inform driver to re-acquire LCT information */
728c2ecf20Sopenharmony_ci#define I2ORESCANCMD	_IO('D',77)
738c2ecf20Sopenharmony_ci/* Inform driver to reset adapter */
748c2ecf20Sopenharmony_ci#define I2ORESETCMD	_IO('D',78)
758c2ecf20Sopenharmony_ci/* See if the target is mounted */
768c2ecf20Sopenharmony_ci#define DPT_TARGET_BUSY	_IOR('D',79, TARGET_BUSY_T)
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci  /* Structure Returned From Get Controller Info                             */
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_citypedef struct {
828c2ecf20Sopenharmony_ci	uCHAR    state;            /* Operational state               */
838c2ecf20Sopenharmony_ci	uCHAR    id;               /* Host adapter SCSI id            */
848c2ecf20Sopenharmony_ci	int      vect;             /* Interrupt vector number         */
858c2ecf20Sopenharmony_ci	int      base;             /* Base I/O address                */
868c2ecf20Sopenharmony_ci	int      njobs;            /* # of jobs sent to HA            */
878c2ecf20Sopenharmony_ci	int      qdepth;           /* Controller queue depth.         */
888c2ecf20Sopenharmony_ci	int      wakebase;         /* mpx wakeup base index.          */
898c2ecf20Sopenharmony_ci	uINT     SGsize;           /* Scatter/Gather list size.       */
908c2ecf20Sopenharmony_ci	unsigned heads;            /* heads for drives on cntlr.      */
918c2ecf20Sopenharmony_ci	unsigned sectors;          /* sectors for drives on cntlr.    */
928c2ecf20Sopenharmony_ci	uCHAR    do_drive32;       /* Flag for Above 16 MB Ability    */
938c2ecf20Sopenharmony_ci	uCHAR    BusQuiet;         /* SCSI Bus Quiet Flag             */
948c2ecf20Sopenharmony_ci	char     idPAL[4];         /* 4 Bytes Of The ID Pal           */
958c2ecf20Sopenharmony_ci	uCHAR    primary;          /* 1 For Primary, 0 For Secondary  */
968c2ecf20Sopenharmony_ci	uCHAR    eataVersion;      /* EATA Version                    */
978c2ecf20Sopenharmony_ci	uINT     cpLength;         /* EATA Command Packet Length      */
988c2ecf20Sopenharmony_ci	uINT     spLength;         /* EATA Status Packet Length       */
998c2ecf20Sopenharmony_ci	uCHAR    drqNum;           /* DRQ Index (0,5,6,7)             */
1008c2ecf20Sopenharmony_ci	uCHAR    flag1;            /* EATA Flags 1 (Byte 9)           */
1018c2ecf20Sopenharmony_ci	uCHAR    flag2;            /* EATA Flags 2 (Byte 30)          */
1028c2ecf20Sopenharmony_ci} CtrlInfo;
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_citypedef struct {
1058c2ecf20Sopenharmony_ci	uSHORT length;		// Remaining length of this
1068c2ecf20Sopenharmony_ci	uSHORT drvrHBAnum;	// Relative HBA # used by the driver
1078c2ecf20Sopenharmony_ci	uINT baseAddr;		// Base I/O address
1088c2ecf20Sopenharmony_ci	uSHORT blinkState;	// Blink LED state (0=Not in blink LED)
1098c2ecf20Sopenharmony_ci	uCHAR pciBusNum;	// PCI Bus # (Optional)
1108c2ecf20Sopenharmony_ci	uCHAR pciDeviceNum;	// PCI Device # (Optional)
1118c2ecf20Sopenharmony_ci	uSHORT hbaFlags;	// Miscellaneous HBA flags
1128c2ecf20Sopenharmony_ci	uSHORT Interrupt;	// Interrupt set for this device.
1138c2ecf20Sopenharmony_ci#   if (defined(_DPT_ARC))
1148c2ecf20Sopenharmony_ci	uINT baseLength;
1158c2ecf20Sopenharmony_ci	ADAPTER_OBJECT *AdapterObject;
1168c2ecf20Sopenharmony_ci	LARGE_INTEGER DmaLogicalAddress;
1178c2ecf20Sopenharmony_ci	PVOID DmaVirtualAddress;
1188c2ecf20Sopenharmony_ci	LARGE_INTEGER ReplyLogicalAddress;
1198c2ecf20Sopenharmony_ci	PVOID ReplyVirtualAddress;
1208c2ecf20Sopenharmony_ci#   else
1218c2ecf20Sopenharmony_ci	uINT reserved1;		// Reserved for future expansion
1228c2ecf20Sopenharmony_ci	uINT reserved2;		// Reserved for future expansion
1238c2ecf20Sopenharmony_ci	uINT reserved3;		// Reserved for future expansion
1248c2ecf20Sopenharmony_ci#   endif
1258c2ecf20Sopenharmony_ci} drvrHBAinfo_S;
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_citypedef struct TARGET_BUSY
1288c2ecf20Sopenharmony_ci{
1298c2ecf20Sopenharmony_ci  uLONG channel;
1308c2ecf20Sopenharmony_ci  uLONG id;
1318c2ecf20Sopenharmony_ci  uLONG lun;
1328c2ecf20Sopenharmony_ci  uLONG isBusy;
1338c2ecf20Sopenharmony_ci} TARGET_BUSY_T;
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci#endif
1368c2ecf20Sopenharmony_ci
137