1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SYS_SCSI_ADAPTERS_EMUL64CMD_H 28 #define _SYS_SCSI_ADAPTERS_EMUL64CMD_H 29 30 #include <sys/scsi/scsi_types.h> 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 #define PKT2CMD(pkt) ((struct emul64_cmd *)(pkt)->pkt_ha_private) 37 #define CMD2PKT(sp) ((sp)->cmd_pkt) 38 39 /* 40 * Per-command EMUL64 private data 41 * 42 * - Allocated at same time as scsi_pkt by scsi_hba_pkt_alloc(9E) 43 * - Pointed to by pkt_ha_private field in scsi_pkt 44 */ 45 struct emul64_cmd { 46 47 struct scsi_pkt *cmd_pkt; /* scsi_pkt reference */ 48 struct emul64_cmd *cmd_forw; /* queue link */ 49 unsigned char *cmd_addr; /* b_un.b_addr */ 50 clock_t cmd_deadline; /* cmd completion time */ 51 uint32_t cmd_flags; /* private flags */ 52 uint32_t cmd_count; /* b_bcount */ 53 uint_t cmd_cdblen; /* length of cdb */ 54 uint_t cmd_scblen; /* length of scb */ 55 struct emul64 *cmd_emul64; 56 }; 57 58 59 60 /* 61 * These are the defined flags for this structure. 62 */ 63 #define CFLAG_FINISHED 0x0001 /* command completed */ 64 #define CFLAG_COMPLETED 0x0002 /* completion routine called */ 65 #define CFLAG_IN_TRANSPORT 0x0004 /* in use by emul64 driver */ 66 #define CFLAG_TRANFLAG 0x000f /* transport part of flags */ 67 #define CFLAG_DMAVALID 0x0010 /* dma mapping valid */ 68 #define CFLAG_DMASEND 0x0020 /* data is going 'out' */ 69 #define CFLAG_CMDIOPB 0x0040 /* this is an 'iopb' packet */ 70 #define CFLAG_FREE 0x0080 /* packet is on free list */ 71 #define CFLAG_DMA_PARTIAL 0x0100 /* partial xfer OK */ 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif /* _SYS_SCSI_ADAPTERS_EMUL64CMD_H */ 78