/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Generic SCSI Host Bus Adapter interface implementation
*/
extern int dcd_options;
struct dcd_hba_inst {
};
/*
* Called from _init when loading the dcd module.
*/
void
{
}
/*
* Called from fini() when unloading the dcd module.
*/
void
{
}
/*
* Called by an HBA from _init()
*/
/* ARGSUSED */
int
{
return (0);
}
#ifdef NOTNEEDED
/* ARGSUSED */
int
int flags,
void *hba_options)
{
}
#endif
int
int flags)
{
int value;
int len;
char *prop_name;
char *errmsg =
"dcd_hba_attach: cannott create property '%s' for %s%d\n";
/*
* Link this instance into the list
*/
if (dcd_hba_list == NULL) {
dcd_hba_list = elem;
}
if (dcd_hba_list_tail) {
}
/*
* Save all the improtant HBA information that must be accessed
* later.
*/
/*
* Note: We only need dma_attr_minxfer and dma_attr_burstsize
* from the DMA atrributes
*/
prop_name = "dcd_options";
len = 0;
value = dcd_options;
}
}
/*
* XXX : This needs to be removed when code cleanup
* ddi_set_driver_private(dip, (caddr_t)hba_tran);
*/
#ifdef DEBUG1
printf("Called Set driver private with dip %x, tran %x\n",
#endif
return (DDI_SUCCESS);
}
/*
* called by an HBA to detach an instance of the driver
*/
int
{
hba->tran_hba_flags = 0;
/*
* Remove HBA instance from dcd_hba_list
*/
break;
}
}
if (elem == dcd_hba_list) {
} else if (elem == dcd_hba_list_tail) {
} else {
}
return (DDI_SUCCESS);
}
void
{
}
/* ARGSUSED */
int flags)
{
return (kmem_zalloc(sizeof (dcd_hba_tran_t),
}
void
{
}
/*
* XXX: Do we really need the following routines.
*/
/*
* private wrapper for dcd_pkt's allocated via scsi_hba_pkt_alloc
*/
struct dcd_pkt_wrapper {
int pkt_wrapper_len;
};
/*
* Round up all allocations so that we can gurentee
* long-long alignment. This is the same alignment
* provided by kmem_alloc().
*/
/*
* Called by an HBA to allocate a dcd_pkt
*/
/* ARGSUSED */
struct dcd_pkt *
struct dcd_address *ap,
int cmdlen,
int statuslen,
int tgtlen,
int hbalen,
{
caddr_t p;
int pktlen;
/*
* Sanity check
*/
" either SLEEP or NULL\n");
}
/*
* Round up so everything gets allocated on long-word boundaries.
*/
pktlen = sizeof (struct dcd_pkt_wrapper) +
return (NULL);
}
/*
* Set up or private info on this pkt
*/
/*
* set up pointers to private data areas, cdb and status.
*/
if (hbalen > 0) {
p += hbalen;
}
if (tgtlen > 0) {
p += tgtlen;
}
if (statuslen > 0) {
p += statuslen;
}
if (cmdlen > 0) {
}
/*
* Initialize the pkt's dcd_address
*/
#ifdef DEBUG1
printf("da_target %x, da_lun %x, a_hba_tran %x\n",
printf("From address : da_target %x, da_lun %x, a_hba_tran %x\n",
#endif
return (pkt);
}
/* ARGSUSED */
void
struct dcd_address *ap,
{
}
/*
* Called by an HBA to map strings to capability indices
*/
int
{
/*
* Capability strings, masking the '-' vs '_'.
*/
static struct cap_strings {
char *cap_string;
int cap_index;
} cap_string[] = {
{ "dma-max", DCD_CAP_DMA_MAX },
{ "dma_max", DCD_CAP_DMA_MAX },
{ "ultraata", DCD_CAP_ULTRA_ATA },
{ "busmaster", DCD_CAP_BUS_MASTER },
{ "overlap", DCD_CAP_OVERLAP },
{ "parity", DCD_CAP_PARITY },
{ "sector-size", DCD_CAP_SECTOR_SIZE },
{ "total-sectors", DCD_CAP_TOTAL_SECTORS },
{ "geometry", DCD_CAP_GEOMETRY },
{ "block-mode", DCD_CAP_BLOCKMODE },
{ "block-factor", DCD_CAP_BLOCKFACTOR },
{ "dma-support", DCD_CAP_DMA_SUPPORT },
{ "pio-support", DCD_CAP_PIO_SUPPORT },
{ "lba-addressing", DCD_CAP_LBA_ADDRESSING },
{ NULL, 0 }
};
}
}
return (-1);
}