2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * This module is part of the photon Command Line 2N/A * Interface program. 2N/A * I18N message number ranges 2N/A * This file: 11500 - 11999 2N/A * Shared common messages: 1 - 1999 2N/A/* #define _POSIX_SOURCE 1 */ 2N/A/* Because of a bug in Unisys Envsen card, Bug ID:1266986. */ 2N/A#
define IMMED 1 /* make the stop immediate */ 2N/A/* Global variables */ 2N/A/* Forward declarations */ 2N/A/* External functions */ 2N/A /* Do in SILENT mode as cmd may not be supported. */ 2N/A * Send Diagnostic command 2N/A * NOTE: This function includes a delay. 2N/A * Allow time for things to stabilize. 2N/A * Internal routine to allow manipulation of the cdb[1] byte 2N/A * Receive Diagnostic command 2N/A * The a5k and newer enclosures abide by the SCSI spec 2N/A * (SPC-2: 7.15) but the SSA does not. It requires 2N/A * 0x10 to be present in cdb[1]. 2N/A * For enclosures that abide by the spec, the first call 2N/A * will work. For SSAs the first call will fail, at which 2N/A * point we try again with the SSA specific value. 2N/A * Write buffer command set up to download firmware 2N/A * Read buffer command set up to upload firmware 2N/A * Reads from code image starting at offset 2N/A * "code_off" for "buf_len" bytes. 2N/A * This is a work around for the format of Daktari's 2N/A * SCSI inquiry page information. The name of the enclosure 2N/A * is not in the same place that products like the a5000 place it 2N/A * so we have to copy the string to the expected location. 2N/A /* clear buffers on cmds that read data */ 2N/A * MODE SELECT USCSI command 2N/A * sp is the save pages bit - Must be bit 0 - 2N/A/* 10 byte Mode Select cmd */ 2N/A * MODE SENSE USCSI command 2N/A * pc = page control field 2N/A * page_code = Pages to return 2N/A/* 10 byte Mode Select cmd */ 2N/A /* Just for me - a sanity check */ 2N/A /* Bytes actually transfered */ 2N/A /* clear buffers on on cmds that read data */ 2N/A /* clear buffers on on cmds that read data */ 2N/A * A capacity of 0xffffffff in response to a 2N/A * READ CAPACITY 10 indicates that the lun 2N/A * is too large to report the size in a 32 bit 2N/A * value, and a READ CAPACITY 16 is required 2N/A * to get the correct size. 2N/A /* clear buffers on on cmds that read data */ 2N/A * Read Capacity (16) is a Service Action In command. One 2N/A * command byte (0x9E) is overloaded for multiple operations, 2N/A * with the second CDB byte specifying the desired operation 2N/A * Fill in allocation length field 2N/A * Use this to induce a SCSI error 2N/A * const my_cdb_g0 cdb = {SCMD_START_STOP, 0, 0xff, 0, 1, 0}; 2N/A * NOTE: This function includes a delay. 2N/A * Allow time for things to stabilize. 2N/A * Retrieves a devid from a device path. 2N/A * devpath: Valid block device path. 2N/A * devid: ptr to ddi_devid_t struct 2N/A * root: root handle to device tree snapshot 2N/A * drvr_name: driver name to start the node tree search 2N/A * On success, devid points to device tree handle to devid 2N/A * di_fini on root will invalidate devid pointer 2N/A * non-zero on failure 2N/A * Form a valid root path by stripping off the /devices/ mount point 2N/A * prefix and the minor name (:a[,raw]). 2N/A /* point to first node which matches portdrvr */ 2N/A * Could not find driver node 2N/A "\t\tTime = %lld millisec\n",
2N/A /* Did we get back a handle? */ 2N/A }
else {
/* Couldn't get a devid. */