dada_pkt.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1996, 1999-2000, 2002 Sun Microsystems, Inc.
* All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DADA_DADA_PKT_H
#define _SYS_DADA_DADA_PKT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* DCD pkt definition.
*
* This structure defined the packet which is allocated by a library
* function and handed to a target driver. The target driver fills
* in some information, and passes it to the library for transport
* to an addressed DCD devices. The host adapter found by the library
* fills in some other information as the command is processed. When
* the command completes (or can be taken no further) the function
* specified in the pkt is called with a pointer to the packet as
* argument. For fields within the packet, the target driver can
* determine the success or failure of the command.
*/
struct dcd_pkt {
int pkt_flags; /* Pkt flags */
int pkt_time; /* Completion timeout */
int pkt_scblen; /* Scb length */
int pkt_cdblen; /* Length of cdb */
void (*pkt_comp)(); /* Pkt Completion routine */
};
/*
* definition for the pkt_flags field.
*/
/*
* Following defines are generic.
*/
/* callback; command has been complted */
/* up return from dcd_transport(9F) */
#define FLAG_FORCENOINTR\
0x0010 /* Force command with to run in polled mode */
#define FLAG_IMMEDIATE_CB\
0x0800 /* Immediate callback on command completion */
/*
* The following flags are they needed ???
*/
#define FLAG_SILENT 0x00010000
#define FLAG_DIAGNOSE 0x00020000
#define FLAG_ISOLATE 0x00040000
/*
* Definitions for pkt_reason field.
*/
/*
* Following defines are generic.
*/
#define CMD_CMPLT 0 /* no transport errors - normal completion */
/*
* definitions for pkt_state field.
*/
/*
* Definitions for pkt_statistics field
*/
/*
* Following defines are generic.
*/
/*
* Following filds are appropriate depending on feature used.
*/
/*
* Definitions for what dcd_transport returns
*/
#define TRAN_ACCEPT 1
#define TRAN_BUSY 0
#define TRAN_BADPKT -1
#ifdef _KERNEL
/*
* Kernel function declarations
*/
#define ata_pkt_transport dcd_transport
#ifdef __STDC__
extern int dcd_transport(struct dcd_pkt *);
#else /* __STDC__ */
extern int dcd_transport();
#endif /* __STDC__ */
#define DCD_POLL_TIMEOUT 60
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DADA_DADA_PKT_H */