/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _GHD_H
#define _GHD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include "ghd_queue.h" /* linked list structures */
#include "ghd_scsi.h"
#include "ghd_waitq.h"
#include "ghd_debug.h"
#ifndef TRUE
#endif
#ifndef FALSE
#define FALSE 0
#endif
/*
* values for cmd_state:
*/
typedef enum {
GCMD_STATE_IDLE = 0,
} cmdstate_t;
/*
* action codes for the HBA timeout function
*/
typedef enum {
} gact_t;
/*
* the common portion of the Command Control Block
*/
typedef struct ghd_cmd {
int cmd_dma_flags;
long cmd_totxfer;
long cmd_resid;
} gcmd_t;
/*
* Initialize the gcmd_t structure
*/
)
/*
*/
typedef struct tmr_conf {
} tmr_t;
/*
*/
typedef struct cmd_ctl {
void *ccc_hba_handle;
void (*ccc_ccbfree)();
void (*ccc_sg_func)();
} ccc_t;
/* Initialize the HBA's list headers */
}
/* ******************************************************************* */
#include "ghd_scsa.h"
/*
* GHD Entry Points
*/
int, int),
void (*ccc_ccbfree)(gcmd_t *),
int, int),
void (*hba_complete)(void *, gcmd_t *, int),
int (*get_status)(void *, void *, int),
void (*process_intr)(void *, void *, int),
int chno);
void *intr_status);
/*
* Allocate a gcmd_t wrapper and HBA private area
*/
/*
* Free the gcmd_t wrapper and HBA private area
*/
/*
*/
gact_t, int));
/*
* Wait queue utility routines
*/
void ghd_waitq_process_and_mutex_exit(ccc_t *);
/*
* The values for the calltype arg for the ghd_timer_newstate() function
*/
#define GHD_NEWSTATE_TGTREQ 0
/* ******************************************************************* */
/*
* specify GHD_INLINE to get optimized versions
*/
#endif
#if defined(GHD_INLINE)
#else
#endif
/*
* request is complete, stop the request timer and add to doneq
*/
{ \
}
{ \
}
/*
* mark the request done and append it to the doneq
*/
{ \
\
if (!(cccp)->ccc_hba_pollmode) \
}
/* ******************************************************************* */
/*
* These are shortcut macros for linkages setup by GHD
*/
/*
* (gcmd_t *) to (struct scsi_pkt *)
*/
/*
* (gcmd_t *) to (gtgt_t *)
*/
/*
* (struct scsi_pkt *) to (gcmd_t *)
*/
/* These are shortcut macros for linkages setup by SCSA */
/*
* (struct scsi_address *) to (scsi_hba_tran *)
*/
/*
* (struct scsi_device *) to (scsi_address *)
*/
/*
* (struct scsi_device *) to (scsi_hba_tran *)
*/
/*
* (struct scsi_pkt *) to (scsi_hba_tran *)
*/
/*
* (scsi_hba_tran_t *) to (per-target-soft-state *)
*/
/*
* (struct scsi_device *) to (per-target-soft-state *)
*/
/*
* (struct scsi_pkt *) to (per-target-soft-state *)
*/
/*
* (scsi_hba_tran_t *) to (per-HBA-soft-state *)
*/
/*
* (struct scsi_device *) to (per-HBA-soft-state *)
*/
/*
* (struct scsi_address *) to (per-target-soft-state *)
*/
/* ******************************************************************* */
#ifdef __cplusplus
}
#endif
#endif /* _GHD_H */