7bc7346c0c75ced7da727f63c2772fd53809244dcm * CDDL HEADER START
7bc7346c0c75ced7da727f63c2772fd53809244dcm * The contents of this file are subject to the terms of the
7bc7346c0c75ced7da727f63c2772fd53809244dcm * Common Development and Distribution License (the "License").
7bc7346c0c75ced7da727f63c2772fd53809244dcm * You may not use this file except in compliance with the License.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7bc7346c0c75ced7da727f63c2772fd53809244dcm * See the License for the specific language governing permissions
7bc7346c0c75ced7da727f63c2772fd53809244dcm * and limitations under the License.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * When distributing Covered Code, include this CDDL HEADER in each
7bc7346c0c75ced7da727f63c2772fd53809244dcm * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * If applicable, add the following below this CDDL HEADER, with the
7bc7346c0c75ced7da727f63c2772fd53809244dcm * fields enclosed by brackets "[]" replaced with your own identifying
7bc7346c0c75ced7da727f63c2772fd53809244dcm * information: Portions Copyright [yyyy] [name of copyright owner]
7bc7346c0c75ced7da727f63c2772fd53809244dcm * CDDL HEADER END
123a66144b2f6baecdc28fa277b0de6d1608d441cm/* Portions Copyright 2008 Hitachi Ltd. */
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * Use is subject to license terms.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * Implementation of "scsi_vhci_f_sym_hds" asymmetric-active-active
7bc7346c0c75ced7da727f63c2772fd53809244dcm * failover_ops. The device has a preferred(owner)/non-preferred
7bc7346c0c75ced7da727f63c2772fd53809244dcm * with no action needed to use the non-preferred path. This is really
7bc7346c0c75ced7da727f63c2772fd53809244dcm * more inline with symmetric device so am using that prefix.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * This file imports the standard "scsi_vhci_f_sym", but with HDS specific
7bc7346c0c75ced7da727f63c2772fd53809244dcm * knowledge related to preferred/non-preferred path.
7bc7346c0c75ced7da727f63c2772fd53809244dcm/* Supported device table entries. */
7bc7346c0c75ced7da727f63c2772fd53809244dcm/* " 111111" */
7bc7346c0c75ced7da727f63c2772fd53809244dcm/* "012345670123456789012345" */
7bc7346c0c75ced7da727f63c2772fd53809244dcm/* "|-VID--||-----PID------|" */
7bc7346c0c75ced7da727f63c2772fd53809244dcm "HITACHI DF",
7bc7346c0c75ced7da727f63c2772fd53809244dcm struct scsi_inquiry *, void **);
7bc7346c0c75ced7da727f63c2772fd53809244dcmstatic void hds_sym_device_unprobe(struct scsi_device *, void *);
7bc7346c0c75ced7da727f63c2772fd53809244dcmstatic void hds_sym_init();
7bc7346c0c75ced7da727f63c2772fd53809244dcm#define scsi_vhci_failover_ops scsi_vhci_failover_ops_f_sym_hds
7bc7346c0c75ced7da727f63c2772fd53809244dcm#endif /* lint */
7bc7346c0c75ced7da727f63c2772fd53809244dcm * Use the following for the Asymmetric-Active-Active fops.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * A different fops may get used for the Symmetric-Active-Active.
7bc7346c0c75ced7da727f63c2772fd53809244dcm /* The rest of the implementation comes from SFO_NAME_SYM import */
7bc7346c0c75ced7da727f63c2772fd53809244dcmextern struct scsi_failover_ops *vhci_failover_ops_by_name(char *);
7bc7346c0c75ced7da727f63c2772fd53809244dcmstatic void
7bc7346c0c75ced7da727f63c2772fd53809244dcm /* clone SFO_NAME_SYM implementation for most things */
7bc7346c0c75ced7da727f63c2772fd53809244dcm/* ARGSUSED */
7bc7346c0c75ced7da727f63c2772fd53809244dcmhds_sym_device_probe(struct scsi_device *sd, struct scsi_inquiry *stdinq,
7bc7346c0c75ced7da727f63c2772fd53809244dcm VHCI_DEBUG(6, (CE_NOTE, NULL, "hds_sym_device_probe: vidpid %s\n",
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_sym_device_probe: vidpid %s len error: %d\n",
7bc7346c0c75ced7da727f63c2772fd53809244dcm if (*dftype == 0) {
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_sym_device_probe: vidpid %s"
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_sym_device_probe: vidpid %s"
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs /* ctprivp is NULL for vhci_is_dev_supported() probe */
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs * Allocate failover module's 'client' private
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs * data on the first successfull path probe.
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs * NOTE: 'client' private means per lun guid,
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs * not per-path.
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs /* update private data */
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs "hds_sym_device_probe: vidpid %s"
55e592a20765db6f52a590785ae2390c3b12fda9Randall Ralphs " - unknown dftype: %d\n",
7bc7346c0c75ced7da727f63c2772fd53809244dcm/* ARGSUSED */
7bc7346c0c75ced7da727f63c2772fd53809244dcmstatic void
7bc7346c0c75ced7da727f63c2772fd53809244dcmhds_sym_device_unprobe(struct scsi_device *sd, void *ctpriv)
7bc7346c0c75ced7da727f63c2772fd53809244dcm * Local routine to get inquiry VPD page from the device.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * return 1 for failure
7bc7346c0c75ced7da727f63c2772fd53809244dcm * return 0 for success
7bc7346c0c75ced7da727f63c2772fd53809244dcmhds_get_inquiry_vpd_page(struct scsi_device *sd, unsigned char page,
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (1);
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (1);
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_get_inquiry_vpd_page:"
7bc7346c0c75ced7da727f63c2772fd53809244dcm "Failed to initialize packet"));
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (1);
7bc7346c0c75ced7da727f63c2772fd53809244dcm * Send the inquiry command for page xx to the target.
7bc7346c0c75ced7da727f63c2772fd53809244dcm * Data is returned in the buf pointed to by buf.
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (!retval);
7bc7346c0c75ced7da727f63c2772fd53809244dcm/* ARGSUSED */
7bc7346c0c75ced7da727f63c2772fd53809244dcmhds_sym_get_opinfo(struct scsi_device *sd, struct scsi_path_opinfo *opinfo,
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_get_opinfo: sd(%p): sym_active_active "
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (0);
7bc7346c0c75ced7da727f63c2772fd53809244dcm /* check if this is the preferred path */
7bc7346c0c75ced7da727f63c2772fd53809244dcm if (hds_get_inquiry_vpd_page(sd, HDS_INQ_PAGE_E0, inq_vpd_buf,
7bc7346c0c75ced7da727f63c2772fd53809244dcm sizeof (inq_vpd_buf)) != 0) {
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_get_opinfo: sd(%p):Unable to "
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (1);
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_get_opinfo: sd(%p): preferred bit set ",
7bc7346c0c75ced7da727f63c2772fd53809244dcm (void*)sd));
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_get_opinfo: sd(%p): non-preferred bit set ",
7bc7346c0c75ced7da727f63c2772fd53809244dcm (void*)sd));
7bc7346c0c75ced7da727f63c2772fd53809244dcm "hds_get_opinfo: sd(%p): "
7bc7346c0c75ced7da727f63c2772fd53809244dcm "get inquiry Page %x has invalid P/SVid bit set",
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (1);
7bc7346c0c75ced7da727f63c2772fd53809244dcm return (0);