/*
* 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.
*/
/*LINTLIBRARY*/
/*
*
* This module is part of the photon Command Line
* Interface program.
*
*/
/*
* I18N message number ranges
* This file: 11500 - 11999
* Shared common messages: 1 - 1999
*/
/* #define _POSIX_SOURCE 1 */
/* Includes */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <nl_types.h>
#include <unistd.h>
#include <l_common.h>
#include <stgcom.h>
#include <l_error.h>
#include <g_state.h>
#include <errno.h>
#include <devid.h>
#include <libdevinfo.h>
/* Defines */
/* Because of a bug in Unisys Envsen card, Bug ID:1266986. */
/* Global variables */
/* Forward declarations */
static int scsi_read_capacity_16_cmd(int, struct scsi_capacity_16 *, int);
/* External functions */
int
{
return (L_INVALID_ARG);
}
if (buf_len & 0x03) {
return (L_PR_INVLD_TRNSFR_LEN);
}
/* Do in SILENT mode as cmd may not be supported. */
}
/*
* Send Diagnostic command
*
* NOTE: This function includes a delay.
*/
int
{
int err;
return (L_INVALID_ARG);
}
return (err);
}
/*
* Allow time for things to stabilize.
*/
sleep(5);
return (0);
}
/*
* Internal routine to allow manipulation of the cdb[1] byte
* in receive diag.
*/
static int
{
return (L_INVALID_ARG);
}
}
/*
* Receive Diagnostic command
*/
int
{
int status;
return (L_INVALID_ARG);
}
if (buf_len & 0x03) {
return (L_RD_INVLD_TRNSFR_LEN);
}
/*
* The a5k and newer enclosures abide by the SCSI spec
* (SPC-2: 7.15) but the SSA does not. It requires
* 0x10 to be present in cdb[1].
*
* For enclosures that abide by the spec, the first call
* will work. For SSAs the first call will fail, at which
* point we try again with the SSA specific value.
*/
if (status != 0) {
}
return (status);
}
/*
* Write buffer command set up to download firmware
*/
int
{
return (L_INVALID_ARG);
}
}
/*
* Read buffer command set up to upload firmware
* Reads from code image starting at offset
* "code_off" for "buf_len" bytes.
*/
int
{
return (L_INVALID_ARG);
}
}
int
{
int myreturn;
return (L_INVALID_ARG);
}
if (myreturn) {
return (myreturn); /* != 0, error just return */
}
/*
* This is a work around for the format of Daktari's
* SCSI inquiry page information. The name of the enclosure
* is not in the same place that products like the a5000 place it
* so we have to copy the string to the expected location.
*/
strlen(DAK_PROD_STR)) == 0) {
}
return (myreturn);
}
int
{
return (L_INVALID_ARG);
}
/* clear buffers on cmds that read data */
}
/*
* MODE SELECT
*
* MODE SELECT USCSI command
*
* sp is the save pages bit - Must be bit 0 -
*
*/
int
{
/* 10 byte Mode Select cmd */
return (L_INVALID_ARG);
}
}
/*
* MODE SENSE USCSI command
*
*
* pc = page control field
* page_code = Pages to return
*/
int
int buf_len,
{
/* 10 byte Mode Select cmd */
int status;
static int uscsi_count;
return (L_INVALID_ARG);
}
/* Just for me - a sanity check */
(buf_len > MAX_MODE_SENSE_LEN)) {
return (L_ILLEGAL_MODE_SENSE_PAGE);
}
/* Bytes actually transfered */
if (status == 0) {
S_DPRINTF(" Number of bytes read on "
"Mode Sense 0x%x\n", uscsi_count);
}
}
return (status);
}
int
{
return (L_INVALID_ARG);
}
/* clear buffers on on cmds that read data */
}
int
{
int ret;
(buf_len < sizeof (struct scsi_capacity_16))) {
return (L_INVALID_ARG);
}
/* clear buffers on on cmds that read data */
/*
* A capacity of 0xffffffff in response to a
* READ CAPACITY 10 indicates that the lun
* is too large to report the size in a 32 bit
* value, and a READ CAPACITY 16 is required
* to get the correct size.
*/
} else {
}
return (ret);
}
static int
{
(buf_len < sizeof (struct scsi_capacity_16))) {
return (L_INVALID_ARG);
}
/* clear buffers on on cmds that read data */
/*
* Read Capacity (16) is a Service Action In command. One
* command byte (0x9E) is overloaded for multiple operations,
* with the second CDB byte specifying the desired operation
*/
/*
* Fill in allocation length field
*/
}
int
{
if (fd < 0) {
return (L_INVALID_ARG);
}
ucmd.uscsi_buflen = 0;
}
int
{
if (fd < 0) {
return (L_INVALID_ARG);
}
ucmd.uscsi_buflen = 0;
}
int
{
/*
* Use this to induce a SCSI error
* const my_cdb_g0 cdb = {SCMD_START_STOP, 0, 0xff, 0, 1, 0};
*/
if (fd < 0) {
return (L_INVALID_ARG);
}
ucmd.uscsi_buflen = 0;
}
int
{
if (fd < 0) {
return (L_INVALID_ARG);
}
if (immediate_flag) {
}
ucmd.uscsi_buflen = 0;
}
int
{
if (fd < 0) {
return (L_INVALID_ARG);
}
}
/*
* NOTE: This function includes a delay.
*/
int
{
int err;
if (fd < 0) {
return (L_INVALID_ARG);
}
return (err);
}
/*
* Allow time for things to stabilize.
*/
sleep(20);
return (0);
}
/*
* Description:
* Retrieves a devid from a device path.
*
* Input Values:
*
* devpath: Valid block device path.
*
* devid: ptr to ddi_devid_t struct
* root: root handle to device tree snapshot
* drvr_name: driver name to start the node tree search
* On success, devid points to device tree handle to devid
* di_fini on root will invalidate devid pointer
*
* Return Value:
* 0 on success
* non-zero on failure
*/
int
const char *drvr_name)
{
char *cptr;
return (L_INVALID_ARG);
}
start_time = gethrtime();
}
rootpath[0] = '\0';
/*
* Form a valid root path by stripping off the /devices/ mount point
* prefix and the minor name (:a[,raw]).
*/
*cptr = '\0';
} else {
return (L_INVALID_PATH);
}
} else {
return (L_INVALID_PATH);
}
/* point to first node which matches portdrvr */
if (node == DI_NODE_NIL) {
/*
* Could not find driver node
*/
return (L_NO_DEVID);
}
while (node != DI_NODE_NIL) {
break;
}
}
}
" g_devid_get: "
"\t\tTime = %lld millisec\n",
}
/* Did we get back a handle? */
return (0);
} else { /* Couldn't get a devid. */
return (L_NO_DEVID);
}
}