#ifndef _SYS_DADA_IMPL_TRANSPORT_H
#define _SYS_DADA_IMPL_TRANSPORT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/modctl.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
typedef struct dcd_hba_tran dcd_hba_tran_t;
struct dcd_hba_tran {
uint_t version;
dev_info_t *tran_hba_dip;
void *tran_hba_private;
void *tran_tgt_private;
struct dcd_device *tran_sd;
int (*tran_tgt_init)(
dev_info_t *hba_dip,
dev_info_t *tgt_dip,
dcd_hba_tran_t *hba_tran,
struct dcd_device *dcd);
int (*tran_tgt_probe)(
struct dcd_device *dcd,
int (*callback)(void));
int (*tran_tgt_free)(
dev_info_t *hba_dip,
dev_info_t *tgt_dip,
dcd_hba_tran_t *hba_tran,
struct dcd_device *dcd);
int (*tran_start)(
struct dcd_address *ap,
struct dcd_pkt *pkt);
int (*tran_reset)(
struct dcd_address *ap,
int level);
int (*tran_abort)(
struct dcd_address *ap,
struct dcd_pkt *pkt);
struct dcd_pkt *(*tran_init_pkt)(
struct dcd_address *ap,
struct dcd_pkt *pkt,
struct buf *bp,
int cmdlen,
int statuslen,
int tgtlen,
int flags,
int (*callback)(
caddr_t arg),
caddr_t callback_arg);
void (*tran_destroy_pkt)(
struct dcd_address *ap,
struct dcd_pkt *pkt);
void (*tran_dmafree)(
struct dcd_address *ap,
struct dcd_pkt *pkt);
void (*tran_sync_pkt)(
struct dcd_address *ap,
struct dcd_pkt *pkt);
int tran_hba_flags;
uint_t tran_min_xfer;
uchar_t tran_min_burst_size;
uchar_t tran_max_burst_size;
};
extern void dcd_initialize_hba_interface(void);
#ifdef NO_DADA_FINI_YET
extern void dcd_uninitialize_hba_interface(void);
#endif
extern int dcd_hba_init(struct modlinkage *modlp);
extern void dcd_hab_fini(struct modlinkage *modlp);
#ifdef NOTNEEDED
extern int dcd_hba_attach(
dev_info_t *dip,
ddi_dma_lim_t *hba_lim,
dcd_hba_tran_t *hba_tran,
int flags,
void *hba_options);
#endif
extern int dcd_hba_attach(
dev_info_t *dip,
ddi_dma_attr_t *hba_dma_attr,
dcd_hba_tran_t *hba_tran,
int flags);
extern int dcd_hba_detach(
dev_info_t *dip);
extern dcd_hba_tran_t *dcd_hba_tran_alloc(
dev_info_t *dip,
int flags);
extern void dcd_hba_tran_free(
dcd_hba_tran_t *hba_tran);
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,
int (*callback)(caddr_t),
caddr_t arg);
extern void dcd_hba_pkt_free(
struct dcd_address *ap,
struct dcd_pkt *pkt);
extern int dcd_hba_lookup_capstr(
char *capstr);
extern int dcd_hba_in_panic(void);
#define DCD_HBA_TRAN_CLONE 0x01
#define DCD_HBA_CANSLEEP 0x01
#endif
#ifdef __cplusplus
}
#endif
#endif