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: 9500 - 9999 2N/A * Shared common messages: 1 - 1999 2N/A/* Global variables */ 2N/A/* External functions */ 2N/A * Get the system time and use "system seconds" 2N/A * as 'seed' to generate a random number. Then, 2N/A * wait between 1/10 - 1/2 seconds before retry. 2N/A * Get the current process id and ex-or it with 2N/A * the seed so that the random number is always 2N/A * different even in case of multiple processes 2N/A * generate a random number at the same time. 2N/A /* get a random number. */ 2N/A * Execute a command and determine the result. 2N/A * Set function flags for driver. 2N/A * Set Automatic request sense enable 2N/A /* intialize error message array */ 2N/A /* print command for debug */ 2N/A (
void)
printf(
" Issuing a SCSI Reset All.\n");
2N/A "SCSI command: %s\n",
2N/A (
void)
printf(
"\n\tlen=0x%x bufaddr=0x%x buflen=0x%x" 2N/A * Default command timeout in case command left it 0 2N/A /* Issue command - finally */ 2N/A (
void)
printf(
"Unexpected USCSICMD ioctl error: %s\n",
2N/A * Just a SCSI error, create error message 2N/A * Retry once for Unit Attention, 2N/A * Not Ready, and Aborted Command 2N/A " UNIT_ATTENTION: Retrying...\n");
2N/A * Retry 5 times in case of BUSY, and only 2N/A * once for Reservation-conflict, Command 2N/A * Termination and Queue Full. Wait for 2N/A * random amount of time (between 1/10 - 1/2 secs.) 2N/A * between each retry. This random wait is to avoid 2N/A * the multiple threads being executed at the same time 2N/A * and also the constraint in Photon IB, where the 2N/A * command queue has a depth of one command. 2N/A " STATUS_BUSY: Retrying...\n",
2N/A " RESERVATION_CONFLICT:"