transport.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 (c) 1996, by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _SYS_DADA_IMPL_TRANSPORT_H
#define _SYS_DADA_IMPL_TRANSPORT_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Include loadable module wrapper.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* DCD transport structure
* As each host adapter makes itself known to the system,
* It will create and register with the library the structure
* describe below. This is so that the library knows how to route
* packets, resource control requests, and capability requests
* for any particular host adapter. The 'a_hba_tran' field of a
* dcd_address structure made known to a target driver will point to
* one of these transport structures.
*/
typedef struct dcd_hba_tran dcd_hba_tran_t;
struct dcd_hba_tran {
/*
* Ptr to the device info structure for thsi particular HBA
*/
/*
* Private fields for use by the HBA itself
*/
void *tran_hba_private; /* HBA Softstate */
void *tran_tgt_private; /* Target specific info */
/*
* Only used to refer to a particular dcd device
* if the entire dcd_hba_tran_structure is cloned
* per target device, otherwise NULL.
*/
struct dcd_device *tran_sd;
/*
* vectors to point to specific HBA entry points.
*/
int (*tran_tgt_init)(
struct dcd_device *dcd);
int (*tran_tgt_probe)(
struct dcd_device *dcd,
int (*callback)(void));
int (*tran_tgt_free)(
struct dcd_device *dcd);
int (*tran_start)(
struct dcd_address *ap,
int (*tran_reset)(
struct dcd_address *ap,
int level);
int (*tran_abort)(
struct dcd_address *ap,
struct dcd_pkt *(*tran_init_pkt)(
struct dcd_address *ap,
int cmdlen,
int statuslen,
int tgtlen,
int flags,
int (*callback)(
void (*tran_destroy_pkt)(
struct dcd_address *ap,
void (*tran_dmafree)(
struct dcd_address *ap,
void (*tran_sync_pkt)(
struct dcd_address *ap,
/*
* Implementation private specifics.
*/
int tran_hba_flags; /* flag option */
/*
*/
};
/*
* Prototypes for DCD HBA interface function.
*/
extern void dcd_initialize_hba_interface(void);
#ifdef NO_DADA_FINI_YET
extern void dcd_uninitialize_hba_interface(void);
#endif
#ifdef NOTNEEDED
extern int dcd_hba_attach(
int flags,
void *hba_options);
#endif
extern int dcd_hba_attach(
int flags);
extern int dcd_hba_detach(
dev_info_t *dip);
extern dcd_hba_tran_t *dcd_hba_tran_alloc(
int flags);
extern void dcd_hba_tran_free(
extern int dcd_hba_probe(
struct dcd_device *dcd,
int (*callback)(void));
extern struct dcd_pkt *dcd_hba_pkt_alloc(
struct dcd_address *ap,
int cmdlen,
int statuslen,
int tgtlen,
int hbalen,
extern void dcd_hba_pkt_free(
struct dcd_address *ap,
extern int dcd_hba_lookup_capstr(
char *capstr);
extern int dcd_hba_in_panic(void);
/*
* Flags for dcd_hba_attach
*/
#define DCD_HBA_TRAN_CLONE 0x01
/*
* Flags for scsi_hab alloaction functions
*/
#define DCD_HBA_CANSLEEP 0x01
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DADA_IMPL_TRANSPORT_H */