i2odpt.h revision 87826
165312Smsmith/****************************************************************
265312Smsmith * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
365312Smsmith * Copyright (c) 2000 Adaptec Corporation.
465312Smsmith * All rights reserved.
565312Smsmith *
687826Sobrien * $FreeBSD: head/sys/dev/asr/i2odpt.h 87826 2001-12-13 23:48:34Z obrien $
787826Sobrien *
865312Smsmith ****************************************************************/
965312Smsmith
1065312Smsmith#if !defined(I2O_DPT_HDR)
1165312Smsmith#define I2O_DPT_HDR
1265312Smsmith
1365312Smsmith#define DPT_ORGANIZATION_ID 0x1B        /* For Private Messages */
1465312Smsmith
1565312Smsmith/*
1665312Smsmith *      PrivateMessageFrame.StdMessageFrame.Function = I2O_PRIVATE_MESSAGE
1765312Smsmith *      PrivateMessageFrame.XFunctionCode = I2O_SCSI_SCB_EXEC
1865312Smsmith */
1965312Smsmith
2065312Smsmithtypedef struct _PRIVATE_SCSI_SCB_EXECUTE_MESSAGE {
2165312Smsmith    I2O_PRIVATE_MESSAGE_FRAME PrivateMessageFrame;
2265312Smsmith#   if (defined(sparc) || defined(_DPT_BIG_ENDIAN))
2365312Smsmith        U32                   TID; /* Upper four bits currently are zero */
2465312Smsmith#   else
2565312Smsmith        BF                    TID:16; /* Upper four bits currently are zero */
2665312Smsmith        /* Command is interpreted by the host */
2765312Smsmith        BF                    Interpret:1;
2865312Smsmith        /* if TRUE, deal with Physical Firmware Array information */
2965312Smsmith        BF                    Physical:1;
3065312Smsmith        BF                    Reserved1:14;
3165312Smsmith#   endif
3265312Smsmith    U8                        CDBLength;
3365312Smsmith    U8                        Reserved;
3465312Smsmith    I2O_SCB_FLAGS             SCBFlags;
3565312Smsmith    U8                        CDB[  I2O_SCSI_CDB_LENGTH  ];
3665312Smsmith    U32                       ByteCount;
3765312Smsmith    I2O_SG_ELEMENT            SGL;
3865312Smsmith} PRIVATE_SCSI_SCB_EXECUTE_MESSAGE, * PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE;
3965312Smsmith
4065312Smsmith/*
4165312Smsmith * Flash access and programming messages
4265312Smsmith *      PrivateMessageFrame.StdMessageFrame.Function = I2O_PRIVATE_MESSAGE
4365312Smsmith *      PrivateMessageFrame.XFunctionCode = PRIVATE_FLAGS_REGION_*
4465312Smsmith *
4565312Smsmith *      SIZE    returns the total size of a region of flash
4665312Smsmith *      READ    copies a region (or portion thereof) into the buffer specified
4765312Smsmith *              by the SGL
4865312Smsmith *      WRITE   writes a region (or portion thereof) using the data specified
4965312Smsmith *              by the SGL
5065312Smsmith *
5165312Smsmith * Flash regions
5265312Smsmith *
5365312Smsmith *      0               operational-mode firmware
5465312Smsmith *      1               software (bios/utility)
5565312Smsmith *      2               oem nvram defaults
5665312Smsmith *      3               hba serial number
5765312Smsmith *      4               boot-mode firmware
5865312Smsmith *
5965312Smsmith * Any combination of RegionOffset and ByteCount can be specified providing
6065312Smsmith * they fit within the size of the specified region.
6165312Smsmith *
6265312Smsmith * Flash messages should be targeted to the Executive TID 0x000
6365312Smsmith */
6465312Smsmith
6565312Smsmith#define PRIVATE_FLASH_REGION_SIZE       0x0100
6665312Smsmith#define PRIVATE_FLASH_REGION_READ       0x0101
6765312Smsmith#define PRIVATE_FLASH_REGION_WRITE      0x0102
6865312Smsmith#define PRIVATE_FLASH_REGION_CRC        0x0103
6965312Smsmith
7065312Smsmithtypedef struct _PRIVATE_FLASH_REGION_MESSAGE {
7165312Smsmith    I2O_PRIVATE_MESSAGE_FRAME PrivateMessageFrame;
7265312Smsmith    U32                       FlashRegion;
7365312Smsmith    U32                       RegionOffset;
7465312Smsmith    U32                       ByteCount;
7565312Smsmith    I2O_SG_ELEMENT            SGL;
7665312Smsmith} PRIVATE_FLASH_REGION_MESSAGE, * PPRIVATE_FLASH_REGION_MESSAGE;
7765312Smsmith
7865312Smsmith/* DPT Driver Printf message */
7965312Smsmith
8065312Smsmith#define PRIVATE_DRIVER_PRINTF 0x0200
8165312Smsmith
8265312Smsmith/* FwPrintFlags */
8365312Smsmith#define FW_FIRMWARE_FLAGS_NO_HEADER_B   0x00000001 /* Remove date header */
8465312Smsmith
8565312Smsmithtypedef struct _PRIVATE_DRIVER_PRINTF_MESSAGE {
8665312Smsmith
8765312Smsmith    I2O_PRIVATE_MESSAGE_FRAME   PrivateMessageFrame;
8865312Smsmith
8965312Smsmith    /* total bytes in PrintBuffer, including header */
9065312Smsmith    U32                 PrintBufferByteCount;
9165312Smsmith    /* exact data to be copied into the serial PrintBuffer */
9265312Smsmith    U8                  PrintBuffer[1];
9365312Smsmith
9465312Smsmith} PRIVATE_DRIVER_PRINTF_MESSAGE, * PPRIVATE_DRIVER_PRINTF_MESSAGE;
9565312Smsmith
9665312Smsmith/* DPT Enable Diagnostics message 0x0201 */
9765312Smsmith
9865312Smsmith#define PRIVATE_DIAG_ENABLE 0x0201
9965312Smsmith
10065312Smsmithtypedef struct _PRIVATE_DIAG_ENABLE_MESSAGE {
10165312Smsmith        I2O_PRIVATE_MESSAGE_FRAME       PrivateMessageFrame;
10265312Smsmith} PRIVATE_DIAG_MESSAGE_FRAME, * PPRIVATE_DIAG_MESSAGE_FRAME;
10365312Smsmith
10465312Smsmith/* DPT Driver Get/Put message */
10565312Smsmith
10665312Smsmith#define PRIVATE_DRIVER_GET      0x300
10765312Smsmith#define PRIVATE_DRIVER_PUT      0x301
10865312Smsmith
10965312Smsmithtypedef struct _PRIVATE_DRIVER_GETPUT_MESSAGE
11065312Smsmith{
11165312Smsmith        I2O_PRIVATE_MESSAGE_FRAME       PrivateMessageFrame;
11265312Smsmith        U32                             Offset;
11365312Smsmith        U32                             ByteCount;
11465312Smsmith        I2O_SG_ELEMENT                  SGL;
11565312Smsmith} PRIVATE_DRIVER_GETPUT_MESSAGE, * PPRIVATE_DRIVER_GETPUT_MESSAGE;
11665312Smsmith
11765312Smsmith/****************************************************************************/
11865312Smsmith
11965312Smsmith/* DPT Peripheral Device Parameter Groups */
12065312Smsmith
12165312Smsmith/****************************************************************************/
12265312Smsmith
12365312Smsmith/* DPT Configuration and Operating Structures and Defines */
12465312Smsmith
12565312Smsmith#define     I2O_DPT_DEVICE_INFO_GROUP_NO               0x8000
12665312Smsmith
12765312Smsmith/* - 8000h - DPT Device Information Parameters Group defines */
12865312Smsmith
12965312Smsmith/* Device Type */
13065312Smsmith
13165312Smsmith#define I2O_DPT_DEVICE_TYPE_DIRECT        I2O_SCSI_DEVICE_TYPE_DIRECT
13265312Smsmith#define I2O_DPT_DEVICE_TYPE_SEQUENTIAL    I2O_SCSI_DEVICE_TYPE_SEQUENTIAL
13365312Smsmith#define I2O_DPT_DEVICE_TYPE_PRINTER       I2O_SCSI_DEVICE_TYPE_PRINTER
13465312Smsmith#define I2O_DPT_DEVICE_TYPE_PROCESSOR     I2O_SCSI_DEVICE_TYPE_PROCESSOR
13565312Smsmith#define I2O_DPT_DEVICE_TYPE_WORM          I2O_SCSI_DEVICE_TYPE_WORM
13665312Smsmith#define I2O_DPT_DEVICE_TYPE_CDROM         I2O_SCSI_DEVICE_TYPE_CDROM
13765312Smsmith#define I2O_DPT_DEVICE_TYPE_SCANNER       I2O_SCSI_DEVICE_TYPE_SCANNER
13865312Smsmith#define I2O_DPT_DEVICE_TYPE_OPTICAL       I2O_SCSI_DEVICE_TYPE_OPTICAL
13965312Smsmith#define I2O_DPT_DEVICE_TYPE_MEDIA_CHANGER I2O_SCSI_DEVICE_TYPE_MEDIA_CHANGER
14065312Smsmith#define I2O_DPT_DEVICE_TYPE_COMM          I2O_SCSI_DEVICE_TYPE_COMM
14165312Smsmith#define I2O_DPT_DEVICE_GRAPHICS_1         I2O_SCSI_DEVICE_GRAPHICS_1
14265312Smsmith#define I2O_DPT_DEVICE_GRAPHICS_2         I2O_SCSI_DEVICE_GRAPHICS_2
14365312Smsmith#define I2O_DPT_DEVICE_TYPE_ARRAY_CONT    I2O_SCSI_DEVICE_TYPE_ARRAY_CONT
14465312Smsmith#define I2O_DPT_DEVICE_TYPE_UNKNOWN       I2O_SCSI_DEVICE_TYPE_UNKNOWN
14565312Smsmith
14665312Smsmith/* Flags */
14765312Smsmith
14865312Smsmith#define I2O_DPT_PERIPHERAL_TYPE_FLAG      I2O_SCSI_PERIPHERAL_TYPE_FLAG
14965312Smsmith#define I2O_DPT_PERIPHERAL_TYPE_PARALLEL  I2O_SCSI_PERIPHERAL_TYPE_PARALLEL
15065312Smsmith#define I2O_DPT_PERIPHERAL_TYPE_SERIAL    I2O_SCSI_PERIPHERAL_TYPE_SERIAL
15165312Smsmith
15265312Smsmith#define I2O_DPT_RESERVED_FLAG             I2O_SCSI_RESERVED_FLAG
15365312Smsmith
15465312Smsmith#define I2O_DPT_DISCONNECT_FLAG           I2O_SCSI_DISCONNECT_FLAG
15565312Smsmith#define I2O_DPT_DISABLE_DISCONNECT        I2O_SCSI_DISABLE_DISCONNECT
15665312Smsmith#define I2O_DPT_ENABLE_DISCONNECT         I2O_SCSI_ENABLE_DISCONNECT
15765312Smsmith
15865312Smsmith#define I2O_DPT_MODE_MASK                 I2O_SCSI_MODE_MASK
15965312Smsmith#define I2O_DPT_MODE_SET_DATA             I2O_SCSI_MODE_SET_DATA
16065312Smsmith#define I2O_DPT_MODE_SET_DEFAULT          I2O_SCSI_MODE_SET_DEFAULT
16165312Smsmith#define I2O_DPT_MODE_SET_SAFEST           I2O_SCSI_MODE_SET_SAFEST
16265312Smsmith
16365312Smsmith#define I2O_DPT_DATA_WIDTH_MASK           I2O_SCSI_DATA_WIDTH_MASK
16465312Smsmith#define I2O_DPT_DATA_WIDTH_8              I2O_SCSI_DATA_WIDTH_8
16565312Smsmith#define I2O_DPT_DATA_WIDTH_16             I2O_SCSI_DATA_WIDTH_16
16665312Smsmith#define I2O_DPT_DATA_WIDTH_32             I2O_SCSI_DATA_WIDTH_32
16765312Smsmith
16865312Smsmith#define I2O_DPT_SYNC_NEGOTIATION_FLAG     I2O_SCSI_SYNC_NEGOTIATION_FLAG
16965312Smsmith#define I2O_DPT_DISABLE_SYNC_NEGOTIATION  I2O_SCSI_DISABLE_SYNC_NEGOTIATION
17065312Smsmith#define I2O_DPT_ENABLE_SYNC_NEGOTIATION   I2O_SCSI_ENABLE_SYNC_NEGOTIATION
17165312Smsmith
17265312Smsmith/* DPT Device Group 8000h - Device Information Parameter Group */
17365312Smsmith
17465312Smsmithtypedef struct _I2O_DPT_DEVICE_INFO_SCALAR {
17565312Smsmith    U8          DeviceType;     /* Identical to I2O_SCSI_DEVICE_INFO SCALAR */
17665312Smsmith    U8          Flags;          /* Identical to I2O_SCSI_DEVICE_INFO SCALAR */
17765312Smsmith    U16         Bus;
17865312Smsmith    U32         Identifier;
17965312Smsmith    U8          LunInfo[8]; /* SCSI-2 8-bit scalar LUN goes into offset 1 */
18065312Smsmith
18165312Smsmith} I2O_DPT_DEVICE_INFO_SCALAR, *PI2O_DPT_DEVICE_INFO_SCALAR;
18265312Smsmith
18365312Smsmith#define I2O_DPT_EXEC_IOP_BUFFERS_GROUP_NO    0x8000
18465312Smsmith
18565312Smsmith/* DPT Exec Iop Buffers Group 8000h */
18665312Smsmith
18765312Smsmithtypedef struct _I2O_DPT_EXEC_IOP_BUFFERS_SCALAR {
18865312Smsmith    U32      SerialOutputOffset;    /* offset from base address to header   */
18965312Smsmith    U32      SerialOutputSize;      /* size of data buffer in bytes         */
19065312Smsmith    U32      SerialHeaderSize;      /* size of data buffer header in bytes  */
19165312Smsmith    U32      SerialFlagsSupported;  /* Mask of debug flags supported        */
19265312Smsmith
19365312Smsmith} I2O_DPT_EXEC_IOP_BUFFERS_SCALAR, *PI2O_DPT_EXEC_IOP_BUFFERS_SCALAR;
19465312Smsmith
19565312Smsmith
19665312Smsmith#endif /* I2O_DPT_HDR */
197