tape.c revision 0205780bc43902d17f94f07ceacb0cd8d5eab20f
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Implementation of "scsi_vhci_f_tape" tape failover_ops.
*
* This file was historically meant for only tape implementation. It has
* been extended to manage SUN "supported" tape controllers. The supported
*/
/* Supported device table entries. */
static char *tape_dev_table[] = {
/* " 111111" */
/* "012345670123456789012345" */
/* "|-VID--||-----PID------|" */
"IBM ULTRIUM-TD3",
"IBM ULTRIUM-TD4",
};
/* Failover module plumbing. */
/* ARGSUSED */
static int
void **ctpriv)
{
int i;
int rval = SFO_DEVICE_PROBE_PHCI;
/*
* See if this a device type that we want to care about.
*/
case DTYPE_SEQUENTIAL:
break;
case DTYPE_CHANGER:
goto done;
default:
/*
* Not interested.
*/
return (rval);
}
/*
* If it reports that it supports tpgs and it got here it may have
* failed the tpgs commands. It might or might not support dual port
* but we'll go with it.
*/
/*
* Looks like it claims to have more then one port.
*/
} else {
/*
* See if this device is on the list.
*/
for (i = 0; tape_dev_table[i]; i++) {
strlen(tape_dev_table[i])) == 0) {
"!was on the list: %s\n",
break;
}
}
}
done:
if (rval == SFO_DEVICE_PROBE_VHCI) {
MDI_SUCCESS) {
return (SFO_DEVICE_PROBE_PHCI);
}
}
return (rval);
}
/* ARGSUSED */
static void
{
/*
* NO OP for tape.
*/
}
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static int
void *ctpriv)
{
opinfo->opinfo_xlf_capable = 0;
return (0);
}
/* ARGSUSED */
static int
{
return (1);
}
/* ARGSUSED */
static int
void *ctpriv)
{
return (SCSI_SENSE_INACTIVE);
}
return (SCSI_SENSE_NOT_READY);
}
return (SCSI_SENSE_NOFAILOVER);
}
/* ARGSUSED */
static int
{
*nxt = PCLASS_PRIMARY;
return (0);
return (ENOENT);
}
return (EINVAL);
}